diff --git a/iothub/resource-manager/v2018_04_01/pom.xml b/iothub/resource-manager/v2018_04_01/pom.xml index cffb1cc0c4af..ca261a3aa23f 100644 --- a/iothub/resource-manager/v2018_04_01/pom.xml +++ b/iothub/resource-manager/v2018_04_01/pom.xml @@ -1,133 +1,133 @@ - - - 4.0.0 - com.microsoft.azure.azure-mgmt-iothub-2018-04-01 - - com.microsoft.azure - azure-arm-parent - 0.0.3-beta - ../../../pom.xml - - azure-mgmt-iothub - 1.0.0-beta-SNAPSHOT - jar - Microsoft Azure SDK for Devices Management - This package contains Microsoft Devices Management SDK. - https://github.com/Azure/azure-libraries-for-java - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - - - scm:git:https://github.com/Azure/azure-libraries-for-java - scm:git:git@github.com:Azure/azure-libraries-for-java.git - HEAD - - - UTF-8 - - - - - microsoft - Microsoft - - - - - com.microsoft.azure - azure-client-runtime - - - com.microsoft.azure - azure-arm-client-runtime - - - junit - junit - test - - - com.microsoft.azure - azure-client-authentication - test - - - com.microsoft.azure - azure-mgmt-resources - test - - - com.microsoft.azure - azure-arm-client-runtime - test-jar - test - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - - true - true - - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - org.apache.maven.plugins - maven-compiler-plugin - 3.1 - - 1.7 - 1.7 - - - com.microsoft.azure.management.apigeneration.LangDefinitionProcessor - - - true - true - - true - true - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.8 - - *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search - - - /** -
* Copyright (c) Microsoft Corporation. All rights reserved. -
* Licensed under the MIT License. See License.txt in the project root for -
* license information. -
*/ - ]]> -
-
-
-
-
-
+ + + 4.0.0 + com.microsoft.azure.iothub.v2018_04_01 + + com.microsoft.azure + azure-arm-parent + 0.0.2-beta + ../../../pom.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-libraries-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-libraries-for-java + scm:git:git@github.com:Azure/azure-libraries-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/CertificateBodyDescription.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/CertificateBodyDescription.java index 65881665d23c..1d1c39b73f17 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/CertificateBodyDescription.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/CertificateBodyDescription.java @@ -22,7 +22,7 @@ public class CertificateBodyDescription { private String certificate; /** - * Get the certificate value. + * Get base-64 representation of the X509 leaf certificate .cer file or just .pem file content. * * @return the certificate value */ @@ -31,7 +31,7 @@ public String certificate() { } /** - * Set the certificate value. + * 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. diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/CertificateDescription.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/CertificateDescription.java index 60fe674ab9e2..798e26c99e03 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/CertificateDescription.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/CertificateDescription.java @@ -16,12 +16,12 @@ 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.v2018_04_01.implementation.IoTHubManager; +import com.microsoft.azure.management.iothub.v2018_04_01.implementation.DevicesManager; /** * Type representing CertificateDescription. */ -public interface CertificateDescription extends HasInner, Indexable, Refreshable, Updatable, HasManager { +public interface CertificateDescription extends HasInner, Indexable, Refreshable, Updatable, HasManager { /** * @return the etag value. */ diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/CertificateListDescription.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/CertificateListDescription.java index 7e51c4dbfc45..87ba1d23fcb5 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/CertificateListDescription.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/CertificateListDescription.java @@ -10,7 +10,7 @@ import com.microsoft.azure.arm.model.HasInner; import com.microsoft.azure.arm.resources.models.HasManager; -import com.microsoft.azure.management.iothub.v2018_04_01.implementation.IoTHubManager; +import com.microsoft.azure.management.iothub.v2018_04_01.implementation.DevicesManager; import com.microsoft.azure.management.iothub.v2018_04_01.implementation.CertificateListDescriptionInner; import com.microsoft.azure.management.iothub.v2018_04_01.implementation.CertificateDescriptionInner; import java.util.List; @@ -18,7 +18,7 @@ /** * Type representing CertificateListDescription. */ -public interface CertificateListDescription extends HasInner, HasManager { +public interface CertificateListDescription extends HasInner, HasManager { /** * @return the value value. */ diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/CertificateProperties.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/CertificateProperties.java index 68b8566724a5..e26a69b51803 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/CertificateProperties.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/CertificateProperties.java @@ -59,7 +59,7 @@ public class CertificateProperties { private String certificate; /** - * Get the subject value. + * Get the certificate's subject name. * * @return the subject value */ @@ -68,7 +68,7 @@ public String subject() { } /** - * Get the expiry value. + * Get the certificate's expiration date and time. * * @return the expiry value */ @@ -80,7 +80,7 @@ public DateTime expiry() { } /** - * Get the thumbprint value. + * Get the certificate's thumbprint. * * @return the thumbprint value */ @@ -89,7 +89,7 @@ public String thumbprint() { } /** - * Get the isVerified value. + * Get determines whether certificate has been verified. * * @return the isVerified value */ @@ -98,7 +98,7 @@ public Boolean isVerified() { } /** - * Get the created value. + * Get the certificate's create date and time. * * @return the created value */ @@ -110,7 +110,7 @@ public DateTime created() { } /** - * Get the updated value. + * Get the certificate's last update date and time. * * @return the updated value */ @@ -122,7 +122,7 @@ public DateTime updated() { } /** - * Get the certificate value. + * Get the certificate content. * * @return the certificate value */ @@ -131,7 +131,7 @@ public String certificate() { } /** - * Set the certificate value. + * Set the certificate content. * * @param certificate the certificate value to set * @return the CertificateProperties object itself. diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/CertificatePropertiesWithNonce.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/CertificatePropertiesWithNonce.java index 3aa6c80473b2..8d991eaf9595 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/CertificatePropertiesWithNonce.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/CertificatePropertiesWithNonce.java @@ -67,7 +67,7 @@ public class CertificatePropertiesWithNonce { private String certificate; /** - * Get the subject value. + * Get the certificate's subject name. * * @return the subject value */ @@ -76,7 +76,7 @@ public String subject() { } /** - * Get the expiry value. + * Get the certificate's expiration date and time. * * @return the expiry value */ @@ -88,7 +88,7 @@ public DateTime expiry() { } /** - * Get the thumbprint value. + * Get the certificate's thumbprint. * * @return the thumbprint value */ @@ -97,7 +97,7 @@ public String thumbprint() { } /** - * Get the isVerified value. + * Get determines whether certificate has been verified. * * @return the isVerified value */ @@ -106,7 +106,7 @@ public Boolean isVerified() { } /** - * Get the created value. + * Get the certificate's create date and time. * * @return the created value */ @@ -118,7 +118,7 @@ public DateTime created() { } /** - * Get the updated value. + * Get the certificate's last update date and time. * * @return the updated value */ @@ -130,7 +130,7 @@ public DateTime updated() { } /** - * Get the verificationCode value. + * Get the certificate's verification code that will be used for proof of possession. * * @return the verificationCode value */ @@ -139,7 +139,7 @@ public String verificationCode() { } /** - * Get the certificate value. + * Get the certificate content. * * @return the certificate value */ diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/CertificateVerificationDescription.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/CertificateVerificationDescription.java index ba0d7e948481..c85dbbf7b4b3 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/CertificateVerificationDescription.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/CertificateVerificationDescription.java @@ -22,7 +22,7 @@ public class CertificateVerificationDescription { private String certificate; /** - * Get the certificate value. + * Get base-64 representation of X509 certificate .cer file or just .pem file content. * * @return the certificate value */ @@ -31,7 +31,7 @@ public String certificate() { } /** - * Set the certificate value. + * 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. diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/CertificateWithNonceDescription.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/CertificateWithNonceDescription.java index 24aea4e9735c..28930c31eb56 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/CertificateWithNonceDescription.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/CertificateWithNonceDescription.java @@ -10,13 +10,13 @@ import com.microsoft.azure.arm.model.HasInner; import com.microsoft.azure.arm.resources.models.HasManager; -import com.microsoft.azure.management.iothub.v2018_04_01.implementation.IoTHubManager; +import com.microsoft.azure.management.iothub.v2018_04_01.implementation.DevicesManager; import com.microsoft.azure.management.iothub.v2018_04_01.implementation.CertificateWithNonceDescriptionInner; /** * Type representing CertificateWithNonceDescription. */ -public interface CertificateWithNonceDescription extends HasInner, HasManager { +public interface CertificateWithNonceDescription extends HasInner, HasManager { /** * @return the etag value. */ diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/CloudToDeviceProperties.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/CloudToDeviceProperties.java index f8f1868e2b60..052ba485823d 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/CloudToDeviceProperties.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/CloudToDeviceProperties.java @@ -38,7 +38,7 @@ public class CloudToDeviceProperties { private FeedbackProperties feedback; /** - * Get the maxDeliveryCount value. + * 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 */ @@ -47,7 +47,7 @@ public Integer maxDeliveryCount() { } /** - * Set the maxDeliveryCount value. + * 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. @@ -58,7 +58,7 @@ public CloudToDeviceProperties withMaxDeliveryCount(Integer maxDeliveryCount) { } /** - * Get the defaultTtlAsIso8601 value. + * 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 */ @@ -67,7 +67,7 @@ public Period defaultTtlAsIso8601() { } /** - * Set the defaultTtlAsIso8601 value. + * 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. diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/EndpointHealthData.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/EndpointHealthData.java index a5f79076c623..a603db571f80 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/EndpointHealthData.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/EndpointHealthData.java @@ -10,13 +10,13 @@ import com.microsoft.azure.arm.model.HasInner; import com.microsoft.azure.arm.resources.models.HasManager; -import com.microsoft.azure.management.iothub.v2018_04_01.implementation.IoTHubManager; +import com.microsoft.azure.management.iothub.v2018_04_01.implementation.DevicesManager; import com.microsoft.azure.management.iothub.v2018_04_01.implementation.EndpointHealthDataInner; /** * Type representing EndpointHealthData. */ -public interface EndpointHealthData extends HasInner, HasManager { +public interface EndpointHealthData extends HasInner, HasManager { /** * @return the endpointId value. */ diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/EventHubConsumerGroupInfo.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/EventHubConsumerGroupInfo.java index d5b2ad5ade64..a06322579662 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/EventHubConsumerGroupInfo.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/EventHubConsumerGroupInfo.java @@ -16,13 +16,13 @@ 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.v2018_04_01.implementation.IoTHubManager; +import com.microsoft.azure.management.iothub.v2018_04_01.implementation.DevicesManager; import java.util.Map; /** * Type representing EventHubConsumerGroupInfo. */ -public interface EventHubConsumerGroupInfo extends HasInner, Indexable, Refreshable, Updatable, HasManager { +public interface EventHubConsumerGroupInfo extends HasInner, Indexable, Refreshable, Updatable, HasManager { /** * @return the etag value. */ diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/EventHubProperties.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/EventHubProperties.java index 92a88f17144a..13e150eb1264 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/EventHubProperties.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/EventHubProperties.java @@ -50,7 +50,7 @@ public class EventHubProperties { private String endpoint; /** - * Get the retentionTimeInDays value. + * 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 */ @@ -59,7 +59,7 @@ public Long retentionTimeInDays() { } /** - * Set the retentionTimeInDays value. + * 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. @@ -70,7 +70,7 @@ public EventHubProperties withRetentionTimeInDays(Long retentionTimeInDays) { } /** - * Get the partitionCount value. + * 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 */ @@ -79,7 +79,7 @@ public Integer partitionCount() { } /** - * Set the partitionCount value. + * 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. @@ -90,7 +90,7 @@ public EventHubProperties withPartitionCount(Integer partitionCount) { } /** - * Get the partitionIds value. + * Get the partition ids in the Event Hub-compatible endpoint. * * @return the partitionIds value */ @@ -99,7 +99,7 @@ public List partitionIds() { } /** - * Get the path value. + * Get the Event Hub-compatible name. * * @return the path value */ @@ -108,7 +108,7 @@ public String path() { } /** - * Get the endpoint value. + * Get the Event Hub-compatible endpoint. * * @return the endpoint value */ diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/ExportDevicesRequest.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/ExportDevicesRequest.java index 341caaf5a2fa..9c2111c9b5b2 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/ExportDevicesRequest.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/ExportDevicesRequest.java @@ -28,7 +28,7 @@ public class ExportDevicesRequest { private boolean excludeKeys; /** - * Get the exportBlobContainerUri value. + * Get the export blob container URI. * * @return the exportBlobContainerUri value */ @@ -37,7 +37,7 @@ public String exportBlobContainerUri() { } /** - * Set the exportBlobContainerUri value. + * Set the export blob container URI. * * @param exportBlobContainerUri the exportBlobContainerUri value to set * @return the ExportDevicesRequest object itself. @@ -48,7 +48,7 @@ public ExportDevicesRequest withExportBlobContainerUri(String exportBlobContaine } /** - * Get the excludeKeys value. + * Get the value indicating whether keys should be excluded during export. * * @return the excludeKeys value */ @@ -57,7 +57,7 @@ public boolean excludeKeys() { } /** - * Set the excludeKeys value. + * Set the value indicating whether keys should be excluded during export. * * @param excludeKeys the excludeKeys value to set * @return the ExportDevicesRequest object itself. diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/FallbackRouteProperties.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/FallbackRouteProperties.java index 5f53ebe08ee2..36d4a73810ec 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/FallbackRouteProperties.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/FallbackRouteProperties.java @@ -55,13 +55,15 @@ public class FallbackRouteProperties { /** * 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 value. + * 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 */ @@ -70,7 +72,7 @@ public String name() { } /** - * Set the name value. + * 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. @@ -81,7 +83,7 @@ public FallbackRouteProperties withName(String name) { } /** - * Get the source value. + * Get the source to which the routing rule is to be applied to. For example, DeviceMessages. * * @return the source value */ @@ -90,7 +92,7 @@ public String source() { } /** - * Set the source value. + * 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. @@ -101,7 +103,7 @@ public FallbackRouteProperties withSource(String source) { } /** - * Get the condition value. + * 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 */ @@ -110,7 +112,7 @@ public String condition() { } /** - * Set the condition value. + * 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. @@ -121,7 +123,7 @@ public FallbackRouteProperties withCondition(String condition) { } /** - * Get the endpointNames value. + * 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 */ @@ -130,7 +132,7 @@ public List endpointNames() { } /** - * Set the endpointNames value. + * 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. @@ -141,7 +143,7 @@ public FallbackRouteProperties withEndpointNames(List endpointNames) { } /** - * Get the isEnabled value. + * Get used to specify whether the fallback route is enabled. * * @return the isEnabled value */ @@ -150,7 +152,7 @@ public boolean isEnabled() { } /** - * Set the isEnabled value. + * Set used to specify whether the fallback route is enabled. * * @param isEnabled the isEnabled value to set * @return the FallbackRouteProperties object itself. diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/FeedbackProperties.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/FeedbackProperties.java index 50e6e1e94261..8b3d7068e3eb 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/FeedbackProperties.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/FeedbackProperties.java @@ -39,7 +39,7 @@ public class FeedbackProperties { private Integer maxDeliveryCount; /** - * Get the lockDurationAsIso8601 value. + * 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 */ @@ -48,7 +48,7 @@ public Period lockDurationAsIso8601() { } /** - * Set the lockDurationAsIso8601 value. + * 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. @@ -59,7 +59,7 @@ public FeedbackProperties withLockDurationAsIso8601(Period lockDurationAsIso8601 } /** - * Get the ttlAsIso8601 value. + * 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 */ @@ -68,7 +68,7 @@ public Period ttlAsIso8601() { } /** - * Set the ttlAsIso8601 value. + * 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. @@ -79,7 +79,7 @@ public FeedbackProperties withTtlAsIso8601(Period ttlAsIso8601) { } /** - * Get the maxDeliveryCount value. + * 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 */ @@ -88,7 +88,7 @@ public Integer maxDeliveryCount() { } /** - * Set the maxDeliveryCount value. + * 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. diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/ImportDevicesRequest.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/ImportDevicesRequest.java index 8507881af4c5..1aa8f7035ed1 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/ImportDevicesRequest.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/ImportDevicesRequest.java @@ -28,7 +28,7 @@ public class ImportDevicesRequest { private String outputBlobContainerUri; /** - * Get the inputBlobContainerUri value. + * Get the input blob container URI. * * @return the inputBlobContainerUri value */ @@ -37,7 +37,7 @@ public String inputBlobContainerUri() { } /** - * Set the inputBlobContainerUri value. + * Set the input blob container URI. * * @param inputBlobContainerUri the inputBlobContainerUri value to set * @return the ImportDevicesRequest object itself. @@ -48,7 +48,7 @@ public ImportDevicesRequest withInputBlobContainerUri(String inputBlobContainerU } /** - * Get the outputBlobContainerUri value. + * Get the output blob container URI. * * @return the outputBlobContainerUri value */ @@ -57,7 +57,7 @@ public String outputBlobContainerUri() { } /** - * Set the outputBlobContainerUri value. + * Set the output blob container URI. * * @param outputBlobContainerUri the outputBlobContainerUri value to set * @return the ImportDevicesRequest object itself. diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/IotHubCapacity.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/IotHubCapacity.java index 4d3ee6b48e0a..b560d520a194 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/IotHubCapacity.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/IotHubCapacity.java @@ -40,7 +40,7 @@ public class IotHubCapacity { private IotHubScaleType scaleType; /** - * Get the minimum value. + * Get the minimum number of units. * * @return the minimum value */ @@ -49,7 +49,7 @@ public Long minimum() { } /** - * Get the maximum value. + * Get the maximum number of units. * * @return the maximum value */ @@ -58,7 +58,7 @@ public Long maximum() { } /** - * Get the defaultProperty value. + * Get the default number of units. * * @return the defaultProperty value */ @@ -67,7 +67,7 @@ public Long defaultProperty() { } /** - * Get the scaleType value. + * Get the type of the scaling enabled. Possible values include: 'Automatic', 'Manual', 'None'. * * @return the scaleType value */ diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/IotHubDescription.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/IotHubDescription.java index c0ea3a2b170c..effbb808d094 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/IotHubDescription.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/IotHubDescription.java @@ -10,20 +10,20 @@ 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.GroupableResourceCore; import com.microsoft.azure.arm.resources.models.HasManager; -import com.microsoft.azure.management.iothub.v2018_04_01.implementation.IoTHubManager; +import com.microsoft.azure.management.iothub.v2018_04_01.implementation.DevicesManager; import com.microsoft.azure.management.iothub.v2018_04_01.implementation.IotHubDescriptionInner; /** * Type representing IotHubDescription. */ -public interface IotHubDescription extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { +public interface IotHubDescription extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { /** * @return the etag value. */ @@ -102,12 +102,32 @@ interface WithCreate extends Creatable, Resource.DefinitionWi /** * The template for a IotHubDescription update operation, containing all the settings that can be modified. */ - interface Update extends Appliable, Resource.UpdateWithTags { + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithEtag, UpdateStages.WithProperties { } /** * Grouping of IotHubDescription update stages. */ interface UpdateStages { + /** + * The stage of the iothubdescription {0} allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + */ + Update withEtag(String etag); + } + + /** + * The stage of the iothubdescription {0} allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + */ + Update withProperties(IotHubProperties properties); + } + } } diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/IotHubNameAvailabilityInfo.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/IotHubNameAvailabilityInfo.java index 68040575d82d..7227c6ed28c6 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/IotHubNameAvailabilityInfo.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/IotHubNameAvailabilityInfo.java @@ -10,13 +10,13 @@ import com.microsoft.azure.arm.model.HasInner; import com.microsoft.azure.arm.resources.models.HasManager; -import com.microsoft.azure.management.iothub.v2018_04_01.implementation.IoTHubManager; +import com.microsoft.azure.management.iothub.v2018_04_01.implementation.DevicesManager; import com.microsoft.azure.management.iothub.v2018_04_01.implementation.IotHubNameAvailabilityInfoInner; /** * Type representing IotHubNameAvailabilityInfo. */ -public interface IotHubNameAvailabilityInfo extends HasInner, HasManager { +public interface IotHubNameAvailabilityInfo extends HasInner, HasManager { /** * @return the message value. */ diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/IotHubProperties.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/IotHubProperties.java index fc6f022d826e..d76a9db77ad4 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/IotHubProperties.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/IotHubProperties.java @@ -37,7 +37,7 @@ public class IotHubProperties { private String provisioningState; /** - * Thehub state state. + * The hub state. */ @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) private String state; @@ -113,7 +113,7 @@ public class IotHubProperties { private Capabilities features; /** - * Get the authorizationPolicies value. + * Get the shared access policies you can use to secure a connection to the IoT hub. * * @return the authorizationPolicies value */ @@ -122,7 +122,7 @@ public List authorizationPolicies() } /** - * Set the authorizationPolicies value. + * 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. @@ -133,7 +133,7 @@ public IotHubProperties withAuthorizationPolicies(List ipFilterRules() { } /** - * Set the ipFilterRules value. + * Set the IP filter rules. * * @param ipFilterRules the ipFilterRules value to set * @return the IotHubProperties object itself. @@ -153,7 +153,7 @@ public IotHubProperties withIpFilterRules(List ipFilterRules) { } /** - * Get the provisioningState value. + * Get the provisioning state. * * @return the provisioningState value */ @@ -162,7 +162,7 @@ public String provisioningState() { } /** - * Get the state value. + * Get the hub state. * * @return the state value */ @@ -171,7 +171,7 @@ public String state() { } /** - * Get the hostName value. + * Get the name of the host. * * @return the hostName value */ @@ -180,7 +180,7 @@ public String hostName() { } /** - * Get the eventHubEndpoints value. + * Get the Event Hub-compatible endpoint properties. The possible keys to this dictionary are events and operationsMonitoringEvents. Both of these keys have to be present in the dictionary while making create or update calls for the IoT hub. * * @return the eventHubEndpoints value */ @@ -189,7 +189,7 @@ public Map eventHubEndpoints() { } /** - * Set the eventHubEndpoints value. + * Set the Event Hub-compatible endpoint properties. The possible keys to this dictionary are events and operationsMonitoringEvents. Both of these keys have 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. @@ -220,7 +220,7 @@ public IotHubProperties withRouting(RoutingProperties routing) { } /** - * Get the storageEndpoints value. + * 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 */ @@ -229,7 +229,7 @@ public Map storageEndpoints() { } /** - * Set the storageEndpoints value. + * 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. @@ -240,7 +240,7 @@ public IotHubProperties withStorageEndpoints(Map messagingEndpoints() { } /** - * Set the messagingEndpoints value. + * Set the messaging endpoint properties for the file upload notification queue. * * @param messagingEndpoints the messagingEndpoints value to set * @return the IotHubProperties object itself. @@ -260,7 +260,7 @@ public IotHubProperties withMessagingEndpoints(Map, HasManager { +public interface IotHubQuotaMetricInfo extends HasInner, HasManager { /** * @return the currentValue value. */ diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/IotHubResources.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/IotHubResources.java index 2cd7f134265a..1b885f4067fa 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/IotHubResources.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/IotHubResources.java @@ -20,8 +20,18 @@ * 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); /** diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/IotHubSkuDescription.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/IotHubSkuDescription.java index a478f012d770..81d5b52ff30c 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/IotHubSkuDescription.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/IotHubSkuDescription.java @@ -11,12 +11,12 @@ import com.microsoft.azure.arm.model.HasInner; import com.microsoft.azure.management.iothub.v2018_04_01.implementation.IotHubSkuDescriptionInner; import com.microsoft.azure.arm.resources.models.HasManager; -import com.microsoft.azure.management.iothub.v2018_04_01.implementation.IoTHubManager; +import com.microsoft.azure.management.iothub.v2018_04_01.implementation.DevicesManager; /** * Type representing IotHubSkuDescription. */ -public interface IotHubSkuDescription extends HasInner, HasManager { +public interface IotHubSkuDescription extends HasInner, HasManager { /** * @return the capacity value. */ diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/IotHubSkuInfo.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/IotHubSkuInfo.java index 11feb975cb9b..35a578f7ca5b 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/IotHubSkuInfo.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/IotHubSkuInfo.java @@ -36,7 +36,7 @@ public class IotHubSkuInfo { private Long capacity; /** - * Get the name value. + * Get the name of the SKU. Possible values include: 'F1', 'S1', 'S2', 'S3', 'B1', 'B2', 'B3'. * * @return the name value */ @@ -45,7 +45,7 @@ public IotHubSku name() { } /** - * Set the name value. + * 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. @@ -56,7 +56,7 @@ public IotHubSkuInfo withName(IotHubSku name) { } /** - * Get the tier value. + * Get the billing tier for the IoT hub. Possible values include: 'Free', 'Standard', 'Basic'. * * @return the tier value */ @@ -65,7 +65,7 @@ public IotHubSkuTier tier() { } /** - * Get the capacity value. + * 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 */ @@ -74,7 +74,7 @@ public Long capacity() { } /** - * Set the capacity value. + * 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. diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/IpFilterRule.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/IpFilterRule.java index 9d498a74a3d5..225852955a6b 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/IpFilterRule.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/IpFilterRule.java @@ -35,7 +35,7 @@ public class IpFilterRule { private String ipMask; /** - * Get the filterName value. + * Get the name of the IP filter rule. * * @return the filterName value */ @@ -44,7 +44,7 @@ public String filterName() { } /** - * Set the filterName value. + * Set the name of the IP filter rule. * * @param filterName the filterName value to set * @return the IpFilterRule object itself. @@ -55,7 +55,7 @@ public IpFilterRule withFilterName(String filterName) { } /** - * Get the action value. + * Get the desired action for requests captured by this rule. Possible values include: 'Accept', 'Reject'. * * @return the action value */ @@ -64,7 +64,7 @@ public IpFilterActionType action() { } /** - * Set the action value. + * 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. @@ -75,7 +75,7 @@ public IpFilterRule withAction(IpFilterActionType action) { } /** - * Get the ipMask value. + * Get a string that contains the IP address range in CIDR notation for the rule. * * @return the ipMask value */ @@ -84,7 +84,7 @@ public String ipMask() { } /** - * Set the ipMask value. + * 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. diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/JobResponse.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/JobResponse.java index b7e3460d0f76..157de04e4a58 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/JobResponse.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/JobResponse.java @@ -11,14 +11,14 @@ import com.microsoft.azure.arm.model.HasInner; import com.microsoft.azure.management.iothub.v2018_04_01.implementation.JobResponseInner; import com.microsoft.azure.arm.resources.models.HasManager; -import com.microsoft.azure.management.iothub.v2018_04_01.implementation.IoTHubManager; +import com.microsoft.azure.management.iothub.v2018_04_01.implementation.DevicesManager; import com.microsoft.rest.DateTimeRfc1123; import org.joda.time.DateTime; /** * Type representing JobResponse. */ -public interface JobResponse extends HasInner, HasManager { +public interface JobResponse extends HasInner, HasManager { /** * @return the endTimeUtc value. */ diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/MatchedRoute.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/MatchedRoute.java index 55e8f0b22f06..bfa9c75f2471 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/MatchedRoute.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/MatchedRoute.java @@ -21,7 +21,7 @@ public class MatchedRoute { private RouteProperties properties; /** - * Get the properties value. + * Get properties of routes that matched. * * @return the properties value */ @@ -30,7 +30,7 @@ public RouteProperties properties() { } /** - * Set the properties value. + * Set properties of routes that matched. * * @param properties the properties value to set * @return the MatchedRoute object itself. diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/MessagingEndpointProperties.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/MessagingEndpointProperties.java index 0d741b978dd3..8e7b3a6e7ee3 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/MessagingEndpointProperties.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/MessagingEndpointProperties.java @@ -38,7 +38,7 @@ public class MessagingEndpointProperties { private Integer maxDeliveryCount; /** - * Get the lockDurationAsIso8601 value. + * Get the lock duration. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload. * * @return the lockDurationAsIso8601 value */ @@ -47,7 +47,7 @@ public Period lockDurationAsIso8601() { } /** - * Set the lockDurationAsIso8601 value. + * 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. @@ -58,7 +58,7 @@ public MessagingEndpointProperties withLockDurationAsIso8601(Period lockDuration } /** - * Get the ttlAsIso8601 value. + * 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 */ @@ -67,7 +67,7 @@ public Period ttlAsIso8601() { } /** - * Set the ttlAsIso8601 value. + * 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. @@ -78,7 +78,7 @@ public MessagingEndpointProperties withTtlAsIso8601(Period ttlAsIso8601) { } /** - * Get the maxDeliveryCount value. + * 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 */ @@ -87,7 +87,7 @@ public Integer maxDeliveryCount() { } /** - * Set the maxDeliveryCount value. + * 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. diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/Name.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/Name.java index 0181bbb939a5..e8264c8f9f6e 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/Name.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/Name.java @@ -27,7 +27,7 @@ public class Name { private String localizedValue; /** - * Get the value value. + * Get iotHub type. * * @return the value value */ @@ -36,7 +36,7 @@ public String value() { } /** - * Set the value value. + * Set iotHub type. * * @param value the value value to set * @return the Name object itself. @@ -47,7 +47,7 @@ public Name withValue(String value) { } /** - * Get the localizedValue value. + * Get localized value of name. * * @return the localizedValue value */ @@ -56,7 +56,7 @@ public String localizedValue() { } /** - * Set the localizedValue value. + * Set localized value of name. * * @param localizedValue the localizedValue value to set * @return the Name object itself. diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/Operation.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/Operation.java index 659fbbe04759..5931dda80cca 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/Operation.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/Operation.java @@ -10,13 +10,13 @@ import com.microsoft.azure.arm.model.HasInner; import com.microsoft.azure.arm.resources.models.HasManager; -import com.microsoft.azure.management.iothub.v2018_04_01.implementation.IoTHubManager; +import com.microsoft.azure.management.iothub.v2018_04_01.implementation.DevicesManager; import com.microsoft.azure.management.iothub.v2018_04_01.implementation.OperationInner; /** * Type representing Operation. */ -public interface Operation extends HasInner, HasManager { +public interface Operation extends HasInner, HasManager { /** * @return the display value. */ diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/OperationDisplay.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/OperationDisplay.java index 5b205f3d958c..d546c1289403 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/OperationDisplay.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/OperationDisplay.java @@ -33,7 +33,7 @@ public class OperationDisplay { private String operation; /** - * Get the provider value. + * Get service provider: Microsoft Devices. * * @return the provider value */ @@ -42,7 +42,7 @@ public String provider() { } /** - * Get the resource value. + * Get resource Type: IotHubs. * * @return the resource value */ @@ -51,7 +51,7 @@ public String resource() { } /** - * Get the operation value. + * Get name of the operation. * * @return the operation value */ diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/OperationInputs.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/OperationInputs.java index 19f79b98dd76..d7b860916e04 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/OperationInputs.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/OperationInputs.java @@ -21,7 +21,7 @@ public class OperationInputs { private String name; /** - * Get the name value. + * Get the name of the IoT hub to check. * * @return the name value */ @@ -30,7 +30,7 @@ public String name() { } /** - * Set the name value. + * Set the name of the IoT hub to check. * * @param name the name value to set * @return the OperationInputs object itself. diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/RegistryStatistics.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/RegistryStatistics.java index 0a4cf17f5dfd..55d29989c060 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/RegistryStatistics.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/RegistryStatistics.java @@ -10,13 +10,13 @@ import com.microsoft.azure.arm.model.HasInner; import com.microsoft.azure.arm.resources.models.HasManager; -import com.microsoft.azure.management.iothub.v2018_04_01.implementation.IoTHubManager; +import com.microsoft.azure.management.iothub.v2018_04_01.implementation.DevicesManager; import com.microsoft.azure.management.iothub.v2018_04_01.implementation.RegistryStatisticsInner; /** * Type representing RegistryStatistics. */ -public interface RegistryStatistics extends HasInner, HasManager { +public interface RegistryStatistics extends HasInner, HasManager { /** * @return the disabledDeviceCount value. */ diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/RouteCompilationError.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/RouteCompilationError.java index be253754151b..1d45ec8619da 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/RouteCompilationError.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/RouteCompilationError.java @@ -34,7 +34,7 @@ public class RouteCompilationError { private RouteErrorRange location; /** - * Get the message value. + * Get route error message. * * @return the message value */ @@ -43,7 +43,7 @@ public String message() { } /** - * Set the message value. + * Set route error message. * * @param message the message value to set * @return the RouteCompilationError object itself. @@ -54,7 +54,7 @@ public RouteCompilationError withMessage(String message) { } /** - * Get the severity value. + * Get severity of the route error. Possible values include: 'error', 'warning'. * * @return the severity value */ @@ -63,7 +63,7 @@ public RouteErrorSeverity severity() { } /** - * Set the severity value. + * Set severity of the route error. Possible values include: 'error', 'warning'. * * @param severity the severity value to set * @return the RouteCompilationError object itself. @@ -74,7 +74,7 @@ public RouteCompilationError withSeverity(RouteErrorSeverity severity) { } /** - * Get the location value. + * Get location where the route error happened. * * @return the location value */ @@ -83,7 +83,7 @@ public RouteErrorRange location() { } /** - * Set the location value. + * Set location where the route error happened. * * @param location the location value to set * @return the RouteCompilationError object itself. diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/RouteErrorPosition.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/RouteErrorPosition.java index 2e4664de3f23..5400e226ffbf 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/RouteErrorPosition.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/RouteErrorPosition.java @@ -27,7 +27,7 @@ public class RouteErrorPosition { private Integer column; /** - * Get the line value. + * Get line where the route error happened. * * @return the line value */ @@ -36,7 +36,7 @@ public Integer line() { } /** - * Set the line value. + * Set line where the route error happened. * * @param line the line value to set * @return the RouteErrorPosition object itself. @@ -47,7 +47,7 @@ public RouteErrorPosition withLine(Integer line) { } /** - * Get the column value. + * Get column where the route error happened. * * @return the column value */ @@ -56,7 +56,7 @@ public Integer column() { } /** - * Set the column value. + * Set column where the route error happened. * * @param column the column value to set * @return the RouteErrorPosition object itself. diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/RouteErrorRange.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/RouteErrorRange.java index 5fd27f7c51f2..a55f128432e8 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/RouteErrorRange.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/RouteErrorRange.java @@ -27,7 +27,7 @@ public class RouteErrorRange { private RouteErrorPosition end; /** - * Get the start value. + * Get start where the route error happened. * * @return the start value */ @@ -36,7 +36,7 @@ public RouteErrorPosition start() { } /** - * Set the start value. + * Set start where the route error happened. * * @param start the start value to set * @return the RouteErrorRange object itself. @@ -47,7 +47,7 @@ public RouteErrorRange withStart(RouteErrorPosition start) { } /** - * Get the end value. + * Get end where the route error happened. * * @return the end value */ @@ -56,7 +56,7 @@ public RouteErrorPosition end() { } /** - * Set the end value. + * Set end where the route error happened. * * @param end the end value to set * @return the RouteErrorRange object itself. diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/RouteProperties.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/RouteProperties.java index 01b7d7063ae8..8e047ecd575c 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/RouteProperties.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/RouteProperties.java @@ -55,7 +55,7 @@ public class RouteProperties { private boolean isEnabled; /** - * Get the name value. + * 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 */ @@ -64,7 +64,7 @@ public String name() { } /** - * Set the name value. + * 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. @@ -75,7 +75,7 @@ public RouteProperties withName(String name) { } /** - * Get the source value. + * 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 */ @@ -84,7 +84,7 @@ public RoutingSource source() { } /** - * Set the source value. + * 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. @@ -95,7 +95,7 @@ public RouteProperties withSource(RoutingSource source) { } /** - * Get the condition value. + * 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 */ @@ -104,7 +104,7 @@ public String condition() { } /** - * Set the condition value. + * 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. @@ -115,7 +115,7 @@ public RouteProperties withCondition(String condition) { } /** - * Get the endpointNames value. + * Get the list of endpoints to which messages that satisfy the condition are routed. Currently only one endpoint is allowed. * * @return the endpointNames value */ @@ -124,7 +124,7 @@ public List endpointNames() { } /** - * Set the endpointNames value. + * 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. @@ -135,7 +135,7 @@ public RouteProperties withEndpointNames(List endpointNames) { } /** - * Get the isEnabled value. + * Get used to specify whether a route is enabled. * * @return the isEnabled value */ @@ -144,7 +144,7 @@ public boolean isEnabled() { } /** - * Set the isEnabled value. + * Set used to specify whether a route is enabled. * * @param isEnabled the isEnabled value to set * @return the RouteProperties object itself. diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/RoutingEndpoints.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/RoutingEndpoints.java index d844f4c7d010..38aed58a5402 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/RoutingEndpoints.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/RoutingEndpoints.java @@ -48,7 +48,7 @@ public class RoutingEndpoints { private List storageContainers; /** - * Get the serviceBusQueues value. + * Get the list of Service Bus queue endpoints that IoT hub routes the messages to, based on the routing rules. * * @return the serviceBusQueues value */ @@ -57,7 +57,7 @@ public List serviceBusQueues() { } /** - * Set the serviceBusQueues value. + * 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. @@ -68,7 +68,7 @@ public RoutingEndpoints withServiceBusQueues(List serviceBusTopics() { } /** - * Set the serviceBusTopics value. + * 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. @@ -88,7 +88,7 @@ public RoutingEndpoints withServiceBusTopics(List eventHubs() { } /** - * Set the eventHubs value. + * 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. @@ -108,7 +108,7 @@ public RoutingEndpoints withEventHubs(List eventHubs) } /** - * Get the storageContainers value. + * Get the list of storage container endpoints that IoT hub routes messages to, based on the routing rules. * * @return the storageContainers value */ @@ -117,7 +117,7 @@ public List storageContainers() { } /** - * Set the storageContainers value. + * 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. diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/RoutingEventHubProperties.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/RoutingEventHubProperties.java index 11d085b58a05..16c51f19df57 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/RoutingEventHubProperties.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/RoutingEventHubProperties.java @@ -43,7 +43,7 @@ public class RoutingEventHubProperties { private String resourceGroup; /** - * Get the connectionString value. + * Get the connection string of the event hub endpoint. * * @return the connectionString value */ @@ -52,7 +52,7 @@ public String connectionString() { } /** - * Set the connectionString value. + * Set the connection string of the event hub endpoint. * * @param connectionString the connectionString value to set * @return the RoutingEventHubProperties object itself. @@ -63,7 +63,7 @@ public RoutingEventHubProperties withConnectionString(String connectionString) { } /** - * Get the name value. + * 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, operationsMonitoringEvents, fileNotifications, $default. Endpoint names must be unique across endpoint types. * * @return the name value */ @@ -72,7 +72,7 @@ public String name() { } /** - * Set the name value. + * 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, operationsMonitoringEvents, fileNotifications, $default. Endpoint names must be unique across endpoint types. * * @param name the name value to set * @return the RoutingEventHubProperties object itself. @@ -83,7 +83,7 @@ public RoutingEventHubProperties withName(String name) { } /** - * Get the subscriptionId value. + * Get the subscription identifier of the event hub endpoint. * * @return the subscriptionId value */ @@ -92,7 +92,7 @@ public String subscriptionId() { } /** - * Set the subscriptionId value. + * Set the subscription identifier of the event hub endpoint. * * @param subscriptionId the subscriptionId value to set * @return the RoutingEventHubProperties object itself. @@ -103,7 +103,7 @@ public RoutingEventHubProperties withSubscriptionId(String subscriptionId) { } /** - * Get the resourceGroup value. + * Get the name of the resource group of the event hub endpoint. * * @return the resourceGroup value */ @@ -112,7 +112,7 @@ public String resourceGroup() { } /** - * Set the resourceGroup value. + * Set the name of the resource group of the event hub endpoint. * * @param resourceGroup the resourceGroup value to set * @return the RoutingEventHubProperties object itself. diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/RoutingMessage.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/RoutingMessage.java index c326b2583d1a..3068080648a4 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/RoutingMessage.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/RoutingMessage.java @@ -34,7 +34,7 @@ public class RoutingMessage { private Map systemProperties; /** - * Get the body value. + * Get body of routing message. * * @return the body value */ @@ -43,7 +43,7 @@ public String body() { } /** - * Set the body value. + * Set body of routing message. * * @param body the body value to set * @return the RoutingMessage object itself. @@ -54,7 +54,7 @@ public RoutingMessage withBody(String body) { } /** - * Get the appProperties value. + * Get app properties. * * @return the appProperties value */ @@ -63,7 +63,7 @@ public Map appProperties() { } /** - * Set the appProperties value. + * Set app properties. * * @param appProperties the appProperties value to set * @return the RoutingMessage object itself. @@ -74,7 +74,7 @@ public RoutingMessage withAppProperties(Map appProperties) { } /** - * Get the systemProperties value. + * Get system properties. * * @return the systemProperties value */ @@ -83,7 +83,7 @@ public Map systemProperties() { } /** - * Set the systemProperties value. + * Set system properties. * * @param systemProperties the systemProperties value to set * @return the RoutingMessage object itself. diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/RoutingProperties.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/RoutingProperties.java index f71f7b720fe7..1b93ef3832b8 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/RoutingProperties.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/RoutingProperties.java @@ -62,7 +62,7 @@ public RoutingProperties withEndpoints(RoutingEndpoints endpoints) { } /** - * Get the routes value. + * 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 */ @@ -71,7 +71,7 @@ public List routes() { } /** - * Set the routes value. + * 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. @@ -82,7 +82,7 @@ public RoutingProperties withRoutes(List routes) { } /** - * Get the fallbackRoute value. + * 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 */ @@ -91,7 +91,7 @@ public FallbackRouteProperties fallbackRoute() { } /** - * Set the fallbackRoute value. + * 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. diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/RoutingServiceBusQueueEndpointProperties.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/RoutingServiceBusQueueEndpointProperties.java index 4838f6f4fbfc..923fa5323485 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/RoutingServiceBusQueueEndpointProperties.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/RoutingServiceBusQueueEndpointProperties.java @@ -44,7 +44,7 @@ public class RoutingServiceBusQueueEndpointProperties { private String resourceGroup; /** - * Get the connectionString value. + * Get the connection string of the service bus queue endpoint. * * @return the connectionString value */ @@ -53,7 +53,7 @@ public String connectionString() { } /** - * Set the connectionString value. + * Set the connection string of the service bus queue endpoint. * * @param connectionString the connectionString value to set * @return the RoutingServiceBusQueueEndpointProperties object itself. @@ -64,7 +64,7 @@ public RoutingServiceBusQueueEndpointProperties withConnectionString(String conn } /** - * Get the name value. + * 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, operationsMonitoringEvents, 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 */ @@ -73,7 +73,7 @@ public String name() { } /** - * Set the name value. + * 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, operationsMonitoringEvents, 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. @@ -84,7 +84,7 @@ public RoutingServiceBusQueueEndpointProperties withName(String name) { } /** - * Get the subscriptionId value. + * Get the subscription identifier of the service bus queue endpoint. * * @return the subscriptionId value */ @@ -93,7 +93,7 @@ public String subscriptionId() { } /** - * Set the subscriptionId value. + * Set the subscription identifier of the service bus queue endpoint. * * @param subscriptionId the subscriptionId value to set * @return the RoutingServiceBusQueueEndpointProperties object itself. @@ -104,7 +104,7 @@ public RoutingServiceBusQueueEndpointProperties withSubscriptionId(String subscr } /** - * Get the resourceGroup value. + * Get the name of the resource group of the service bus queue endpoint. * * @return the resourceGroup value */ @@ -113,7 +113,7 @@ public String resourceGroup() { } /** - * Set the resourceGroup value. + * 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. diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/RoutingServiceBusTopicEndpointProperties.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/RoutingServiceBusTopicEndpointProperties.java index ab73f5cfc968..a2935d115194 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/RoutingServiceBusTopicEndpointProperties.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/RoutingServiceBusTopicEndpointProperties.java @@ -44,7 +44,7 @@ public class RoutingServiceBusTopicEndpointProperties { private String resourceGroup; /** - * Get the connectionString value. + * Get the connection string of the service bus topic endpoint. * * @return the connectionString value */ @@ -53,7 +53,7 @@ public String connectionString() { } /** - * Set the connectionString value. + * Set the connection string of the service bus topic endpoint. * * @param connectionString the connectionString value to set * @return the RoutingServiceBusTopicEndpointProperties object itself. @@ -64,7 +64,7 @@ public RoutingServiceBusTopicEndpointProperties withConnectionString(String conn } /** - * Get the name value. + * 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, operationsMonitoringEvents, 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 */ @@ -73,7 +73,7 @@ public String name() { } /** - * Set the name value. + * 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, operationsMonitoringEvents, 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. @@ -84,7 +84,7 @@ public RoutingServiceBusTopicEndpointProperties withName(String name) { } /** - * Get the subscriptionId value. + * Get the subscription identifier of the service bus topic endpoint. * * @return the subscriptionId value */ @@ -93,7 +93,7 @@ public String subscriptionId() { } /** - * Set the subscriptionId value. + * Set the subscription identifier of the service bus topic endpoint. * * @param subscriptionId the subscriptionId value to set * @return the RoutingServiceBusTopicEndpointProperties object itself. @@ -104,7 +104,7 @@ public RoutingServiceBusTopicEndpointProperties withSubscriptionId(String subscr } /** - * Get the resourceGroup value. + * Get the name of the resource group of the service bus topic endpoint. * * @return the resourceGroup value */ @@ -113,7 +113,7 @@ public String resourceGroup() { } /** - * Set the resourceGroup value. + * 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. diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/RoutingStorageContainerProperties.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/RoutingStorageContainerProperties.java index 906408b79c80..82d7ed308ea6 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/RoutingStorageContainerProperties.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/RoutingStorageContainerProperties.java @@ -73,13 +73,13 @@ public class RoutingStorageContainerProperties { /** * Encoding that is used to serialize messages to blobs. Supported values - * are 'avro' and 'avrodeflate'. Default value is 'avro'. + * are 'avro' and 'avroDeflate'. Default value is 'avro'. */ @JsonProperty(value = "encoding") private String encoding; /** - * Get the connectionString value. + * Get the connection string of the storage account. * * @return the connectionString value */ @@ -88,7 +88,7 @@ public String connectionString() { } /** - * Set the connectionString value. + * Set the connection string of the storage account. * * @param connectionString the connectionString value to set * @return the RoutingStorageContainerProperties object itself. @@ -99,7 +99,7 @@ public RoutingStorageContainerProperties withConnectionString(String connectionS } /** - * Get the name value. + * 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, operationsMonitoringEvents, fileNotifications, $default. Endpoint names must be unique across endpoint types. * * @return the name value */ @@ -108,7 +108,7 @@ public String name() { } /** - * Set the name value. + * 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, operationsMonitoringEvents, fileNotifications, $default. Endpoint names must be unique across endpoint types. * * @param name the name value to set * @return the RoutingStorageContainerProperties object itself. @@ -119,7 +119,7 @@ public RoutingStorageContainerProperties withName(String name) { } /** - * Get the subscriptionId value. + * Get the subscription identifier of the storage account. * * @return the subscriptionId value */ @@ -128,7 +128,7 @@ public String subscriptionId() { } /** - * Set the subscriptionId value. + * Set the subscription identifier of the storage account. * * @param subscriptionId the subscriptionId value to set * @return the RoutingStorageContainerProperties object itself. @@ -139,7 +139,7 @@ public RoutingStorageContainerProperties withSubscriptionId(String subscriptionI } /** - * Get the resourceGroup value. + * Get the name of the resource group of the storage account. * * @return the resourceGroup value */ @@ -148,7 +148,7 @@ public String resourceGroup() { } /** - * Set the resourceGroup value. + * Set the name of the resource group of the storage account. * * @param resourceGroup the resourceGroup value to set * @return the RoutingStorageContainerProperties object itself. @@ -159,7 +159,7 @@ public RoutingStorageContainerProperties withResourceGroup(String resourceGroup) } /** - * Get the containerName value. + * Get the name of storage container in the storage account. * * @return the containerName value */ @@ -168,7 +168,7 @@ public String containerName() { } /** - * Set the containerName value. + * Set the name of storage container in the storage account. * * @param containerName the containerName value to set * @return the RoutingStorageContainerProperties object itself. @@ -179,7 +179,7 @@ public RoutingStorageContainerProperties withContainerName(String containerName) } /** - * Get the fileNameFormat value. + * 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 */ @@ -188,7 +188,7 @@ public String fileNameFormat() { } /** - * Set the fileNameFormat value. + * 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. @@ -199,7 +199,7 @@ public RoutingStorageContainerProperties withFileNameFormat(String fileNameForma } /** - * Get the batchFrequencyInSeconds value. + * 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 */ @@ -208,7 +208,7 @@ public Integer batchFrequencyInSeconds() { } /** - * Set the batchFrequencyInSeconds value. + * 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. @@ -219,7 +219,7 @@ public RoutingStorageContainerProperties withBatchFrequencyInSeconds(Integer bat } /** - * Get the maxChunkSizeInBytes value. + * 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 */ @@ -228,7 +228,7 @@ public Integer maxChunkSizeInBytes() { } /** - * Set the maxChunkSizeInBytes value. + * 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. @@ -239,7 +239,7 @@ public RoutingStorageContainerProperties withMaxChunkSizeInBytes(Integer maxChun } /** - * Get the encoding value. + * Get encoding that is used to serialize messages to blobs. Supported values are 'avro' and 'avroDeflate'. Default value is 'avro'. * * @return the encoding value */ @@ -248,7 +248,7 @@ public String encoding() { } /** - * Set the encoding value. + * Set encoding that is used to serialize messages to blobs. Supported values are 'avro' and 'avroDeflate'. Default value is 'avro'. * * @param encoding the encoding value to set * @return the RoutingStorageContainerProperties object itself. diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/RoutingTwin.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/RoutingTwin.java new file mode 100644 index 000000000000..7840cb7a128a --- /dev/null +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_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.v2018_04_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/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/RoutingTwinProperties.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/RoutingTwinProperties.java new file mode 100644 index 000000000000..de98fd94b514 --- /dev/null +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_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.v2018_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The RoutingTwinProperties model. + */ +public class RoutingTwinProperties { + /** + * Twin desired properties. + */ + @JsonProperty(value = "desiredProperties") + private Object desiredProperties; + + /** + * Twin desired properties. + */ + @JsonProperty(value = "reportedProperties") + private Object reportedProperties; + + /** + * Get twin desired properties. + * + * @return the desiredProperties value + */ + public Object desiredProperties() { + return this.desiredProperties; + } + + /** + * Set twin desired properties. + * + * @param desiredProperties the desiredProperties value to set + * @return the RoutingTwinProperties object itself. + */ + public RoutingTwinProperties withDesiredProperties(Object desiredProperties) { + this.desiredProperties = desiredProperties; + return this; + } + + /** + * Get twin desired properties. + * + * @return the reportedProperties value + */ + public Object reportedProperties() { + return this.reportedProperties; + } + + /** + * Set twin desired properties. + * + * @param reportedProperties the reportedProperties value to set + * @return the RoutingTwinProperties object itself. + */ + public RoutingTwinProperties withReportedProperties(Object reportedProperties) { + this.reportedProperties = reportedProperties; + return this; + } + +} diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/SharedAccessSignatureAuthorizationRule.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/SharedAccessSignatureAuthorizationRule.java index f143f874d893..a03a233d57c3 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/SharedAccessSignatureAuthorizationRule.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/SharedAccessSignatureAuthorizationRule.java @@ -10,13 +10,13 @@ import com.microsoft.azure.arm.model.HasInner; import com.microsoft.azure.arm.resources.models.HasManager; -import com.microsoft.azure.management.iothub.v2018_04_01.implementation.IoTHubManager; +import com.microsoft.azure.management.iothub.v2018_04_01.implementation.DevicesManager; import com.microsoft.azure.management.iothub.v2018_04_01.implementation.SharedAccessSignatureAuthorizationRuleInner; /** * Type representing SharedAccessSignatureAuthorizationRule. */ -public interface SharedAccessSignatureAuthorizationRule extends HasInner, HasManager { +public interface SharedAccessSignatureAuthorizationRule extends HasInner, HasManager { /** * @return the keyName value. */ diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/StorageEndpointProperties.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/StorageEndpointProperties.java index 695eb40b104b..54b050c8c3aa 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/StorageEndpointProperties.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/StorageEndpointProperties.java @@ -16,8 +16,8 @@ */ public class StorageEndpointProperties { /** - * The period of time for which the the SAS URI generated by IoT Hub for - * file upload is valid. See: + * 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") @@ -39,7 +39,7 @@ public class StorageEndpointProperties { private String containerName; /** - * Get the sasTtlAsIso8601 value. + * 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 */ @@ -48,7 +48,7 @@ public Period sasTtlAsIso8601() { } /** - * Set the sasTtlAsIso8601 value. + * 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. @@ -59,7 +59,7 @@ public StorageEndpointProperties withSasTtlAsIso8601(Period sasTtlAsIso8601) { } /** - * Get the connectionString value. + * Get the connection string for the Azure Storage account to which files are uploaded. * * @return the connectionString value */ @@ -68,7 +68,7 @@ public String connectionString() { } /** - * Set the connectionString value. + * 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. @@ -79,7 +79,7 @@ public StorageEndpointProperties withConnectionString(String connectionString) { } /** - * Get the containerName value. + * 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 */ @@ -88,7 +88,7 @@ public String containerName() { } /** - * Set the containerName value. + * 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. diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/TagsResource.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/TagsResource.java index e26f3382f751..d2b617e77991 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/TagsResource.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/TagsResource.java @@ -23,7 +23,7 @@ public class TagsResource { private Map tags; /** - * Get the tags value. + * Get resource tags. * * @return the tags value */ @@ -32,7 +32,7 @@ public Map tags() { } /** - * Set the tags value. + * Set resource tags. * * @param tags the tags value to set * @return the TagsResource object itself. diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/TestAllRoutesInput.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/TestAllRoutesInput.java index 0f3167a41df8..cd828a1749d1 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/TestAllRoutesInput.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/TestAllRoutesInput.java @@ -28,7 +28,13 @@ public class TestAllRoutesInput { private RoutingMessage message; /** - * Get the routingSource value. + * Routing Twin Reference. + */ + @JsonProperty(value = "twin") + private RoutingTwin twin; + + /** + * Get routing source. Possible values include: 'Invalid', 'DeviceMessages', 'TwinChangeEvents', 'DeviceLifecycleEvents', 'DeviceJobLifecycleEvents'. * * @return the routingSource value */ @@ -37,7 +43,7 @@ public RoutingSource routingSource() { } /** - * Set the routingSource value. + * Set routing source. Possible values include: 'Invalid', 'DeviceMessages', 'TwinChangeEvents', 'DeviceLifecycleEvents', 'DeviceJobLifecycleEvents'. * * @param routingSource the routingSource value to set * @return the TestAllRoutesInput object itself. @@ -48,7 +54,7 @@ public TestAllRoutesInput withRoutingSource(RoutingSource routingSource) { } /** - * Get the message value. + * Get routing message. * * @return the message value */ @@ -57,7 +63,7 @@ public RoutingMessage message() { } /** - * Set the message value. + * Set routing message. * * @param message the message value to set * @return the TestAllRoutesInput object itself. @@ -67,4 +73,24 @@ public TestAllRoutesInput withMessage(RoutingMessage 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/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/TestAllRoutesResult.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/TestAllRoutesResult.java index f4cec3d0cac0..30a17703a947 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/TestAllRoutesResult.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/TestAllRoutesResult.java @@ -10,14 +10,14 @@ import com.microsoft.azure.arm.model.HasInner; import com.microsoft.azure.arm.resources.models.HasManager; -import com.microsoft.azure.management.iothub.v2018_04_01.implementation.IoTHubManager; +import com.microsoft.azure.management.iothub.v2018_04_01.implementation.DevicesManager; import com.microsoft.azure.management.iothub.v2018_04_01.implementation.TestAllRoutesResultInner; import java.util.List; /** * Type representing TestAllRoutesResult. */ -public interface TestAllRoutesResult extends HasInner, HasManager { +public interface TestAllRoutesResult extends HasInner, HasManager { /** * @return the routes value. */ diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/TestRouteInput.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/TestRouteInput.java index 15fcbbca970e..6859fc5a8ff8 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/TestRouteInput.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/TestRouteInput.java @@ -27,7 +27,13 @@ public class TestRouteInput { private RouteProperties route; /** - * Get the message value. + * Routing Twin Reference. + */ + @JsonProperty(value = "twin") + private RoutingTwin twin; + + /** + * Get routing message. * * @return the message value */ @@ -36,7 +42,7 @@ public RoutingMessage message() { } /** - * Set the message value. + * Set routing message. * * @param message the message value to set * @return the TestRouteInput object itself. @@ -47,7 +53,7 @@ public TestRouteInput withMessage(RoutingMessage message) { } /** - * Get the route value. + * Get route properties. * * @return the route value */ @@ -56,7 +62,7 @@ public RouteProperties route() { } /** - * Set the route value. + * Set route properties. * * @param route the route value to set * @return the TestRouteInput object itself. @@ -66,4 +72,24 @@ public TestRouteInput withRoute(RouteProperties 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/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/TestRouteResult.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/TestRouteResult.java index 9d160cb8d1bf..95f2b6a9f999 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/TestRouteResult.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/TestRouteResult.java @@ -10,13 +10,13 @@ import com.microsoft.azure.arm.model.HasInner; import com.microsoft.azure.arm.resources.models.HasManager; -import com.microsoft.azure.management.iothub.v2018_04_01.implementation.IoTHubManager; +import com.microsoft.azure.management.iothub.v2018_04_01.implementation.DevicesManager; import com.microsoft.azure.management.iothub.v2018_04_01.implementation.TestRouteResultInner; /** * Type representing TestRouteResult. */ -public interface TestRouteResult extends HasInner, HasManager { +public interface TestRouteResult extends HasInner, HasManager { /** * @return the details value. */ diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/TestRouteResultDetails.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/TestRouteResultDetails.java index 308c292dc6e9..b7ff3345aef7 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/TestRouteResultDetails.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/TestRouteResultDetails.java @@ -22,7 +22,7 @@ public class TestRouteResultDetails { private List compilationErrors; /** - * Get the compilationErrors value. + * Get jSON-serialized list of route compilation errors. * * @return the compilationErrors value */ @@ -31,7 +31,7 @@ public List compilationErrors() { } /** - * Set the compilationErrors value. + * Set jSON-serialized list of route compilation errors. * * @param compilationErrors the compilationErrors value to set * @return the TestRouteResultDetails object itself. diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/UserSubscriptionQuota.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/UserSubscriptionQuota.java index 4a77f4276174..0d1dcee3c538 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/UserSubscriptionQuota.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/UserSubscriptionQuota.java @@ -10,13 +10,13 @@ import com.microsoft.azure.arm.model.HasInner; import com.microsoft.azure.arm.resources.models.HasManager; -import com.microsoft.azure.management.iothub.v2018_04_01.implementation.IoTHubManager; +import com.microsoft.azure.management.iothub.v2018_04_01.implementation.DevicesManager; import com.microsoft.azure.management.iothub.v2018_04_01.implementation.UserSubscriptionQuotaInner; /** * Type representing UserSubscriptionQuota. */ -public interface UserSubscriptionQuota extends HasInner, HasManager { +public interface UserSubscriptionQuota extends HasInner, HasManager { /** * @return the currentValue value. */ @@ -35,7 +35,7 @@ public interface UserSubscriptionQuota extends HasInner implements CertificateDescription, CertificateDescription.Definition, CertificateDescription.Update { - private final IoTHubManager manager; + private final DevicesManager manager; private String resourceGroupName; private String resourceName; private String certificateName; - CertificateDescriptionImpl(String name, IoTHubManager manager) { + CertificateDescriptionImpl(String name, DevicesManager manager) { super(name, new CertificateDescriptionInner()); this.manager = manager; // Set resource name @@ -27,7 +27,7 @@ class CertificateDescriptionImpl extends CreatableUpdatableImpl implements CertificateListDescription { - private final IoTHubManager manager; - CertificateListDescriptionImpl(CertificateListDescriptionInner inner, IoTHubManager manager) { + private final DevicesManager manager; + CertificateListDescriptionImpl(CertificateListDescriptionInner inner, DevicesManager manager) { super(inner); this.manager = manager; } @Override - public IoTHubManager manager() { + public DevicesManager manager() { return this.manager; } diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/CertificateListDescriptionInner.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/CertificateListDescriptionInner.java index 6803cfb560c8..14461cf354f3 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/CertificateListDescriptionInner.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/CertificateListDescriptionInner.java @@ -22,7 +22,7 @@ public class CertificateListDescriptionInner { private List value; /** - * Get the value value. + * Get the array of Certificate objects. * * @return the value value */ @@ -31,7 +31,7 @@ public List value() { } /** - * Set the value value. + * Set the array of Certificate objects. * * @param value the value value to set * @return the CertificateListDescriptionInner object itself. diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/CertificateWithNonceDescriptionImpl.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/CertificateWithNonceDescriptionImpl.java index 156ee706805c..793472fe6482 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/CertificateWithNonceDescriptionImpl.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/CertificateWithNonceDescriptionImpl.java @@ -13,14 +13,14 @@ import com.microsoft.azure.management.iothub.v2018_04_01.CertificatePropertiesWithNonce; class CertificateWithNonceDescriptionImpl extends WrapperImpl implements CertificateWithNonceDescription { - private final IoTHubManager manager; - CertificateWithNonceDescriptionImpl(CertificateWithNonceDescriptionInner inner, IoTHubManager manager) { + private final DevicesManager manager; + CertificateWithNonceDescriptionImpl(CertificateWithNonceDescriptionInner inner, DevicesManager manager) { super(inner); this.manager = manager; } @Override - public IoTHubManager manager() { + public DevicesManager manager() { return this.manager; } diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/CertificateWithNonceDescriptionInner.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/CertificateWithNonceDescriptionInner.java index a08c6991cc48..132c740f0094 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/CertificateWithNonceDescriptionInner.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/CertificateWithNonceDescriptionInner.java @@ -49,7 +49,7 @@ public CertificateWithNonceDescriptionInner withProperties(CertificateProperties } /** - * Get the etag value. + * Get the entity tag. * * @return the etag value */ diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/CertificatesImpl.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/CertificatesImpl.java index ab588db506e0..b286ad181168 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/CertificatesImpl.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/CertificatesImpl.java @@ -19,14 +19,14 @@ import com.microsoft.azure.management.iothub.v2018_04_01.CertificateDescription; class CertificatesImpl extends WrapperImpl implements Certificates { - private final IoTHubManager manager; + private final DevicesManager manager; - CertificatesImpl(IoTHubManager manager) { + CertificatesImpl(DevicesManager manager) { super(manager.inner().certificates()); this.manager = manager; } - public IoTHubManager manager() { + public DevicesManager manager() { return this.manager; } diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/CertificatesInner.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/CertificatesInner.java index fd9246b502cf..2ca44554544d 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/CertificatesInner.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/CertificatesInner.java @@ -12,7 +12,7 @@ import com.google.common.reflect.TypeToken; import com.microsoft.azure.management.iothub.v2018_04_01.CertificateBodyDescription; import com.microsoft.azure.management.iothub.v2018_04_01.CertificateVerificationDescription; -import com.microsoft.azure.management.iothub.v2018_04_01.ErrorDetailsException; +import com.microsoft.azure.management.iothub.v2018_04_01.ErrorDetailsInnerException; import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture; import com.microsoft.rest.ServiceResponse; @@ -90,7 +90,7 @@ interface CertificatesService { * @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 ErrorDetailsException thrown if the request is rejected by server + * @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. */ @@ -166,10 +166,10 @@ public Observable> call(Respons }); } - private ServiceResponse listByIotHubDelegate(Response response) throws ErrorDetailsException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse listByIotHubDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(ErrorDetailsException.class) + .registerError(ErrorDetailsInnerException.class) .build(response); } @@ -181,7 +181,7 @@ private ServiceResponse listByIotHubDelegate(Re * @param resourceName The name of the IoT hub. * @param certificateName The name of the certificate * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorDetailsException thrown if the request is rejected by server + * @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. */ @@ -263,10 +263,10 @@ public Observable> call(Response getDelegate(Response response) throws ErrorDetailsException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse getDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(ErrorDetailsException.class) + .registerError(ErrorDetailsInnerException.class) .build(response); } @@ -278,7 +278,7 @@ private ServiceResponse getDelegate(Response> call(Response> call(Response createOrUpdateDelegate(Response response) throws ErrorDetailsException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + 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(ErrorDetailsException.class) + .registerError(ErrorDetailsInnerException.class) .build(response); } @@ -481,7 +481,7 @@ private ServiceResponse createOrUpdateDelegate(Resp * @param certificateName The name of the certificate * @param ifMatch ETag of the Certificate. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorDetailsException thrown if the request is rejected by server + * @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) { @@ -568,11 +568,11 @@ public Observable> call(Response response) { }); } - private ServiceResponse deleteDelegate(Response response) throws ErrorDetailsException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + 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(ErrorDetailsException.class) + .registerError(ErrorDetailsInnerException.class) .build(response); } @@ -585,7 +585,7 @@ private ServiceResponse deleteDelegate(Response response) th * @param certificateName The name of the certificate * @param ifMatch ETag of the Certificate. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorDetailsException thrown if the request is rejected by server + * @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. */ @@ -673,10 +673,10 @@ public Observable> call(Re }); } - private ServiceResponse generateVerificationCodeDelegate(Response response) throws ErrorDetailsException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse generateVerificationCodeDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(ErrorDetailsException.class) + .registerError(ErrorDetailsInnerException.class) .build(response); } @@ -689,7 +689,7 @@ private ServiceResponse generateVerificati * @param certificateName The name of the certificate * @param ifMatch ETag of the Certificate. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorDetailsException thrown if the request is rejected by server + * @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. */ @@ -790,7 +790,7 @@ public Observable> call(Response> call(Response verifyDelegate(Response response) throws ErrorDetailsException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse verifyDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(ErrorDetailsException.class) + .registerError(ErrorDetailsInnerException.class) .build(response); } diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/DevicesManager.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/DevicesManager.java new file mode 100644 index 000000000000..e46fb6291ab2 --- /dev/null +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/DevicesManager.java @@ -0,0 +1,135 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2018_04_01.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.iothub.v2018_04_01.Operations; +import com.microsoft.azure.management.iothub.v2018_04_01.IotHubResources; +import com.microsoft.azure.management.iothub.v2018_04_01.ResourceProviderCommons; +import com.microsoft.azure.management.iothub.v2018_04_01.Certificates; +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; + /** + * 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; + } + + /** + * 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/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/EndpointHealthDataImpl.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/EndpointHealthDataImpl.java index 3589b2bccf64..9dbb2510b52c 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/EndpointHealthDataImpl.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/EndpointHealthDataImpl.java @@ -13,14 +13,14 @@ import com.microsoft.azure.management.iothub.v2018_04_01.EndpointHealthStatus; class EndpointHealthDataImpl extends WrapperImpl implements EndpointHealthData { - private final IoTHubManager manager; - EndpointHealthDataImpl(EndpointHealthDataInner inner, IoTHubManager manager) { + private final DevicesManager manager; + EndpointHealthDataImpl(EndpointHealthDataInner inner, DevicesManager manager) { super(inner); this.manager = manager; } @Override - public IoTHubManager manager() { + public DevicesManager manager() { return this.manager; } diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/EndpointHealthDataInner.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/EndpointHealthDataInner.java index 67025b765799..68df54648515 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/EndpointHealthDataInner.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/EndpointHealthDataInner.java @@ -22,14 +22,14 @@ public class EndpointHealthDataInner { private String endpointId; /** - * Health status. Possible values include: 'unknown', 'healthy', - * 'unhealthy', 'dead'. + * The health status code of the endpoint. Possible values include: + * 'unknown', 'healthy', 'unhealthy', 'dead'. */ @JsonProperty(value = "healthStatus") private EndpointHealthStatus healthStatus; /** - * Get the endpointId value. + * Get id of the endpoint. * * @return the endpointId value */ @@ -38,7 +38,7 @@ public String endpointId() { } /** - * Set the endpointId value. + * Set id of the endpoint. * * @param endpointId the endpointId value to set * @return the EndpointHealthDataInner object itself. @@ -49,7 +49,7 @@ public EndpointHealthDataInner withEndpointId(String endpointId) { } /** - * Get the healthStatus value. + * Get the health status code of the endpoint. Possible values include: 'unknown', 'healthy', 'unhealthy', 'dead'. * * @return the healthStatus value */ @@ -58,7 +58,7 @@ public EndpointHealthStatus healthStatus() { } /** - * Set the healthStatus value. + * Set the health status code of the endpoint. Possible values include: 'unknown', 'healthy', 'unhealthy', 'dead'. * * @param healthStatus the healthStatus value to set * @return the EndpointHealthDataInner object itself. diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/ErrorDetailsInner.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/ErrorDetailsInner.java new file mode 100644 index 000000000000..8bd5f28f45ee --- /dev/null +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_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.v2018_04_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/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/ErrorDetailsInnerException.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/ErrorDetailsInnerException.java new file mode 100644 index 000000000000..9148cf6ab4b8 --- /dev/null +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_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.v2018_04_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/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/EventHubConsumerGroupInfoImpl.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/EventHubConsumerGroupInfoImpl.java index 1e558c1ca905..ba035c00eaa0 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/EventHubConsumerGroupInfoImpl.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/EventHubConsumerGroupInfoImpl.java @@ -14,13 +14,13 @@ import java.util.Map; class EventHubConsumerGroupInfoImpl extends CreatableUpdatableImpl implements EventHubConsumerGroupInfo, EventHubConsumerGroupInfo.Definition, EventHubConsumerGroupInfo.Update { - private final IoTHubManager manager; + private final DevicesManager manager; private String resourceGroupName; private String resourceName; private String eventHubEndpointName; private String name; - EventHubConsumerGroupInfoImpl(String name, IoTHubManager manager) { + EventHubConsumerGroupInfoImpl(String name, DevicesManager manager) { super(name, new EventHubConsumerGroupInfoInner()); this.manager = manager; // Set resource name @@ -28,7 +28,7 @@ class EventHubConsumerGroupInfoImpl extends CreatableUpdatableImpl properties() { } /** - * Set the properties value. + * Set the tags. * * @param properties the properties value to set * @return the EventHubConsumerGroupInfoInner object itself. @@ -49,7 +49,7 @@ public EventHubConsumerGroupInfoInner withProperties(Map propert } /** - * Get the etag value. + * Get the etag. * * @return the etag value */ diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubDescriptionImpl.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubDescriptionImpl.java index 0cb4420264f1..ebb3aa85d4ff 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubDescriptionImpl.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubDescriptionImpl.java @@ -14,8 +14,8 @@ import com.microsoft.azure.management.iothub.v2018_04_01.IotHubProperties; import com.microsoft.azure.management.iothub.v2018_04_01.IotHubSkuInfo; -class IotHubDescriptionImpl extends GroupableResourceCoreImpl implements IotHubDescription, IotHubDescription.Definition, IotHubDescription.Update { - IotHubDescriptionImpl(String name, IotHubDescriptionInner inner, IoTHubManager manager) { +class IotHubDescriptionImpl extends GroupableResourceCoreImpl implements IotHubDescription, IotHubDescription.Definition, IotHubDescription.Update { + IotHubDescriptionImpl(String name, IotHubDescriptionInner inner, DevicesManager manager) { super(name, inner, manager); } @@ -29,7 +29,7 @@ public Observable createResourceAsync() { @Override public Observable updateResourceAsync() { IotHubResourcesInner client = this.manager().inner().iotHubResources(); - return client.updateAsync(this.resourceGroupName(), this.name()) + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) .map(innerToFluentMap(this)); } diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubDescriptionInner.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubDescriptionInner.java index d28eed61e146..6a50a5232c41 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubDescriptionInner.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubDescriptionInner.java @@ -38,7 +38,7 @@ public class IotHubDescriptionInner extends Resource { private IotHubSkuInfo sku; /** - * Get the etag value. + * 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 */ @@ -47,7 +47,7 @@ public String etag() { } /** - * Set the etag value. + * 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. @@ -58,7 +58,7 @@ public IotHubDescriptionInner withEtag(String etag) { } /** - * Get the properties value. + * Get iotHub properties. * * @return the properties value */ @@ -67,7 +67,7 @@ public IotHubProperties properties() { } /** - * Set the properties value. + * Set iotHub properties. * * @param properties the properties value to set * @return the IotHubDescriptionInner object itself. @@ -78,7 +78,7 @@ public IotHubDescriptionInner withProperties(IotHubProperties properties) { } /** - * Get the sku value. + * Get iotHub SKU info. * * @return the sku value */ @@ -87,7 +87,7 @@ public IotHubSkuInfo sku() { } /** - * Set the sku value. + * Set iotHub SKU info. * * @param sku the sku value to set * @return the IotHubDescriptionInner object itself. diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubNameAvailabilityInfoImpl.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubNameAvailabilityInfoImpl.java index 9e828a536da5..1aef9eedfe8e 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubNameAvailabilityInfoImpl.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubNameAvailabilityInfoImpl.java @@ -13,14 +13,14 @@ import com.microsoft.azure.management.iothub.v2018_04_01.IotHubNameUnavailabilityReason; class IotHubNameAvailabilityInfoImpl extends WrapperImpl implements IotHubNameAvailabilityInfo { - private final IoTHubManager manager; - IotHubNameAvailabilityInfoImpl(IotHubNameAvailabilityInfoInner inner, IoTHubManager manager) { + private final DevicesManager manager; + IotHubNameAvailabilityInfoImpl(IotHubNameAvailabilityInfoInner inner, DevicesManager manager) { super(inner); this.manager = manager; } @Override - public IoTHubManager manager() { + public DevicesManager manager() { return this.manager; } diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubNameAvailabilityInfoInner.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubNameAvailabilityInfoInner.java index 1552cd89916c..9d83bdcbcbef 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubNameAvailabilityInfoInner.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubNameAvailabilityInfoInner.java @@ -35,7 +35,7 @@ public class IotHubNameAvailabilityInfoInner { private String message; /** - * Get the nameAvailable value. + * Get the value which indicates whether the provided name is available. * * @return the nameAvailable value */ @@ -44,7 +44,7 @@ public Boolean nameAvailable() { } /** - * Get the reason value. + * Get the reason for unavailability. Possible values include: 'Invalid', 'AlreadyExists'. * * @return the reason value */ @@ -53,7 +53,7 @@ public IotHubNameUnavailabilityReason reason() { } /** - * Get the message value. + * Get the detailed reason message. * * @return the message value */ @@ -62,7 +62,7 @@ public String message() { } /** - * Set the message value. + * Set the detailed reason message. * * @param message the message value to set * @return the IotHubNameAvailabilityInfoInner object itself. diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubQuotaMetricInfoImpl.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubQuotaMetricInfoImpl.java index 1d5f6442ce23..7f359aeed96e 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubQuotaMetricInfoImpl.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubQuotaMetricInfoImpl.java @@ -13,15 +13,15 @@ import rx.Observable; class IotHubQuotaMetricInfoImpl extends WrapperImpl implements IotHubQuotaMetricInfo { - private final IoTHubManager manager; + private final DevicesManager manager; - IotHubQuotaMetricInfoImpl(IotHubQuotaMetricInfoInner inner, IoTHubManager manager) { + IotHubQuotaMetricInfoImpl(IotHubQuotaMetricInfoInner inner, DevicesManager manager) { super(inner); this.manager = manager; } @Override - public IoTHubManager manager() { + public DevicesManager manager() { return this.manager; } diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubQuotaMetricInfoInner.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubQuotaMetricInfoInner.java index be1cb5eb082c..e0301250f4a0 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubQuotaMetricInfoInner.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubQuotaMetricInfoInner.java @@ -33,7 +33,7 @@ public class IotHubQuotaMetricInfoInner { private Long maxValue; /** - * Get the name value. + * Get the name of the quota metric. * * @return the name value */ @@ -42,7 +42,7 @@ public String name() { } /** - * Get the currentValue value. + * Get the current value for the quota metric. * * @return the currentValue value */ @@ -51,7 +51,7 @@ public Long currentValue() { } /** - * Get the maxValue value. + * Get the maximum value of the quota metric. * * @return the maxValue value */ diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubResourcesImpl.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubResourcesImpl.java index c66d2360a4f8..0b9993e45c62 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubResourcesImpl.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubResourcesImpl.java @@ -32,14 +32,14 @@ import com.microsoft.azure.management.iothub.v2018_04_01.TestRouteInput; class IotHubResourcesImpl extends WrapperImpl implements IotHubResources { - private final IoTHubManager manager; + private final DevicesManager manager; - IotHubResourcesImpl(IoTHubManager manager) { + IotHubResourcesImpl(DevicesManager manager) { super(manager.inner().iotHubResources()); this.manager = manager; } - public IoTHubManager manager() { + public DevicesManager manager() { return this.manager; } @@ -61,23 +61,23 @@ private EventHubConsumerGroupInfoImpl wrapConsumerGroupModel(String name) { return new EventHubConsumerGroupInfoImpl(name, this.manager()); } - private IotHubDescriptionImpl wrapModel(IotHubDescriptionInner inner) { + private IotHubDescriptionImpl wrapIotHubDescriptionModel(IotHubDescriptionInner inner) { return new IotHubDescriptionImpl(inner.name(), inner, manager()); } - private IotHubSkuDescriptionImpl wrapModel(IotHubSkuDescriptionInner inner) { + private IotHubSkuDescriptionImpl wrapIotHubSkuDescriptionModel(IotHubSkuDescriptionInner inner) { return new IotHubSkuDescriptionImpl(inner, manager()); } - private EventHubConsumerGroupInfoImpl wrapModel(EventHubConsumerGroupInfoInner inner) { + private EventHubConsumerGroupInfoImpl wrapEventHubConsumerGroupInfoModel(EventHubConsumerGroupInfoInner inner) { return new EventHubConsumerGroupInfoImpl(inner, manager()); } - private JobResponseImpl wrapModel(JobResponseInner inner) { + private JobResponseImpl wrapJobResponseModel(JobResponseInner inner) { return new JobResponseImpl(inner, manager()); } - private IotHubQuotaMetricInfoImpl wrapModel(IotHubQuotaMetricInfoInner inner) { + private IotHubQuotaMetricInfoImpl wrapIotHubQuotaMetricInfoModel(IotHubQuotaMetricInfoInner inner) { return new IotHubQuotaMetricInfoImpl(inner, manager()); } @@ -86,88 +86,67 @@ private Observable getIotHubDescriptionInnerUsingIotHubR 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).map(new Func1 () { @Override public IotHubDescription call(IotHubDescriptionInner inner) { - return wrapModel(inner); + return wrapIotHubDescriptionModel(inner); } }); } - private Observable> listByResourceGroupNextInnerPageAsync(String nextLink) { - if (nextLink == null) { - Observable.empty(); - } - IotHubResourcesInner client = this.inner(); - return client.listByResourceGroupNextAsync(nextLink) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Page page) { - return Observable.just(page).concatWith(listByResourceGroupNextInnerPageAsync(page.nextPageLink())); - } - }); - } @Override public Observable listByResourceGroupAsync(String resourceGroupName) { IotHubResourcesInner client = this.inner(); return client.listByResourceGroupAsync(resourceGroupName) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Page page) { - return listByResourceGroupNextInnerPageAsync(page.nextPageLink()); - } - }) .flatMapIterable(new Func1, Iterable>() { @Override public Iterable call(Page page) { return page.items(); } - }) + }) .map(new Func1() { @Override public IotHubDescription call(IotHubDescriptionInner inner) { - return wrapModel(inner); - } - }); - } - - private Observable> listNextInnerPageAsync(String nextLink) { - if (nextLink == null) { - Observable.empty(); - } - IotHubResourcesInner client = this.inner(); - return client.listNextAsync(nextLink) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Page page) { - return Observable.just(page).concatWith(listNextInnerPageAsync(page.nextPageLink())); + return wrapIotHubDescriptionModel(inner); } }); } + @Override public Observable listAsync() { IotHubResourcesInner client = this.inner(); return client.listAsync() - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Page page) { - return listNextInnerPageAsync(page.nextPageLink()); - } - }) .flatMapIterable(new Func1, Iterable>() { @Override public Iterable call(Page page) { return page.items(); } - }) + }) .map(new Func1() { @Override public IotHubDescription call(IotHubDescriptionInner inner) { - return wrapModel(inner); + return wrapIotHubDescriptionModel(inner); } - }); + }); } @Override @@ -175,78 +154,40 @@ public Completable deleteAsync(String resourceGroupName, String name) { return this.inner().deleteAsync(resourceGroupName, name).toCompletable(); } - private Observable> getEndpointHealthNextInnerPageAsync(String nextLink) { - if (nextLink == null) { - Observable.empty(); - } - IotHubResourcesInner client = this.inner(); - return client.getEndpointHealthNextAsync(nextLink) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Page page) { - return Observable.just(page).concatWith(getEndpointHealthNextInnerPageAsync(page.nextPageLink())); - } - }); - } @Override public Observable getEndpointHealthAsync(final String resourceGroupName, final String iotHubName) { IotHubResourcesInner client = this.inner(); return client.getEndpointHealthAsync(resourceGroupName, iotHubName) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Page page) { - return getEndpointHealthNextInnerPageAsync(page.nextPageLink()); - } - }) .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()); } - }); - } - - private Observable> listKeysNextInnerPageAsync(String nextLink) { - if (nextLink == null) { - Observable.empty(); - } - IotHubResourcesInner client = this.inner(); - return client.listKeysNextAsync(nextLink) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Page page) { - return Observable.just(page).concatWith(listKeysNextInnerPageAsync(page.nextPageLink())); - } }); } + @Override public Observable listKeysAsync(final String resourceGroupName, final String resourceName) { IotHubResourcesInner client = this.inner(); return client.listKeysAsync(resourceGroupName, resourceName) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Page page) { - return listKeysNextInnerPageAsync(page.nextPageLink()); - } - }) .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 @@ -297,41 +238,22 @@ public RegistryStatistics call(RegistryStatisticsInner inner) { }); } - private Observable> getValidSkusNextInnerPageAsync(String nextLink) { - if (nextLink == null) { - Observable.empty(); - } - IotHubResourcesInner client = this.inner(); - return client.getValidSkusNextAsync(nextLink) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Page page) { - return Observable.just(page).concatWith(getValidSkusNextInnerPageAsync(page.nextPageLink())); - } - }); - } @Override public Observable getValidSkusAsync(final String resourceGroupName, final String resourceName) { IotHubResourcesInner client = this.inner(); return client.getValidSkusAsync(resourceGroupName, resourceName) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Page page) { - return getValidSkusNextInnerPageAsync(page.nextPageLink()); - } - }) .flatMapIterable(new Func1, Iterable>() { @Override public Iterable call(Page page) { return page.items(); } - }) + }) .map(new Func1() { @Override public IotHubSkuDescription call(IotHubSkuDescriptionInner inner) { - return wrapModel(inner); + return wrapIotHubSkuDescriptionModel(inner); } - }); + }); } @Override @@ -341,46 +263,27 @@ public Observable getEventHubConsumerGroupAsync(Strin .map(new Func1() { @Override public EventHubConsumerGroupInfo call(EventHubConsumerGroupInfoInner inner) { - return wrapModel(inner); + return wrapEventHubConsumerGroupInfoModel(inner); } }); } - private Observable> listEventHubConsumerGroupsNextInnerPageAsync(String nextLink) { - if (nextLink == null) { - Observable.empty(); - } - IotHubResourcesInner client = this.inner(); - return client.listEventHubConsumerGroupsNextAsync(nextLink) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Page page) { - return Observable.just(page).concatWith(listEventHubConsumerGroupsNextInnerPageAsync(page.nextPageLink())); - } - }); - } @Override public Observable listEventHubConsumerGroupsAsync(final String resourceGroupName, final String resourceName, final String eventHubEndpointName) { IotHubResourcesInner client = this.inner(); return client.listEventHubConsumerGroupsAsync(resourceGroupName, resourceName, eventHubEndpointName) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Page page) { - return listEventHubConsumerGroupsNextInnerPageAsync(page.nextPageLink()); - } - }) .flatMapIterable(new Func1, Iterable>() { @Override public Iterable call(Page page) { return page.items(); } - }) + }) .map(new Func1() { @Override public EventHubConsumerGroupInfo call(EventHubConsumerGroupInfoInner inner) { - return wrapModel(inner); + return wrapEventHubConsumerGroupInfoModel(inner); } - }); + }); } @Override @@ -396,83 +299,45 @@ public Observable getJobAsync(String resourceGroupName, String reso .map(new Func1() { @Override public JobResponse call(JobResponseInner inner) { - return wrapModel(inner); + return wrapJobResponseModel(inner); } }); } - private Observable> listJobsNextInnerPageAsync(String nextLink) { - if (nextLink == null) { - Observable.empty(); - } - IotHubResourcesInner client = this.inner(); - return client.listJobsNextAsync(nextLink) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Page page) { - return Observable.just(page).concatWith(listJobsNextInnerPageAsync(page.nextPageLink())); - } - }); - } @Override public Observable listJobsAsync(final String resourceGroupName, final String resourceName) { IotHubResourcesInner client = this.inner(); return client.listJobsAsync(resourceGroupName, resourceName) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Page page) { - return listJobsNextInnerPageAsync(page.nextPageLink()); - } - }) .flatMapIterable(new Func1, Iterable>() { @Override public Iterable call(Page page) { return page.items(); } - }) + }) .map(new Func1() { @Override public JobResponse call(JobResponseInner inner) { - return wrapModel(inner); - } - }); - } - - private Observable> getQuotaMetricsNextInnerPageAsync(String nextLink) { - if (nextLink == null) { - Observable.empty(); - } - IotHubResourcesInner client = this.inner(); - return client.getQuotaMetricsNextAsync(nextLink) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Page page) { - return Observable.just(page).concatWith(getQuotaMetricsNextInnerPageAsync(page.nextPageLink())); + return wrapJobResponseModel(inner); } }); } + @Override public Observable getQuotaMetricsAsync(final String resourceGroupName, final String resourceName) { IotHubResourcesInner client = this.inner(); return client.getQuotaMetricsAsync(resourceGroupName, resourceName) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Page page) { - return getQuotaMetricsNextInnerPageAsync(page.nextPageLink()); - } - }) .flatMapIterable(new Func1, Iterable>() { @Override public Iterable call(Page page) { return page.items(); } - }) + }) .map(new Func1() { @Override public IotHubQuotaMetricInfo call(IotHubQuotaMetricInfoInner inner) { - return wrapModel(inner); + return wrapIotHubQuotaMetricInfoModel(inner); } - }); + }); } @Override diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubResourcesInner.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubResourcesInner.java index 9e8069e57ee0..7c5fb909174d 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubResourcesInner.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubResourcesInner.java @@ -16,8 +16,7 @@ import com.microsoft.azure.AzureServiceFuture; import com.microsoft.azure.CloudException; import com.microsoft.azure.ListOperationCallback; -import com.microsoft.azure.management.iothub.v2018_04_01.ErrorDetails; -import com.microsoft.azure.management.iothub.v2018_04_01.ErrorDetailsException; +import com.microsoft.azure.management.iothub.v2018_04_01.ErrorDetailsInnerException; import com.microsoft.azure.management.iothub.v2018_04_01.ExportDevicesRequest; import com.microsoft.azure.management.iothub.v2018_04_01.ImportDevicesRequest; import com.microsoft.azure.management.iothub.v2018_04_01.OperationInputs; @@ -220,7 +219,7 @@ interface IotHubResourcesService { * @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 ErrorDetailsException thrown if the request is rejected by server + * @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. */ @@ -296,10 +295,10 @@ public Observable> call(Response getByResourceGroupDelegate(Response response) throws ErrorDetailsException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse getByResourceGroupDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(ErrorDetailsException.class) + .registerError(ErrorDetailsInnerException.class) .build(response); } @@ -311,7 +310,7 @@ private ServiceResponse getByResourceGroupDelegate(Respo * @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 ErrorDetailsException thrown if the request is rejected by server + * @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. */ @@ -393,7 +392,7 @@ public Observable> createOrUpdateWithSer * @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 ErrorDetailsException thrown if the request is rejected by server + * @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. */ @@ -477,7 +476,7 @@ public Observable> createOrUpdateWithSer * @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 ErrorDetailsException thrown if the request is rejected by server + * @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. */ @@ -570,7 +569,7 @@ public Observable> call(Response> call(Response beginCreateOrUpdateDelegate(Response response) throws ErrorDetailsException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + 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(ErrorDetailsException.class) + .registerError(ErrorDetailsInnerException.class) .build(response); } @@ -1009,7 +1008,7 @@ private ServiceResponse beginUpdateDelegate(Response> deleteWithServiceResponseAsync(String * @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 ErrorDetailsException thrown if the request is rejected by server + * @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. */ @@ -1158,13 +1157,13 @@ public Observable> call(Response response) }); } - private ServiceResponse beginDeleteDelegate(Response response) throws ErrorDetailsException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + 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(ErrorDetailsException.class) + .register(404, new TypeToken() { }.getType()) + .registerError(ErrorDetailsInnerException.class) .build(response); } @@ -1173,7 +1172,7 @@ private ServiceResponse beginDeleteDelegate(Response respo * Get all the IoT hubs in a subscription. * * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorDetailsException thrown if the request is rejected by server + * @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. */ @@ -1273,10 +1272,10 @@ public Observable>> call(Response> listDelegate(Response response) throws ErrorDetailsException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ErrorDetailsException>newInstance(this.client.serializerAdapter()) + 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(ErrorDetailsException.class) + .registerError(ErrorDetailsInnerException.class) .build(response); } @@ -1286,7 +1285,7 @@ private ServiceResponse> listDelegate(Response< * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorDetailsException thrown if the request is rejected by server + * @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. */ @@ -1393,10 +1392,10 @@ public Observable>> call(Response> listByResourceGroupDelegate(Response response) throws ErrorDetailsException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ErrorDetailsException>newInstance(this.client.serializerAdapter()) + 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(ErrorDetailsException.class) + .registerError(ErrorDetailsInnerException.class) .build(response); } @@ -1407,7 +1406,7 @@ private ServiceResponse> listByResourceGroupDel * @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 ErrorDetailsException thrown if the request is rejected by server + * @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. */ @@ -1483,10 +1482,10 @@ public Observable> call(Response getStatsDelegate(Response response) throws ErrorDetailsException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse getStatsDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(ErrorDetailsException.class) + .registerError(ErrorDetailsInnerException.class) .build(response); } @@ -1497,7 +1496,7 @@ private ServiceResponse getStatsDelegate(Response>> call(Respons }); } - private ServiceResponse> getValidSkusDelegate(Response response) throws ErrorDetailsException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ErrorDetailsException>newInstance(this.client.serializerAdapter()) + 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(ErrorDetailsException.class) + .registerError(ErrorDetailsInnerException.class) .build(response); } @@ -1626,7 +1625,7 @@ private ServiceResponse> getValidSkusDelegat * @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 ErrorDetailsException thrown if the request is rejected by server + * @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. */ @@ -1747,10 +1746,10 @@ public Observable>> call(Re }); } - private ServiceResponse> listEventHubConsumerGroupsDelegate(Response response) throws ErrorDetailsException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ErrorDetailsException>newInstance(this.client.serializerAdapter()) + 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(ErrorDetailsException.class) + .registerError(ErrorDetailsInnerException.class) .build(response); } @@ -1763,7 +1762,7 @@ private ServiceResponse> listEventHubCo * @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 ErrorDetailsException thrown if the request is rejected by server + * @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. */ @@ -1851,10 +1850,10 @@ public Observable> call(Response }); } - private ServiceResponse getEventHubConsumerGroupDelegate(Response response) throws ErrorDetailsException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse getEventHubConsumerGroupDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(ErrorDetailsException.class) + .registerError(ErrorDetailsInnerException.class) .build(response); } @@ -1867,7 +1866,7 @@ private ServiceResponse getEventHubConsumerGroup * @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 ErrorDetailsException thrown if the request is rejected by server + * @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. */ @@ -1955,10 +1954,10 @@ public Observable> call(Response }); } - private ServiceResponse createEventHubConsumerGroupDelegate(Response response) throws ErrorDetailsException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse createEventHubConsumerGroupDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(ErrorDetailsException.class) + .registerError(ErrorDetailsInnerException.class) .build(response); } @@ -1971,7 +1970,7 @@ private ServiceResponse createEventHubConsumerGr * @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 ErrorDetailsException thrown if the request is rejected by server + * @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) { @@ -2058,10 +2057,10 @@ public Observable> call(Response response) { }); } - private ServiceResponse deleteEventHubConsumerGroupDelegate(Response response) throws ErrorDetailsException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse deleteEventHubConsumerGroupDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(ErrorDetailsException.class) + .registerError(ErrorDetailsInnerException.class) .build(response); } @@ -2072,7 +2071,7 @@ private ServiceResponse deleteEventHubConsumerGroupDelegate(Response>> call(Response> listJobsDelegate(Response response) throws ErrorDetailsException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ErrorDetailsException>newInstance(this.client.serializerAdapter()) + 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(ErrorDetailsException.class) + .registerError(ErrorDetailsInnerException.class) .build(response); } @@ -2201,7 +2200,7 @@ private ServiceResponse> listJobsDelegate(Response> call(Response }); } - private ServiceResponse getJobDelegate(Response response) throws ErrorDetailsException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse getJobDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(ErrorDetailsException.class) + .registerError(ErrorDetailsInnerException.class) .build(response); } @@ -2297,7 +2296,7 @@ private ServiceResponse getJobDelegate(Response * @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 ErrorDetailsException thrown if the request is rejected by server + * @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. */ @@ -2411,10 +2410,10 @@ public Observable>> call(Respon }); } - private ServiceResponse> getQuotaMetricsDelegate(Response response) throws ErrorDetailsException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ErrorDetailsException>newInstance(this.client.serializerAdapter()) + 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(ErrorDetailsException.class) + .registerError(ErrorDetailsInnerException.class) .build(response); } @@ -2425,7 +2424,7 @@ private ServiceResponse> getQuotaMetricsDel * @param resourceGroupName the String value * @param iotHubName the String value * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorDetailsException thrown if the request is rejected by server + * @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. */ @@ -2539,10 +2538,10 @@ public Observable>> call(Response< }); } - private ServiceResponse> getEndpointHealthDelegate(Response response) throws ErrorDetailsException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ErrorDetailsException>newInstance(this.client.serializerAdapter()) + 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(ErrorDetailsException.class) + .registerError(ErrorDetailsInnerException.class) .build(response); } @@ -2552,7 +2551,7 @@ private ServiceResponse> getEndpointHealthDele * * @param name The name of the IoT hub to check. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorDetailsException thrown if the request is rejected by server + * @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. */ @@ -2624,10 +2623,10 @@ public Observable> call(Respons }); } - private ServiceResponse checkNameAvailabilityDelegate(Response response) throws ErrorDetailsException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse checkNameAvailabilityDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(ErrorDetailsException.class) + .registerError(ErrorDetailsInnerException.class) .build(response); } @@ -2639,7 +2638,7 @@ private ServiceResponse checkNameAvailabilityDe * @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 ErrorDetailsException thrown if the request is rejected by server + * @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. */ @@ -2722,10 +2721,10 @@ public Observable> call(Response testAllRoutesDelegate(Response response) throws ErrorDetailsException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse testAllRoutesDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(ErrorDetailsException.class) + .registerError(ErrorDetailsInnerException.class) .build(response); } @@ -2737,7 +2736,7 @@ private ServiceResponse testAllRoutesDelegate(Response * @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 ErrorDetailsException thrown if the request is rejected by server + * @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. */ @@ -2820,10 +2819,10 @@ public Observable> call(Response testRouteDelegate(Response response) throws ErrorDetailsException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse testRouteDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(ErrorDetailsException.class) + .registerError(ErrorDetailsInnerException.class) .build(response); } @@ -2834,7 +2833,7 @@ private ServiceResponse testRouteDelegate(Response> listKeysDelegate(Response response) throws ErrorDetailsException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ErrorDetailsException>newInstance(this.client.serializerAdapter()) + 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(ErrorDetailsException.class) + .registerError(ErrorDetailsInnerException.class) .build(response); } @@ -2963,7 +2962,7 @@ private ServiceResponse> l * @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 ErrorDetailsException thrown if the request is rejected by server + * @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. */ @@ -3045,10 +3044,10 @@ public Observable> }); } - private ServiceResponse getKeysForKeyNameDelegate(Response response) throws ErrorDetailsException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse getKeysForKeyNameDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(ErrorDetailsException.class) + .registerError(ErrorDetailsInnerException.class) .build(response); } @@ -3060,7 +3059,7 @@ private ServiceResponse getKeysForK * @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 ErrorDetailsException thrown if the request is rejected by server + * @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. */ @@ -3143,10 +3142,10 @@ public Observable> call(Response }); } - private ServiceResponse exportDevicesDelegate(Response response) throws ErrorDetailsException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse exportDevicesDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(ErrorDetailsException.class) + .registerError(ErrorDetailsInnerException.class) .build(response); } @@ -3158,7 +3157,7 @@ private ServiceResponse exportDevicesDelegate(Response> call(Response }); } - private ServiceResponse importDevicesDelegate(Response response) throws ErrorDetailsException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse importDevicesDelegate(Response response) throws ErrorDetailsInnerException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(ErrorDetailsException.class) + .registerError(ErrorDetailsInnerException.class) .build(response); } @@ -3254,7 +3253,7 @@ private ServiceResponse importDevicesDelegate(Response>> call(Response> listNextDelegate(Response response) throws ErrorDetailsException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ErrorDetailsException>newInstance(this.client.serializerAdapter()) + 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(ErrorDetailsException.class) + .registerError(ErrorDetailsInnerException.class) .build(response); } @@ -3370,7 +3369,7 @@ private ServiceResponse> listNextDelegate(Respo * * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorDetailsException thrown if the request is rejected by server + * @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. */ @@ -3473,10 +3472,10 @@ public Observable>> call(Response> listByResourceGroupNextDelegate(Response response) throws ErrorDetailsException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ErrorDetailsException>newInstance(this.client.serializerAdapter()) + 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(ErrorDetailsException.class) + .registerError(ErrorDetailsInnerException.class) .build(response); } @@ -3486,7 +3485,7 @@ private ServiceResponse> listByResourceGroupNex * * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorDetailsException thrown if the request is rejected by server + * @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. */ @@ -3589,10 +3588,10 @@ public Observable>> call(Respons }); } - private ServiceResponse> getValidSkusNextDelegate(Response response) throws ErrorDetailsException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ErrorDetailsException>newInstance(this.client.serializerAdapter()) + 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(ErrorDetailsException.class) + .registerError(ErrorDetailsInnerException.class) .build(response); } @@ -3602,7 +3601,7 @@ private ServiceResponse> getValidSkusNextDel * * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorDetailsException thrown if the request is rejected by server + * @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. */ @@ -3705,10 +3704,10 @@ public Observable>> call(Re }); } - private ServiceResponse> listEventHubConsumerGroupsNextDelegate(Response response) throws ErrorDetailsException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ErrorDetailsException>newInstance(this.client.serializerAdapter()) + 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(ErrorDetailsException.class) + .registerError(ErrorDetailsInnerException.class) .build(response); } @@ -3718,7 +3717,7 @@ private ServiceResponse> listEventHubCo * * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorDetailsException thrown if the request is rejected by server + * @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. */ @@ -3821,10 +3820,10 @@ public Observable>> call(Response> listJobsNextDelegate(Response response) throws ErrorDetailsException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ErrorDetailsException>newInstance(this.client.serializerAdapter()) + 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(ErrorDetailsException.class) + .registerError(ErrorDetailsInnerException.class) .build(response); } @@ -3834,7 +3833,7 @@ private ServiceResponse> listJobsNextDelegate(Respons * * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorDetailsException thrown if the request is rejected by server + * @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. */ @@ -3937,10 +3936,10 @@ public Observable>> call(Respon }); } - private ServiceResponse> getQuotaMetricsNextDelegate(Response response) throws ErrorDetailsException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ErrorDetailsException>newInstance(this.client.serializerAdapter()) + 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(ErrorDetailsException.class) + .registerError(ErrorDetailsInnerException.class) .build(response); } @@ -3950,7 +3949,7 @@ private ServiceResponse> getQuotaMetricsNex * * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorDetailsException thrown if the request is rejected by server + * @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. */ @@ -4053,10 +4052,10 @@ public Observable>> call(Response< }); } - private ServiceResponse> getEndpointHealthNextDelegate(Response response) throws ErrorDetailsException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ErrorDetailsException>newInstance(this.client.serializerAdapter()) + 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(ErrorDetailsException.class) + .registerError(ErrorDetailsInnerException.class) .build(response); } @@ -4066,7 +4065,7 @@ private ServiceResponse> getEndpointHealthNext * * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorDetailsException thrown if the request is rejected by server + * @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. */ @@ -4169,10 +4168,10 @@ public Observable> listKeysNextDelegate(Response response) throws ErrorDetailsException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ErrorDetailsException>newInstance(this.client.serializerAdapter()) + 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(ErrorDetailsException.class) + .registerError(ErrorDetailsInnerException.class) .build(response); } diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubSkuDescriptionImpl.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubSkuDescriptionImpl.java index 4bc36ed277ac..c82434f19beb 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubSkuDescriptionImpl.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubSkuDescriptionImpl.java @@ -15,15 +15,15 @@ import com.microsoft.azure.management.iothub.v2018_04_01.IotHubSkuInfo; class IotHubSkuDescriptionImpl extends WrapperImpl implements IotHubSkuDescription { - private final IoTHubManager manager; + private final DevicesManager manager; - IotHubSkuDescriptionImpl(IotHubSkuDescriptionInner inner, IoTHubManager manager) { + IotHubSkuDescriptionImpl(IotHubSkuDescriptionInner inner, DevicesManager manager) { super(inner); this.manager = manager; } @Override - public IoTHubManager manager() { + public DevicesManager manager() { return this.manager; } diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubSkuDescriptionInner.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubSkuDescriptionInner.java index 3dbe5b8b6c4a..9883545d3146 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubSkuDescriptionInner.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubSkuDescriptionInner.java @@ -35,7 +35,7 @@ public class IotHubSkuDescriptionInner { private IotHubCapacity capacity; /** - * Get the resourceType value. + * Get the type of the resource. * * @return the resourceType value */ @@ -44,7 +44,7 @@ public String resourceType() { } /** - * Get the sku value. + * Get the type of the resource. * * @return the sku value */ @@ -53,7 +53,7 @@ public IotHubSkuInfo sku() { } /** - * Set the sku value. + * Set the type of the resource. * * @param sku the sku value to set * @return the IotHubSkuDescriptionInner object itself. @@ -64,7 +64,7 @@ public IotHubSkuDescriptionInner withSku(IotHubSkuInfo sku) { } /** - * Get the capacity value. + * Get iotHub capacity. * * @return the capacity value */ @@ -73,7 +73,7 @@ public IotHubCapacity capacity() { } /** - * Set the capacity value. + * Set iotHub capacity. * * @param capacity the capacity value to set * @return the IotHubSkuDescriptionInner object itself. diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/JobResponseImpl.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/JobResponseImpl.java index 33a9cc7ce36b..529ba7d622b0 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/JobResponseImpl.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/JobResponseImpl.java @@ -17,18 +17,18 @@ import com.microsoft.azure.management.iothub.v2018_04_01.JobType; class JobResponseImpl extends WrapperImpl implements JobResponse { - private final IoTHubManager manager; + private final DevicesManager manager; private String resourceGroupName; private String resourceName; private String jobId; - JobResponseImpl(JobResponseInner inner, IoTHubManager manager) { + JobResponseImpl(JobResponseInner inner, DevicesManager manager) { super(inner); this.manager = manager; } @Override - public IoTHubManager manager() { + public DevicesManager manager() { return this.manager; } diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/JobResponseInner.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/JobResponseInner.java index d0056e352738..bbf5d093041f 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/JobResponseInner.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/JobResponseInner.java @@ -71,7 +71,7 @@ public class JobResponseInner { private String parentJobId; /** - * Get the jobId value. + * Get the job identifier. * * @return the jobId value */ @@ -80,7 +80,7 @@ public String jobId() { } /** - * Get the startTimeUtc value. + * Get the start time of the job. * * @return the startTimeUtc value */ @@ -92,7 +92,7 @@ public DateTime startTimeUtc() { } /** - * Get the endTimeUtc value. + * Get the time the job stopped processing. * * @return the endTimeUtc value */ @@ -104,7 +104,7 @@ public DateTime endTimeUtc() { } /** - * Get the type value. + * Get the type of the job. Possible values include: 'unknown', 'export', 'import', 'backup', 'readDeviceProperties', 'writeDeviceProperties', 'updateDeviceConfiguration', 'rebootDevice', 'factoryResetDevice', 'firmwareUpdate'. * * @return the type value */ @@ -113,7 +113,7 @@ public JobType type() { } /** - * Get the status value. + * Get the status of the job. Possible values include: 'unknown', 'enqueued', 'running', 'completed', 'failed', 'cancelled'. * * @return the status value */ @@ -122,7 +122,7 @@ public JobStatus status() { } /** - * Get the failureReason value. + * Get if status == failed, this string containing the reason for the failure. * * @return the failureReason value */ @@ -131,7 +131,7 @@ public String failureReason() { } /** - * Get the statusMessage value. + * Get the status message for the job. * * @return the statusMessage value */ @@ -140,7 +140,7 @@ public String statusMessage() { } /** - * Get the parentJobId value. + * Get the job identifier of the parent job, if any. * * @return the parentJobId value */ diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/OperationImpl.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/OperationImpl.java index d7c51d5dda4d..df9e7c8202bb 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/OperationImpl.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/OperationImpl.java @@ -13,14 +13,14 @@ import com.microsoft.azure.management.iothub.v2018_04_01.OperationDisplay; class OperationImpl extends WrapperImpl implements Operation { - private final IoTHubManager manager; - OperationImpl(OperationInner inner, IoTHubManager manager) { + private final DevicesManager manager; + OperationImpl(OperationInner inner, DevicesManager manager) { super(inner); this.manager = manager; } @Override - public IoTHubManager manager() { + public DevicesManager manager() { return this.manager; } diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/OperationInner.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/OperationInner.java index 377c18a0d0a3..7f8d0e31755f 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/OperationInner.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/OperationInner.java @@ -28,7 +28,7 @@ public class OperationInner { private OperationDisplay display; /** - * Get the name value. + * Get operation name: {provider}/{resource}/{read | write | action | delete}. * * @return the name value */ @@ -37,7 +37,7 @@ public String name() { } /** - * Get the display value. + * Get the object that represents the operation. * * @return the display value */ @@ -46,7 +46,7 @@ public OperationDisplay display() { } /** - * Set the display value. + * Set the object that represents the operation. * * @param display the display value to set * @return the OperationInner object itself. diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/OperationsImpl.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/OperationsImpl.java index 897a29126ce3..f807aacc1ad2 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/OperationsImpl.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/OperationsImpl.java @@ -17,52 +17,33 @@ import com.microsoft.azure.management.iothub.v2018_04_01.Operation; class OperationsImpl extends WrapperImpl implements Operations { - private final IoTHubManager manager; + private final DevicesManager manager; - OperationsImpl(IoTHubManager manager) { + OperationsImpl(DevicesManager manager) { super(manager.inner().operations()); this.manager = manager; } - public IoTHubManager manager() { + public DevicesManager manager() { return this.manager; } - private Observable> listNextInnerPageAsync(String nextLink) { - if (nextLink == null) { - Observable.empty(); - } - OperationsInner client = this.inner(); - return client.listNextAsync(nextLink) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Page page) { - return Observable.just(page).concatWith(listNextInnerPageAsync(page.nextPageLink())); - } - }); - } @Override public Observable listAsync() { OperationsInner client = this.inner(); return client.listAsync() - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Page page) { - return listNextInnerPageAsync(page.nextPageLink()); - } - }) .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/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/OperationsInner.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/OperationsInner.java index e025bc72730f..bf7cb1c909a8 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/OperationsInner.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/OperationsInner.java @@ -12,7 +12,7 @@ import com.google.common.reflect.TypeToken; import com.microsoft.azure.AzureServiceFuture; import com.microsoft.azure.ListOperationCallback; -import com.microsoft.azure.management.iothub.v2018_04_01.ErrorDetailsException; +import com.microsoft.azure.management.iothub.v2018_04_01.ErrorDetailsInnerException; import com.microsoft.azure.Page; import com.microsoft.azure.PagedList; import com.microsoft.rest.ServiceFuture; @@ -69,7 +69,7 @@ interface OperationsService { * Lists all of the available IoT Hub REST API operations. * * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorDetailsException thrown if the request is rejected by server + * @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. */ @@ -162,10 +162,10 @@ public Observable>> call(Response> listDelegate(Response response) throws ErrorDetailsException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ErrorDetailsException>newInstance(this.client.serializerAdapter()) + 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(ErrorDetailsException.class) + .registerError(ErrorDetailsInnerException.class) .build(response); } @@ -174,7 +174,7 @@ private ServiceResponse> listDelegate(Response>> call(Response> listNextDelegate(Response response) throws ErrorDetailsException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ErrorDetailsException>newInstance(this.client.serializerAdapter()) + 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(ErrorDetailsException.class) + .registerError(ErrorDetailsInnerException.class) .build(response); } diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/RegistryStatisticsImpl.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/RegistryStatisticsImpl.java index d0c0e789a46d..d1bf03c99e6c 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/RegistryStatisticsImpl.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/RegistryStatisticsImpl.java @@ -12,14 +12,14 @@ import com.microsoft.azure.arm.model.implementation.WrapperImpl; class RegistryStatisticsImpl extends WrapperImpl implements RegistryStatistics { - private final IoTHubManager manager; - RegistryStatisticsImpl(RegistryStatisticsInner inner, IoTHubManager manager) { + private final DevicesManager manager; + RegistryStatisticsImpl(RegistryStatisticsInner inner, DevicesManager manager) { super(inner); this.manager = manager; } @Override - public IoTHubManager manager() { + public DevicesManager manager() { return this.manager; } diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/RegistryStatisticsInner.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/RegistryStatisticsInner.java index ae61a1682358..862fb6c82b38 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/RegistryStatisticsInner.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/RegistryStatisticsInner.java @@ -33,7 +33,7 @@ public class RegistryStatisticsInner { private Long disabledDeviceCount; /** - * Get the totalDeviceCount value. + * Get the total count of devices in the identity registry. * * @return the totalDeviceCount value */ @@ -42,7 +42,7 @@ public Long totalDeviceCount() { } /** - * Get the enabledDeviceCount value. + * Get the count of enabled devices in the identity registry. * * @return the enabledDeviceCount value */ @@ -51,7 +51,7 @@ public Long enabledDeviceCount() { } /** - * Get the disabledDeviceCount value. + * Get the count of disabled devices in the identity registry. * * @return the disabledDeviceCount value */ diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/ResourceProviderCommonsImpl.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/ResourceProviderCommonsImpl.java index 5bf8d7d75e48..82b7b1f47159 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/ResourceProviderCommonsImpl.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/ResourceProviderCommonsImpl.java @@ -17,14 +17,14 @@ import com.microsoft.azure.management.iothub.v2018_04_01.UserSubscriptionQuota; class ResourceProviderCommonsImpl extends WrapperImpl implements ResourceProviderCommons { - private final IoTHubManager manager; + private final DevicesManager manager; - ResourceProviderCommonsImpl(IoTHubManager manager) { + ResourceProviderCommonsImpl(DevicesManager manager) { super(manager.inner().resourceProviderCommons()); this.manager = manager; } - public IoTHubManager manager() { + public DevicesManager manager() { return this.manager; } diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/ResourceProviderCommonsInner.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/ResourceProviderCommonsInner.java index c852bc7e79f8..66cbfb5ad1eb 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/ResourceProviderCommonsInner.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/ResourceProviderCommonsInner.java @@ -10,7 +10,7 @@ import retrofit2.Retrofit; import com.google.common.reflect.TypeToken; -import com.microsoft.azure.management.iothub.v2018_04_01.ErrorDetailsException; +import com.microsoft.azure.management.iothub.v2018_04_01.ErrorDetailsInnerException; import com.microsoft.azure.Page; import com.microsoft.azure.PagedList; import com.microsoft.rest.ServiceCallback; @@ -138,10 +138,10 @@ public Observable>> call(Respon }); } - private ServiceResponse> listDelegate(Response response) throws ErrorDetailsException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ErrorDetailsException>newInstance(this.client.serializerAdapter()) + 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(ErrorDetailsException.class) + .registerError(ErrorDetailsInnerException.class) .build(response); } diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/SharedAccessSignatureAuthorizationRuleImpl.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/SharedAccessSignatureAuthorizationRuleImpl.java index 1fe3c09cb865..4ce06e4347ef 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/SharedAccessSignatureAuthorizationRuleImpl.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/SharedAccessSignatureAuthorizationRuleImpl.java @@ -13,14 +13,14 @@ import com.microsoft.azure.management.iothub.v2018_04_01.AccessRights; class SharedAccessSignatureAuthorizationRuleImpl extends WrapperImpl implements SharedAccessSignatureAuthorizationRule { - private final IoTHubManager manager; - SharedAccessSignatureAuthorizationRuleImpl(SharedAccessSignatureAuthorizationRuleInner inner, IoTHubManager manager) { + private final DevicesManager manager; + SharedAccessSignatureAuthorizationRuleImpl(SharedAccessSignatureAuthorizationRuleInner inner, DevicesManager manager) { super(inner); this.manager = manager; } @Override - public IoTHubManager manager() { + public DevicesManager manager() { return this.manager; } diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/SharedAccessSignatureAuthorizationRuleInner.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/SharedAccessSignatureAuthorizationRuleInner.java index a5214e641d9c..b2fa1ffbfc9e 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/SharedAccessSignatureAuthorizationRuleInner.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/SharedAccessSignatureAuthorizationRuleInner.java @@ -49,7 +49,7 @@ public class SharedAccessSignatureAuthorizationRuleInner { private AccessRights rights; /** - * Get the keyName value. + * Get the name of the shared access policy. * * @return the keyName value */ @@ -58,7 +58,7 @@ public String keyName() { } /** - * Set the keyName value. + * Set the name of the shared access policy. * * @param keyName the keyName value to set * @return the SharedAccessSignatureAuthorizationRuleInner object itself. @@ -69,7 +69,7 @@ public SharedAccessSignatureAuthorizationRuleInner withKeyName(String keyName) { } /** - * Get the primaryKey value. + * Get the primary key. * * @return the primaryKey value */ @@ -78,7 +78,7 @@ public String primaryKey() { } /** - * Set the primaryKey value. + * Set the primary key. * * @param primaryKey the primaryKey value to set * @return the SharedAccessSignatureAuthorizationRuleInner object itself. @@ -89,7 +89,7 @@ public SharedAccessSignatureAuthorizationRuleInner withPrimaryKey(String primary } /** - * Get the secondaryKey value. + * Get the secondary key. * * @return the secondaryKey value */ @@ -98,7 +98,7 @@ public String secondaryKey() { } /** - * Set the secondaryKey value. + * Set the secondary key. * * @param secondaryKey the secondaryKey value to set * @return the SharedAccessSignatureAuthorizationRuleInner object itself. @@ -109,7 +109,7 @@ public SharedAccessSignatureAuthorizationRuleInner withSecondaryKey(String secon } /** - * Get the rights value. + * 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 */ @@ -118,7 +118,7 @@ public AccessRights rights() { } /** - * Set the rights value. + * 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. diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/TestAllRoutesResultImpl.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/TestAllRoutesResultImpl.java index fd3f2d11e951..de7e48d04e42 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/TestAllRoutesResultImpl.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/TestAllRoutesResultImpl.java @@ -14,14 +14,14 @@ import com.microsoft.azure.management.iothub.v2018_04_01.MatchedRoute; class TestAllRoutesResultImpl extends WrapperImpl implements TestAllRoutesResult { - private final IoTHubManager manager; - TestAllRoutesResultImpl(TestAllRoutesResultInner inner, IoTHubManager manager) { + private final DevicesManager manager; + TestAllRoutesResultImpl(TestAllRoutesResultInner inner, DevicesManager manager) { super(inner); this.manager = manager; } @Override - public IoTHubManager manager() { + public DevicesManager manager() { return this.manager; } diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/TestAllRoutesResultInner.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/TestAllRoutesResultInner.java index b1bd6eaa3de1..c42a8d76b3cf 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/TestAllRoutesResultInner.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/TestAllRoutesResultInner.java @@ -23,7 +23,7 @@ public class TestAllRoutesResultInner { private List routes; /** - * Get the routes value. + * Get jSON-serialized array of matched routes. * * @return the routes value */ @@ -32,7 +32,7 @@ public List routes() { } /** - * Set the routes value. + * Set jSON-serialized array of matched routes. * * @param routes the routes value to set * @return the TestAllRoutesResultInner object itself. diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/TestRouteResultImpl.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/TestRouteResultImpl.java index 92a1f44b99f6..f6412e25a80e 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/TestRouteResultImpl.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/TestRouteResultImpl.java @@ -14,14 +14,14 @@ import com.microsoft.azure.management.iothub.v2018_04_01.TestResultStatus; class TestRouteResultImpl extends WrapperImpl implements TestRouteResult { - private final IoTHubManager manager; - TestRouteResultImpl(TestRouteResultInner inner, IoTHubManager manager) { + private final DevicesManager manager; + TestRouteResultImpl(TestRouteResultInner inner, DevicesManager manager) { super(inner); this.manager = manager; } @Override - public IoTHubManager manager() { + public DevicesManager manager() { return this.manager; } diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/TestRouteResultInner.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/TestRouteResultInner.java index cff7edd86850..971b19c29b3b 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/TestRouteResultInner.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/TestRouteResultInner.java @@ -30,7 +30,7 @@ public class TestRouteResultInner { private TestRouteResultDetails details; /** - * Get the result value. + * Get result of testing route. Possible values include: 'undefined', 'false', 'true'. * * @return the result value */ @@ -39,7 +39,7 @@ public TestResultStatus result() { } /** - * Set the result value. + * Set result of testing route. Possible values include: 'undefined', 'false', 'true'. * * @param result the result value to set * @return the TestRouteResultInner object itself. @@ -50,7 +50,7 @@ public TestRouteResultInner withResult(TestResultStatus result) { } /** - * Get the details value. + * Get detailed result of testing route. * * @return the details value */ @@ -59,7 +59,7 @@ public TestRouteResultDetails details() { } /** - * Set the details value. + * Set detailed result of testing route. * * @param details the details value to set * @return the TestRouteResultInner object itself. diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/UserSubscriptionQuotaImpl.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/UserSubscriptionQuotaImpl.java index 4166c829bd33..532d743d9e56 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/UserSubscriptionQuotaImpl.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/UserSubscriptionQuotaImpl.java @@ -10,16 +10,17 @@ import com.microsoft.azure.management.iothub.v2018_04_01.UserSubscriptionQuota; import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.iothub.v2018_04_01.Name; class UserSubscriptionQuotaImpl extends WrapperImpl implements UserSubscriptionQuota { - private final IoTHubManager manager; - UserSubscriptionQuotaImpl(UserSubscriptionQuotaInner inner, IoTHubManager manager) { + private final DevicesManager manager; + UserSubscriptionQuotaImpl(UserSubscriptionQuotaInner inner, DevicesManager manager) { super(inner); this.manager = manager; } @Override - public IoTHubManager manager() { + public DevicesManager manager() { return this.manager; } @@ -39,7 +40,7 @@ public Integer limit() { } @Override - public String name() { + public Name name() { return this.inner().name(); } diff --git a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/UserSubscriptionQuotaInner.java b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/UserSubscriptionQuotaInner.java index 77de7b77672c..6b7615ceb461 100644 --- a/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/UserSubscriptionQuotaInner.java +++ b/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/UserSubscriptionQuotaInner.java @@ -8,13 +8,25 @@ package com.microsoft.azure.management.iothub.v2018_04_01.implementation; +import com.microsoft.azure.management.iothub.v2018_04_01.Name; import com.fasterxml.jackson.annotation.JsonProperty; -import com.microsoft.azure.ProxyResource; /** * User subscription quota response. */ -public class UserSubscriptionQuotaInner extends ProxyResource { +public class UserSubscriptionQuotaInner { + /** + * IotHub type id. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Response type. + */ + @JsonProperty(value = "type") + private String type; + /** * Unit of IotHub type. */ @@ -34,7 +46,53 @@ public class UserSubscriptionQuotaInner extends ProxyResource { private Integer limit; /** - * Get the unit value. + * 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 */ @@ -43,7 +101,7 @@ public String unit() { } /** - * Set the unit value. + * Set unit of IotHub type. * * @param unit the unit value to set * @return the UserSubscriptionQuotaInner object itself. @@ -54,7 +112,7 @@ public UserSubscriptionQuotaInner withUnit(String unit) { } /** - * Get the currentValue value. + * Get current number of IotHub type. * * @return the currentValue value */ @@ -63,7 +121,7 @@ public Integer currentValue() { } /** - * Set the currentValue value. + * Set current number of IotHub type. * * @param currentValue the currentValue value to set * @return the UserSubscriptionQuotaInner object itself. @@ -74,7 +132,7 @@ public UserSubscriptionQuotaInner withCurrentValue(Integer currentValue) { } /** - * Get the limit value. + * Get numerical limit on IotHub type. * * @return the limit value */ @@ -83,7 +141,7 @@ public Integer limit() { } /** - * Set the limit value. + * Set numerical limit on IotHub type. * * @param limit the limit value to set * @return the UserSubscriptionQuotaInner object itself. @@ -93,4 +151,24 @@ public UserSubscriptionQuotaInner withLimit(Integer 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/iothub/resource-manager/v2018_12_01/pom.xml b/iothub/resource-manager/v2018_12_01/pom.xml new file mode 100644 index 000000000000..fd778acc4600 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.iothub.v2018_12_01 + + com.microsoft.azure + azure-arm-parent + 0.0.2-beta + ../../../pom.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-libraries-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-libraries-for-java + scm:git:git@github.com:Azure/azure-libraries-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/AccessRights.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/AccessRights.java new file mode 100644 index 000000000000..3bc58b167bd6 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/Capabilities.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/Capabilities.java new file mode 100644 index 000000000000..b35cb131677d --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/CertificateBodyDescription.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/CertificateBodyDescription.java new file mode 100644 index 000000000000..02f595022658 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/CertificateDescription.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/CertificateDescription.java new file mode 100644 index 000000000000..02c120d028da --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/CertificateDescription.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.v2018_12_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.iothub.v2018_12_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.v2018_12_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.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. + */ + WithCreate withExistingIotHub(String resourceGroupName, String resourceName); + } + + /** + * 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 { + } + + /** + * Grouping of CertificateDescription update stages. + */ + interface UpdateStages { + } +} diff --git a/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/CertificateListDescription.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/CertificateListDescription.java new file mode 100644 index 000000000000..589c87eefff8 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.iothub.v2018_12_01.implementation.DevicesManager; +import com.microsoft.azure.management.iothub.v2018_12_01.implementation.CertificateListDescriptionInner; +import com.microsoft.azure.management.iothub.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/CertificateProperties.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/CertificateProperties.java new file mode 100644 index 000000000000..ae432fdb70bd --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/CertificatePropertiesWithNonce.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/CertificatePropertiesWithNonce.java new file mode 100644 index 000000000000..98e6aadec280 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/CertificateVerificationDescription.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/CertificateVerificationDescription.java new file mode 100644 index 000000000000..f382b000eb95 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/CertificateWithNonceDescription.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/CertificateWithNonceDescription.java new file mode 100644 index 000000000000..eb91a2c6d48d --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.iothub.v2018_12_01.implementation.DevicesManager; +import com.microsoft.azure.management.iothub.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/Certificates.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/Certificates.java new file mode 100644 index 000000000000..b35fd0e100fb --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.iothub.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/CloudToDeviceProperties.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/CloudToDeviceProperties.java new file mode 100644 index 000000000000..21d73c060cb1 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/EndpointHealthData.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/EndpointHealthData.java new file mode 100644 index 000000000000..8754e0a7f4cc --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.iothub.v2018_12_01.implementation.DevicesManager; +import com.microsoft.azure.management.iothub.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/EndpointHealthStatus.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/EndpointHealthStatus.java new file mode 100644 index 000000000000..a6340717b2de --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/EventHubConsumerGroupInfo.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/EventHubConsumerGroupInfo.java new file mode 100644 index 000000000000..41cb997b4677 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/EventHubConsumerGroupInfo.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.v2018_12_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.iothub.v2018_12_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.v2018_12_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. + */ + 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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/EventHubProperties.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/EventHubProperties.java new file mode 100644 index 000000000000..2472013c5bcf --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/ExportDevicesRequest.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/ExportDevicesRequest.java new file mode 100644 index 000000000000..35675314a86d --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/ExportDevicesRequest.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2018_12_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; + + /** + * 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; + } + +} diff --git a/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/FallbackRouteProperties.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/FallbackRouteProperties.java new file mode 100644 index 000000000000..1f8d70e08904 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/FeedbackProperties.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/FeedbackProperties.java new file mode 100644 index 000000000000..ed44ca2cf5b2 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/ImportDevicesRequest.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/ImportDevicesRequest.java new file mode 100644 index 000000000000..8ab72ddf4bbe --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/ImportDevicesRequest.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2018_12_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; + + /** + * 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; + } + +} diff --git a/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/IotHubCapacity.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/IotHubCapacity.java new file mode 100644 index 000000000000..35cb484ced9d --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/IotHubDescription.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/IotHubDescription.java new file mode 100644 index 000000000000..dd550526d1c4 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/IotHubDescription.java @@ -0,0 +1,133 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2018_12_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.iothub.v2018_12_01.implementation.DevicesManager; +import com.microsoft.azure.management.iothub.v2018_12_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.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 Sku. + */ + interface WithSku { + /** + * Specifies sku. + */ + WithCreate withSku(IotHubSkuInfo sku); + } + + /** + * The stage of the iothubdescription update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the iothubdescription update allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + */ + 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.WithEtag, UpdateStages.WithProperties { + } + + /** + * Grouping of IotHubDescription update stages. + */ + interface UpdateStages { + /** + * The stage of the iothubdescription {0} allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + */ + Update withEtag(String etag); + } + + /** + * The stage of the iothubdescription {0} allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + */ + Update withProperties(IotHubProperties properties); + } + + } +} diff --git a/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/IotHubNameAvailabilityInfo.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/IotHubNameAvailabilityInfo.java new file mode 100644 index 000000000000..3d76488e7020 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.iothub.v2018_12_01.implementation.DevicesManager; +import com.microsoft.azure.management.iothub.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/IotHubNameUnavailabilityReason.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/IotHubNameUnavailabilityReason.java new file mode 100644 index 000000000000..5ea459c04b5a --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/IotHubProperties.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/IotHubProperties.java new file mode 100644 index 000000000000..c51a0dcfcaa8 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/IotHubProperties.java @@ -0,0 +1,388 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2018_12_01; + +import java.util.List; +import com.microsoft.azure.management.iothub.v2018_12_01.implementation.SharedAccessSignatureAuthorizationRuleInner; +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; + + /** + * The IP filter rules. + */ + @JsonProperty(value = "ipFilterRules") + private List ipFilterRules; + + /** + * The provisioning state. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Thehub state 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 possible keys to this + * dictionary are events and operationsMonitoringEvents. Both of these keys + * have 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 operationsMonitoringProperties property. + */ + @JsonProperty(value = "operationsMonitoringProperties") + private OperationsMonitoringProperties operationsMonitoringProperties; + + /** + * The device streams properties of iothub. + */ + @JsonProperty(value = "deviceStreams") + private IotHubPropertiesDeviceStreams deviceStreams; + + /** + * The capabilities and features enabled for the IoT hub. Possible values + * include: 'None', 'DeviceManagement'. + */ + @JsonProperty(value = "features") + private Capabilities features; + + /** + * 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 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 the provisioning state. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get thehub state 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 possible keys to this dictionary are events and operationsMonitoringEvents. Both of these keys have 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 possible keys to this dictionary are events and operationsMonitoringEvents. Both of these keys have 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 operationsMonitoringProperties value. + * + * @return the operationsMonitoringProperties value + */ + public OperationsMonitoringProperties operationsMonitoringProperties() { + return this.operationsMonitoringProperties; + } + + /** + * Set the operationsMonitoringProperties value. + * + * @param operationsMonitoringProperties the operationsMonitoringProperties value to set + * @return the IotHubProperties object itself. + */ + public IotHubProperties withOperationsMonitoringProperties(OperationsMonitoringProperties operationsMonitoringProperties) { + this.operationsMonitoringProperties = operationsMonitoringProperties; + return this; + } + + /** + * Get the device streams properties of iothub. + * + * @return the deviceStreams value + */ + public IotHubPropertiesDeviceStreams deviceStreams() { + return this.deviceStreams; + } + + /** + * Set the device streams properties of iothub. + * + * @param deviceStreams the deviceStreams value to set + * @return the IotHubProperties object itself. + */ + public IotHubProperties withDeviceStreams(IotHubPropertiesDeviceStreams deviceStreams) { + this.deviceStreams = deviceStreams; + 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; + } + +} diff --git a/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/IotHubPropertiesDeviceStreams.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/IotHubPropertiesDeviceStreams.java new file mode 100644 index 000000000000..f4c77af6f094 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/IotHubPropertiesDeviceStreams.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.v2018_12_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The device streams properties of iothub. + */ +public class IotHubPropertiesDeviceStreams { + /** + * List of Device Streams Endpoints. + */ + @JsonProperty(value = "streamingEndpoints") + private List streamingEndpoints; + + /** + * Get list of Device Streams Endpoints. + * + * @return the streamingEndpoints value + */ + public List streamingEndpoints() { + return this.streamingEndpoints; + } + + /** + * Set list of Device Streams Endpoints. + * + * @param streamingEndpoints the streamingEndpoints value to set + * @return the IotHubPropertiesDeviceStreams object itself. + */ + public IotHubPropertiesDeviceStreams withStreamingEndpoints(List streamingEndpoints) { + this.streamingEndpoints = streamingEndpoints; + return this; + } + +} diff --git a/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/IotHubQuotaMetricInfo.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/IotHubQuotaMetricInfo.java new file mode 100644 index 000000000000..19f0057cfa9d --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.iothub.v2018_12_01.implementation.IotHubQuotaMetricInfoInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.iothub.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/IotHubResources.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/IotHubResources.java new file mode 100644 index 000000000000..820d32418fe6 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_01; + +import rx.Observable; +import com.microsoft.azure.management.iothub.v2018_12_01.IotHubDescription; +import rx.Completable; +import com.microsoft.azure.management.iothub.v2018_12_01.IotHubSkuDescription; +import com.microsoft.azure.management.iothub.v2018_12_01.EventHubConsumerGroupInfo; +import com.microsoft.azure.management.iothub.v2018_12_01.JobResponse; +import com.microsoft.azure.management.iothub.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/IotHubScaleType.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/IotHubScaleType.java new file mode 100644 index 000000000000..e0505224e4f4 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/IotHubSku.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/IotHubSku.java new file mode 100644 index 000000000000..d7aaa67eea1f --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/IotHubSkuDescription.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/IotHubSkuDescription.java new file mode 100644 index 000000000000..4f6095d49fb1 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.iothub.v2018_12_01.implementation.IotHubSkuDescriptionInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.iothub.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/IotHubSkuInfo.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/IotHubSkuInfo.java new file mode 100644 index 000000000000..b3d94085b6db --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/IotHubSkuTier.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/IotHubSkuTier.java new file mode 100644 index 000000000000..251e5083b849 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/IpFilterActionType.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/IpFilterActionType.java new file mode 100644 index 000000000000..3d7705046c8e --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/IpFilterRule.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/IpFilterRule.java new file mode 100644 index 000000000000..b2589f9ab9cb --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/JobResponse.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/JobResponse.java new file mode 100644 index 000000000000..380178cddddb --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.iothub.v2018_12_01.implementation.JobResponseInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.iothub.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/JobStatus.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/JobStatus.java new file mode 100644 index 000000000000..6446e27ffdd4 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/JobType.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/JobType.java new file mode 100644 index 000000000000..774b204aefba --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/MatchedRoute.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/MatchedRoute.java new file mode 100644 index 000000000000..93b9de8f6c3b --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/MessagingEndpointProperties.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/MessagingEndpointProperties.java new file mode 100644 index 000000000000..2a6fd9895c7c --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/Name.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/Name.java new file mode 100644 index 000000000000..eb1515002c92 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/Operation.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/Operation.java new file mode 100644 index 000000000000..d4cf23471df1 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.iothub.v2018_12_01.implementation.DevicesManager; +import com.microsoft.azure.management.iothub.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/OperationDisplay.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/OperationDisplay.java new file mode 100644 index 000000000000..755ae87b5544 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/OperationDisplay.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/OperationInputs.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/OperationInputs.java new file mode 100644 index 000000000000..ddb50284eac3 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/OperationMonitoringLevel.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/OperationMonitoringLevel.java new file mode 100644 index 000000000000..3af1df5890ba --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/OperationMonitoringLevel.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.v2018_12_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for OperationMonitoringLevel. + */ +public final class OperationMonitoringLevel extends ExpandableStringEnum { + /** Static value None for OperationMonitoringLevel. */ + public static final OperationMonitoringLevel NONE = fromString("None"); + + /** Static value Error for OperationMonitoringLevel. */ + public static final OperationMonitoringLevel ERROR = fromString("Error"); + + /** Static value Information for OperationMonitoringLevel. */ + public static final OperationMonitoringLevel INFORMATION = fromString("Information"); + + /** Static value Error, Information for OperationMonitoringLevel. */ + public static final OperationMonitoringLevel ERROR_INFORMATION = fromString("Error, Information"); + + /** + * Creates or finds a OperationMonitoringLevel from its string representation. + * @param name a name to look for + * @return the corresponding OperationMonitoringLevel + */ + @JsonCreator + public static OperationMonitoringLevel fromString(String name) { + return fromString(name, OperationMonitoringLevel.class); + } + + /** + * @return known OperationMonitoringLevel values + */ + public static Collection values() { + return values(OperationMonitoringLevel.class); + } +} diff --git a/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/Operations.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/Operations.java new file mode 100644 index 000000000000..40780da6b55c --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/Operations.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2018_12_01; + +import rx.Observable; +import com.microsoft.azure.management.iothub.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/OperationsMonitoringProperties.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/OperationsMonitoringProperties.java new file mode 100644 index 000000000000..2e41df2fe80b --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/OperationsMonitoringProperties.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.v2018_12_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The operations monitoring properties for the IoT hub. The possible keys to + * the dictionary are Connections, DeviceTelemetry, C2DCommands, + * DeviceIdentityOperations, FileUploadOperations, Routes, D2CTwinOperations, + * C2DTwinOperations, TwinQueries, JobsOperations, DirectMethods. + */ +public class OperationsMonitoringProperties { + /** + * The events property. + */ + @JsonProperty(value = "events") + private Map events; + + /** + * Get the events value. + * + * @return the events value + */ + public Map events() { + return this.events; + } + + /** + * Set the events value. + * + * @param events the events value to set + * @return the OperationsMonitoringProperties object itself. + */ + public OperationsMonitoringProperties withEvents(Map events) { + this.events = events; + return this; + } + +} diff --git a/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/RegistryStatistics.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/RegistryStatistics.java new file mode 100644 index 000000000000..41f9d01427dd --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.iothub.v2018_12_01.implementation.DevicesManager; +import com.microsoft.azure.management.iothub.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/ResourceProviderCommons.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/ResourceProviderCommons.java new file mode 100644 index 000000000000..7a4f22a383f5 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_01; + +import rx.Observable; +import com.microsoft.azure.management.iothub.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/RouteCompilationError.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/RouteCompilationError.java new file mode 100644 index 000000000000..c34fb52bd4ba --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/RouteErrorPosition.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/RouteErrorPosition.java new file mode 100644 index 000000000000..b9903745e375 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/RouteErrorRange.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/RouteErrorRange.java new file mode 100644 index 000000000000..4b9da340f4c5 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/RouteErrorSeverity.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/RouteErrorSeverity.java new file mode 100644 index 000000000000..dce11a870fc6 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/RouteProperties.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/RouteProperties.java new file mode 100644 index 000000000000..21f66ad4b872 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/RoutingEndpoints.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/RoutingEndpoints.java new file mode 100644 index 000000000000..5f5fe6888450 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/RoutingEventHubProperties.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/RoutingEventHubProperties.java new file mode 100644 index 000000000000..c3b95692d47a --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/RoutingEventHubProperties.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.v2018_12_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties related to an event hub endpoint. + */ +public class RoutingEventHubProperties { + /** + * The connection string of the event hub endpoint. + */ + @JsonProperty(value = "connectionString", required = true) + private String connectionString; + + /** + * 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, + * operationsMonitoringEvents, 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 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 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, operationsMonitoringEvents, 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, operationsMonitoringEvents, 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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/RoutingMessage.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/RoutingMessage.java new file mode 100644 index 000000000000..4dd76420a985 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/RoutingProperties.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/RoutingProperties.java new file mode 100644 index 000000000000..4ca69d149075 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/RoutingProperties.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.v2018_12_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; + + /** + * 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; + } + +} diff --git a/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/RoutingServiceBusQueueEndpointProperties.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/RoutingServiceBusQueueEndpointProperties.java new file mode 100644 index 000000000000..e8fe592d9791 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/RoutingServiceBusQueueEndpointProperties.java @@ -0,0 +1,126 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2018_12_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties related to service bus queue endpoint types. + */ +public class RoutingServiceBusQueueEndpointProperties { + /** + * The connection string of the service bus queue endpoint. + */ + @JsonProperty(value = "connectionString", required = true) + private String connectionString; + + /** + * 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, + * operationsMonitoringEvents, 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 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 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, operationsMonitoringEvents, 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, operationsMonitoringEvents, 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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/RoutingServiceBusTopicEndpointProperties.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/RoutingServiceBusTopicEndpointProperties.java new file mode 100644 index 000000000000..1eee7f035d49 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/RoutingServiceBusTopicEndpointProperties.java @@ -0,0 +1,126 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2018_12_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties related to service bus topic endpoint types. + */ +public class RoutingServiceBusTopicEndpointProperties { + /** + * The connection string of the service bus topic endpoint. + */ + @JsonProperty(value = "connectionString", required = true) + private String connectionString; + + /** + * 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, + * operationsMonitoringEvents, 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 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 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, operationsMonitoringEvents, 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, operationsMonitoringEvents, 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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/RoutingSource.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/RoutingSource.java new file mode 100644 index 000000000000..fde9ca39204b --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/RoutingStorageContainerProperties.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/RoutingStorageContainerProperties.java new file mode 100644 index 000000000000..eb201f8b3256 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/RoutingStorageContainerProperties.java @@ -0,0 +1,261 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2018_12_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties related to a storage container endpoint. + */ +public class RoutingStorageContainerProperties { + /** + * The connection string of the storage account. + */ + @JsonProperty(value = "connectionString", required = true) + private String connectionString; + + /** + * 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, + * operationsMonitoringEvents, 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' and 'avrodeflate'. Default value is 'avro'. + */ + @JsonProperty(value = "encoding") + private String encoding; + + /** + * 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 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, operationsMonitoringEvents, 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, operationsMonitoringEvents, 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' and 'avrodeflate'. Default value is 'avro'. + * + * @return the encoding value + */ + public String encoding() { + return this.encoding; + } + + /** + * Set encoding that is used to serialize messages to blobs. Supported values are 'avro' and 'avrodeflate'. Default value is 'avro'. + * + * @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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/RoutingTwin.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/RoutingTwin.java new file mode 100644 index 000000000000..64f647933ad8 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/RoutingTwinProperties.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/RoutingTwinProperties.java new file mode 100644 index 000000000000..8b5bc80ba2a9 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/SharedAccessSignatureAuthorizationRule.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/SharedAccessSignatureAuthorizationRule.java new file mode 100644 index 000000000000..f51d74db991f --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.iothub.v2018_12_01.implementation.DevicesManager; +import com.microsoft.azure.management.iothub.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/StorageEndpointProperties.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/StorageEndpointProperties.java new file mode 100644 index 000000000000..01f9893396de --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/StorageEndpointProperties.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.v2018_12_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 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; + + /** + * Get the period of time for which the 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 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; + } + +} diff --git a/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/TagsResource.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/TagsResource.java new file mode 100644 index 000000000000..24c4b1ddf83d --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/TestAllRoutesInput.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/TestAllRoutesInput.java new file mode 100644 index 000000000000..80f7a65f5214 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/TestAllRoutesResult.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/TestAllRoutesResult.java new file mode 100644 index 000000000000..e81fc920cedb --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.iothub.v2018_12_01.implementation.DevicesManager; +import com.microsoft.azure.management.iothub.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/TestResultStatus.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/TestResultStatus.java new file mode 100644 index 000000000000..1129ca465646 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/TestRouteInput.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/TestRouteInput.java new file mode 100644 index 000000000000..deccb868f55e --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/TestRouteResult.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/TestRouteResult.java new file mode 100644 index 000000000000..7ea4a346f1c4 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.iothub.v2018_12_01.implementation.DevicesManager; +import com.microsoft.azure.management.iothub.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/TestRouteResultDetails.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/TestRouteResultDetails.java new file mode 100644 index 000000000000..8529f62bff23 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/UserSubscriptionQuota.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/UserSubscriptionQuota.java new file mode 100644 index 000000000000..6e60c90a4b55 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.iothub.v2018_12_01.implementation.DevicesManager; +import com.microsoft.azure.management.iothub.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/CertificateDescriptionImpl.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/CertificateDescriptionImpl.java new file mode 100644 index 000000000000..0d28fd6aa835 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/CertificateDescriptionImpl.java @@ -0,0 +1,105 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2018_12_01.implementation; + +import com.microsoft.azure.management.iothub.v2018_12_01.CertificateDescription; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.iothub.v2018_12_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; + + 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(); + // resource ancestor names + 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) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + CertificatesInner client = this.manager().inner().certificates(); + return client.createOrUpdateAsync(this.resourceGroupName, this.resourceName, this.certificateName) + .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; + } + +} diff --git a/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/CertificateDescriptionInner.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/CertificateDescriptionInner.java new file mode 100644 index 000000000000..a6e37704ca76 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_01.implementation; + +import com.microsoft.azure.management.iothub.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/CertificateListDescriptionImpl.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/CertificateListDescriptionImpl.java new file mode 100644 index 000000000000..9f8f84730df6 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_01.implementation; + +import com.microsoft.azure.management.iothub.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/CertificateListDescriptionInner.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/CertificateListDescriptionInner.java new file mode 100644 index 000000000000..3c9e63d475cb --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/CertificateWithNonceDescriptionImpl.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/CertificateWithNonceDescriptionImpl.java new file mode 100644 index 000000000000..8961d5a91678 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_01.implementation; + +import com.microsoft.azure.management.iothub.v2018_12_01.CertificateWithNonceDescription; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.iothub.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/CertificateWithNonceDescriptionInner.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/CertificateWithNonceDescriptionInner.java new file mode 100644 index 000000000000..fe2440025965 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_01.implementation; + +import com.microsoft.azure.management.iothub.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/CertificatesImpl.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/CertificatesImpl.java new file mode 100644 index 000000000000..2ee5f2ba4295 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/CertificatesImpl.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.v2018_12_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.iothub.v2018_12_01.Certificates; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.iothub.v2018_12_01.CertificateListDescription; +import com.microsoft.azure.management.iothub.v2018_12_01.CertificateWithNonceDescription; +import com.microsoft.azure.management.iothub.v2018_12_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) + .map(new Func1() { + @Override + public CertificateDescription call(CertificateDescriptionInner inner) { + return 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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/CertificatesInner.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/CertificatesInner.java new file mode 100644 index 000000000000..492b50cb2dfc --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.iothub.v2018_12_01.CertificateBodyDescription; +import com.microsoft.azure.management.iothub.v2018_12_01.CertificateVerificationDescription; +import com.microsoft.azure.management.iothub.v2018_12_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.v2018_12_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.v2018_12_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.v2018_12_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.v2018_12_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.v2018_12_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.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/DevicesManager.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/DevicesManager.java new file mode 100644 index 000000000000..5d275dceb550 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/DevicesManager.java @@ -0,0 +1,135 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2018_12_01.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.iothub.v2018_12_01.Operations; +import com.microsoft.azure.management.iothub.v2018_12_01.IotHubResources; +import com.microsoft.azure.management.iothub.v2018_12_01.ResourceProviderCommons; +import com.microsoft.azure.management.iothub.v2018_12_01.Certificates; +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; + /** + * 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; + } + + /** + * 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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/EndpointHealthDataImpl.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/EndpointHealthDataImpl.java new file mode 100644 index 000000000000..87c9d438b04a --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_01.implementation; + +import com.microsoft.azure.management.iothub.v2018_12_01.EndpointHealthData; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.iothub.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/EndpointHealthDataInner.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/EndpointHealthDataInner.java new file mode 100644 index 000000000000..2e29d46c6f95 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/EndpointHealthDataInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2018_12_01.implementation; + +import com.microsoft.azure.management.iothub.v2018_12_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 status. 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 status. Possible values include: 'unknown', 'healthy', 'unhealthy', 'dead'. + * + * @return the healthStatus value + */ + public EndpointHealthStatus healthStatus() { + return this.healthStatus; + } + + /** + * Set health status. 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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/ErrorDetailsInner.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/ErrorDetailsInner.java new file mode 100644 index 000000000000..94e6402a789c --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/ErrorDetailsInnerException.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/ErrorDetailsInnerException.java new file mode 100644 index 000000000000..09d6bef9307a --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/EventHubConsumerGroupInfoImpl.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/EventHubConsumerGroupInfoImpl.java new file mode 100644 index 000000000000..8a42d2e7ebbc --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_01.implementation; + +import com.microsoft.azure.management.iothub.v2018_12_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(); + // resource ancestor names + 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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/EventHubConsumerGroupInfoInner.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/EventHubConsumerGroupInfoInner.java new file mode 100644 index 000000000000..402ba823f8c9 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/IdParsingUtils.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/IdParsingUtils.java new file mode 100644 index 000000000000..cc89b8577cb4 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2018_12_01.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/IotHubClientImpl.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/IotHubClientImpl.java new file mode 100644 index 000000000000..9efbffe636dd --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/IotHubClientImpl.java @@ -0,0 +1,238 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2018_12_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; + } + + /** Gets or sets the preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public IotHubClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public IotHubClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public 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; + } + + /** + * 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 = "2018-12-01-preview"; + 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.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s)", super.userAgent(), "IotHubClient", "2018-12-01-preview"); + } +} diff --git a/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/IotHubDescriptionImpl.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/IotHubDescriptionImpl.java new file mode 100644 index 000000000000..2153a7d6d741 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/IotHubDescriptionImpl.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.v2018_12_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.iothub.v2018_12_01.IotHubDescription; +import rx.Observable; +import com.microsoft.azure.management.iothub.v2018_12_01.IotHubProperties; +import com.microsoft.azure.management.iothub.v2018_12_01.IotHubSkuInfo; + +class IotHubDescriptionImpl extends GroupableResourceCoreImpl implements IotHubDescription, IotHubDescription.Definition, IotHubDescription.Update { + 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()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + IotHubResourcesInner client = this.manager().inner().iotHubResources(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .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 withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public IotHubDescriptionImpl withProperties(IotHubProperties properties) { + this.inner().withProperties(properties); + return this; + } + +} diff --git a/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/IotHubDescriptionInner.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/IotHubDescriptionInner.java new file mode 100644 index 000000000000..bb3a7b6c93c7 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_01.implementation; + +import com.microsoft.azure.management.iothub.v2018_12_01.IotHubProperties; +import com.microsoft.azure.management.iothub.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/IotHubNameAvailabilityInfoImpl.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/IotHubNameAvailabilityInfoImpl.java new file mode 100644 index 000000000000..839c357ef3a0 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_01.implementation; + +import com.microsoft.azure.management.iothub.v2018_12_01.IotHubNameAvailabilityInfo; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.iothub.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/IotHubNameAvailabilityInfoInner.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/IotHubNameAvailabilityInfoInner.java new file mode 100644 index 000000000000..9d74d8715741 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_01.implementation; + +import com.microsoft.azure.management.iothub.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/IotHubQuotaMetricInfoImpl.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/IotHubQuotaMetricInfoImpl.java new file mode 100644 index 000000000000..148dd81f3fda --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_01.implementation; + +import com.microsoft.azure.management.iothub.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/IotHubQuotaMetricInfoInner.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/IotHubQuotaMetricInfoInner.java new file mode 100644 index 000000000000..108a7f755aff --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/IotHubResourcesImpl.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/IotHubResourcesImpl.java new file mode 100644 index 000000000000..2f7c42065588 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/IotHubResourcesImpl.java @@ -0,0 +1,379 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.v2018_12_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.iothub.v2018_12_01.IotHubResources; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.iothub.v2018_12_01.IotHubDescription; +import com.microsoft.azure.Page; +import rx.Completable; +import com.microsoft.azure.management.iothub.v2018_12_01.EndpointHealthData; +import com.microsoft.azure.management.iothub.v2018_12_01.SharedAccessSignatureAuthorizationRule; +import com.microsoft.azure.management.iothub.v2018_12_01.JobResponse; +import com.microsoft.azure.management.iothub.v2018_12_01.IotHubNameAvailabilityInfo; +import com.microsoft.azure.management.iothub.v2018_12_01.ExportDevicesRequest; +import com.microsoft.azure.management.iothub.v2018_12_01.ImportDevicesRequest; +import com.microsoft.azure.management.iothub.v2018_12_01.RegistryStatistics; +import com.microsoft.azure.management.iothub.v2018_12_01.IotHubSkuDescription; +import com.microsoft.azure.management.iothub.v2018_12_01.EventHubConsumerGroupInfo; +import com.microsoft.azure.management.iothub.v2018_12_01.IotHubQuotaMetricInfo; +import com.microsoft.azure.management.iothub.v2018_12_01.TestAllRoutesResult; +import com.microsoft.azure.management.iothub.v2018_12_01.TestRouteResult; +import com.microsoft.azure.management.iothub.v2018_12_01.TestAllRoutesInput; +import com.microsoft.azure.management.iothub.v2018_12_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).map(new Func1 () { + @Override + public IotHubDescription call(IotHubDescriptionInner inner) { + return 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) + .map(new Func1() { + @Override + public EventHubConsumerGroupInfo call(EventHubConsumerGroupInfoInner inner) { + return 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) + .map(new Func1() { + @Override + public JobResponse call(JobResponseInner inner) { + return 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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/IotHubResourcesInner.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/IotHubResourcesInner.java new file mode 100644 index 000000000000..75ceda564677 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.iothub.v2018_12_01.ErrorDetailsInnerException; +import com.microsoft.azure.management.iothub.v2018_12_01.ExportDevicesRequest; +import com.microsoft.azure.management.iothub.v2018_12_01.ImportDevicesRequest; +import com.microsoft.azure.management.iothub.v2018_12_01.OperationInputs; +import com.microsoft.azure.management.iothub.v2018_12_01.TagsResource; +import com.microsoft.azure.management.iothub.v2018_12_01.TestAllRoutesInput; +import com.microsoft.azure.management.iothub.v2018_12_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.v2018_12_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.v2018_12_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.v2018_12_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.v2018_12_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.v2018_12_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.v2018_12_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.v2018_12_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.v2018_12_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.v2018_12_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.v2018_12_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.v2018_12_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.v2018_12_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.v2018_12_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.v2018_12_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.v2018_12_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.v2018_12_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.v2018_12_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.v2018_12_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.v2018_12_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.v2018_12_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.v2018_12_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.v2018_12_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.v2018_12_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.v2018_12_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.v2018_12_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.v2018_12_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.v2018_12_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.v2018_12_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.v2018_12_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.v2018_12_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.v2018_12_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.v2018_12_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.v2018_12_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.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/IotHubSkuDescriptionImpl.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/IotHubSkuDescriptionImpl.java new file mode 100644 index 000000000000..1fe0bdaeb906 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_01.implementation; + +import com.microsoft.azure.management.iothub.v2018_12_01.IotHubSkuDescription; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.iothub.v2018_12_01.IotHubCapacity; +import com.microsoft.azure.management.iothub.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/IotHubSkuDescriptionInner.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/IotHubSkuDescriptionInner.java new file mode 100644 index 000000000000..65e03a8079da --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_01.implementation; + +import com.microsoft.azure.management.iothub.v2018_12_01.IotHubSkuInfo; +import com.microsoft.azure.management.iothub.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/JobResponseImpl.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/JobResponseImpl.java new file mode 100644 index 000000000000..0dc1fa5520d4 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_01.implementation; + +import com.microsoft.azure.management.iothub.v2018_12_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.v2018_12_01.JobStatus; +import com.microsoft.azure.management.iothub.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/JobResponseInner.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/JobResponseInner.java new file mode 100644 index 000000000000..2d768a56b04a --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_01.implementation; + +import com.microsoft.rest.DateTimeRfc1123; +import org.joda.time.DateTime; +import com.microsoft.azure.management.iothub.v2018_12_01.JobType; +import com.microsoft.azure.management.iothub.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/OperationImpl.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/OperationImpl.java new file mode 100644 index 000000000000..ef8ddedb8517 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_01.implementation; + +import com.microsoft.azure.management.iothub.v2018_12_01.Operation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.iothub.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/OperationInner.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/OperationInner.java new file mode 100644 index 000000000000..343751d0309f --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_01.implementation; + +import com.microsoft.azure.management.iothub.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/OperationsImpl.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/OperationsImpl.java new file mode 100644 index 000000000000..0f38631172e7 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/OperationsImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.iothub.v2018_12_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.iothub.v2018_12_01.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.iothub.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/OperationsInner.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/OperationsInner.java new file mode 100644 index 000000000000..04a5e413e58a --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.iothub.v2018_12_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.v2018_12_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.v2018_12_01.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the available 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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/PageImpl.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/PageImpl.java new file mode 100644 index 000000000000..9537e6861cc5 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2018_12_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/PageImpl1.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/PageImpl1.java new file mode 100644 index 000000000000..e3c0cf11d452 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class 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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/RegistryStatisticsImpl.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/RegistryStatisticsImpl.java new file mode 100644 index 000000000000..19b31ff3b637 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_01.implementation; + +import com.microsoft.azure.management.iothub.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/RegistryStatisticsInner.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/RegistryStatisticsInner.java new file mode 100644 index 000000000000..7e084e1d9626 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/ResourceProviderCommonsImpl.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/ResourceProviderCommonsImpl.java new file mode 100644 index 000000000000..bb73b7f2102a --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.iothub.v2018_12_01.ResourceProviderCommons; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.iothub.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/ResourceProviderCommonsInner.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/ResourceProviderCommonsInner.java new file mode 100644 index 000000000000..d4c1987a5f21 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.iothub.v2018_12_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.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/SharedAccessSignatureAuthorizationRuleImpl.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/SharedAccessSignatureAuthorizationRuleImpl.java new file mode 100644 index 000000000000..94d58ce9fd8f --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_01.implementation; + +import com.microsoft.azure.management.iothub.v2018_12_01.SharedAccessSignatureAuthorizationRule; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.iothub.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/SharedAccessSignatureAuthorizationRuleInner.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/SharedAccessSignatureAuthorizationRuleInner.java new file mode 100644 index 000000000000..649b305fc527 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_01.implementation; + +import com.microsoft.azure.management.iothub.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/TestAllRoutesResultImpl.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/TestAllRoutesResultImpl.java new file mode 100644 index 000000000000..8bcbed7925cc --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_01.implementation; + +import com.microsoft.azure.management.iothub.v2018_12_01.TestAllRoutesResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.iothub.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/TestAllRoutesResultInner.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/TestAllRoutesResultInner.java new file mode 100644 index 000000000000..dd0785f104af --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.iothub.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/TestRouteResultImpl.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/TestRouteResultImpl.java new file mode 100644 index 000000000000..26dce14d42e5 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_01.implementation; + +import com.microsoft.azure.management.iothub.v2018_12_01.TestRouteResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.iothub.v2018_12_01.TestRouteResultDetails; +import com.microsoft.azure.management.iothub.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/TestRouteResultInner.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/TestRouteResultInner.java new file mode 100644 index 000000000000..88e5f9af8e67 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_01.implementation; + +import com.microsoft.azure.management.iothub.v2018_12_01.TestResultStatus; +import com.microsoft.azure.management.iothub.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/UserSubscriptionQuotaImpl.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/UserSubscriptionQuotaImpl.java new file mode 100644 index 000000000000..a5f7518113d1 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_01.implementation; + +import com.microsoft.azure.management.iothub.v2018_12_01.UserSubscriptionQuota; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.iothub.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/UserSubscriptionQuotaInner.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/UserSubscriptionQuotaInner.java new file mode 100644 index 000000000000..978b6fcfb2da --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_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.v2018_12_01.implementation; + +import com.microsoft.azure.management.iothub.v2018_12_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/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/package-info.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/package-info.java new file mode 100644 index 000000000000..5b75f0bef136 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/implementation/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for IotHubClient. + * Use this API to manage the IoT hubs in your Azure subscription. + */ +package com.microsoft.azure.management.iothub.v2018_12_01.implementation; diff --git a/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/package-info.java b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/package-info.java new file mode 100644 index 000000000000..896add0327d7 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for IotHubClient. + * Use this API to manage the IoT hubs in your Azure subscription. + */ +package com.microsoft.azure.management.iothub.v2018_12_01; diff --git a/iothub/resource-manager/v2018_12_01_preview/pom.xml b/iothub/resource-manager/v2018_12_01_preview/pom.xml new file mode 100644 index 000000000000..936184b778a0 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.iothub.v2018_12_01_preview + + com.microsoft.azure + azure-arm-parent + 0.0.2-beta + ../../../pom.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-libraries-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-libraries-for-java + scm:git:git@github.com:Azure/azure-libraries-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/AccessRights.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/AccessRights.java new file mode 100644 index 000000000000..a8fb0ca9da26 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview; + +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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/Capabilities.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/Capabilities.java new file mode 100644 index 000000000000..b368d3d6b3a8 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview; + +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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/CertificateBodyDescription.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/CertificateBodyDescription.java new file mode 100644 index 000000000000..a8e7b5eec752 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview; + +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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/CertificateDescription.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/CertificateDescription.java new file mode 100644 index 000000000000..685e3f679450 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/CertificateDescription.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.v2018_12_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.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.v2018_12_01_preview.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.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. + */ + WithCreate withExistingIotHub(String resourceGroupName, String resourceName); + } + + /** + * 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 { + } + + /** + * Grouping of CertificateDescription update stages. + */ + interface UpdateStages { + } +} diff --git a/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/CertificateListDescription.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/CertificateListDescription.java new file mode 100644 index 000000000000..104b3cf3f0da --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.implementation.DevicesManager; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.implementation.CertificateListDescriptionInner; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.implementation.CertificateDescriptionInner; +import java.util.List; + +/** + * Type representing CertificateListDescription. + */ +public interface CertificateListDescription extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/CertificateProperties.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/CertificateProperties.java new file mode 100644 index 000000000000..e8f44f53dac8 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview; + +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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/CertificatePropertiesWithNonce.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/CertificatePropertiesWithNonce.java new file mode 100644 index 000000000000..d15e48be7d80 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview; + +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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/CertificateVerificationDescription.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/CertificateVerificationDescription.java new file mode 100644 index 000000000000..119d57f65c12 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview; + +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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/CertificateWithNonceDescription.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/CertificateWithNonceDescription.java new file mode 100644 index 000000000000..3cef4881b63b --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.implementation.DevicesManager; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/Certificates.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/Certificates.java new file mode 100644 index 000000000000..94634ad6819f --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/CloudToDeviceProperties.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/CloudToDeviceProperties.java new file mode 100644 index 000000000000..567eb089d29e --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview; + +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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/EndpointHealthData.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/EndpointHealthData.java new file mode 100644 index 000000000000..d33faf87bb01 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.implementation.DevicesManager; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/EndpointHealthStatus.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/EndpointHealthStatus.java new file mode 100644 index 000000000000..83163eabe39f --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview; + +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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/EventHubConsumerGroupInfo.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/EventHubConsumerGroupInfo.java new file mode 100644 index 000000000000..bc93a84f6e5d --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/EventHubConsumerGroupInfo.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.v2018_12_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.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.v2018_12_01_preview.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. + */ + 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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/EventHubProperties.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/EventHubProperties.java new file mode 100644 index 000000000000..37536f7f5d04 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview; + +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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/ExportDevicesRequest.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/ExportDevicesRequest.java new file mode 100644 index 000000000000..c17f1a64af51 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/ExportDevicesRequest.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2018_12_01_preview; + +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; + + /** + * 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; + } + +} diff --git a/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/FallbackRouteProperties.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/FallbackRouteProperties.java new file mode 100644 index 000000000000..a7c886780deb --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview; + +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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/FeedbackProperties.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/FeedbackProperties.java new file mode 100644 index 000000000000..0d21fd64f43f --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview; + +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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/ImportDevicesRequest.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/ImportDevicesRequest.java new file mode 100644 index 000000000000..cd4a7cc22eb4 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/ImportDevicesRequest.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2018_12_01_preview; + +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; + + /** + * 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; + } + +} diff --git a/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/IotHubCapacity.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/IotHubCapacity.java new file mode 100644 index 000000000000..2c9967b97177 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview; + +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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/IotHubDescription.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/IotHubDescription.java new file mode 100644 index 000000000000..c5e61a020f18 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/IotHubDescription.java @@ -0,0 +1,133 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2018_12_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.implementation.DevicesManager; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.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.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 Sku. + */ + interface WithSku { + /** + * Specifies sku. + */ + WithCreate withSku(IotHubSkuInfo sku); + } + + /** + * The stage of the iothubdescription update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the iothubdescription update allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + */ + 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.WithEtag, UpdateStages.WithProperties { + } + + /** + * Grouping of IotHubDescription update stages. + */ + interface UpdateStages { + /** + * The stage of the iothubdescription {0} allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + */ + Update withEtag(String etag); + } + + /** + * The stage of the iothubdescription {0} allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + */ + Update withProperties(IotHubProperties properties); + } + + } +} diff --git a/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/IotHubLocationDescription.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/IotHubLocationDescription.java new file mode 100644 index 000000000000..4f4c6e69c058 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/IotHubLocationDescription.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2018_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Public representation of one of the locations where a resource is + * provisioned. + */ +public class IotHubLocationDescription { + /** + * Azure Geo Regions. + */ + @JsonProperty(value = "location") + private String location; + + /** + * Specific Role assigned to this location. Possible values include: + * 'primary', 'secondary'. + */ + @JsonProperty(value = "role") + private IotHubReplicaRoleType role; + + /** + * Get azure Geo Regions. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set azure Geo Regions. + * + * @param location the location value to set + * @return the IotHubLocationDescription object itself. + */ + public IotHubLocationDescription withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get specific Role assigned to this location. Possible values include: 'primary', 'secondary'. + * + * @return the role value + */ + public IotHubReplicaRoleType role() { + return this.role; + } + + /** + * Set specific Role assigned to this location. 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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/IotHubNameAvailabilityInfo.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/IotHubNameAvailabilityInfo.java new file mode 100644 index 000000000000..aa38652136c4 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.implementation.DevicesManager; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/IotHubNameUnavailabilityReason.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/IotHubNameUnavailabilityReason.java new file mode 100644 index 000000000000..6608453330d9 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview; + +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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/IotHubProperties.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/IotHubProperties.java new file mode 100644 index 000000000000..0fad35611c40 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/IotHubProperties.java @@ -0,0 +1,387 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2018_12_01_preview; + +import java.util.List; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.implementation.SharedAccessSignatureAuthorizationRuleInner; +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; + + /** + * The IP filter rules. + */ + @JsonProperty(value = "ipFilterRules") + private List ipFilterRules; + + /** + * 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 device streams properties of iothub. + */ + @JsonProperty(value = "deviceStreams") + private IotHubPropertiesDeviceStreams deviceStreams; + + /** + * 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") + 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 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 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 device streams properties of iothub. + * + * @return the deviceStreams value + */ + public IotHubPropertiesDeviceStreams deviceStreams() { + return this.deviceStreams; + } + + /** + * Set the device streams properties of iothub. + * + * @param deviceStreams the deviceStreams value to set + * @return the IotHubProperties object itself. + */ + public IotHubProperties withDeviceStreams(IotHubPropertiesDeviceStreams deviceStreams) { + this.deviceStreams = deviceStreams; + 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; + } + + /** + * Set primary and secondary location for iot hub. + * + * @param locations the locations value to set + * @return the IotHubProperties object itself. + */ + public IotHubProperties withLocations(List locations) { + this.locations = locations; + return this; + } + +} diff --git a/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/IotHubPropertiesDeviceStreams.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/IotHubPropertiesDeviceStreams.java new file mode 100644 index 000000000000..37ccd2f1f38b --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/IotHubPropertiesDeviceStreams.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.v2018_12_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The device streams properties of iothub. + */ +public class IotHubPropertiesDeviceStreams { + /** + * List of Device Streams Endpoints. + */ + @JsonProperty(value = "streamingEndpoints") + private List streamingEndpoints; + + /** + * Get list of Device Streams Endpoints. + * + * @return the streamingEndpoints value + */ + public List streamingEndpoints() { + return this.streamingEndpoints; + } + + /** + * Set list of Device Streams Endpoints. + * + * @param streamingEndpoints the streamingEndpoints value to set + * @return the IotHubPropertiesDeviceStreams object itself. + */ + public IotHubPropertiesDeviceStreams withStreamingEndpoints(List streamingEndpoints) { + this.streamingEndpoints = streamingEndpoints; + return this; + } + +} diff --git a/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/IotHubQuotaMetricInfo.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/IotHubQuotaMetricInfo.java new file mode 100644 index 000000000000..f1d531151855 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.implementation.IotHubQuotaMetricInfoInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/IotHubReplicaRoleType.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/IotHubReplicaRoleType.java new file mode 100644 index 000000000000..30433cb2d29b --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview; + +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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/IotHubResources.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/IotHubResources.java new file mode 100644 index 000000000000..ce0ec01ae569 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.IotHubDescription; +import rx.Completable; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.IotHubSkuDescription; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.EventHubConsumerGroupInfo; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.JobResponse; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/IotHubScaleType.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/IotHubScaleType.java new file mode 100644 index 000000000000..846f3dd61d0c --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview; + +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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/IotHubSku.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/IotHubSku.java new file mode 100644 index 000000000000..2e4cba29351d --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview; + +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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/IotHubSkuDescription.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/IotHubSkuDescription.java new file mode 100644 index 000000000000..2c59210ea04e --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.implementation.IotHubSkuDescriptionInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/IotHubSkuInfo.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/IotHubSkuInfo.java new file mode 100644 index 000000000000..faf8c0d731c0 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview; + +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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/IotHubSkuTier.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/IotHubSkuTier.java new file mode 100644 index 000000000000..2982d614cde6 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview; + +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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/IpFilterActionType.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/IpFilterActionType.java new file mode 100644 index 000000000000..aa452f933626 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview; + +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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/IpFilterRule.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/IpFilterRule.java new file mode 100644 index 000000000000..31c2dec0a51e --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview; + +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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/JobResponse.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/JobResponse.java new file mode 100644 index 000000000000..446528e2034a --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.implementation.JobResponseInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/JobStatus.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/JobStatus.java new file mode 100644 index 000000000000..bdbc4a3d7c0d --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview; + +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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/JobType.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/JobType.java new file mode 100644 index 000000000000..b4c5b4b036a2 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview; + +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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/MatchedRoute.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/MatchedRoute.java new file mode 100644 index 000000000000..9100d34d8c89 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview; + +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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/MessagingEndpointProperties.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/MessagingEndpointProperties.java new file mode 100644 index 000000000000..25c5b015e584 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview; + +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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/Name.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/Name.java new file mode 100644 index 000000000000..88e609d52e34 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview; + +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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/Operation.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/Operation.java new file mode 100644 index 000000000000..6e80d96b8230 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/Operation.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2018_12_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.implementation.DevicesManager; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.implementation.OperationInner; + +/** + * Type representing Operation. + */ +public interface Operation extends HasInner, HasManager { + /** + * @return the display value. + */ + OperationDisplay display(); + + /** + * @return the name value. + */ + String name(); + +} diff --git a/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/OperationDisplay.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/OperationDisplay.java new file mode 100644 index 000000000000..48a2dbe8fe31 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview; + +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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/OperationInputs.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/OperationInputs.java new file mode 100644 index 000000000000..1b2149206306 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview; + +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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/OperationMonitoringLevel.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/OperationMonitoringLevel.java new file mode 100644 index 000000000000..51219d72098b --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/OperationMonitoringLevel.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.v2018_12_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for OperationMonitoringLevel. + */ +public final class OperationMonitoringLevel extends ExpandableStringEnum { + /** Static value None for OperationMonitoringLevel. */ + public static final OperationMonitoringLevel NONE = fromString("None"); + + /** Static value Error for OperationMonitoringLevel. */ + public static final OperationMonitoringLevel ERROR = fromString("Error"); + + /** Static value Information for OperationMonitoringLevel. */ + public static final OperationMonitoringLevel INFORMATION = fromString("Information"); + + /** Static value Error, Information for OperationMonitoringLevel. */ + public static final OperationMonitoringLevel ERROR_INFORMATION = fromString("Error, Information"); + + /** + * Creates or finds a OperationMonitoringLevel from its string representation. + * @param name a name to look for + * @return the corresponding OperationMonitoringLevel + */ + @JsonCreator + public static OperationMonitoringLevel fromString(String name) { + return fromString(name, OperationMonitoringLevel.class); + } + + /** + * @return known OperationMonitoringLevel values + */ + public static Collection values() { + return values(OperationMonitoringLevel.class); + } +} diff --git a/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/Operations.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/Operations.java new file mode 100644 index 000000000000..c24ef4dced59 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/Operations.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2018_12_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/OperationsMonitoringProperties.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/OperationsMonitoringProperties.java new file mode 100644 index 000000000000..07ba9a301ce1 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/OperationsMonitoringProperties.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.v2018_12_01_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The operations monitoring properties for the IoT hub. The possible keys to + * the dictionary are Connections, DeviceTelemetry, C2DCommands, + * DeviceIdentityOperations, FileUploadOperations, Routes, D2CTwinOperations, + * C2DTwinOperations, TwinQueries, JobsOperations, DirectMethods. + */ +public class OperationsMonitoringProperties { + /** + * The events property. + */ + @JsonProperty(value = "events") + private Map events; + + /** + * Get the events value. + * + * @return the events value + */ + public Map events() { + return this.events; + } + + /** + * Set the events value. + * + * @param events the events value to set + * @return the OperationsMonitoringProperties object itself. + */ + public OperationsMonitoringProperties withEvents(Map events) { + this.events = events; + return this; + } + +} diff --git a/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/RegistryStatistics.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/RegistryStatistics.java new file mode 100644 index 000000000000..ebd5c85ef538 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.implementation.DevicesManager; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/ResourceProviderCommons.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/ResourceProviderCommons.java new file mode 100644 index 000000000000..dad8e5a99aec --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/RouteCompilationError.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/RouteCompilationError.java new file mode 100644 index 000000000000..417e1ff6c67b --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview; + +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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/RouteErrorPosition.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/RouteErrorPosition.java new file mode 100644 index 000000000000..334324838e4a --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview; + +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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/RouteErrorRange.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/RouteErrorRange.java new file mode 100644 index 000000000000..b4fb1a556388 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview; + +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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/RouteErrorSeverity.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/RouteErrorSeverity.java new file mode 100644 index 000000000000..ff34930e4303 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview; + +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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/RouteProperties.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/RouteProperties.java new file mode 100644 index 000000000000..c27a270bc7d1 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview; + +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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/RoutingEndpoints.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/RoutingEndpoints.java new file mode 100644 index 000000000000..756b5050a9e3 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview; + +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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/RoutingEventHubProperties.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/RoutingEventHubProperties.java new file mode 100644 index 000000000000..87c79803c586 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/RoutingEventHubProperties.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.v2018_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties related to an event hub endpoint. + */ +public class RoutingEventHubProperties { + /** + * The connection string of the event hub endpoint. + */ + @JsonProperty(value = "connectionString", required = true) + private String connectionString; + + /** + * 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 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 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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/RoutingMessage.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/RoutingMessage.java new file mode 100644 index 000000000000..fc9e61ed99bf --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview; + +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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/RoutingProperties.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/RoutingProperties.java new file mode 100644 index 000000000000..9d00127965ce --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/RoutingProperties.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.v2018_12_01_preview; + +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; + + /** + * 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; + } + +} diff --git a/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/RoutingServiceBusQueueEndpointProperties.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/RoutingServiceBusQueueEndpointProperties.java new file mode 100644 index 000000000000..1bb470ce80b0 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/RoutingServiceBusQueueEndpointProperties.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.v2018_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties related to service bus queue endpoint types. + */ +public class RoutingServiceBusQueueEndpointProperties { + /** + * The connection string of the service bus queue endpoint. + */ + @JsonProperty(value = "connectionString", required = true) + private String connectionString; + + /** + * 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 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 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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/RoutingServiceBusTopicEndpointProperties.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/RoutingServiceBusTopicEndpointProperties.java new file mode 100644 index 000000000000..b3bb0de0a53f --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/RoutingServiceBusTopicEndpointProperties.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.v2018_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties related to service bus topic endpoint types. + */ +public class RoutingServiceBusTopicEndpointProperties { + /** + * The connection string of the service bus topic endpoint. + */ + @JsonProperty(value = "connectionString", required = true) + private String connectionString; + + /** + * 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 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 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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/RoutingSource.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/RoutingSource.java new file mode 100644 index 000000000000..ca32d3413669 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview; + +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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/RoutingStorageContainerProperties.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/RoutingStorageContainerProperties.java new file mode 100644 index 000000000000..3a0dbf090694 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/RoutingStorageContainerProperties.java @@ -0,0 +1,262 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2018_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties related to a storage container endpoint. + */ +public class RoutingStorageContainerProperties { + /** + * The connection string of the storage account. + */ + @JsonProperty(value = "connectionString", required = true) + private String connectionString; + + /** + * 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 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 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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/RoutingTwin.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/RoutingTwin.java new file mode 100644 index 000000000000..ea4f4466a9dc --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview; + +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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/RoutingTwinProperties.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/RoutingTwinProperties.java new file mode 100644 index 000000000000..783999f220c3 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview; + +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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/SharedAccessSignatureAuthorizationRule.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/SharedAccessSignatureAuthorizationRule.java new file mode 100644 index 000000000000..043d531bbda0 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.implementation.DevicesManager; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/StorageEndpointProperties.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/StorageEndpointProperties.java new file mode 100644 index 000000000000..6a3386256e6b --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/StorageEndpointProperties.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.v2018_12_01_preview; + +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; + + /** + * 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; + } + +} diff --git a/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/TagsResource.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/TagsResource.java new file mode 100644 index 000000000000..7dfe25a18b1c --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview; + +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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/TestAllRoutesInput.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/TestAllRoutesInput.java new file mode 100644 index 000000000000..b1fde6d12d16 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview; + +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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/TestAllRoutesResult.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/TestAllRoutesResult.java new file mode 100644 index 000000000000..fb9d6dcb8ea9 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.implementation.DevicesManager; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.implementation.TestAllRoutesResultInner; +import java.util.List; + +/** + * Type representing TestAllRoutesResult. + */ +public interface TestAllRoutesResult extends HasInner, HasManager { + /** + * @return the routes value. + */ + List routes(); + +} diff --git a/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/TestResultStatus.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/TestResultStatus.java new file mode 100644 index 000000000000..78b13d2167f0 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview; + +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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/TestRouteInput.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/TestRouteInput.java new file mode 100644 index 000000000000..1c7adae0a990 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview; + +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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/TestRouteResult.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/TestRouteResult.java new file mode 100644 index 000000000000..58d217832d50 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.implementation.DevicesManager; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/TestRouteResultDetails.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/TestRouteResultDetails.java new file mode 100644 index 000000000000..d71c5049ce38 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview; + +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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/UserSubscriptionQuota.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/UserSubscriptionQuota.java new file mode 100644 index 000000000000..e6da8445c465 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.implementation.DevicesManager; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/CertificateDescriptionImpl.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/CertificateDescriptionImpl.java new file mode 100644 index 000000000000..20243a1f7cde --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/CertificateDescriptionImpl.java @@ -0,0 +1,105 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2018_12_01_preview.implementation; + +import com.microsoft.azure.management.iothub.v2018_12_01_preview.CertificateDescription; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.CertificateProperties; + +class CertificateDescriptionImpl extends CreatableUpdatableImpl implements CertificateDescription, CertificateDescription.Definition, CertificateDescription.Update { + private final DevicesManager manager; + private String resourceGroupName; + private String resourceName; + private String certificateName; + + 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(); + // resource ancestor names + 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) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + CertificatesInner client = this.manager().inner().certificates(); + return client.createOrUpdateAsync(this.resourceGroupName, this.resourceName, this.certificateName) + .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; + } + +} diff --git a/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/CertificateDescriptionInner.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/CertificateDescriptionInner.java new file mode 100644 index 000000000000..524ec09f2260 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview.implementation; + +import com.microsoft.azure.management.iothub.v2018_12_01_preview.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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/CertificateListDescriptionImpl.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/CertificateListDescriptionImpl.java new file mode 100644 index 000000000000..a03036f56e07 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview.implementation; + +import com.microsoft.azure.management.iothub.v2018_12_01_preview.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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/CertificateListDescriptionInner.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/CertificateListDescriptionInner.java new file mode 100644 index 000000000000..384f9a5d788f --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview.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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/CertificateWithNonceDescriptionImpl.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/CertificateWithNonceDescriptionImpl.java new file mode 100644 index 000000000000..9cee873ca6d2 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview.implementation; + +import com.microsoft.azure.management.iothub.v2018_12_01_preview.CertificateWithNonceDescription; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/CertificateWithNonceDescriptionInner.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/CertificateWithNonceDescriptionInner.java new file mode 100644 index 000000000000..b53243a922ea --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview.implementation; + +import com.microsoft.azure.management.iothub.v2018_12_01_preview.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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/CertificatesImpl.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/CertificatesImpl.java new file mode 100644 index 000000000000..525a5dd9d590 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/CertificatesImpl.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.v2018_12_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.Certificates; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.CertificateListDescription; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.CertificateWithNonceDescription; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.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) + .map(new Func1() { + @Override + public CertificateDescription call(CertificateDescriptionInner inner) { + return 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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/CertificatesInner.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/CertificatesInner.java new file mode 100644 index 000000000000..fb97c5db0656 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.CertificateBodyDescription; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.CertificateVerificationDescription; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.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.v2018_12_01_preview.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.v2018_12_01_preview.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.v2018_12_01_preview.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.v2018_12_01_preview.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.v2018_12_01_preview.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.v2018_12_01_preview.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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/DevicesManager.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/DevicesManager.java new file mode 100644 index 000000000000..c7852ea133b9 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/DevicesManager.java @@ -0,0 +1,135 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2018_12_01_preview.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.Operations; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.IotHubResources; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.ResourceProviderCommons; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.Certificates; +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; + /** + * 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; + } + + /** + * 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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/EndpointHealthDataImpl.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/EndpointHealthDataImpl.java new file mode 100644 index 000000000000..9937827d7a62 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview.implementation; + +import com.microsoft.azure.management.iothub.v2018_12_01_preview.EndpointHealthData; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/EndpointHealthDataInner.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/EndpointHealthDataInner.java new file mode 100644 index 000000000000..f6e06b427e9d --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview.implementation; + +import com.microsoft.azure.management.iothub.v2018_12_01_preview.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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/ErrorDetailsInner.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/ErrorDetailsInner.java new file mode 100644 index 000000000000..737a70fb649c --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview.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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/ErrorDetailsInnerException.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/ErrorDetailsInnerException.java new file mode 100644 index 000000000000..356919dc9117 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview.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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/EventHubConsumerGroupInfoImpl.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/EventHubConsumerGroupInfoImpl.java new file mode 100644 index 000000000000..dca67799eb98 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview.implementation; + +import com.microsoft.azure.management.iothub.v2018_12_01_preview.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(); + // resource ancestor names + 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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/EventHubConsumerGroupInfoInner.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/EventHubConsumerGroupInfoInner.java new file mode 100644 index 000000000000..2bf32852e3ca --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview.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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/IdParsingUtils.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/IdParsingUtils.java new file mode 100644 index 000000000000..f11a58d5c5dd --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2018_12_01_preview.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/IotHubClientImpl.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/IotHubClientImpl.java new file mode 100644 index 000000000000..91d83fe76b23 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/IotHubClientImpl.java @@ -0,0 +1,238 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2018_12_01_preview.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the 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; + } + + /** Gets or sets the preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public IotHubClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public IotHubClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public 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; + } + + /** + * 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 = "2018-12-01-preview"; + 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.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s)", super.userAgent(), "IotHubClient", "2018-12-01-preview"); + } +} diff --git a/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/IotHubDescriptionImpl.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/IotHubDescriptionImpl.java new file mode 100644 index 000000000000..78ed8356dc9f --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/IotHubDescriptionImpl.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.v2018_12_01_preview.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.IotHubDescription; +import rx.Observable; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.IotHubProperties; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.IotHubSkuInfo; + +class IotHubDescriptionImpl extends GroupableResourceCoreImpl implements IotHubDescription, IotHubDescription.Definition, IotHubDescription.Update { + 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()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + IotHubResourcesInner client = this.manager().inner().iotHubResources(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .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 withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public IotHubDescriptionImpl withProperties(IotHubProperties properties) { + this.inner().withProperties(properties); + return this; + } + +} diff --git a/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/IotHubDescriptionInner.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/IotHubDescriptionInner.java new file mode 100644 index 000000000000..8a367061b125 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview.implementation; + +import com.microsoft.azure.management.iothub.v2018_12_01_preview.IotHubProperties; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/IotHubNameAvailabilityInfoImpl.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/IotHubNameAvailabilityInfoImpl.java new file mode 100644 index 000000000000..21088652d66d --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview.implementation; + +import com.microsoft.azure.management.iothub.v2018_12_01_preview.IotHubNameAvailabilityInfo; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/IotHubNameAvailabilityInfoInner.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/IotHubNameAvailabilityInfoInner.java new file mode 100644 index 000000000000..778fa598275a --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview.implementation; + +import com.microsoft.azure.management.iothub.v2018_12_01_preview.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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/IotHubQuotaMetricInfoImpl.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/IotHubQuotaMetricInfoImpl.java new file mode 100644 index 000000000000..f43b25f7490d --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview.implementation; + +import com.microsoft.azure.management.iothub.v2018_12_01_preview.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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/IotHubQuotaMetricInfoInner.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/IotHubQuotaMetricInfoInner.java new file mode 100644 index 000000000000..09923832461f --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview.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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/IotHubResourcesImpl.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/IotHubResourcesImpl.java new file mode 100644 index 000000000000..ef2ef967d371 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/IotHubResourcesImpl.java @@ -0,0 +1,379 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.v2018_12_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.IotHubResources; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.IotHubDescription; +import com.microsoft.azure.Page; +import rx.Completable; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.EndpointHealthData; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.SharedAccessSignatureAuthorizationRule; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.JobResponse; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.IotHubNameAvailabilityInfo; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.ExportDevicesRequest; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.ImportDevicesRequest; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.RegistryStatistics; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.IotHubSkuDescription; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.EventHubConsumerGroupInfo; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.IotHubQuotaMetricInfo; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.TestAllRoutesResult; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.TestRouteResult; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.TestAllRoutesInput; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.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).map(new Func1 () { + @Override + public IotHubDescription call(IotHubDescriptionInner inner) { + return 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) + .map(new Func1() { + @Override + public EventHubConsumerGroupInfo call(EventHubConsumerGroupInfoInner inner) { + return 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) + .map(new Func1() { + @Override + public JobResponse call(JobResponseInner inner) { + return 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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/IotHubResourcesInner.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/IotHubResourcesInner.java new file mode 100644 index 000000000000..3ea1ebbedc51 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.ErrorDetailsInnerException; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.ExportDevicesRequest; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.ImportDevicesRequest; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.OperationInputs; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.TagsResource; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.TestAllRoutesInput; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.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.v2018_12_01_preview.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.v2018_12_01_preview.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.v2018_12_01_preview.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.v2018_12_01_preview.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.v2018_12_01_preview.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.v2018_12_01_preview.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.v2018_12_01_preview.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.v2018_12_01_preview.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.v2018_12_01_preview.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.v2018_12_01_preview.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.v2018_12_01_preview.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.v2018_12_01_preview.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.v2018_12_01_preview.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.v2018_12_01_preview.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.v2018_12_01_preview.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.v2018_12_01_preview.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.v2018_12_01_preview.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.v2018_12_01_preview.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.v2018_12_01_preview.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.v2018_12_01_preview.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.v2018_12_01_preview.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.v2018_12_01_preview.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.v2018_12_01_preview.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.v2018_12_01_preview.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.v2018_12_01_preview.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.v2018_12_01_preview.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.v2018_12_01_preview.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.v2018_12_01_preview.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.v2018_12_01_preview.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.v2018_12_01_preview.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.v2018_12_01_preview.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.v2018_12_01_preview.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.v2018_12_01_preview.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.v2018_12_01_preview.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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/IotHubSkuDescriptionImpl.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/IotHubSkuDescriptionImpl.java new file mode 100644 index 000000000000..64e55d787379 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview.implementation; + +import com.microsoft.azure.management.iothub.v2018_12_01_preview.IotHubSkuDescription; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.IotHubCapacity; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/IotHubSkuDescriptionInner.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/IotHubSkuDescriptionInner.java new file mode 100644 index 000000000000..de7deee93b80 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview.implementation; + +import com.microsoft.azure.management.iothub.v2018_12_01_preview.IotHubSkuInfo; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/JobResponseImpl.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/JobResponseImpl.java new file mode 100644 index 000000000000..46ac15e57583 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview.implementation; + +import com.microsoft.azure.management.iothub.v2018_12_01_preview.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.v2018_12_01_preview.JobStatus; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/JobResponseInner.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/JobResponseInner.java new file mode 100644 index 000000000000..83d21e69b5fc --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview.implementation; + +import com.microsoft.rest.DateTimeRfc1123; +import org.joda.time.DateTime; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.JobType; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/OperationImpl.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/OperationImpl.java new file mode 100644 index 000000000000..22878ffd964b --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/OperationImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2018_12_01_preview.implementation; + +import com.microsoft.azure.management.iothub.v2018_12_01_preview.Operation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/OperationInner.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/OperationInner.java new file mode 100644 index 000000000000..49958ab6862e --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview.implementation; + +import com.microsoft.azure.management.iothub.v2018_12_01_preview.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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/OperationsImpl.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/OperationsImpl.java new file mode 100644 index 000000000000..fbb5e818d5bb --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/OperationsImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.iothub.v2018_12_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/OperationsInner.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/OperationsInner.java new file mode 100644 index 000000000000..e2dd28f2c839 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/OperationsInner.java @@ -0,0 +1,283 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2018_12_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.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.v2018_12_01_preview.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.v2018_12_01_preview.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the available 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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/PageImpl.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/PageImpl.java new file mode 100644 index 000000000000..dbd697ece7ab --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iothub.v2018_12_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/PageImpl1.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/PageImpl1.java new file mode 100644 index 000000000000..cc6da610942a --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class 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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/RegistryStatisticsImpl.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/RegistryStatisticsImpl.java new file mode 100644 index 000000000000..b8575c41b876 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview.implementation; + +import com.microsoft.azure.management.iothub.v2018_12_01_preview.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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/RegistryStatisticsInner.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/RegistryStatisticsInner.java new file mode 100644 index 000000000000..63ddd63c22b1 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview.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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/ResourceProviderCommonsImpl.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/ResourceProviderCommonsImpl.java new file mode 100644 index 000000000000..0d0ad91062f8 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.ResourceProviderCommons; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/ResourceProviderCommonsInner.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/ResourceProviderCommonsInner.java new file mode 100644 index 000000000000..74d882497dee --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.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.v2018_12_01_preview.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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/SharedAccessSignatureAuthorizationRuleImpl.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/SharedAccessSignatureAuthorizationRuleImpl.java new file mode 100644 index 000000000000..6932d1053e17 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview.implementation; + +import com.microsoft.azure.management.iothub.v2018_12_01_preview.SharedAccessSignatureAuthorizationRule; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/SharedAccessSignatureAuthorizationRuleInner.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/SharedAccessSignatureAuthorizationRuleInner.java new file mode 100644 index 000000000000..d683365cc1c2 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview.implementation; + +import com.microsoft.azure.management.iothub.v2018_12_01_preview.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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/TestAllRoutesResultImpl.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/TestAllRoutesResultImpl.java new file mode 100644 index 000000000000..4ce955444e43 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview.implementation; + +import com.microsoft.azure.management.iothub.v2018_12_01_preview.TestAllRoutesResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/TestAllRoutesResultInner.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/TestAllRoutesResultInner.java new file mode 100644 index 000000000000..6a20b3be698b --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/TestRouteResultImpl.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/TestRouteResultImpl.java new file mode 100644 index 000000000000..744b99409da4 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview.implementation; + +import com.microsoft.azure.management.iothub.v2018_12_01_preview.TestRouteResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.TestRouteResultDetails; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/TestRouteResultInner.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/TestRouteResultInner.java new file mode 100644 index 000000000000..947fedacd581 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview.implementation; + +import com.microsoft.azure.management.iothub.v2018_12_01_preview.TestResultStatus; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/UserSubscriptionQuotaImpl.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/UserSubscriptionQuotaImpl.java new file mode 100644 index 000000000000..753bb532081b --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview.implementation; + +import com.microsoft.azure.management.iothub.v2018_12_01_preview.UserSubscriptionQuota; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.iothub.v2018_12_01_preview.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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/UserSubscriptionQuotaInner.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/UserSubscriptionQuotaInner.java new file mode 100644 index 000000000000..e8bff853efe4 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/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.v2018_12_01_preview.implementation; + +import com.microsoft.azure.management.iothub.v2018_12_01_preview.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/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/package-info.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/package-info.java new file mode 100644 index 000000000000..572e66085333 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/implementation/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for IotHubClient. + * Use this API to manage the IoT hubs in your Azure subscription. + */ +package com.microsoft.azure.management.iothub.v2018_12_01_preview.implementation; diff --git a/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/package-info.java b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/package-info.java new file mode 100644 index 000000000000..bdd332685b30 --- /dev/null +++ b/iothub/resource-manager/v2018_12_01_preview/src/main/java/com/microsoft/azure/management/iothub/v2018_12_01_preview/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for IotHubClient. + * Use this API to manage the IoT hubs in your Azure subscription. + */ +package com.microsoft.azure.management.iothub.v2018_12_01_preview;