From b44ae5f15d91df2bd3c017c8b628db7856375841 Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Thu, 7 May 2020 07:38:43 +0000 Subject: [PATCH] Generated from 41ef7a4e015eb88994a8d731d7e14363ba28ab15 Keyvault properties to Array --- .../mgmt-v2018_01_01_preview/pom.xml | 4 +- .../v2018_01_01_preview/AccessKeys.java | 55 + .../v2018_01_01_preview/AccessRights.java | 44 + .../ArmDisasterRecovery.java | 161 ++ .../CaptureDescription.java | 179 ++ .../CheckNameAvailabilityParameter.java | 43 + .../CheckNameAvailabilityResult.java | 35 + .../v2018_01_01_preview/Clusters.java | 2 +- .../v2018_01_01_preview/Configurations.java | 4 +- .../v2018_01_01_preview/ConsumerGroup.java | 129 + .../v2018_01_01_preview/ConsumerGroups.java | 56 + .../v2018_01_01_preview/Destination.java | 126 + ...overyConfigNamespaceAuthorizationRule.java | 43 + .../DisasterRecoveryConfigs.java | 122 + .../v2018_01_01_preview/EHNamespace.java | 91 +- .../EncodingCaptureDescription.java | 53 + .../v2018_01_01_preview/Encryption.java | 71 + .../v2018_01_01_preview/EntityStatus.java | 74 + .../v2018_01_01_preview/ErrorResponse.java | 2 +- .../v2018_01_01_preview/EventHubs.java | 121 + .../v2018_01_01_preview/Eventhub.java | 221 ++ .../EventhubNamespaceAuthorizationRule.java | 119 + .../v2018_01_01_preview/Identity.java | 96 + .../v2018_01_01_preview/IdentityType.java | 50 + .../v2018_01_01_preview/IpFilterRule.java | 2 +- .../v2018_01_01_preview/KeySource.java | 50 + .../v2018_01_01_preview/KeyType.java | 53 + .../KeyVaultProperties.java | 95 + .../v2018_01_01_preview/MessagingRegions.java | 51 + .../MessagingRegionsProperties.java | 47 + .../NamespaceAuthorizationRule.java | 118 + .../v2018_01_01_preview/Namespaces.java | 88 +- .../ProvisioningStateDR.java | 56 + .../RegenerateAccessKeyParameters.java | 72 + .../v2018_01_01_preview/Regions.java | 28 + .../RoleDisasterRecovery.java | 56 + .../UnavailableReason.java | 65 + .../VirtualNetworkRule.java | 2 +- .../implementation/AccessKeysImpl.java | 61 + .../implementation/AccessKeysInner.java | 124 + .../ArmDisasterRecoveryImpl.java | 133 + .../ArmDisasterRecoveryInner.java | 124 + .../AuthorizationRuleInner.java | 48 + .../CheckNameAvailabilityResultImpl.java | 42 + .../CheckNameAvailabilityResultInner.java | 88 + .../implementation/ClustersInner.java | 168 +- .../implementation/ConfigurationsInner.java | 46 +- .../implementation/ConsumerGroupImpl.java | 125 + .../implementation/ConsumerGroupInner.java | 80 + .../implementation/ConsumerGroupsImpl.java | 85 + .../implementation/ConsumerGroupsInner.java | 853 ++++++ ...yConfigNamespaceAuthorizationRuleImpl.java | 67 + .../DisasterRecoveryConfigsImpl.java | 171 ++ .../DisasterRecoveryConfigsInner.java | 1338 ++++++++++ .../implementation/EHNamespaceImpl.java | 35 + .../implementation/EHNamespaceInner.java | 80 + .../EventHubManagementClientImpl.java | 281 ++ .../implementation/EventHubsImpl.java | 174 ++ .../implementation/EventHubsInner.java | 1504 +++++++++++ .../implementation/EventHubsManager.java | 90 +- .../implementation/EventhubImpl.java | 157 ++ .../implementation/EventhubInner.java | 177 ++ ...venthubNamespaceAuthorizationRuleImpl.java | 116 + .../implementation/MessagingRegionsImpl.java | 58 + .../implementation/MessagingRegionsInner.java | 47 + .../NamespaceAuthorizationRuleImpl.java | 113 + .../implementation/NamespacesImpl.java | 121 +- .../implementation/NamespacesInner.java | 2308 +++++++++++------ .../implementation/OperationsInner.java | 28 +- .../implementation/PageImpl.java | 2 +- .../implementation/PageImpl1.java | 2 +- .../implementation/RegionsImpl.java | 49 + .../implementation/RegionsInner.java | 293 +++ .../implementation/package-info.java | 3 +- .../v2018_01_01_preview/package-info.java | 3 +- 75 files changed, 10930 insertions(+), 948 deletions(-) create mode 100644 sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/AccessKeys.java create mode 100644 sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/AccessRights.java create mode 100644 sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/ArmDisasterRecovery.java create mode 100644 sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/CaptureDescription.java create mode 100644 sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/CheckNameAvailabilityParameter.java create mode 100644 sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/CheckNameAvailabilityResult.java create mode 100644 sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/ConsumerGroup.java create mode 100644 sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/ConsumerGroups.java create mode 100644 sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/Destination.java create mode 100644 sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/DisasterRecoveryConfigNamespaceAuthorizationRule.java create mode 100644 sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/DisasterRecoveryConfigs.java create mode 100644 sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/EncodingCaptureDescription.java create mode 100644 sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/Encryption.java create mode 100644 sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/EntityStatus.java create mode 100644 sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/EventHubs.java create mode 100644 sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/Eventhub.java create mode 100644 sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/EventhubNamespaceAuthorizationRule.java create mode 100644 sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/Identity.java create mode 100644 sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/IdentityType.java create mode 100644 sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/KeySource.java create mode 100644 sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/KeyType.java create mode 100644 sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/KeyVaultProperties.java create mode 100644 sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/MessagingRegions.java create mode 100644 sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/MessagingRegionsProperties.java create mode 100644 sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/NamespaceAuthorizationRule.java create mode 100644 sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/ProvisioningStateDR.java create mode 100644 sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/RegenerateAccessKeyParameters.java create mode 100644 sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/Regions.java create mode 100644 sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/RoleDisasterRecovery.java create mode 100644 sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/UnavailableReason.java create mode 100644 sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/AccessKeysImpl.java create mode 100644 sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/AccessKeysInner.java create mode 100644 sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/ArmDisasterRecoveryImpl.java create mode 100644 sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/ArmDisasterRecoveryInner.java create mode 100644 sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/AuthorizationRuleInner.java create mode 100644 sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/CheckNameAvailabilityResultImpl.java create mode 100644 sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/CheckNameAvailabilityResultInner.java create mode 100644 sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/ConsumerGroupImpl.java create mode 100644 sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/ConsumerGroupInner.java create mode 100644 sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/ConsumerGroupsImpl.java create mode 100644 sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/ConsumerGroupsInner.java create mode 100644 sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/DisasterRecoveryConfigNamespaceAuthorizationRuleImpl.java create mode 100644 sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/DisasterRecoveryConfigsImpl.java create mode 100644 sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/DisasterRecoveryConfigsInner.java create mode 100644 sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/EventHubManagementClientImpl.java create mode 100644 sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/EventHubsImpl.java create mode 100644 sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/EventHubsInner.java create mode 100644 sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/EventhubImpl.java create mode 100644 sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/EventhubInner.java create mode 100644 sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/EventhubNamespaceAuthorizationRuleImpl.java create mode 100644 sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/MessagingRegionsImpl.java create mode 100644 sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/MessagingRegionsInner.java create mode 100644 sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/NamespaceAuthorizationRuleImpl.java create mode 100644 sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/RegionsImpl.java create mode 100644 sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/RegionsInner.java diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/pom.xml b/sdk/eventhubs/mgmt-v2018_01_01_preview/pom.xml index d58fee6e6779f..b702a03e5233f 100644 --- a/sdk/eventhubs/mgmt-v2018_01_01_preview/pom.xml +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 1.2.0 + 1.1.0 ../../../pom.management.xml azure-mgmt-eventhubs @@ -71,6 +71,8 @@ azure-arm-client-runtime test-jar test + + 1.6.5 diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/AccessKeys.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/AccessKeys.java new file mode 100644 index 0000000000000..27e7706789bb0 --- /dev/null +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/AccessKeys.java @@ -0,0 +1,55 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventhubs.v2018_01_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.implementation.EventHubsManager; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.implementation.AccessKeysInner; + +/** + * Type representing AccessKeys. + */ +public interface AccessKeys extends HasInner, HasManager { + /** + * @return the aliasPrimaryConnectionString value. + */ + String aliasPrimaryConnectionString(); + + /** + * @return the aliasSecondaryConnectionString value. + */ + String aliasSecondaryConnectionString(); + + /** + * @return the keyName value. + */ + String keyName(); + + /** + * @return the primaryConnectionString value. + */ + String primaryConnectionString(); + + /** + * @return the primaryKey value. + */ + String primaryKey(); + + /** + * @return the secondaryConnectionString value. + */ + String secondaryConnectionString(); + + /** + * @return the secondaryKey value. + */ + String secondaryKey(); + +} diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/AccessRights.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/AccessRights.java new file mode 100644 index 0000000000000..e2126a47c1a9a --- /dev/null +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/AccessRights.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.eventhubs.v2018_01_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for AccessRights. + */ +public final class AccessRights extends ExpandableStringEnum { + /** Static value Manage for AccessRights. */ + public static final AccessRights MANAGE = fromString("Manage"); + + /** Static value Send for AccessRights. */ + public static final AccessRights SEND = fromString("Send"); + + /** Static value Listen for AccessRights. */ + public static final AccessRights LISTEN = fromString("Listen"); + + /** + * Creates or finds a AccessRights from its string representation. + * @param name a name to look for + * @return the corresponding AccessRights + */ + @JsonCreator + public static AccessRights fromString(String name) { + return fromString(name, AccessRights.class); + } + + /** + * @return known AccessRights values + */ + public static Collection values() { + return values(AccessRights.class); + } +} diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/ArmDisasterRecovery.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/ArmDisasterRecovery.java new file mode 100644 index 0000000000000..64a59e4ee22fd --- /dev/null +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/ArmDisasterRecovery.java @@ -0,0 +1,161 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventhubs.v2018_01_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.implementation.ArmDisasterRecoveryInner; +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.eventhubs.v2018_01_01_preview.implementation.EventHubsManager; + +/** + * Type representing ArmDisasterRecovery. + */ +public interface ArmDisasterRecovery extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the alternateName value. + */ + String alternateName(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the partnerNamespace value. + */ + String partnerNamespace(); + + /** + * @return the pendingReplicationOperationsCount value. + */ + Long pendingReplicationOperationsCount(); + + /** + * @return the provisioningState value. + */ + ProvisioningStateDR provisioningState(); + + /** + * @return the role value. + */ + RoleDisasterRecovery role(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the ArmDisasterRecovery definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithNamespace, DefinitionStages.WithCreate { + } + + /** + * Grouping of ArmDisasterRecovery definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ArmDisasterRecovery definition. + */ + interface Blank extends WithNamespace { + } + + /** + * The stage of the armdisasterrecovery definition allowing to specify Namespace. + */ + interface WithNamespace { + /** + * Specifies resourceGroupName, namespaceName. + * @param resourceGroupName Name of the resource group within the azure subscription + * @param namespaceName The Namespace name + * @return the next definition stage + */ + WithCreate withExistingNamespace(String resourceGroupName, String namespaceName); + } + + /** + * The stage of the armdisasterrecovery definition allowing to specify AlternateName. + */ + interface WithAlternateName { + /** + * Specifies alternateName. + * @param alternateName Alternate name specified when alias and namespace names are same + * @return the next definition stage + */ + WithCreate withAlternateName(String alternateName); + } + + /** + * The stage of the armdisasterrecovery definition allowing to specify PartnerNamespace. + */ + interface WithPartnerNamespace { + /** + * Specifies partnerNamespace. + * @param partnerNamespace ARM Id of the Primary/Secondary eventhub namespace name, which is part of GEO DR pairing + * @return the next definition stage + */ + WithCreate withPartnerNamespace(String partnerNamespace); + } + + /** + * 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, DefinitionStages.WithAlternateName, DefinitionStages.WithPartnerNamespace { + } + } + /** + * The template for a ArmDisasterRecovery update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAlternateName, UpdateStages.WithPartnerNamespace { + } + + /** + * Grouping of ArmDisasterRecovery update stages. + */ + interface UpdateStages { + /** + * The stage of the armdisasterrecovery update allowing to specify AlternateName. + */ + interface WithAlternateName { + /** + * Specifies alternateName. + * @param alternateName Alternate name specified when alias and namespace names are same + * @return the next update stage + */ + Update withAlternateName(String alternateName); + } + + /** + * The stage of the armdisasterrecovery update allowing to specify PartnerNamespace. + */ + interface WithPartnerNamespace { + /** + * Specifies partnerNamespace. + * @param partnerNamespace ARM Id of the Primary/Secondary eventhub namespace name, which is part of GEO DR pairing + * @return the next update stage + */ + Update withPartnerNamespace(String partnerNamespace); + } + + } +} diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/CaptureDescription.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/CaptureDescription.java new file mode 100644 index 0000000000000..aa488dbf19147 --- /dev/null +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/CaptureDescription.java @@ -0,0 +1,179 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventhubs.v2018_01_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties to configure capture description for eventhub. + */ +public class CaptureDescription { + /** + * A value that indicates whether capture description is enabled. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /** + * Enumerates the possible values for the encoding format of capture + * description. Note: 'AvroDeflate' will be deprecated in New API Version. + * Possible values include: 'Avro', 'AvroDeflate'. + */ + @JsonProperty(value = "encoding") + private EncodingCaptureDescription encoding; + + /** + * The time window allows you to set the frequency with which the capture + * to Azure Blobs will happen, value should between 60 to 900 seconds. + */ + @JsonProperty(value = "intervalInSeconds") + private Integer intervalInSeconds; + + /** + * The size window defines the amount of data built up in your Event Hub + * before an capture operation, value should be between 10485760 to + * 524288000 bytes. + */ + @JsonProperty(value = "sizeLimitInBytes") + private Integer sizeLimitInBytes; + + /** + * Properties of Destination where capture will be stored. (Storage + * Account, Blob Names). + */ + @JsonProperty(value = "destination") + private Destination destination; + + /** + * A value that indicates whether to Skip Empty Archives. + */ + @JsonProperty(value = "skipEmptyArchives") + private Boolean skipEmptyArchives; + + /** + * Get a value that indicates whether capture description is enabled. + * + * @return the enabled value + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set a value that indicates whether capture description is enabled. + * + * @param enabled the enabled value to set + * @return the CaptureDescription object itself. + */ + public CaptureDescription withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get enumerates the possible values for the encoding format of capture description. Note: 'AvroDeflate' will be deprecated in New API Version. Possible values include: 'Avro', 'AvroDeflate'. + * + * @return the encoding value + */ + public EncodingCaptureDescription encoding() { + return this.encoding; + } + + /** + * Set enumerates the possible values for the encoding format of capture description. Note: 'AvroDeflate' will be deprecated in New API Version. Possible values include: 'Avro', 'AvroDeflate'. + * + * @param encoding the encoding value to set + * @return the CaptureDescription object itself. + */ + public CaptureDescription withEncoding(EncodingCaptureDescription encoding) { + this.encoding = encoding; + return this; + } + + /** + * Get the time window allows you to set the frequency with which the capture to Azure Blobs will happen, value should between 60 to 900 seconds. + * + * @return the intervalInSeconds value + */ + public Integer intervalInSeconds() { + return this.intervalInSeconds; + } + + /** + * Set the time window allows you to set the frequency with which the capture to Azure Blobs will happen, value should between 60 to 900 seconds. + * + * @param intervalInSeconds the intervalInSeconds value to set + * @return the CaptureDescription object itself. + */ + public CaptureDescription withIntervalInSeconds(Integer intervalInSeconds) { + this.intervalInSeconds = intervalInSeconds; + return this; + } + + /** + * Get the size window defines the amount of data built up in your Event Hub before an capture operation, value should be between 10485760 to 524288000 bytes. + * + * @return the sizeLimitInBytes value + */ + public Integer sizeLimitInBytes() { + return this.sizeLimitInBytes; + } + + /** + * Set the size window defines the amount of data built up in your Event Hub before an capture operation, value should be between 10485760 to 524288000 bytes. + * + * @param sizeLimitInBytes the sizeLimitInBytes value to set + * @return the CaptureDescription object itself. + */ + public CaptureDescription withSizeLimitInBytes(Integer sizeLimitInBytes) { + this.sizeLimitInBytes = sizeLimitInBytes; + return this; + } + + /** + * Get properties of Destination where capture will be stored. (Storage Account, Blob Names). + * + * @return the destination value + */ + public Destination destination() { + return this.destination; + } + + /** + * Set properties of Destination where capture will be stored. (Storage Account, Blob Names). + * + * @param destination the destination value to set + * @return the CaptureDescription object itself. + */ + public CaptureDescription withDestination(Destination destination) { + this.destination = destination; + return this; + } + + /** + * Get a value that indicates whether to Skip Empty Archives. + * + * @return the skipEmptyArchives value + */ + public Boolean skipEmptyArchives() { + return this.skipEmptyArchives; + } + + /** + * Set a value that indicates whether to Skip Empty Archives. + * + * @param skipEmptyArchives the skipEmptyArchives value to set + * @return the CaptureDescription object itself. + */ + public CaptureDescription withSkipEmptyArchives(Boolean skipEmptyArchives) { + this.skipEmptyArchives = skipEmptyArchives; + return this; + } + +} diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/CheckNameAvailabilityParameter.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/CheckNameAvailabilityParameter.java new file mode 100644 index 0000000000000..e5f0889079d57 --- /dev/null +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/CheckNameAvailabilityParameter.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.eventhubs.v2018_01_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameter supplied to check Namespace name availability operation. + */ +public class CheckNameAvailabilityParameter { + /** + * Name to check the namespace name availability. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Get name to check the namespace name availability. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name to check the namespace name availability. + * + * @param name the name value to set + * @return the CheckNameAvailabilityParameter object itself. + */ + public CheckNameAvailabilityParameter withName(String name) { + this.name = name; + return this; + } + +} diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/CheckNameAvailabilityResult.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/CheckNameAvailabilityResult.java new file mode 100644 index 0000000000000..6cb18f38a46e4 --- /dev/null +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/CheckNameAvailabilityResult.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.eventhubs.v2018_01_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.implementation.EventHubsManager; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.implementation.CheckNameAvailabilityResultInner; + +/** + * Type representing CheckNameAvailabilityResult. + */ +public interface CheckNameAvailabilityResult extends HasInner, HasManager { + /** + * @return the message value. + */ + String message(); + + /** + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * @return the reason value. + */ + UnavailableReason reason(); + +} diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/Clusters.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/Clusters.java index c7414ce7d64be..9fd22cc996639 100644 --- a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/Clusters.java +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/Clusters.java @@ -32,7 +32,7 @@ public interface Clusters extends SupportsCreating { /** * Replace all specified Event Hubs Cluster settings with those contained in the request body. Leaves the settings not specified in the request body unmodified. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param clusterName The name of the Event Hubs Cluster. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request @@ -29,7 +29,7 @@ public interface Configurations extends HasInner { /** * Get all Event Hubs Cluster settings - a collection of key/value pairs which represent the quotas and settings imposed on the cluster. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param clusterName The name of the Event Hubs Cluster. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/ConsumerGroup.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/ConsumerGroup.java new file mode 100644 index 0000000000000..d6fd8e3543b67 --- /dev/null +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/ConsumerGroup.java @@ -0,0 +1,129 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventhubs.v2018_01_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.implementation.ConsumerGroupInner; +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.eventhubs.v2018_01_01_preview.implementation.EventHubsManager; +import org.joda.time.DateTime; + +/** + * Type representing ConsumerGroup. + */ +public interface ConsumerGroup extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the createdAt value. + */ + DateTime createdAt(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the updatedAt value. + */ + DateTime updatedAt(); + + /** + * @return the userMetadata value. + */ + String userMetadata(); + + /** + * The entirety of the ConsumerGroup definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithEventhub, DefinitionStages.WithUserMetadata, DefinitionStages.WithCreate { + } + + /** + * Grouping of ConsumerGroup definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ConsumerGroup definition. + */ + interface Blank extends WithEventhub { + } + + /** + * The stage of the consumergroup definition allowing to specify Eventhub. + */ + interface WithEventhub { + /** + * Specifies resourceGroupName, namespaceName, eventHubName. + * @param resourceGroupName Name of the resource group within the azure subscription + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @return the next definition stage + */ + WithUserMetadata withExistingEventhub(String resourceGroupName, String namespaceName, String eventHubName); + } + + /** + * The stage of the consumergroup definition allowing to specify UserMetadata. + */ + interface WithUserMetadata { + /** + * Specifies userMetadata. + * @param userMetadata User Metadata is a placeholder to store user-defined string data with maximum length 1024. e.g. it can be used to store descriptive data, such as list of teams and their contact information also user-defined configuration settings can be stored + * @return the next definition stage + */ + WithCreate withUserMetadata(String userMetadata); + } + + /** + * 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 ConsumerGroup update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithUserMetadata { + } + + /** + * Grouping of ConsumerGroup update stages. + */ + interface UpdateStages { + /** + * The stage of the consumergroup update allowing to specify UserMetadata. + */ + interface WithUserMetadata { + /** + * Specifies userMetadata. + * @param userMetadata User Metadata is a placeholder to store user-defined string data with maximum length 1024. e.g. it can be used to store descriptive data, such as list of teams and their contact information also user-defined configuration settings can be stored + * @return the next update stage + */ + Update withUserMetadata(String userMetadata); + } + + } +} diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/ConsumerGroups.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/ConsumerGroups.java new file mode 100644 index 0000000000000..87954d64bc63a --- /dev/null +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/ConsumerGroups.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.eventhubs.v2018_01_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.implementation.ConsumerGroupsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ConsumerGroups. + */ +public interface ConsumerGroups extends SupportsCreating, HasInner { + /** + * Gets a description for the specified consumer group. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param consumerGroupName The consumer group name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String namespaceName, String eventHubName, String consumerGroupName); + + /** + * Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByEventHubAsync(final String resourceGroupName, final String namespaceName, final String eventHubName); + + /** + * Deletes a consumer group from the specified Event Hub and resource group. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param consumerGroupName The consumer group name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String namespaceName, String eventHubName, String consumerGroupName); + +} diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/Destination.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/Destination.java new file mode 100644 index 0000000000000..c6dddb2869112 --- /dev/null +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/Destination.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.eventhubs.v2018_01_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Capture storage details for capture description. + */ +@JsonFlatten +public class Destination { + /** + * Name for capture destination. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Resource id of the storage account to be used to create the blobs. + */ + @JsonProperty(value = "properties.storageAccountResourceId") + private String storageAccountResourceId; + + /** + * Blob container Name. + */ + @JsonProperty(value = "properties.blobContainer") + private String blobContainer; + + /** + * Blob naming convention for archive, e.g. + * {Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}. + * Here all the parameters (Namespace,EventHub .. etc) are mandatory + * irrespective of order. + */ + @JsonProperty(value = "properties.archiveNameFormat") + private String archiveNameFormat; + + /** + * Get name for capture destination. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name for capture destination. + * + * @param name the name value to set + * @return the Destination object itself. + */ + public Destination withName(String name) { + this.name = name; + return this; + } + + /** + * Get resource id of the storage account to be used to create the blobs. + * + * @return the storageAccountResourceId value + */ + public String storageAccountResourceId() { + return this.storageAccountResourceId; + } + + /** + * Set resource id of the storage account to be used to create the blobs. + * + * @param storageAccountResourceId the storageAccountResourceId value to set + * @return the Destination object itself. + */ + public Destination withStorageAccountResourceId(String storageAccountResourceId) { + this.storageAccountResourceId = storageAccountResourceId; + return this; + } + + /** + * Get blob container Name. + * + * @return the blobContainer value + */ + public String blobContainer() { + return this.blobContainer; + } + + /** + * Set blob container Name. + * + * @param blobContainer the blobContainer value to set + * @return the Destination object itself. + */ + public Destination withBlobContainer(String blobContainer) { + this.blobContainer = blobContainer; + return this; + } + + /** + * Get blob naming convention for archive, e.g. {Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}. Here all the parameters (Namespace,EventHub .. etc) are mandatory irrespective of order. + * + * @return the archiveNameFormat value + */ + public String archiveNameFormat() { + return this.archiveNameFormat; + } + + /** + * Set blob naming convention for archive, e.g. {Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}. Here all the parameters (Namespace,EventHub .. etc) are mandatory irrespective of order. + * + * @param archiveNameFormat the archiveNameFormat value to set + * @return the Destination object itself. + */ + public Destination withArchiveNameFormat(String archiveNameFormat) { + this.archiveNameFormat = archiveNameFormat; + return this; + } + +} diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/DisasterRecoveryConfigNamespaceAuthorizationRule.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/DisasterRecoveryConfigNamespaceAuthorizationRule.java new file mode 100644 index 0000000000000..84740a64eac5e --- /dev/null +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/DisasterRecoveryConfigNamespaceAuthorizationRule.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.eventhubs.v2018_01_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.implementation.AuthorizationRuleInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.implementation.EventHubsManager; +import java.util.List; + +/** + * Type representing DisasterRecoveryConfigNamespaceAuthorizationRule. + */ +public interface DisasterRecoveryConfigNamespaceAuthorizationRule extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the rights value. + */ + List rights(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/DisasterRecoveryConfigs.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/DisasterRecoveryConfigs.java new file mode 100644 index 0000000000000..c1083ff0a8b63 --- /dev/null +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/DisasterRecoveryConfigs.java @@ -0,0 +1,122 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventhubs.v2018_01_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.implementation.DisasterRecoveryConfigsInner; +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.DisasterRecoveryConfigNamespaceAuthorizationRule; + +/** + * Type representing DisasterRecoveryConfigs. + */ +public interface DisasterRecoveryConfigs extends SupportsCreating, HasInner { + /** + * Check the give Namespace name availability. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param name Name to check the namespace name availability + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkNameAvailabilityAsync(String resourceGroupName, String namespaceName, String name); + + /** + * This operation disables the Disaster Recovery and stops replicating changes from primary to secondary namespaces. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param alias The Disaster Recovery configuration name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable breakPairingAsync(String resourceGroupName, String namespaceName, String alias); + + /** + * Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param alias The Disaster Recovery configuration name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable failOverAsync(String resourceGroupName, String namespaceName, String alias); + + /** + * Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param alias The Disaster Recovery configuration name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String namespaceName, String alias); + + /** + * Gets all Alias(Disaster Recovery configurations). + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String namespaceName); + + /** + * Deletes an Alias(Disaster Recovery configuration). + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param alias The Disaster Recovery configuration name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String namespaceName, String alias); + + /** + * Gets an AuthorizationRule for a Namespace by rule name. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param alias The Disaster Recovery configuration name + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String alias, String authorizationRuleName); + + /** + * Gets a list of authorization rules for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param alias The Disaster Recovery configuration name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final String alias); + + /** + * Gets the primary and secondary connection strings for the Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param alias The Disaster Recovery configuration name + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listKeysAsync(String resourceGroupName, String namespaceName, String alias, String authorizationRuleName); + +} diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/EHNamespace.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/EHNamespace.java index 168d7ee6b9dec..e3635f3c49f1d 100644 --- a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/EHNamespace.java +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/EHNamespace.java @@ -25,11 +25,26 @@ * Type representing EHNamespace. */ public interface EHNamespace extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the clusterArmId value. + */ + String clusterArmId(); + /** * @return the createdAt value. */ DateTime createdAt(); + /** + * @return the encryption value. + */ + Encryption encryption(); + + /** + * @return the identity value. + */ + Identity identity(); + /** * @return the isAutoInflateEnabled value. */ @@ -97,6 +112,42 @@ interface Blank extends GroupableResourceCore.DefinitionWithRegion { interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { } + /** + * The stage of the ehnamespace definition allowing to specify ClusterArmId. + */ + interface WithClusterArmId { + /** + * Specifies clusterArmId. + * @param clusterArmId Cluster ARM ID of the Namespace + * @return the next definition stage + */ + WithCreate withClusterArmId(String clusterArmId); + } + + /** + * The stage of the ehnamespace definition allowing to specify Encryption. + */ + interface WithEncryption { + /** + * Specifies encryption. + * @param encryption Properties of BYOK Encryption description + * @return the next definition stage + */ + WithCreate withEncryption(Encryption encryption); + } + + /** + * The stage of the ehnamespace definition allowing to specify Identity. + */ + interface WithIdentity { + /** + * Specifies identity. + * @param identity Properties of BYOK Identity description + * @return the next definition stage + */ + WithCreate withIdentity(Identity identity); + } + /** * The stage of the ehnamespace definition allowing to specify IsAutoInflateEnabled. */ @@ -162,19 +213,55 @@ interface WithZoneRedundant { * 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.WithIsAutoInflateEnabled, DefinitionStages.WithKafkaEnabled, DefinitionStages.WithMaximumThroughputUnits, DefinitionStages.WithSku, DefinitionStages.WithZoneRedundant { + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithClusterArmId, DefinitionStages.WithEncryption, DefinitionStages.WithIdentity, DefinitionStages.WithIsAutoInflateEnabled, DefinitionStages.WithKafkaEnabled, DefinitionStages.WithMaximumThroughputUnits, DefinitionStages.WithSku, DefinitionStages.WithZoneRedundant { } } /** * The template for a EHNamespace update operation, containing all the settings that can be modified. */ - interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithIsAutoInflateEnabled, UpdateStages.WithKafkaEnabled, UpdateStages.WithMaximumThroughputUnits, UpdateStages.WithSku, UpdateStages.WithZoneRedundant { + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithClusterArmId, UpdateStages.WithEncryption, UpdateStages.WithIdentity, UpdateStages.WithIsAutoInflateEnabled, UpdateStages.WithKafkaEnabled, UpdateStages.WithMaximumThroughputUnits, UpdateStages.WithSku, UpdateStages.WithZoneRedundant { } /** * Grouping of EHNamespace update stages. */ interface UpdateStages { + /** + * The stage of the ehnamespace update allowing to specify ClusterArmId. + */ + interface WithClusterArmId { + /** + * Specifies clusterArmId. + * @param clusterArmId Cluster ARM ID of the Namespace + * @return the next update stage + */ + Update withClusterArmId(String clusterArmId); + } + + /** + * The stage of the ehnamespace update allowing to specify Encryption. + */ + interface WithEncryption { + /** + * Specifies encryption. + * @param encryption Properties of BYOK Encryption description + * @return the next update stage + */ + Update withEncryption(Encryption encryption); + } + + /** + * The stage of the ehnamespace update allowing to specify Identity. + */ + interface WithIdentity { + /** + * Specifies identity. + * @param identity Properties of BYOK Identity description + * @return the next update stage + */ + Update withIdentity(Identity identity); + } + /** * The stage of the ehnamespace update allowing to specify IsAutoInflateEnabled. */ diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/EncodingCaptureDescription.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/EncodingCaptureDescription.java new file mode 100644 index 0000000000000..6c746391c9246 --- /dev/null +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/EncodingCaptureDescription.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.eventhubs.v2018_01_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for EncodingCaptureDescription. + */ +public enum EncodingCaptureDescription { + /** Enum value Avro. */ + AVRO("Avro"), + + /** Enum value AvroDeflate. */ + AVRO_DEFLATE("AvroDeflate"); + + /** The actual serialized value for a EncodingCaptureDescription instance. */ + private String value; + + EncodingCaptureDescription(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a EncodingCaptureDescription instance. + * + * @param value the serialized value to parse. + * @return the parsed EncodingCaptureDescription object, or null if unable to parse. + */ + @JsonCreator + public static EncodingCaptureDescription fromString(String value) { + EncodingCaptureDescription[] items = EncodingCaptureDescription.values(); + for (EncodingCaptureDescription item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/Encryption.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/Encryption.java new file mode 100644 index 0000000000000..db22c3a196467 --- /dev/null +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/Encryption.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.eventhubs.v2018_01_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties to configure Encryption. + */ +public class Encryption { + /** + * Properties of KeyVault. + */ + @JsonProperty(value = "keyVaultProperties") + private List keyVaultProperties; + + /** + * Enumerates the possible value of keySource for Encryption. Possible + * values include: 'Microsoft.KeyVault'. + */ + @JsonProperty(value = "keySource") + private KeySource keySource; + + /** + * Get properties of KeyVault. + * + * @return the keyVaultProperties value + */ + public List keyVaultProperties() { + return this.keyVaultProperties; + } + + /** + * Set properties of KeyVault. + * + * @param keyVaultProperties the keyVaultProperties value to set + * @return the Encryption object itself. + */ + public Encryption withKeyVaultProperties(List keyVaultProperties) { + this.keyVaultProperties = keyVaultProperties; + return this; + } + + /** + * Get enumerates the possible value of keySource for Encryption. Possible values include: 'Microsoft.KeyVault'. + * + * @return the keySource value + */ + public KeySource keySource() { + return this.keySource; + } + + /** + * Set enumerates the possible value of keySource for Encryption. Possible values include: 'Microsoft.KeyVault'. + * + * @param keySource the keySource value to set + * @return the Encryption object itself. + */ + public Encryption withKeySource(KeySource keySource) { + this.keySource = keySource; + return this; + } + +} diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/EntityStatus.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/EntityStatus.java new file mode 100644 index 0000000000000..1824ae835b13c --- /dev/null +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/EntityStatus.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventhubs.v2018_01_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for EntityStatus. + */ +public enum EntityStatus { + /** Enum value Active. */ + ACTIVE("Active"), + + /** Enum value Disabled. */ + DISABLED("Disabled"), + + /** Enum value Restoring. */ + RESTORING("Restoring"), + + /** Enum value SendDisabled. */ + SEND_DISABLED("SendDisabled"), + + /** Enum value ReceiveDisabled. */ + RECEIVE_DISABLED("ReceiveDisabled"), + + /** Enum value Creating. */ + CREATING("Creating"), + + /** Enum value Deleting. */ + DELETING("Deleting"), + + /** Enum value Renaming. */ + RENAMING("Renaming"), + + /** Enum value Unknown. */ + UNKNOWN("Unknown"); + + /** The actual serialized value for a EntityStatus instance. */ + private String value; + + EntityStatus(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a EntityStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed EntityStatus object, or null if unable to parse. + */ + @JsonCreator + public static EntityStatus fromString(String value) { + EntityStatus[] items = EntityStatus.values(); + for (EntityStatus item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/ErrorResponse.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/ErrorResponse.java index 9f158bb1dc4b5..d1bc7d5ec1367 100644 --- a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/ErrorResponse.java +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/ErrorResponse.java @@ -11,7 +11,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * Error response that indicates the service is not able to process the + * Error response indicates Event Hub service is not able to process the * incoming request. The reason is provided in the error message. */ public class ErrorResponse { diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/EventHubs.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/EventHubs.java new file mode 100644 index 0000000000000..7dbd4cc5bb639 --- /dev/null +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/EventHubs.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventhubs.v2018_01_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.implementation.EventHubsInner; +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.EventhubNamespaceAuthorizationRule; + +/** + * Type representing EventHubs. + */ +public interface EventHubs extends SupportsCreating, HasInner { + /** + * Begins definition for a new AuthorizationRule resource. + * @param name resource name. + * @return the first stage of the new AuthorizationRule definition. + */ + EventhubNamespaceAuthorizationRule.DefinitionStages.Blank defineAuthorizationRule(String name); + + /** + * Gets an Event Hubs description for the specified Event Hub. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String namespaceName, String eventHubName); + + /** + * Gets all the Event Hubs in a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByNamespaceAsync(final String resourceGroupName, final String namespaceName); + + /** + * Deletes an Event Hub from the specified Namespace and resource group. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String namespaceName, String eventHubName); + + /** + * Gets an AuthorizationRule for an Event Hub by rule name. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName); + + /** + * Gets the authorization rules for an Event Hub. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final String eventHubName); + + /** + * Deletes an Event Hub AuthorizationRule. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName); + + /** + * Gets the ACS and SAS connection strings for the Event Hub. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listKeysAsync(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName); + + /** + * Regenerates the ACS and SAS connection strings for the Event Hub. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the AuthorizationRule Keys (PrimaryKey/SecondaryKey). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable regenerateKeysAsync(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName, RegenerateAccessKeyParameters parameters); + +} diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/Eventhub.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/Eventhub.java new file mode 100644 index 0000000000000..b17597ead740e --- /dev/null +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/Eventhub.java @@ -0,0 +1,221 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventhubs.v2018_01_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.implementation.EventhubInner; +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.eventhubs.v2018_01_01_preview.implementation.EventHubsManager; +import java.util.List; +import org.joda.time.DateTime; + +/** + * Type representing Eventhub. + */ +public interface Eventhub extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the captureDescription value. + */ + CaptureDescription captureDescription(); + + /** + * @return the createdAt value. + */ + DateTime createdAt(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the messageRetentionInDays value. + */ + Long messageRetentionInDays(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the partitionCount value. + */ + Long partitionCount(); + + /** + * @return the partitionIds value. + */ + List partitionIds(); + + /** + * @return the status value. + */ + EntityStatus status(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the updatedAt value. + */ + DateTime updatedAt(); + + /** + * The entirety of the Eventhub definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithNamespace, DefinitionStages.WithCreate { + } + + /** + * Grouping of Eventhub definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Eventhub definition. + */ + interface Blank extends WithNamespace { + } + + /** + * The stage of the eventhub definition allowing to specify Namespace. + */ + interface WithNamespace { + /** + * Specifies resourceGroupName, namespaceName. + * @param resourceGroupName Name of the resource group within the azure subscription + * @param namespaceName The Namespace name + * @return the next definition stage + */ + WithCreate withExistingNamespace(String resourceGroupName, String namespaceName); + } + + /** + * The stage of the eventhub definition allowing to specify CaptureDescription. + */ + interface WithCaptureDescription { + /** + * Specifies captureDescription. + * @param captureDescription Properties of capture description + * @return the next definition stage + */ + WithCreate withCaptureDescription(CaptureDescription captureDescription); + } + + /** + * The stage of the eventhub definition allowing to specify MessageRetentionInDays. + */ + interface WithMessageRetentionInDays { + /** + * Specifies messageRetentionInDays. + * @param messageRetentionInDays Number of days to retain the events for this Event Hub, value should be 1 to 7 days + * @return the next definition stage + */ + WithCreate withMessageRetentionInDays(Long messageRetentionInDays); + } + + /** + * The stage of the eventhub definition allowing to specify PartitionCount. + */ + interface WithPartitionCount { + /** + * Specifies partitionCount. + * @param partitionCount Number of partitions created for the Event Hub, allowed values are from 1 to 32 partitions + * @return the next definition stage + */ + WithCreate withPartitionCount(Long partitionCount); + } + + /** + * The stage of the eventhub definition allowing to specify Status. + */ + interface WithStatus { + /** + * Specifies status. + * @param status Enumerates the possible values for the status of the Event Hub. Possible values include: 'Active', 'Disabled', 'Restoring', 'SendDisabled', 'ReceiveDisabled', 'Creating', 'Deleting', 'Renaming', 'Unknown' + * @return the next definition stage + */ + WithCreate withStatus(EntityStatus status); + } + + /** + * 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, DefinitionStages.WithCaptureDescription, DefinitionStages.WithMessageRetentionInDays, DefinitionStages.WithPartitionCount, DefinitionStages.WithStatus { + } + } + /** + * The template for a Eventhub update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithCaptureDescription, UpdateStages.WithMessageRetentionInDays, UpdateStages.WithPartitionCount, UpdateStages.WithStatus { + } + + /** + * Grouping of Eventhub update stages. + */ + interface UpdateStages { + /** + * The stage of the eventhub update allowing to specify CaptureDescription. + */ + interface WithCaptureDescription { + /** + * Specifies captureDescription. + * @param captureDescription Properties of capture description + * @return the next update stage + */ + Update withCaptureDescription(CaptureDescription captureDescription); + } + + /** + * The stage of the eventhub update allowing to specify MessageRetentionInDays. + */ + interface WithMessageRetentionInDays { + /** + * Specifies messageRetentionInDays. + * @param messageRetentionInDays Number of days to retain the events for this Event Hub, value should be 1 to 7 days + * @return the next update stage + */ + Update withMessageRetentionInDays(Long messageRetentionInDays); + } + + /** + * The stage of the eventhub update allowing to specify PartitionCount. + */ + interface WithPartitionCount { + /** + * Specifies partitionCount. + * @param partitionCount Number of partitions created for the Event Hub, allowed values are from 1 to 32 partitions + * @return the next update stage + */ + Update withPartitionCount(Long partitionCount); + } + + /** + * The stage of the eventhub update allowing to specify Status. + */ + interface WithStatus { + /** + * Specifies status. + * @param status Enumerates the possible values for the status of the Event Hub. Possible values include: 'Active', 'Disabled', 'Restoring', 'SendDisabled', 'ReceiveDisabled', 'Creating', 'Deleting', 'Renaming', 'Unknown' + * @return the next update stage + */ + Update withStatus(EntityStatus status); + } + + } +} diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/EventhubNamespaceAuthorizationRule.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/EventhubNamespaceAuthorizationRule.java new file mode 100644 index 0000000000000..a24ce622172ef --- /dev/null +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/EventhubNamespaceAuthorizationRule.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.eventhubs.v2018_01_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.implementation.AuthorizationRuleInner; +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.eventhubs.v2018_01_01_preview.implementation.EventHubsManager; +import java.util.List; + +/** + * Type representing EventhubNamespaceAuthorizationRule. + */ +public interface EventhubNamespaceAuthorizationRule extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the rights value. + */ + List rights(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the EventhubNamespaceAuthorizationRule definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithEventhub, DefinitionStages.WithRights, DefinitionStages.WithCreate { + } + + /** + * Grouping of EventhubNamespaceAuthorizationRule definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a EventhubNamespaceAuthorizationRule definition. + */ + interface Blank extends WithEventhub { + } + + /** + * The stage of the eventhubnamespaceauthorizationrule definition allowing to specify Eventhub. + */ + interface WithEventhub { + /** + * Specifies resourceGroupName, namespaceName, eventHubName. + * @param resourceGroupName Name of the resource group within the azure subscription + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @return the next definition stage + */ + WithRights withExistingEventhub(String resourceGroupName, String namespaceName, String eventHubName); + } + + /** + * The stage of the eventhubnamespaceauthorizationrule definition allowing to specify Rights. + */ + interface WithRights { + /** + * Specifies rights. + * @param rights The rights associated with the rule + * @return the next definition stage + */ + WithCreate withRights(List rights); + } + + /** + * 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 EventhubNamespaceAuthorizationRule update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithRights { + } + + /** + * Grouping of EventhubNamespaceAuthorizationRule update stages. + */ + interface UpdateStages { + /** + * The stage of the eventhubnamespaceauthorizationrule update allowing to specify Rights. + */ + interface WithRights { + /** + * Specifies rights. + * @param rights The rights associated with the rule + * @return the next update stage + */ + Update withRights(List rights); + } + + } +} diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/Identity.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/Identity.java new file mode 100644 index 0000000000000..86d459330076d --- /dev/null +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/Identity.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.eventhubs.v2018_01_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties to configure Identity for Bring your Own Keys. + */ +public class Identity { + /** + * ObjectId from the KeyVault. + */ + @JsonProperty(value = "principalId") + private String principalId; + + /** + * TenantId from the KeyVault. + */ + @JsonProperty(value = "tenantId") + private String tenantId; + + /** + * Enumerates the possible value Identity type, which currently supports + * only 'SystemAssigned'. Possible values include: 'SystemAssigned'. + */ + @JsonProperty(value = "type") + private IdentityType type; + + /** + * Get objectId from the KeyVault. + * + * @return the principalId value + */ + public String principalId() { + return this.principalId; + } + + /** + * Set objectId from the KeyVault. + * + * @param principalId the principalId value to set + * @return the Identity object itself. + */ + public Identity withPrincipalId(String principalId) { + this.principalId = principalId; + return this; + } + + /** + * Get tenantId from the KeyVault. + * + * @return the tenantId value + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set tenantId from the KeyVault. + * + * @param tenantId the tenantId value to set + * @return the Identity object itself. + */ + public Identity withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Get enumerates the possible value Identity type, which currently supports only 'SystemAssigned'. Possible values include: 'SystemAssigned'. + * + * @return the type value + */ + public IdentityType type() { + return this.type; + } + + /** + * Set enumerates the possible value Identity type, which currently supports only 'SystemAssigned'. Possible values include: 'SystemAssigned'. + * + * @param type the type value to set + * @return the Identity object itself. + */ + public Identity withType(IdentityType type) { + this.type = type; + return this; + } + +} diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/IdentityType.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/IdentityType.java new file mode 100644 index 0000000000000..5ba624f01cc3d --- /dev/null +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/IdentityType.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.eventhubs.v2018_01_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for IdentityType. + */ +public enum IdentityType { + /** Enum value SystemAssigned. */ + SYSTEM_ASSIGNED("SystemAssigned"); + + /** The actual serialized value for a IdentityType instance. */ + private String value; + + IdentityType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a IdentityType instance. + * + * @param value the serialized value to parse. + * @return the parsed IdentityType object, or null if unable to parse. + */ + @JsonCreator + public static IdentityType fromString(String value) { + IdentityType[] items = IdentityType.values(); + for (IdentityType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/IpFilterRule.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/IpFilterRule.java index 73869dd697f86..e234ea14bde38 100644 --- a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/IpFilterRule.java +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/IpFilterRule.java @@ -74,7 +74,7 @@ interface Blank extends WithNamespace { interface WithNamespace { /** * Specifies resourceGroupName, namespaceName. - * @param resourceGroupName Name of the resource group within the Azure subscription + * @param resourceGroupName Name of the resource group within the azure subscription * @param namespaceName The Namespace name * @return the next definition stage */ diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/KeySource.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/KeySource.java new file mode 100644 index 0000000000000..ed68de3c2ac70 --- /dev/null +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/KeySource.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.eventhubs.v2018_01_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for KeySource. + */ +public enum KeySource { + /** Enum value Microsoft.KeyVault. */ + MICROSOFT_KEY_VAULT("Microsoft.KeyVault"); + + /** The actual serialized value for a KeySource instance. */ + private String value; + + KeySource(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a KeySource instance. + * + * @param value the serialized value to parse. + * @return the parsed KeySource object, or null if unable to parse. + */ + @JsonCreator + public static KeySource fromString(String value) { + KeySource[] items = KeySource.values(); + for (KeySource item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/KeyType.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/KeyType.java new file mode 100644 index 0000000000000..09268288fe417 --- /dev/null +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/KeyType.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.eventhubs.v2018_01_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for KeyType. + */ +public enum KeyType { + /** Enum value PrimaryKey. */ + PRIMARY_KEY("PrimaryKey"), + + /** Enum value SecondaryKey. */ + SECONDARY_KEY("SecondaryKey"); + + /** The actual serialized value for a KeyType instance. */ + private String value; + + KeyType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a KeyType instance. + * + * @param value the serialized value to parse. + * @return the parsed KeyType object, or null if unable to parse. + */ + @JsonCreator + public static KeyType fromString(String value) { + KeyType[] items = KeyType.values(); + for (KeyType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/KeyVaultProperties.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/KeyVaultProperties.java new file mode 100644 index 0000000000000..8dbaa4a8ae0fd --- /dev/null +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/KeyVaultProperties.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.eventhubs.v2018_01_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties to configure keyVault Properties. + */ +public class KeyVaultProperties { + /** + * Name of the Key from KeyVault. + */ + @JsonProperty(value = "keyName") + private String keyName; + + /** + * Uri of KeyVault. + */ + @JsonProperty(value = "keyVaultUri") + private String keyVaultUri; + + /** + * Key Version. + */ + @JsonProperty(value = "keyVersion") + private String keyVersion; + + /** + * Get name of the Key from KeyVault. + * + * @return the keyName value + */ + public String keyName() { + return this.keyName; + } + + /** + * Set name of the Key from KeyVault. + * + * @param keyName the keyName value to set + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withKeyName(String keyName) { + this.keyName = keyName; + return this; + } + + /** + * Get uri of KeyVault. + * + * @return the keyVaultUri value + */ + public String keyVaultUri() { + return this.keyVaultUri; + } + + /** + * Set uri of KeyVault. + * + * @param keyVaultUri the keyVaultUri value to set + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withKeyVaultUri(String keyVaultUri) { + this.keyVaultUri = keyVaultUri; + return this; + } + + /** + * Get key Version. + * + * @return the keyVersion value + */ + public String keyVersion() { + return this.keyVersion; + } + + /** + * Set key Version. + * + * @param keyVersion the keyVersion value to set + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withKeyVersion(String keyVersion) { + this.keyVersion = keyVersion; + return this; + } + +} diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/MessagingRegions.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/MessagingRegions.java new file mode 100644 index 0000000000000..af41c821243ec --- /dev/null +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/MessagingRegions.java @@ -0,0 +1,51 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventhubs.v2018_01_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.implementation.EventHubsManager; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.implementation.MessagingRegionsInner; +import java.util.Map; + +/** + * Type representing MessagingRegions. + */ +public interface MessagingRegions extends HasInner, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + MessagingRegionsProperties properties(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/MessagingRegionsProperties.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/MessagingRegionsProperties.java new file mode 100644 index 0000000000000..946a7efede4ca --- /dev/null +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/MessagingRegionsProperties.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.eventhubs.v2018_01_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties of Messaging Region. + */ +public class MessagingRegionsProperties { + /** + * Region code. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /** + * Full name of the region. + */ + @JsonProperty(value = "fullName", access = JsonProperty.Access.WRITE_ONLY) + private String fullName; + + /** + * Get region code. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Get full name of the region. + * + * @return the fullName value + */ + public String fullName() { + return this.fullName; + } + +} diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/NamespaceAuthorizationRule.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/NamespaceAuthorizationRule.java new file mode 100644 index 0000000000000..0ca2d02d43040 --- /dev/null +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/NamespaceAuthorizationRule.java @@ -0,0 +1,118 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventhubs.v2018_01_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.implementation.AuthorizationRuleInner; +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.eventhubs.v2018_01_01_preview.implementation.EventHubsManager; +import java.util.List; + +/** + * Type representing NamespaceAuthorizationRule. + */ +public interface NamespaceAuthorizationRule extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the rights value. + */ + List rights(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the NamespaceAuthorizationRule definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithNamespace, DefinitionStages.WithRights, DefinitionStages.WithCreate { + } + + /** + * Grouping of NamespaceAuthorizationRule definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a NamespaceAuthorizationRule definition. + */ + interface Blank extends WithNamespace { + } + + /** + * The stage of the namespaceauthorizationrule definition allowing to specify Namespace. + */ + interface WithNamespace { + /** + * Specifies resourceGroupName, namespaceName. + * @param resourceGroupName Name of the resource group within the azure subscription + * @param namespaceName The Namespace name + * @return the next definition stage + */ + WithRights withExistingNamespace(String resourceGroupName, String namespaceName); + } + + /** + * The stage of the namespaceauthorizationrule definition allowing to specify Rights. + */ + interface WithRights { + /** + * Specifies rights. + * @param rights The rights associated with the rule + * @return the next definition stage + */ + WithCreate withRights(List rights); + } + + /** + * 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 NamespaceAuthorizationRule update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithRights { + } + + /** + * Grouping of NamespaceAuthorizationRule update stages. + */ + interface UpdateStages { + /** + * The stage of the namespaceauthorizationrule update allowing to specify Rights. + */ + interface WithRights { + /** + * Specifies rights. + * @param rights The rights associated with the rule + * @return the next update stage + */ + Update withRights(List rights); + } + + } +} diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/Namespaces.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/Namespaces.java index 43f0faada39af..27ccef7cf8c9c 100644 --- a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/Namespaces.java +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/Namespaces.java @@ -21,6 +21,7 @@ import rx.Completable; import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.VirtualNetworkRule; import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.implementation.NetworkRuleSetInner; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.NamespaceAuthorizationRule; /** * Type representing Namespaces. @@ -40,10 +41,26 @@ public interface Namespaces extends SupportsCreating checkNameAvailabilityAsync(String name); + /** * Gets an IpFilterRule for a Namespace by rule name. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name * @param ipFilterRuleName The IP Filter Rule name. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -54,7 +71,7 @@ public interface Namespaces extends SupportsCreating getNetworkRuleSetAsync(String resourceGroupName, String namespaceName); + /** + * Gets an AuthorizationRule for a Namespace by rule name. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName); + + /** + * Gets a list of authorization rules for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName); + + /** + * Deletes an AuthorizationRule for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName); + + /** + * Gets the primary and secondary connection strings for the Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName); + + /** + * Regenerates the primary or secondary connection strings for the specified Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters required to regenerate the connection string. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable regenerateKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, RegenerateAccessKeyParameters parameters); + } diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/ProvisioningStateDR.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/ProvisioningStateDR.java new file mode 100644 index 0000000000000..9a3c3b44c487b --- /dev/null +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/ProvisioningStateDR.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.eventhubs.v2018_01_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ProvisioningStateDR. + */ +public enum ProvisioningStateDR { + /** Enum value Accepted. */ + ACCEPTED("Accepted"), + + /** Enum value Succeeded. */ + SUCCEEDED("Succeeded"), + + /** Enum value Failed. */ + FAILED("Failed"); + + /** The actual serialized value for a ProvisioningStateDR instance. */ + private String value; + + ProvisioningStateDR(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ProvisioningStateDR instance. + * + * @param value the serialized value to parse. + * @return the parsed ProvisioningStateDR object, or null if unable to parse. + */ + @JsonCreator + public static ProvisioningStateDR fromString(String value) { + ProvisioningStateDR[] items = ProvisioningStateDR.values(); + for (ProvisioningStateDR item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/RegenerateAccessKeyParameters.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/RegenerateAccessKeyParameters.java new file mode 100644 index 0000000000000..b9cbfbc5ebd24 --- /dev/null +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/RegenerateAccessKeyParameters.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.eventhubs.v2018_01_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters supplied to the Regenerate Authorization Rule operation, + * specifies which key needs to be reset. + */ +public class RegenerateAccessKeyParameters { + /** + * The access key to regenerate. Possible values include: 'PrimaryKey', + * 'SecondaryKey'. + */ + @JsonProperty(value = "keyType", required = true) + private KeyType keyType; + + /** + * Optional, if the key value provided, is set for KeyType or autogenerated + * Key value set for keyType. + */ + @JsonProperty(value = "key") + private String key; + + /** + * Get the access key to regenerate. Possible values include: 'PrimaryKey', 'SecondaryKey'. + * + * @return the keyType value + */ + public KeyType keyType() { + return this.keyType; + } + + /** + * Set the access key to regenerate. Possible values include: 'PrimaryKey', 'SecondaryKey'. + * + * @param keyType the keyType value to set + * @return the RegenerateAccessKeyParameters object itself. + */ + public RegenerateAccessKeyParameters withKeyType(KeyType keyType) { + this.keyType = keyType; + return this; + } + + /** + * Get optional, if the key value provided, is set for KeyType or autogenerated Key value set for keyType. + * + * @return the key value + */ + public String key() { + return this.key; + } + + /** + * Set optional, if the key value provided, is set for KeyType or autogenerated Key value set for keyType. + * + * @param key the key value to set + * @return the RegenerateAccessKeyParameters object itself. + */ + public RegenerateAccessKeyParameters withKey(String key) { + this.key = key; + return this; + } + +} diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/Regions.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/Regions.java new file mode 100644 index 0000000000000..e78411cb30339 --- /dev/null +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/Regions.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.eventhubs.v2018_01_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.implementation.RegionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Regions. + */ +public interface Regions extends HasInner { + /** + * Gets the available Regions for a given sku. + * + * @param sku The sku type. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listBySkuAsync(final String sku); + +} diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/RoleDisasterRecovery.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/RoleDisasterRecovery.java new file mode 100644 index 0000000000000..34eec0bd0ca5f --- /dev/null +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/RoleDisasterRecovery.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.eventhubs.v2018_01_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for RoleDisasterRecovery. + */ +public enum RoleDisasterRecovery { + /** Enum value Primary. */ + PRIMARY("Primary"), + + /** Enum value PrimaryNotReplicating. */ + PRIMARY_NOT_REPLICATING("PrimaryNotReplicating"), + + /** Enum value Secondary. */ + SECONDARY("Secondary"); + + /** The actual serialized value for a RoleDisasterRecovery instance. */ + private String value; + + RoleDisasterRecovery(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a RoleDisasterRecovery instance. + * + * @param value the serialized value to parse. + * @return the parsed RoleDisasterRecovery object, or null if unable to parse. + */ + @JsonCreator + public static RoleDisasterRecovery fromString(String value) { + RoleDisasterRecovery[] items = RoleDisasterRecovery.values(); + for (RoleDisasterRecovery item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/UnavailableReason.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/UnavailableReason.java new file mode 100644 index 0000000000000..f7e7b473c0192 --- /dev/null +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/UnavailableReason.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.eventhubs.v2018_01_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for UnavailableReason. + */ +public enum UnavailableReason { + /** Enum value None. */ + NONE("None"), + + /** Enum value InvalidName. */ + INVALID_NAME("InvalidName"), + + /** Enum value SubscriptionIsDisabled. */ + SUBSCRIPTION_IS_DISABLED("SubscriptionIsDisabled"), + + /** Enum value NameInUse. */ + NAME_IN_USE("NameInUse"), + + /** Enum value NameInLockdown. */ + NAME_IN_LOCKDOWN("NameInLockdown"), + + /** Enum value TooManyNamespaceInCurrentSubscription. */ + TOO_MANY_NAMESPACE_IN_CURRENT_SUBSCRIPTION("TooManyNamespaceInCurrentSubscription"); + + /** The actual serialized value for a UnavailableReason instance. */ + private String value; + + UnavailableReason(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a UnavailableReason instance. + * + * @param value the serialized value to parse. + * @return the parsed UnavailableReason object, or null if unable to parse. + */ + @JsonCreator + public static UnavailableReason fromString(String value) { + UnavailableReason[] items = UnavailableReason.values(); + for (UnavailableReason item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/VirtualNetworkRule.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/VirtualNetworkRule.java index ba23d13503fd5..cf0f2ab433882 100644 --- a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/VirtualNetworkRule.java +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/VirtualNetworkRule.java @@ -64,7 +64,7 @@ interface Blank extends WithNamespace { interface WithNamespace { /** * Specifies resourceGroupName, namespaceName. - * @param resourceGroupName Name of the resource group within the Azure subscription + * @param resourceGroupName Name of the resource group within the azure subscription * @param namespaceName The Namespace name * @return the next definition stage */ diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/AccessKeysImpl.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/AccessKeysImpl.java new file mode 100644 index 0000000000000..65464fcafe864 --- /dev/null +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/AccessKeysImpl.java @@ -0,0 +1,61 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventhubs.v2018_01_01_preview.implementation; + +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.AccessKeys; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class AccessKeysImpl extends WrapperImpl implements AccessKeys { + private final EventHubsManager manager; + AccessKeysImpl(AccessKeysInner inner, EventHubsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public EventHubsManager manager() { + return this.manager; + } + + @Override + public String aliasPrimaryConnectionString() { + return this.inner().aliasPrimaryConnectionString(); + } + + @Override + public String aliasSecondaryConnectionString() { + return this.inner().aliasSecondaryConnectionString(); + } + + @Override + public String keyName() { + return this.inner().keyName(); + } + + @Override + public String primaryConnectionString() { + return this.inner().primaryConnectionString(); + } + + @Override + public String primaryKey() { + return this.inner().primaryKey(); + } + + @Override + public String secondaryConnectionString() { + return this.inner().secondaryConnectionString(); + } + + @Override + public String secondaryKey() { + return this.inner().secondaryKey(); + } + +} diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/AccessKeysInner.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/AccessKeysInner.java new file mode 100644 index 0000000000000..4d6a1262db2a2 --- /dev/null +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/AccessKeysInner.java @@ -0,0 +1,124 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventhubs.v2018_01_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Namespace/EventHub Connection String. + */ +public class AccessKeysInner { + /** + * Primary connection string of the created namespace AuthorizationRule. + */ + @JsonProperty(value = "primaryConnectionString", access = JsonProperty.Access.WRITE_ONLY) + private String primaryConnectionString; + + /** + * Secondary connection string of the created namespace AuthorizationRule. + */ + @JsonProperty(value = "secondaryConnectionString", access = JsonProperty.Access.WRITE_ONLY) + private String secondaryConnectionString; + + /** + * Primary connection string of the alias if GEO DR is enabled. + */ + @JsonProperty(value = "aliasPrimaryConnectionString", access = JsonProperty.Access.WRITE_ONLY) + private String aliasPrimaryConnectionString; + + /** + * Secondary connection string of the alias if GEO DR is enabled. + */ + @JsonProperty(value = "aliasSecondaryConnectionString", access = JsonProperty.Access.WRITE_ONLY) + private String aliasSecondaryConnectionString; + + /** + * A base64-encoded 256-bit primary key for signing and validating the SAS + * token. + */ + @JsonProperty(value = "primaryKey", access = JsonProperty.Access.WRITE_ONLY) + private String primaryKey; + + /** + * A base64-encoded 256-bit primary key for signing and validating the SAS + * token. + */ + @JsonProperty(value = "secondaryKey", access = JsonProperty.Access.WRITE_ONLY) + private String secondaryKey; + + /** + * A string that describes the AuthorizationRule. + */ + @JsonProperty(value = "keyName", access = JsonProperty.Access.WRITE_ONLY) + private String keyName; + + /** + * Get primary connection string of the created namespace AuthorizationRule. + * + * @return the primaryConnectionString value + */ + public String primaryConnectionString() { + return this.primaryConnectionString; + } + + /** + * Get secondary connection string of the created namespace AuthorizationRule. + * + * @return the secondaryConnectionString value + */ + public String secondaryConnectionString() { + return this.secondaryConnectionString; + } + + /** + * Get primary connection string of the alias if GEO DR is enabled. + * + * @return the aliasPrimaryConnectionString value + */ + public String aliasPrimaryConnectionString() { + return this.aliasPrimaryConnectionString; + } + + /** + * Get secondary connection string of the alias if GEO DR is enabled. + * + * @return the aliasSecondaryConnectionString value + */ + public String aliasSecondaryConnectionString() { + return this.aliasSecondaryConnectionString; + } + + /** + * Get a base64-encoded 256-bit primary key for signing and validating the SAS token. + * + * @return the primaryKey value + */ + public String primaryKey() { + return this.primaryKey; + } + + /** + * Get a base64-encoded 256-bit primary key for signing and validating the SAS token. + * + * @return the secondaryKey value + */ + public String secondaryKey() { + return this.secondaryKey; + } + + /** + * Get a string that describes the AuthorizationRule. + * + * @return the keyName value + */ + public String keyName() { + return this.keyName; + } + +} diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/ArmDisasterRecoveryImpl.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/ArmDisasterRecoveryImpl.java new file mode 100644 index 0000000000000..54b4eb34296d4 --- /dev/null +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/ArmDisasterRecoveryImpl.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.eventhubs.v2018_01_01_preview.implementation; + +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.ArmDisasterRecovery; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.ProvisioningStateDR; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.RoleDisasterRecovery; + +class ArmDisasterRecoveryImpl extends CreatableUpdatableImpl implements ArmDisasterRecovery, ArmDisasterRecovery.Definition, ArmDisasterRecovery.Update { + private final EventHubsManager manager; + private String resourceGroupName; + private String namespaceName; + private String alias; + + ArmDisasterRecoveryImpl(String name, EventHubsManager manager) { + super(name, new ArmDisasterRecoveryInner()); + this.manager = manager; + // Set resource name + this.alias = name; + // + } + + ArmDisasterRecoveryImpl(ArmDisasterRecoveryInner inner, EventHubsManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.alias = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.namespaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "namespaces"); + this.alias = IdParsingUtils.getValueFromIdByName(inner.id(), "disasterRecoveryConfigs"); + // + } + + @Override + public EventHubsManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + DisasterRecoveryConfigsInner client = this.manager().inner().disasterRecoveryConfigs(); + return client.createOrUpdateAsync(this.resourceGroupName, this.namespaceName, this.alias, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + DisasterRecoveryConfigsInner client = this.manager().inner().disasterRecoveryConfigs(); + return client.createOrUpdateAsync(this.resourceGroupName, this.namespaceName, this.alias, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + DisasterRecoveryConfigsInner client = this.manager().inner().disasterRecoveryConfigs(); + return client.getAsync(this.resourceGroupName, this.namespaceName, this.alias); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String alternateName() { + return this.inner().alternateName(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String partnerNamespace() { + return this.inner().partnerNamespace(); + } + + @Override + public Long pendingReplicationOperationsCount() { + return this.inner().pendingReplicationOperationsCount(); + } + + @Override + public ProvisioningStateDR provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public RoleDisasterRecovery role() { + return this.inner().role(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public ArmDisasterRecoveryImpl withExistingNamespace(String resourceGroupName, String namespaceName) { + this.resourceGroupName = resourceGroupName; + this.namespaceName = namespaceName; + return this; + } + + @Override + public ArmDisasterRecoveryImpl withAlternateName(String alternateName) { + this.inner().withAlternateName(alternateName); + return this; + } + + @Override + public ArmDisasterRecoveryImpl withPartnerNamespace(String partnerNamespace) { + this.inner().withPartnerNamespace(partnerNamespace); + return this; + } + +} diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/ArmDisasterRecoveryInner.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/ArmDisasterRecoveryInner.java new file mode 100644 index 0000000000000..4be691fac4e7c --- /dev/null +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/ArmDisasterRecoveryInner.java @@ -0,0 +1,124 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventhubs.v2018_01_01_preview.implementation; + +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.ProvisioningStateDR; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.RoleDisasterRecovery; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Single item in List or Get Alias(Disaster Recovery configuration) operation. + */ +@JsonFlatten +public class ArmDisasterRecoveryInner extends ProxyResource { + /** + * Provisioning state of the Alias(Disaster Recovery configuration) - + * possible values 'Accepted' or 'Succeeded' or 'Failed'. Possible values + * include: 'Accepted', 'Succeeded', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningStateDR provisioningState; + + /** + * ARM Id of the Primary/Secondary eventhub namespace name, which is part + * of GEO DR pairing. + */ + @JsonProperty(value = "properties.partnerNamespace") + private String partnerNamespace; + + /** + * Alternate name specified when alias and namespace names are same. + */ + @JsonProperty(value = "properties.alternateName") + private String alternateName; + + /** + * role of namespace in GEO DR - possible values 'Primary' or + * 'PrimaryNotReplicating' or 'Secondary'. Possible values include: + * 'Primary', 'PrimaryNotReplicating', 'Secondary'. + */ + @JsonProperty(value = "properties.role", access = JsonProperty.Access.WRITE_ONLY) + private RoleDisasterRecovery role; + + /** + * Number of entities pending to be replicated. + */ + @JsonProperty(value = "properties.pendingReplicationOperationsCount", access = JsonProperty.Access.WRITE_ONLY) + private Long pendingReplicationOperationsCount; + + /** + * Get provisioning state of the Alias(Disaster Recovery configuration) - possible values 'Accepted' or 'Succeeded' or 'Failed'. Possible values include: 'Accepted', 'Succeeded', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningStateDR provisioningState() { + return this.provisioningState; + } + + /** + * Get aRM Id of the Primary/Secondary eventhub namespace name, which is part of GEO DR pairing. + * + * @return the partnerNamespace value + */ + public String partnerNamespace() { + return this.partnerNamespace; + } + + /** + * Set aRM Id of the Primary/Secondary eventhub namespace name, which is part of GEO DR pairing. + * + * @param partnerNamespace the partnerNamespace value to set + * @return the ArmDisasterRecoveryInner object itself. + */ + public ArmDisasterRecoveryInner withPartnerNamespace(String partnerNamespace) { + this.partnerNamespace = partnerNamespace; + return this; + } + + /** + * Get alternate name specified when alias and namespace names are same. + * + * @return the alternateName value + */ + public String alternateName() { + return this.alternateName; + } + + /** + * Set alternate name specified when alias and namespace names are same. + * + * @param alternateName the alternateName value to set + * @return the ArmDisasterRecoveryInner object itself. + */ + public ArmDisasterRecoveryInner withAlternateName(String alternateName) { + this.alternateName = alternateName; + return this; + } + + /** + * Get role of namespace in GEO DR - possible values 'Primary' or 'PrimaryNotReplicating' or 'Secondary'. Possible values include: 'Primary', 'PrimaryNotReplicating', 'Secondary'. + * + * @return the role value + */ + public RoleDisasterRecovery role() { + return this.role; + } + + /** + * Get number of entities pending to be replicated. + * + * @return the pendingReplicationOperationsCount value + */ + public Long pendingReplicationOperationsCount() { + return this.pendingReplicationOperationsCount; + } + +} diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/AuthorizationRuleInner.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/AuthorizationRuleInner.java new file mode 100644 index 0000000000000..56280715edb31 --- /dev/null +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/AuthorizationRuleInner.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventhubs.v2018_01_01_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.AccessRights; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Single item in a List or Get AuthorizationRule operation. + */ +@JsonFlatten +public class AuthorizationRuleInner extends ProxyResource { + /** + * The rights associated with the rule. + */ + @JsonProperty(value = "properties.rights", required = true) + private List rights; + + /** + * Get the rights associated with the rule. + * + * @return the rights value + */ + public List rights() { + return this.rights; + } + + /** + * Set the rights associated with the rule. + * + * @param rights the rights value to set + * @return the AuthorizationRuleInner object itself. + */ + public AuthorizationRuleInner withRights(List rights) { + this.rights = rights; + return this; + } + +} diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/CheckNameAvailabilityResultImpl.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/CheckNameAvailabilityResultImpl.java new file mode 100644 index 0000000000000..c5f722730bec0 --- /dev/null +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/CheckNameAvailabilityResultImpl.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.eventhubs.v2018_01_01_preview.implementation; + +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.CheckNameAvailabilityResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.UnavailableReason; + +class CheckNameAvailabilityResultImpl extends WrapperImpl implements CheckNameAvailabilityResult { + private final EventHubsManager manager; + CheckNameAvailabilityResultImpl(CheckNameAvailabilityResultInner inner, EventHubsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public EventHubsManager manager() { + return this.manager; + } + + @Override + public String message() { + return this.inner().message(); + } + + @Override + public Boolean nameAvailable() { + return this.inner().nameAvailable(); + } + + @Override + public UnavailableReason reason() { + return this.inner().reason(); + } + +} diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/CheckNameAvailabilityResultInner.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/CheckNameAvailabilityResultInner.java new file mode 100644 index 0000000000000..14eb267e7a71b --- /dev/null +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/CheckNameAvailabilityResultInner.java @@ -0,0 +1,88 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventhubs.v2018_01_01_preview.implementation; + +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.UnavailableReason; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Result of the CheckNameAvailability operation. + */ +public class CheckNameAvailabilityResultInner { + /** + * The detailed info regarding the reason associated with the Namespace. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Value indicating Namespace is availability, true if the Namespace is + * available; otherwise, false. + */ + @JsonProperty(value = "nameAvailable") + private Boolean nameAvailable; + + /** + * The reason for unavailability of a Namespace. Possible values include: + * 'None', 'InvalidName', 'SubscriptionIsDisabled', 'NameInUse', + * 'NameInLockdown', 'TooManyNamespaceInCurrentSubscription'. + */ + @JsonProperty(value = "reason") + private UnavailableReason reason; + + /** + * Get the detailed info regarding the reason associated with the Namespace. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get value indicating Namespace is availability, true if the Namespace is available; otherwise, false. + * + * @return the nameAvailable value + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Set value indicating Namespace is availability, true if the Namespace is available; otherwise, false. + * + * @param nameAvailable the nameAvailable value to set + * @return the CheckNameAvailabilityResultInner object itself. + */ + public CheckNameAvailabilityResultInner withNameAvailable(Boolean nameAvailable) { + this.nameAvailable = nameAvailable; + return this; + } + + /** + * Get the reason for unavailability of a Namespace. Possible values include: 'None', 'InvalidName', 'SubscriptionIsDisabled', 'NameInUse', 'NameInLockdown', 'TooManyNamespaceInCurrentSubscription'. + * + * @return the reason value + */ + public UnavailableReason reason() { + return this.reason; + } + + /** + * Set the reason for unavailability of a Namespace. Possible values include: 'None', 'InvalidName', 'SubscriptionIsDisabled', 'NameInUse', 'NameInLockdown', 'TooManyNamespaceInCurrentSubscription'. + * + * @param reason the reason value to set + * @return the CheckNameAvailabilityResultInner object itself. + */ + public CheckNameAvailabilityResultInner withReason(UnavailableReason reason) { + this.reason = reason; + return this; + } + +} diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/ClustersInner.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/ClustersInner.java index 0c6cf586b7b85..36e36c5fa7f59 100644 --- a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/ClustersInner.java +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/ClustersInner.java @@ -46,7 +46,7 @@ public class ClustersInner implements InnerSupportsGet, InnerSuppo /** The Retrofit service to perform REST calls. */ private ClustersService service; /** The service client containing this operation class. */ - private EventHub2018PreviewManagementClientImpl client; + private EventHubManagementClientImpl client; /** * Initializes an instance of ClustersInner. @@ -54,7 +54,7 @@ public class ClustersInner implements InnerSupportsGet, InnerSuppo * @param retrofit the Retrofit instance built from a Retrofit Builder. * @param client the instance of the service client containing this operation class. */ - public ClustersInner(Retrofit retrofit, EventHub2018PreviewManagementClientImpl client) { + public ClustersInner(Retrofit retrofit, EventHubManagementClientImpl client) { this.service = retrofit.create(ClustersService.class); this.client = client; } @@ -116,7 +116,7 @@ interface ClustersService { * @return the PagedList object if successful. */ public PagedList list() { - PageImpl1 page = new PageImpl1<>(); + PageImpl page = new PageImpl<>(); page.setItems(listWithServiceResponseAsync().toBlocking().single().body()); page.setNextPageLink(null); return new PagedList(page) { @@ -146,7 +146,7 @@ public Observable> listAsync() { return listWithServiceResponseAsync().map(new Func1>, Page>() { @Override public Page call(ServiceResponse> response) { - PageImpl1 page = new PageImpl1<>(); + PageImpl page = new PageImpl<>(); page.setItems(response.body()); return page; } @@ -162,15 +162,13 @@ public Observable>> listWithServiceR 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()) + final String apiVersion = "2018-01-01-preview"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { try { - ServiceResponse> result = listDelegate(response); + ServiceResponse> result = listDelegate(response); List items = null; if (result.body() != null) { items = result.body().items(); @@ -184,9 +182,9 @@ public Observable>> call(Response> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) .registerError(ErrorResponseException.class) .build(response); } @@ -194,7 +192,7 @@ private ServiceResponse> listDelegate(Response< /** * Lists the available Event Hubs Clusters within an ARM resource group. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent @@ -213,7 +211,7 @@ public Page nextPage(String nextPageLink) { /** * Lists the available Event Hubs Clusters within an ARM resource group. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure 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 @@ -233,7 +231,7 @@ public Observable>> call(String nextPageLink) /** * Lists the available Event Hubs Clusters within an ARM resource group. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PagedList<ClusterInner> object */ @@ -250,7 +248,7 @@ public Page call(ServiceResponse> response) { /** * Lists the available Event Hubs Clusters within an ARM resource group. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PagedList<ClusterInner> object */ @@ -271,7 +269,7 @@ public Observable>> call(ServiceResponse> * @param resourceGroupName Name of the resource group within the Azure subscription. + ServiceResponse> * @param resourceGroupName Name of the resource group within the azure subscription. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList<ClusterInner> object wrapped in {@link ServiceResponse} if successful. */ @@ -282,15 +280,13 @@ public Observable>> listByResourceGroupSingle 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()) + final String apiVersion = "2018-01-01-preview"; + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { try { - ServiceResponse> result = listByResourceGroupDelegate(response); + ServiceResponse> result = listByResourceGroupDelegate(response); return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); @@ -299,9 +295,9 @@ public Observable>> call(Response> listByResourceGroupDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) + private ServiceResponse> listByResourceGroupDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) .registerError(ErrorResponseException.class) .build(response); } @@ -309,7 +305,7 @@ private ServiceResponse> listByResourceGroupDelegate(Resp /** * Gets the resource description of the specified Event Hubs Cluster. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param clusterName The name of the Event Hubs Cluster. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server @@ -323,7 +319,7 @@ public ClusterInner getByResourceGroup(String resourceGroupName, String clusterN /** * Gets the resource description of the specified Event Hubs Cluster. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param clusterName The name of the Event Hubs Cluster. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -336,7 +332,7 @@ public ServiceFuture getByResourceGroupAsync(String resourceGroupN /** * Gets the resource description of the specified Event Hubs Cluster. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param clusterName The name of the Event Hubs Cluster. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ClusterInner object @@ -353,7 +349,7 @@ public ClusterInner call(ServiceResponse response) { /** * Gets the resource description of the specified Event Hubs Cluster. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param clusterName The name of the Event Hubs Cluster. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ClusterInner object @@ -368,10 +364,8 @@ public Observable> getByResourceGroupWithServiceRe if (clusterName == null) { throw new IllegalArgumentException("Parameter clusterName 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, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + final String apiVersion = "2018-01-01-preview"; + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, clusterName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -395,7 +389,7 @@ private ServiceResponse getByResourceGroupDelegate(Response putAsync(String resourceGroupName, String clu /** * Creates or updates an instance of an Event Hubs Cluster. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param clusterName The name of the Event Hubs Cluster. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request @@ -439,7 +433,7 @@ public ClusterInner call(ServiceResponse response) { /** * Creates or updates an instance of an Event Hubs Cluster. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param clusterName The name of the Event Hubs Cluster. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request @@ -454,17 +448,15 @@ public Observable> putWithServiceResponseAsync(Str if (clusterName == null) { throw new IllegalArgumentException("Parameter clusterName 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.put(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + final String apiVersion = "2018-01-01-preview"; + Observable> observable = service.put(this.client.subscriptionId(), resourceGroupName, clusterName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); } /** * Creates or updates an instance of an Event Hubs Cluster. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param clusterName The name of the Event Hubs Cluster. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server @@ -478,7 +470,7 @@ public ClusterInner beginPut(String resourceGroupName, String clusterName) { /** * Creates or updates an instance of an Event Hubs Cluster. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param clusterName The name of the Event Hubs Cluster. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -491,7 +483,7 @@ public ServiceFuture beginPutAsync(String resourceGroupName, Strin /** * Creates or updates an instance of an Event Hubs Cluster. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param clusterName The name of the Event Hubs Cluster. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ClusterInner object @@ -508,7 +500,7 @@ public ClusterInner call(ServiceResponse response) { /** * Creates or updates an instance of an Event Hubs Cluster. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param clusterName The name of the Event Hubs Cluster. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ClusterInner object @@ -523,10 +515,8 @@ public Observable> beginPutWithServiceResponseAsyn if (clusterName == null) { throw new IllegalArgumentException("Parameter clusterName 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.beginPut(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + final String apiVersion = "2018-01-01-preview"; + return service.beginPut(this.client.subscriptionId(), resourceGroupName, clusterName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -552,7 +542,7 @@ private ServiceResponse beginPutDelegate(Response re /** * Modifies mutable properties on the Event Hubs Cluster. This operation is idempotent. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param clusterName The name of the Event Hubs Cluster. * @param parameters The properties of the Event Hubs Cluster which should be updated. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -567,7 +557,7 @@ public ClusterInner patch(String resourceGroupName, String clusterName, ClusterI /** * Modifies mutable properties on the Event Hubs Cluster. This operation is idempotent. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param clusterName The name of the Event Hubs Cluster. * @param parameters The properties of the Event Hubs Cluster which should be updated. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -581,7 +571,7 @@ public ServiceFuture patchAsync(String resourceGroupName, String c /** * Modifies mutable properties on the Event Hubs Cluster. This operation is idempotent. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param clusterName The name of the Event Hubs Cluster. * @param parameters The properties of the Event Hubs Cluster which should be updated. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -599,7 +589,7 @@ public ClusterInner call(ServiceResponse response) { /** * Modifies mutable properties on the Event Hubs Cluster. This operation is idempotent. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param clusterName The name of the Event Hubs Cluster. * @param parameters The properties of the Event Hubs Cluster which should be updated. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -615,21 +605,19 @@ public Observable> patchWithServiceResponseAsync(S if (clusterName == null) { throw new IllegalArgumentException("Parameter clusterName 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 (parameters == null) { throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); } Validator.validate(parameters); - Observable> observable = service.patch(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + final String apiVersion = "2018-01-01-preview"; + Observable> observable = service.patch(this.client.subscriptionId(), resourceGroupName, clusterName, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); } /** * Modifies mutable properties on the Event Hubs Cluster. This operation is idempotent. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param clusterName The name of the Event Hubs Cluster. * @param parameters The properties of the Event Hubs Cluster which should be updated. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -644,7 +632,7 @@ public ClusterInner beginPatch(String resourceGroupName, String clusterName, Clu /** * Modifies mutable properties on the Event Hubs Cluster. This operation is idempotent. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param clusterName The name of the Event Hubs Cluster. * @param parameters The properties of the Event Hubs Cluster which should be updated. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -658,7 +646,7 @@ public ServiceFuture beginPatchAsync(String resourceGroupName, Str /** * Modifies mutable properties on the Event Hubs Cluster. This operation is idempotent. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param clusterName The name of the Event Hubs Cluster. * @param parameters The properties of the Event Hubs Cluster which should be updated. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -676,7 +664,7 @@ public ClusterInner call(ServiceResponse response) { /** * Modifies mutable properties on the Event Hubs Cluster. This operation is idempotent. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param clusterName The name of the Event Hubs Cluster. * @param parameters The properties of the Event Hubs Cluster which should be updated. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -692,14 +680,12 @@ public Observable> beginPatchWithServiceResponseAs if (clusterName == null) { throw new IllegalArgumentException("Parameter clusterName 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 (parameters == null) { throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); } Validator.validate(parameters); - return service.beginPatch(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + final String apiVersion = "2018-01-01-preview"; + return service.beginPatch(this.client.subscriptionId(), resourceGroupName, clusterName, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -725,7 +711,7 @@ private ServiceResponse beginPatchDelegate(Response /** * Deletes an existing Event Hubs Cluster. This operation is idempotent. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param clusterName The name of the Event Hubs Cluster. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server @@ -738,7 +724,7 @@ public void delete(String resourceGroupName, String clusterName) { /** * Deletes an existing Event Hubs Cluster. This operation is idempotent. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param clusterName The name of the Event Hubs Cluster. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -751,7 +737,7 @@ public ServiceFuture deleteAsync(String resourceGroupName, String clusterN /** * Deletes an existing Event Hubs Cluster. This operation is idempotent. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param clusterName The name of the Event Hubs Cluster. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request @@ -768,7 +754,7 @@ public Void call(ServiceResponse response) { /** * Deletes an existing Event Hubs Cluster. This operation is idempotent. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param clusterName The name of the Event Hubs Cluster. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request @@ -783,17 +769,15 @@ public Observable> deleteWithServiceResponseAsync(String r if (clusterName == null) { throw new IllegalArgumentException("Parameter clusterName 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, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + final String apiVersion = "2018-01-01-preview"; + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, clusterName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** * Deletes an existing Event Hubs Cluster. This operation is idempotent. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param clusterName The name of the Event Hubs Cluster. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server @@ -806,7 +790,7 @@ public void beginDelete(String resourceGroupName, String clusterName) { /** * Deletes an existing Event Hubs Cluster. This operation is idempotent. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param clusterName The name of the Event Hubs Cluster. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -819,7 +803,7 @@ public ServiceFuture beginDeleteAsync(String resourceGroupName, String clu /** * Deletes an existing Event Hubs Cluster. This operation is idempotent. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param clusterName The name of the Event Hubs Cluster. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. @@ -836,7 +820,7 @@ public Void call(ServiceResponse response) { /** * Deletes an existing Event Hubs Cluster. This operation is idempotent. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param clusterName The name of the Event Hubs Cluster. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. @@ -851,10 +835,8 @@ public Observable> beginDeleteWithServiceResponseAsync(Str if (clusterName == null) { throw new IllegalArgumentException("Parameter clusterName 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, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + final String apiVersion = "2018-01-01-preview"; + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, clusterName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -880,7 +862,7 @@ private ServiceResponse beginDeleteDelegate(Response respons /** * List all Event Hubs Namespace IDs in an Event Hubs Dedicated Cluster. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param clusterName The name of the Event Hubs Cluster. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server @@ -894,7 +876,7 @@ public EHNamespaceIdListResultInner listNamespaces(String resourceGroupName, Str /** * List all Event Hubs Namespace IDs in an Event Hubs Dedicated Cluster. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param clusterName The name of the Event Hubs Cluster. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -907,7 +889,7 @@ public ServiceFuture listNamespacesAsync(String re /** * List all Event Hubs Namespace IDs in an Event Hubs Dedicated Cluster. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param clusterName The name of the Event Hubs Cluster. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the EHNamespaceIdListResultInner object @@ -924,7 +906,7 @@ public EHNamespaceIdListResultInner call(ServiceResponse> listNamespacesW if (clusterName == null) { throw new IllegalArgumentException("Parameter clusterName 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.listNamespaces(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + final String apiVersion = "2018-01-01-preview"; + return service.listNamespaces(this.client.subscriptionId(), resourceGroupName, clusterName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -1044,7 +1024,7 @@ public Observable>> call(ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList<ClusterInner> object wrapped in {@link ServiceResponse} if successful. */ @@ -1058,7 +1038,7 @@ public Observable>> listByResourceGroupNextSi @Override public Observable>> call(Response response) { try { - ServiceResponse> result = listByResourceGroupNextDelegate(response); + ServiceResponse> result = listByResourceGroupNextDelegate(response); return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); @@ -1067,9 +1047,9 @@ public Observable>> call(Response> listByResourceGroupNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) .registerError(ErrorResponseException.class) .build(response); } diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/ConfigurationsInner.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/ConfigurationsInner.java index c9a6e319f164f..09b99cb7d584c 100644 --- a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/ConfigurationsInner.java +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/ConfigurationsInner.java @@ -37,7 +37,7 @@ public class ConfigurationsInner { /** The Retrofit service to perform REST calls. */ private ConfigurationsService service; /** The service client containing this operation class. */ - private EventHub2018PreviewManagementClientImpl client; + private EventHubManagementClientImpl client; /** * Initializes an instance of ConfigurationsInner. @@ -45,7 +45,7 @@ public class ConfigurationsInner { * @param retrofit the Retrofit instance built from a Retrofit Builder. * @param client the instance of the service client containing this operation class. */ - public ConfigurationsInner(Retrofit retrofit, EventHub2018PreviewManagementClientImpl client) { + public ConfigurationsInner(Retrofit retrofit, EventHubManagementClientImpl client) { this.service = retrofit.create(ConfigurationsService.class); this.client = client; } @@ -68,7 +68,7 @@ interface ConfigurationsService { /** * Replace all specified Event Hubs Cluster settings with those contained in the request body. Leaves the settings not specified in the request body unmodified. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param clusterName The name of the Event Hubs Cluster. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server @@ -82,7 +82,7 @@ public ClusterQuotaConfigurationPropertiesInner patch(String resourceGroupName, /** * Replace all specified Event Hubs Cluster settings with those contained in the request body. Leaves the settings not specified in the request body unmodified. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param clusterName The name of the Event Hubs Cluster. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -95,7 +95,7 @@ public ServiceFuture patchAsync(String /** * Replace all specified Event Hubs Cluster settings with those contained in the request body. Leaves the settings not specified in the request body unmodified. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param clusterName The name of the Event Hubs Cluster. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ClusterQuotaConfigurationPropertiesInner object @@ -112,7 +112,7 @@ public ClusterQuotaConfigurationPropertiesInner call(ServiceResponse> pat if (clusterName == null) { throw new IllegalArgumentException("Parameter clusterName 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 apiVersion = "2018-01-01-preview"; final Map settings = null; ClusterQuotaConfigurationPropertiesInner parameters = new ClusterQuotaConfigurationPropertiesInner(); parameters.withSettings(null); - return service.patch(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + return service.patch(this.client.subscriptionId(), resourceGroupName, clusterName, apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -150,7 +148,7 @@ public Observable> cal /** * Replace all specified Event Hubs Cluster settings with those contained in the request body. Leaves the settings not specified in the request body unmodified. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param clusterName The name of the Event Hubs Cluster. * @param settings All possible Cluster settings - a collection of key/value paired settings which apply to quotas and configurations imposed on the cluster. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -165,7 +163,7 @@ public ClusterQuotaConfigurationPropertiesInner patch(String resourceGroupName, /** * Replace all specified Event Hubs Cluster settings with those contained in the request body. Leaves the settings not specified in the request body unmodified. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param clusterName The name of the Event Hubs Cluster. * @param settings All possible Cluster settings - a collection of key/value paired settings which apply to quotas and configurations imposed on the cluster. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -179,7 +177,7 @@ public ServiceFuture patchAsync(String /** * Replace all specified Event Hubs Cluster settings with those contained in the request body. Leaves the settings not specified in the request body unmodified. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param clusterName The name of the Event Hubs Cluster. * @param settings All possible Cluster settings - a collection of key/value paired settings which apply to quotas and configurations imposed on the cluster. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -197,7 +195,7 @@ public ClusterQuotaConfigurationPropertiesInner call(ServiceResponse> pat if (clusterName == null) { throw new IllegalArgumentException("Parameter clusterName 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(settings); + final String apiVersion = "2018-01-01-preview"; ClusterQuotaConfigurationPropertiesInner parameters = new ClusterQuotaConfigurationPropertiesInner(); parameters.withSettings(settings); - return service.patch(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + return service.patch(this.client.subscriptionId(), resourceGroupName, clusterName, apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -245,7 +241,7 @@ private ServiceResponse patchDelegate( /** * Get all Event Hubs Cluster settings - a collection of key/value pairs which represent the quotas and settings imposed on the cluster. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param clusterName The name of the Event Hubs Cluster. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server @@ -259,7 +255,7 @@ public ClusterQuotaConfigurationPropertiesInner get(String resourceGroupName, St /** * Get all Event Hubs Cluster settings - a collection of key/value pairs which represent the quotas and settings imposed on the cluster. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param clusterName The name of the Event Hubs Cluster. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -272,7 +268,7 @@ public ServiceFuture getAsync(String r /** * Get all Event Hubs Cluster settings - a collection of key/value pairs which represent the quotas and settings imposed on the cluster. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param clusterName The name of the Event Hubs Cluster. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ClusterQuotaConfigurationPropertiesInner object @@ -289,7 +285,7 @@ public ClusterQuotaConfigurationPropertiesInner call(ServiceResponse> get if (clusterName == null) { throw new IllegalArgumentException("Parameter clusterName 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, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + final String apiVersion = "2018-01-01-preview"; + return service.get(this.client.subscriptionId(), resourceGroupName, clusterName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/ConsumerGroupImpl.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/ConsumerGroupImpl.java new file mode 100644 index 0000000000000..5c70c31eb78c2 --- /dev/null +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/ConsumerGroupImpl.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.eventhubs.v2018_01_01_preview.implementation; + +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.ConsumerGroup; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import org.joda.time.DateTime; + +class ConsumerGroupImpl extends CreatableUpdatableImpl implements ConsumerGroup, ConsumerGroup.Definition, ConsumerGroup.Update { + private final EventHubsManager manager; + private String resourceGroupName; + private String namespaceName; + private String eventHubName; + private String consumerGroupName; + private String cuserMetadata; + private String uuserMetadata; + + ConsumerGroupImpl(String name, EventHubsManager manager) { + super(name, new ConsumerGroupInner()); + this.manager = manager; + // Set resource name + this.consumerGroupName = name; + // + } + + ConsumerGroupImpl(ConsumerGroupInner inner, EventHubsManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.consumerGroupName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.namespaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "namespaces"); + this.eventHubName = IdParsingUtils.getValueFromIdByName(inner.id(), "eventhubs"); + this.consumerGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "consumergroups"); + // + } + + @Override + public EventHubsManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ConsumerGroupsInner client = this.manager().inner().consumerGroups(); + return client.createOrUpdateAsync(this.resourceGroupName, this.namespaceName, this.eventHubName, this.consumerGroupName, this.cuserMetadata) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ConsumerGroupsInner client = this.manager().inner().consumerGroups(); + return client.createOrUpdateAsync(this.resourceGroupName, this.namespaceName, this.eventHubName, this.consumerGroupName, this.uuserMetadata) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ConsumerGroupsInner client = this.manager().inner().consumerGroups(); + return client.getAsync(this.resourceGroupName, this.namespaceName, this.eventHubName, this.consumerGroupName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public DateTime createdAt() { + return this.inner().createdAt(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public DateTime updatedAt() { + return this.inner().updatedAt(); + } + + @Override + public String userMetadata() { + return this.inner().userMetadata(); + } + + @Override + public ConsumerGroupImpl withExistingEventhub(String resourceGroupName, String namespaceName, String eventHubName) { + this.resourceGroupName = resourceGroupName; + this.namespaceName = namespaceName; + this.eventHubName = eventHubName; + return this; + } + + @Override + public ConsumerGroupImpl withUserMetadata(String userMetadata) { + if (isInCreateMode()) { + this.cuserMetadata = userMetadata; + } else { + this.uuserMetadata = userMetadata; + } + return this; + } + +} diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/ConsumerGroupInner.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/ConsumerGroupInner.java new file mode 100644 index 0000000000000..5e5dd9c4af0e2 --- /dev/null +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/ConsumerGroupInner.java @@ -0,0 +1,80 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventhubs.v2018_01_01_preview.implementation; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Single item in List or Get Consumer group operation. + */ +@JsonFlatten +public class ConsumerGroupInner extends ProxyResource { + /** + * Exact time the message was created. + */ + @JsonProperty(value = "properties.createdAt", access = JsonProperty.Access.WRITE_ONLY) + private DateTime createdAt; + + /** + * The exact time the message was updated. + */ + @JsonProperty(value = "properties.updatedAt", access = JsonProperty.Access.WRITE_ONLY) + private DateTime updatedAt; + + /** + * User Metadata is a placeholder to store user-defined string data with + * maximum length 1024. e.g. it can be used to store descriptive data, such + * as list of teams and their contact information also user-defined + * configuration settings can be stored. + */ + @JsonProperty(value = "properties.userMetadata") + private String userMetadata; + + /** + * Get exact time the message was created. + * + * @return the createdAt value + */ + public DateTime createdAt() { + return this.createdAt; + } + + /** + * Get the exact time the message was updated. + * + * @return the updatedAt value + */ + public DateTime updatedAt() { + return this.updatedAt; + } + + /** + * Get user Metadata is a placeholder to store user-defined string data with maximum length 1024. e.g. it can be used to store descriptive data, such as list of teams and their contact information also user-defined configuration settings can be stored. + * + * @return the userMetadata value + */ + public String userMetadata() { + return this.userMetadata; + } + + /** + * Set user Metadata is a placeholder to store user-defined string data with maximum length 1024. e.g. it can be used to store descriptive data, such as list of teams and their contact information also user-defined configuration settings can be stored. + * + * @param userMetadata the userMetadata value to set + * @return the ConsumerGroupInner object itself. + */ + public ConsumerGroupInner withUserMetadata(String userMetadata) { + this.userMetadata = userMetadata; + return this; + } + +} diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/ConsumerGroupsImpl.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/ConsumerGroupsImpl.java new file mode 100644 index 0000000000000..9a6fa3de80e68 --- /dev/null +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/ConsumerGroupsImpl.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.eventhubs.v2018_01_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.ConsumerGroups; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.ConsumerGroup; + +class ConsumerGroupsImpl extends WrapperImpl implements ConsumerGroups { + private final EventHubsManager manager; + + ConsumerGroupsImpl(EventHubsManager manager) { + super(manager.inner().consumerGroups()); + this.manager = manager; + } + + public EventHubsManager manager() { + return this.manager; + } + + @Override + public ConsumerGroupImpl define(String name) { + return wrapModel(name); + } + + private ConsumerGroupImpl wrapModel(ConsumerGroupInner inner) { + return new ConsumerGroupImpl(inner, manager()); + } + + private ConsumerGroupImpl wrapModel(String name) { + return new ConsumerGroupImpl(name, this.manager()); + } + + @Override + public Observable listByEventHubAsync(final String resourceGroupName, final String namespaceName, final String eventHubName) { + ConsumerGroupsInner client = this.inner(); + return client.listByEventHubAsync(resourceGroupName, namespaceName, eventHubName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ConsumerGroup call(ConsumerGroupInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String namespaceName, String eventHubName, String consumerGroupName) { + ConsumerGroupsInner client = this.inner(); + return client.getAsync(resourceGroupName, namespaceName, eventHubName, consumerGroupName) + .flatMap(new Func1>() { + @Override + public Observable call(ConsumerGroupInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((ConsumerGroup)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String namespaceName, String eventHubName, String consumerGroupName) { + ConsumerGroupsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, namespaceName, eventHubName, consumerGroupName).toCompletable(); + } + +} diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/ConsumerGroupsInner.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/ConsumerGroupsInner.java new file mode 100644 index 0000000000000..20f8ea1ecf8ec --- /dev/null +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/ConsumerGroupsInner.java @@ -0,0 +1,853 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventhubs.v2018_01_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.eventhubs.v2018_01_01_preview.ErrorResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ConsumerGroups. + */ +public class ConsumerGroupsInner { + /** The Retrofit service to perform REST calls. */ + private ConsumerGroupsService service; + /** The service client containing this operation class. */ + private EventHubManagementClientImpl client; + + /** + * Initializes an instance of ConsumerGroupsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ConsumerGroupsInner(Retrofit retrofit, EventHubManagementClientImpl client) { + this.service = retrofit.create(ConsumerGroupsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ConsumerGroups to be + * used by Retrofit to perform actually REST calls. + */ + interface ConsumerGroupsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventhubs.v2018_01_01_preview.ConsumerGroups createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/consumergroups/{consumerGroupName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("eventHubName") String eventHubName, @Path("consumerGroupName") String consumerGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ConsumerGroupInner parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventhubs.v2018_01_01_preview.ConsumerGroups delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/consumergroups/{consumerGroupName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("eventHubName") String eventHubName, @Path("consumerGroupName") String consumerGroupName, @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.eventhubs.v2018_01_01_preview.ConsumerGroups get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/consumergroups/{consumerGroupName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("eventHubName") String eventHubName, @Path("consumerGroupName") String consumerGroupName, @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.eventhubs.v2018_01_01_preview.ConsumerGroups listByEventHub" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/consumergroups") + Observable> listByEventHub(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("eventHubName") String eventHubName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$skip") Integer skip, @Query("$top") Integer top, @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.eventhubs.v2018_01_01_preview.ConsumerGroups listByEventHubNext" }) + @GET + Observable> listByEventHubNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Creates or updates an Event Hubs consumer group as a nested resource within a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param consumerGroupName The consumer group name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ConsumerGroupInner object if successful. + */ + public ConsumerGroupInner createOrUpdate(String resourceGroupName, String namespaceName, String eventHubName, String consumerGroupName) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, consumerGroupName).toBlocking().single().body(); + } + + /** + * Creates or updates an Event Hubs consumer group as a nested resource within a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param consumerGroupName The consumer group name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String namespaceName, String eventHubName, String consumerGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, consumerGroupName), serviceCallback); + } + + /** + * Creates or updates an Event Hubs consumer group as a nested resource within a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param consumerGroupName The consumer group name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConsumerGroupInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String namespaceName, String eventHubName, String consumerGroupName) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, consumerGroupName).map(new Func1, ConsumerGroupInner>() { + @Override + public ConsumerGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates an Event Hubs consumer group as a nested resource within a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param consumerGroupName The consumer group name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConsumerGroupInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String namespaceName, String eventHubName, String consumerGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (eventHubName == null) { + throw new IllegalArgumentException("Parameter eventHubName is required and cannot be null."); + } + if (consumerGroupName == null) { + throw new IllegalArgumentException("Parameter consumerGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-04-01"; + final String userMetadata = null; + ConsumerGroupInner parameters = new ConsumerGroupInner(); + parameters.withUserMetadata(null); + return service.createOrUpdate(resourceGroupName, namespaceName, eventHubName, consumerGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, 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); + } + } + }); + } + + /** + * Creates or updates an Event Hubs consumer group as a nested resource within a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param consumerGroupName The consumer group name + * @param userMetadata User Metadata is a placeholder to store user-defined string data with maximum length 1024. e.g. it can be used to store descriptive data, such as list of teams and their contact information also user-defined configuration settings can be stored. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ConsumerGroupInner object if successful. + */ + public ConsumerGroupInner createOrUpdate(String resourceGroupName, String namespaceName, String eventHubName, String consumerGroupName, String userMetadata) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, consumerGroupName, userMetadata).toBlocking().single().body(); + } + + /** + * Creates or updates an Event Hubs consumer group as a nested resource within a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param consumerGroupName The consumer group name + * @param userMetadata User Metadata is a placeholder to store user-defined string data with maximum length 1024. e.g. it can be used to store descriptive data, such as list of teams and their contact information also user-defined configuration settings can be stored. + * @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 namespaceName, String eventHubName, String consumerGroupName, String userMetadata, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, consumerGroupName, userMetadata), serviceCallback); + } + + /** + * Creates or updates an Event Hubs consumer group as a nested resource within a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param consumerGroupName The consumer group name + * @param userMetadata User Metadata is a placeholder to store user-defined string data with maximum length 1024. e.g. it can be used to store descriptive data, such as list of teams and their contact information also user-defined configuration settings can be stored. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConsumerGroupInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String namespaceName, String eventHubName, String consumerGroupName, String userMetadata) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, consumerGroupName, userMetadata).map(new Func1, ConsumerGroupInner>() { + @Override + public ConsumerGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates an Event Hubs consumer group as a nested resource within a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param consumerGroupName The consumer group name + * @param userMetadata User Metadata is a placeholder to store user-defined string data with maximum length 1024. e.g. it can be used to store descriptive data, such as list of teams and their contact information also user-defined configuration settings can be stored. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConsumerGroupInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String namespaceName, String eventHubName, String consumerGroupName, String userMetadata) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (eventHubName == null) { + throw new IllegalArgumentException("Parameter eventHubName is required and cannot be null."); + } + if (consumerGroupName == null) { + throw new IllegalArgumentException("Parameter consumerGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-04-01"; + ConsumerGroupInner parameters = new ConsumerGroupInner(); + parameters.withUserMetadata(userMetadata); + return service.createOrUpdate(resourceGroupName, namespaceName, eventHubName, consumerGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Deletes a consumer group from the specified Event Hub and resource group. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param consumerGroupName The consumer group name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String namespaceName, String eventHubName, String consumerGroupName) { + deleteWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, consumerGroupName).toBlocking().single().body(); + } + + /** + * Deletes a consumer group from the specified Event Hub and resource group. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param consumerGroupName The consumer group name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String namespaceName, String eventHubName, String consumerGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, consumerGroupName), serviceCallback); + } + + /** + * Deletes a consumer group from the specified Event Hub and resource group. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param consumerGroupName The consumer group name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String namespaceName, String eventHubName, String consumerGroupName) { + return deleteWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, consumerGroupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a consumer group from the specified Event Hub and resource group. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param consumerGroupName The consumer group name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String namespaceName, String eventHubName, String consumerGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (eventHubName == null) { + throw new IllegalArgumentException("Parameter eventHubName is required and cannot be null."); + } + if (consumerGroupName == null) { + throw new IllegalArgumentException("Parameter consumerGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-04-01"; + return service.delete(resourceGroupName, namespaceName, eventHubName, consumerGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets a description for the specified consumer group. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param consumerGroupName The consumer group name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ConsumerGroupInner object if successful. + */ + public ConsumerGroupInner get(String resourceGroupName, String namespaceName, String eventHubName, String consumerGroupName) { + return getWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, consumerGroupName).toBlocking().single().body(); + } + + /** + * Gets a description for the specified consumer group. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param consumerGroupName The consumer group name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String namespaceName, String eventHubName, String consumerGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, consumerGroupName), serviceCallback); + } + + /** + * Gets a description for the specified consumer group. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param consumerGroupName The consumer group name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConsumerGroupInner object + */ + public Observable getAsync(String resourceGroupName, String namespaceName, String eventHubName, String consumerGroupName) { + return getWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, consumerGroupName).map(new Func1, ConsumerGroupInner>() { + @Override + public ConsumerGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a description for the specified consumer group. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param consumerGroupName The consumer group name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConsumerGroupInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String namespaceName, String eventHubName, String consumerGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (eventHubName == null) { + throw new IllegalArgumentException("Parameter eventHubName is required and cannot be null."); + } + if (consumerGroupName == null) { + throw new IllegalArgumentException("Parameter consumerGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-04-01"; + return service.get(resourceGroupName, namespaceName, eventHubName, consumerGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ConsumerGroupInner> object if successful. + */ + public PagedList listByEventHub(final String resourceGroupName, final String namespaceName, final String eventHubName) { + ServiceResponse> response = listByEventHubSinglePageAsync(resourceGroupName, namespaceName, eventHubName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByEventHubNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByEventHubAsync(final String resourceGroupName, final String namespaceName, final String eventHubName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByEventHubSinglePageAsync(resourceGroupName, namespaceName, eventHubName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByEventHubNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ConsumerGroupInner> object + */ + public Observable> listByEventHubAsync(final String resourceGroupName, final String namespaceName, final String eventHubName) { + return listByEventHubWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ConsumerGroupInner> object + */ + public Observable>> listByEventHubWithServiceResponseAsync(final String resourceGroupName, final String namespaceName, final String eventHubName) { + return listByEventHubSinglePageAsync(resourceGroupName, namespaceName, eventHubName) + .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(listByEventHubNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ConsumerGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByEventHubSinglePageAsync(final String resourceGroupName, final String namespaceName, final String eventHubName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (eventHubName == null) { + throw new IllegalArgumentException("Parameter eventHubName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-04-01"; + final Integer skip = null; + final Integer top = null; + return service.listByEventHub(resourceGroupName, namespaceName, eventHubName, this.client.subscriptionId(), apiVersion, skip, top, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByEventHubDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls. + * @param top May be used to limit the number of results to the most recent N usageDetails. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ConsumerGroupInner> object if successful. + */ + public PagedList listByEventHub(final String resourceGroupName, final String namespaceName, final String eventHubName, final Integer skip, final Integer top) { + ServiceResponse> response = listByEventHubSinglePageAsync(resourceGroupName, namespaceName, eventHubName, skip, top).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByEventHubNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls. + * @param top May be used to limit the number of results to the most recent N usageDetails. + * @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> listByEventHubAsync(final String resourceGroupName, final String namespaceName, final String eventHubName, final Integer skip, final Integer top, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByEventHubSinglePageAsync(resourceGroupName, namespaceName, eventHubName, skip, top), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByEventHubNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls. + * @param top May be used to limit the number of results to the most recent N usageDetails. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ConsumerGroupInner> object + */ + public Observable> listByEventHubAsync(final String resourceGroupName, final String namespaceName, final String eventHubName, final Integer skip, final Integer top) { + return listByEventHubWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, skip, top) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls. + * @param top May be used to limit the number of results to the most recent N usageDetails. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ConsumerGroupInner> object + */ + public Observable>> listByEventHubWithServiceResponseAsync(final String resourceGroupName, final String namespaceName, final String eventHubName, final Integer skip, final Integer top) { + return listByEventHubSinglePageAsync(resourceGroupName, namespaceName, eventHubName, skip, top) + .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(listByEventHubNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the Namespace. + * + ServiceResponse> * @param resourceGroupName Name of the resource group within the azure subscription. + ServiceResponse> * @param namespaceName The Namespace name + ServiceResponse> * @param eventHubName The Event Hub name + ServiceResponse> * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls. + ServiceResponse> * @param top May be used to limit the number of results to the most recent N usageDetails. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ConsumerGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByEventHubSinglePageAsync(final String resourceGroupName, final String namespaceName, final String eventHubName, final Integer skip, final Integer top) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (eventHubName == null) { + throw new IllegalArgumentException("Parameter eventHubName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-04-01"; + return service.listByEventHub(resourceGroupName, namespaceName, eventHubName, this.client.subscriptionId(), apiVersion, skip, top, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByEventHubDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByEventHubDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the Namespace. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ConsumerGroupInner> object if successful. + */ + public PagedList listByEventHubNext(final String nextPageLink) { + ServiceResponse> response = listByEventHubNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByEventHubNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the Namespace. + * + * @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> listByEventHubNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByEventHubNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByEventHubNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the Namespace. + * + * @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<ConsumerGroupInner> object + */ + public Observable> listByEventHubNextAsync(final String nextPageLink) { + return listByEventHubNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the Namespace. + * + * @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<ConsumerGroupInner> object + */ + public Observable>> listByEventHubNextWithServiceResponseAsync(final String nextPageLink) { + return listByEventHubNextSinglePageAsync(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(listByEventHubNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the Namespace. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ConsumerGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByEventHubNextSinglePageAsync(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.listByEventHubNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByEventHubNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByEventHubNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/DisasterRecoveryConfigNamespaceAuthorizationRuleImpl.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/DisasterRecoveryConfigNamespaceAuthorizationRuleImpl.java new file mode 100644 index 0000000000000..7064ed041fc81 --- /dev/null +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/DisasterRecoveryConfigNamespaceAuthorizationRuleImpl.java @@ -0,0 +1,67 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventhubs.v2018_01_01_preview.implementation; + +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.DisasterRecoveryConfigNamespaceAuthorizationRule; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.AccessRights; + +class DisasterRecoveryConfigNamespaceAuthorizationRuleImpl extends IndexableRefreshableWrapperImpl implements DisasterRecoveryConfigNamespaceAuthorizationRule { + private final EventHubsManager manager; + private String resourceGroupName; + private String namespaceName; + private String alias; + private String authorizationRuleName; + + DisasterRecoveryConfigNamespaceAuthorizationRuleImpl(AuthorizationRuleInner inner, EventHubsManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.namespaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "namespaces"); + this.alias = IdParsingUtils.getValueFromIdByName(inner.id(), "disasterRecoveryConfigs"); + this.authorizationRuleName = IdParsingUtils.getValueFromIdByName(inner.id(), "authorizationRules"); + } + + @Override + public EventHubsManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + DisasterRecoveryConfigsInner client = this.manager().inner().disasterRecoveryConfigs(); + return client.getAuthorizationRuleAsync(this.resourceGroupName, this.namespaceName, this.alias, this.authorizationRuleName); + } + + + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List rights() { + return this.inner().rights(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/DisasterRecoveryConfigsImpl.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/DisasterRecoveryConfigsImpl.java new file mode 100644 index 0000000000000..7d8b33829c175 --- /dev/null +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/DisasterRecoveryConfigsImpl.java @@ -0,0 +1,171 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.eventhubs.v2018_01_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.DisasterRecoveryConfigs; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.CheckNameAvailabilityResult; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.ArmDisasterRecovery; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.DisasterRecoveryConfigNamespaceAuthorizationRule; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.AccessKeys; + +class DisasterRecoveryConfigsImpl extends WrapperImpl implements DisasterRecoveryConfigs { + private final EventHubsManager manager; + + DisasterRecoveryConfigsImpl(EventHubsManager manager) { + super(manager.inner().disasterRecoveryConfigs()); + this.manager = manager; + } + + public EventHubsManager manager() { + return this.manager; + } + + @Override + public ArmDisasterRecoveryImpl define(String name) { + return wrapModel(name); + } + + private ArmDisasterRecoveryImpl wrapModel(ArmDisasterRecoveryInner inner) { + return new ArmDisasterRecoveryImpl(inner, manager()); + } + + private ArmDisasterRecoveryImpl wrapModel(String name) { + return new ArmDisasterRecoveryImpl(name, this.manager()); + } + + @Override + public Observable checkNameAvailabilityAsync(String resourceGroupName, String namespaceName, String name) { + DisasterRecoveryConfigsInner client = this.inner(); + return client.checkNameAvailabilityAsync(resourceGroupName, namespaceName, name) + .map(new Func1() { + @Override + public CheckNameAvailabilityResult call(CheckNameAvailabilityResultInner inner) { + return new CheckNameAvailabilityResultImpl(inner, manager()); + } + }); + } + + @Override + public Completable breakPairingAsync(String resourceGroupName, String namespaceName, String alias) { + DisasterRecoveryConfigsInner client = this.inner(); + return client.breakPairingAsync(resourceGroupName, namespaceName, alias).toCompletable(); + } + + @Override + public Completable failOverAsync(String resourceGroupName, String namespaceName, String alias) { + DisasterRecoveryConfigsInner client = this.inner(); + return client.failOverAsync(resourceGroupName, namespaceName, alias).toCompletable(); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String namespaceName) { + DisasterRecoveryConfigsInner client = this.inner(); + return client.listAsync(resourceGroupName, namespaceName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ArmDisasterRecovery call(ArmDisasterRecoveryInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String namespaceName, String alias) { + DisasterRecoveryConfigsInner client = this.inner(); + return client.getAsync(resourceGroupName, namespaceName, alias) + .flatMap(new Func1>() { + @Override + public Observable call(ArmDisasterRecoveryInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((ArmDisasterRecovery)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String namespaceName, String alias) { + DisasterRecoveryConfigsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, namespaceName, alias).toCompletable(); + } + + private DisasterRecoveryConfigNamespaceAuthorizationRuleImpl wrapDisasterRecoveryConfigNamespaceAuthorizationRuleModel(AuthorizationRuleInner inner) { + return new DisasterRecoveryConfigNamespaceAuthorizationRuleImpl(inner, manager()); + } + + private Observable getAuthorizationRuleInnerUsingDisasterRecoveryConfigsInnerAsync(String id) { + String resourceGroupName = IdParsingUtils.getValueFromIdByName(id, "resourceGroups"); + String namespaceName = IdParsingUtils.getValueFromIdByName(id, "namespaces"); + String alias = IdParsingUtils.getValueFromIdByName(id, "disasterRecoveryConfigs"); + String authorizationRuleName = IdParsingUtils.getValueFromIdByName(id, "authorizationRules"); + DisasterRecoveryConfigsInner client = this.inner(); + return client.getAuthorizationRuleAsync(resourceGroupName, namespaceName, alias, authorizationRuleName); + } + + @Override + public Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String alias, String authorizationRuleName) { + DisasterRecoveryConfigsInner client = this.inner(); + return client.getAuthorizationRuleAsync(resourceGroupName, namespaceName, alias, authorizationRuleName) + .flatMap(new Func1>() { + @Override + public Observable call(AuthorizationRuleInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((DisasterRecoveryConfigNamespaceAuthorizationRule)wrapDisasterRecoveryConfigNamespaceAuthorizationRuleModel(inner)); + } + } + }); + } + + @Override + public Observable listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final String alias) { + DisasterRecoveryConfigsInner client = this.inner(); + return client.listAuthorizationRulesAsync(resourceGroupName, namespaceName, alias) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public DisasterRecoveryConfigNamespaceAuthorizationRule call(AuthorizationRuleInner inner) { + return wrapDisasterRecoveryConfigNamespaceAuthorizationRuleModel(inner); + } + }); + } + + @Override + public Observable listKeysAsync(String resourceGroupName, String namespaceName, String alias, String authorizationRuleName) { + DisasterRecoveryConfigsInner client = this.inner(); + return client.listKeysAsync(resourceGroupName, namespaceName, alias, authorizationRuleName) + .map(new Func1() { + @Override + public AccessKeys call(AccessKeysInner inner) { + return new AccessKeysImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/DisasterRecoveryConfigsInner.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/DisasterRecoveryConfigsInner.java new file mode 100644 index 0000000000000..0a019ca08ae80 --- /dev/null +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/DisasterRecoveryConfigsInner.java @@ -0,0 +1,1338 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventhubs.v2018_01_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.eventhubs.v2018_01_01_preview.CheckNameAvailabilityParameter; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.ErrorResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.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 DisasterRecoveryConfigs. + */ +public class DisasterRecoveryConfigsInner { + /** The Retrofit service to perform REST calls. */ + private DisasterRecoveryConfigsService service; + /** The service client containing this operation class. */ + private EventHubManagementClientImpl client; + + /** + * Initializes an instance of DisasterRecoveryConfigsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public DisasterRecoveryConfigsInner(Retrofit retrofit, EventHubManagementClientImpl client) { + this.service = retrofit.create(DisasterRecoveryConfigsService.class); + this.client = client; + } + + /** + * The interface defining all the services for DisasterRecoveryConfigs to be + * used by Retrofit to perform actually REST calls. + */ + interface DisasterRecoveryConfigsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventhubs.v2018_01_01_preview.DisasterRecoveryConfigs listAuthorizationRules" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/authorizationRules") + Observable> listAuthorizationRules(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("alias") String alias, @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.eventhubs.v2018_01_01_preview.DisasterRecoveryConfigs getAuthorizationRule" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/authorizationRules/{authorizationRuleName}") + Observable> getAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("alias") String alias, @Path("authorizationRuleName") String authorizationRuleName, @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.eventhubs.v2018_01_01_preview.DisasterRecoveryConfigs listKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/authorizationRules/{authorizationRuleName}/listKeys") + Observable> listKeys(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("alias") String alias, @Path("authorizationRuleName") String authorizationRuleName, @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.eventhubs.v2018_01_01_preview.DisasterRecoveryConfigs checkNameAvailability" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/checkNameAvailability") + Observable> checkNameAvailability(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body CheckNameAvailabilityParameter parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventhubs.v2018_01_01_preview.DisasterRecoveryConfigs list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @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.eventhubs.v2018_01_01_preview.DisasterRecoveryConfigs createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("alias") String alias, @Path("subscriptionId") String subscriptionId, @Body ArmDisasterRecoveryInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventhubs.v2018_01_01_preview.DisasterRecoveryConfigs delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("alias") String alias, @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.eventhubs.v2018_01_01_preview.DisasterRecoveryConfigs get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("alias") String alias, @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.eventhubs.v2018_01_01_preview.DisasterRecoveryConfigs breakPairing" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/breakPairing") + Observable> breakPairing(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("alias") String alias, @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.eventhubs.v2018_01_01_preview.DisasterRecoveryConfigs failOver" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/failover") + Observable> failOver(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("alias") String alias, @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.eventhubs.v2018_01_01_preview.DisasterRecoveryConfigs listAuthorizationRulesNext" }) + @GET + Observable> listAuthorizationRulesNext(@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.eventhubs.v2018_01_01_preview.DisasterRecoveryConfigs listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets a list of authorization rules for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param alias The Disaster Recovery configuration name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AuthorizationRuleInner> object if successful. + */ + public PagedList listAuthorizationRules(final String resourceGroupName, final String namespaceName, final String alias) { + ServiceResponse> response = listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, alias).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets a list of authorization rules for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param alias The Disaster Recovery configuration name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final String alias, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, alias), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets a list of authorization rules for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param alias The Disaster Recovery configuration name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AuthorizationRuleInner> object + */ + public Observable> listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final String alias) { + return listAuthorizationRulesWithServiceResponseAsync(resourceGroupName, namespaceName, alias) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of authorization rules for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param alias The Disaster Recovery configuration name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AuthorizationRuleInner> object + */ + public Observable>> listAuthorizationRulesWithServiceResponseAsync(final String resourceGroupName, final String namespaceName, final String alias) { + return listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, alias) + .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(listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets a list of authorization rules for a Namespace. + * + ServiceResponse> * @param resourceGroupName Name of the resource group within the azure subscription. + ServiceResponse> * @param namespaceName The Namespace name + ServiceResponse> * @param alias The Disaster Recovery configuration name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AuthorizationRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listAuthorizationRulesSinglePageAsync(final String resourceGroupName, final String namespaceName, final String alias) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (alias == null) { + throw new IllegalArgumentException("Parameter alias is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-04-01"; + return service.listAuthorizationRules(resourceGroupName, namespaceName, alias, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listAuthorizationRulesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listAuthorizationRulesDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets an AuthorizationRule for a Namespace by rule name. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param alias The Disaster Recovery configuration name + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AuthorizationRuleInner object if successful. + */ + public AuthorizationRuleInner getAuthorizationRule(String resourceGroupName, String namespaceName, String alias, String authorizationRuleName) { + return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, alias, authorizationRuleName).toBlocking().single().body(); + } + + /** + * Gets an AuthorizationRule for a Namespace by rule name. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param alias The Disaster Recovery configuration name + * @param authorizationRuleName The authorization rule name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String alias, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, alias, authorizationRuleName), serviceCallback); + } + + /** + * Gets an AuthorizationRule for a Namespace by rule name. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param alias The Disaster Recovery configuration name + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AuthorizationRuleInner object + */ + public Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String alias, String authorizationRuleName) { + return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, alias, authorizationRuleName).map(new Func1, AuthorizationRuleInner>() { + @Override + public AuthorizationRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets an AuthorizationRule for a Namespace by rule name. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param alias The Disaster Recovery configuration name + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AuthorizationRuleInner object + */ + public Observable> getAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String alias, String authorizationRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (alias == null) { + throw new IllegalArgumentException("Parameter alias is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-04-01"; + return service.getAuthorizationRule(resourceGroupName, namespaceName, alias, authorizationRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getAuthorizationRuleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getAuthorizationRuleDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets the primary and secondary connection strings for the Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param alias The Disaster Recovery configuration name + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AccessKeysInner object if successful. + */ + public AccessKeysInner listKeys(String resourceGroupName, String namespaceName, String alias, String authorizationRuleName) { + return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, alias, authorizationRuleName).toBlocking().single().body(); + } + + /** + * Gets the primary and secondary connection strings for the Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param alias The Disaster Recovery configuration name + * @param authorizationRuleName The authorization rule name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listKeysAsync(String resourceGroupName, String namespaceName, String alias, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, alias, authorizationRuleName), serviceCallback); + } + + /** + * Gets the primary and secondary connection strings for the Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param alias The Disaster Recovery configuration name + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AccessKeysInner object + */ + public Observable listKeysAsync(String resourceGroupName, String namespaceName, String alias, String authorizationRuleName) { + return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, alias, authorizationRuleName).map(new Func1, AccessKeysInner>() { + @Override + public AccessKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the primary and secondary connection strings for the Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param alias The Disaster Recovery configuration name + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AccessKeysInner object + */ + public Observable> listKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String alias, String authorizationRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (alias == null) { + throw new IllegalArgumentException("Parameter alias is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-04-01"; + return service.listKeys(resourceGroupName, namespaceName, alias, authorizationRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listKeysDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Check the give Namespace name availability. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param name Name to check the namespace name availability + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CheckNameAvailabilityResultInner object if successful. + */ + public CheckNameAvailabilityResultInner checkNameAvailability(String resourceGroupName, String namespaceName, String name) { + return checkNameAvailabilityWithServiceResponseAsync(resourceGroupName, namespaceName, name).toBlocking().single().body(); + } + + /** + * Check the give Namespace name availability. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param name Name to check the namespace name availability + * @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 resourceGroupName, String namespaceName, String name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNameAvailabilityWithServiceResponseAsync(resourceGroupName, namespaceName, name), serviceCallback); + } + + /** + * Check the give Namespace name availability. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param name Name to check the namespace name availability + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckNameAvailabilityResultInner object + */ + public Observable checkNameAvailabilityAsync(String resourceGroupName, String namespaceName, String name) { + return checkNameAvailabilityWithServiceResponseAsync(resourceGroupName, namespaceName, name).map(new Func1, CheckNameAvailabilityResultInner>() { + @Override + public CheckNameAvailabilityResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Check the give Namespace name availability. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param name Name to check the namespace name availability + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckNameAvailabilityResultInner object + */ + public Observable> checkNameAvailabilityWithServiceResponseAsync(String resourceGroupName, String namespaceName, 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 (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + final String apiVersion = "2017-04-01"; + CheckNameAvailabilityParameter parameters = new CheckNameAvailabilityParameter(); + parameters.withName(name); + return service.checkNameAvailability(this.client.subscriptionId(), resourceGroupName, namespaceName, apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkNameAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkNameAvailabilityDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets all Alias(Disaster Recovery configurations). + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ArmDisasterRecoveryInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String namespaceName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, namespaceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all Alias(Disaster Recovery configurations). + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String namespaceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, namespaceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all Alias(Disaster Recovery configurations). + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ArmDisasterRecoveryInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String namespaceName) { + return listWithServiceResponseAsync(resourceGroupName, namespaceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all Alias(Disaster Recovery configurations). + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ArmDisasterRecoveryInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String namespaceName) { + return listSinglePageAsync(resourceGroupName, namespaceName) + .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)); + } + }); + } + + /** + * Gets all Alias(Disaster Recovery configurations). + * + ServiceResponse> * @param resourceGroupName Name of the resource group within the azure subscription. + ServiceResponse> * @param namespaceName The Namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ArmDisasterRecoveryInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String namespaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-04-01"; + return service.list(resourceGroupName, namespaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Creates or updates a new Alias(Disaster Recovery configuration). + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param alias The Disaster Recovery configuration name + * @param parameters Parameters required to create an Alias(Disaster Recovery configuration) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ArmDisasterRecoveryInner object if successful. + */ + public ArmDisasterRecoveryInner createOrUpdate(String resourceGroupName, String namespaceName, String alias, ArmDisasterRecoveryInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, alias, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates a new Alias(Disaster Recovery configuration). + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param alias The Disaster Recovery configuration name + * @param parameters Parameters required to create an Alias(Disaster Recovery configuration) + * @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 namespaceName, String alias, ArmDisasterRecoveryInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, alias, parameters), serviceCallback); + } + + /** + * Creates or updates a new Alias(Disaster Recovery configuration). + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param alias The Disaster Recovery configuration name + * @param parameters Parameters required to create an Alias(Disaster Recovery configuration) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ArmDisasterRecoveryInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String namespaceName, String alias, ArmDisasterRecoveryInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, alias, parameters).map(new Func1, ArmDisasterRecoveryInner>() { + @Override + public ArmDisasterRecoveryInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a new Alias(Disaster Recovery configuration). + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param alias The Disaster Recovery configuration name + * @param parameters Parameters required to create an Alias(Disaster Recovery configuration) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ArmDisasterRecoveryInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String namespaceName, String alias, ArmDisasterRecoveryInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (alias == null) { + throw new IllegalArgumentException("Parameter alias 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2017-04-01"; + return service.createOrUpdate(resourceGroupName, namespaceName, alias, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Deletes an Alias(Disaster Recovery configuration). + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param alias The Disaster Recovery configuration name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String namespaceName, String alias) { + deleteWithServiceResponseAsync(resourceGroupName, namespaceName, alias).toBlocking().single().body(); + } + + /** + * Deletes an Alias(Disaster Recovery configuration). + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param alias The Disaster Recovery configuration name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String namespaceName, String alias, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, namespaceName, alias), serviceCallback); + } + + /** + * Deletes an Alias(Disaster Recovery configuration). + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param alias The Disaster Recovery configuration name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String namespaceName, String alias) { + return deleteWithServiceResponseAsync(resourceGroupName, namespaceName, alias).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an Alias(Disaster Recovery configuration). + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param alias The Disaster Recovery configuration name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String namespaceName, String alias) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (alias == null) { + throw new IllegalArgumentException("Parameter alias is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-04-01"; + return service.delete(resourceGroupName, namespaceName, alias, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param alias The Disaster Recovery configuration name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ArmDisasterRecoveryInner object if successful. + */ + public ArmDisasterRecoveryInner get(String resourceGroupName, String namespaceName, String alias) { + return getWithServiceResponseAsync(resourceGroupName, namespaceName, alias).toBlocking().single().body(); + } + + /** + * Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param alias The Disaster Recovery configuration name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String namespaceName, String alias, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, namespaceName, alias), serviceCallback); + } + + /** + * Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param alias The Disaster Recovery configuration name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ArmDisasterRecoveryInner object + */ + public Observable getAsync(String resourceGroupName, String namespaceName, String alias) { + return getWithServiceResponseAsync(resourceGroupName, namespaceName, alias).map(new Func1, ArmDisasterRecoveryInner>() { + @Override + public ArmDisasterRecoveryInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param alias The Disaster Recovery configuration name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ArmDisasterRecoveryInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String namespaceName, String alias) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (alias == null) { + throw new IllegalArgumentException("Parameter alias is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-04-01"; + return service.get(resourceGroupName, namespaceName, alias, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * This operation disables the Disaster Recovery and stops replicating changes from primary to secondary namespaces. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param alias The Disaster Recovery configuration name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void breakPairing(String resourceGroupName, String namespaceName, String alias) { + breakPairingWithServiceResponseAsync(resourceGroupName, namespaceName, alias).toBlocking().single().body(); + } + + /** + * This operation disables the Disaster Recovery and stops replicating changes from primary to secondary namespaces. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param alias The Disaster Recovery configuration name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture breakPairingAsync(String resourceGroupName, String namespaceName, String alias, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(breakPairingWithServiceResponseAsync(resourceGroupName, namespaceName, alias), serviceCallback); + } + + /** + * This operation disables the Disaster Recovery and stops replicating changes from primary to secondary namespaces. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param alias The Disaster Recovery configuration name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable breakPairingAsync(String resourceGroupName, String namespaceName, String alias) { + return breakPairingWithServiceResponseAsync(resourceGroupName, namespaceName, alias).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * This operation disables the Disaster Recovery and stops replicating changes from primary to secondary namespaces. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param alias The Disaster Recovery configuration name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> breakPairingWithServiceResponseAsync(String resourceGroupName, String namespaceName, String alias) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (alias == null) { + throw new IllegalArgumentException("Parameter alias is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-04-01"; + return service.breakPairing(resourceGroupName, namespaceName, alias, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = breakPairingDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse breakPairingDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param alias The Disaster Recovery configuration name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void failOver(String resourceGroupName, String namespaceName, String alias) { + failOverWithServiceResponseAsync(resourceGroupName, namespaceName, alias).toBlocking().single().body(); + } + + /** + * Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param alias The Disaster Recovery configuration name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture failOverAsync(String resourceGroupName, String namespaceName, String alias, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(failOverWithServiceResponseAsync(resourceGroupName, namespaceName, alias), serviceCallback); + } + + /** + * Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param alias The Disaster Recovery configuration name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable failOverAsync(String resourceGroupName, String namespaceName, String alias) { + return failOverWithServiceResponseAsync(resourceGroupName, namespaceName, alias).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param alias The Disaster Recovery configuration name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> failOverWithServiceResponseAsync(String resourceGroupName, String namespaceName, String alias) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (alias == null) { + throw new IllegalArgumentException("Parameter alias is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-04-01"; + return service.failOver(resourceGroupName, namespaceName, alias, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = failOverDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse failOverDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets a list of authorization rules for a Namespace. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AuthorizationRuleInner> object if successful. + */ + public PagedList listAuthorizationRulesNext(final String nextPageLink) { + ServiceResponse> response = listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets a list of authorization rules for a Namespace. + * + * @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> listAuthorizationRulesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listAuthorizationRulesNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets a list of authorization rules for a Namespace. + * + * @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<AuthorizationRuleInner> object + */ + public Observable> listAuthorizationRulesNextAsync(final String nextPageLink) { + return listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of authorization rules for a Namespace. + * + * @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<AuthorizationRuleInner> object + */ + public Observable>> listAuthorizationRulesNextWithServiceResponseAsync(final String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(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(listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets a list of authorization rules for a Namespace. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AuthorizationRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listAuthorizationRulesNextSinglePageAsync(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.listAuthorizationRulesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listAuthorizationRulesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listAuthorizationRulesNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets all Alias(Disaster Recovery configurations). + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ArmDisasterRecoveryInner> 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(); + } + }; + } + + /** + * Gets all Alias(Disaster Recovery configurations). + * + * @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); + } + + /** + * Gets all Alias(Disaster Recovery configurations). + * + * @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<ArmDisasterRecoveryInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all Alias(Disaster Recovery configurations). + * + * @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<ArmDisasterRecoveryInner> 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)); + } + }); + } + + /** + * Gets all Alias(Disaster Recovery configurations). + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ArmDisasterRecoveryInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/EHNamespaceImpl.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/EHNamespaceImpl.java index fc32754d967ba..7c56162180af0 100644 --- a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/EHNamespaceImpl.java +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/EHNamespaceImpl.java @@ -12,7 +12,9 @@ import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.EHNamespace; import rx.Observable; import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.Sku; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.Identity; import org.joda.time.DateTime; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.Encryption; class EHNamespaceImpl extends GroupableResourceCoreImpl implements EHNamespace, EHNamespace.Definition, EHNamespace.Update { EHNamespaceImpl(String name, EHNamespaceInner inner, EventHubsManager manager) { @@ -45,11 +47,26 @@ public boolean isInCreateMode() { } + @Override + public String clusterArmId() { + return this.inner().clusterArmId(); + } + @Override public DateTime createdAt() { return this.inner().createdAt(); } + @Override + public Encryption encryption() { + return this.inner().encryption(); + } + + @Override + public Identity identity() { + return this.inner().identity(); + } + @Override public Boolean isAutoInflateEnabled() { return this.inner().isAutoInflateEnabled(); @@ -95,6 +112,24 @@ public Boolean zoneRedundant() { return this.inner().zoneRedundant(); } + @Override + public EHNamespaceImpl withClusterArmId(String clusterArmId) { + this.inner().withClusterArmId(clusterArmId); + return this; + } + + @Override + public EHNamespaceImpl withEncryption(Encryption encryption) { + this.inner().withEncryption(encryption); + return this; + } + + @Override + public EHNamespaceImpl withIdentity(Identity identity) { + this.inner().withIdentity(identity); + return this; + } + @Override public EHNamespaceImpl withIsAutoInflateEnabled(Boolean isAutoInflateEnabled) { this.inner().withIsAutoInflateEnabled(isAutoInflateEnabled); diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/EHNamespaceInner.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/EHNamespaceInner.java index 75928021004f9..09582bb4fb538 100644 --- a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/EHNamespaceInner.java +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/EHNamespaceInner.java @@ -9,7 +9,9 @@ package com.microsoft.azure.management.eventhubs.v2018_01_01_preview.implementation; import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.Sku; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.Identity; import org.joda.time.DateTime; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.Encryption; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; import com.microsoft.rest.SkipParentValidation; @@ -27,6 +29,12 @@ public class EHNamespaceInner extends Resource { @JsonProperty(value = "sku") private Sku sku; + /** + * Properties of BYOK Identity description. + */ + @JsonProperty(value = "identity") + private Identity identity; + /** * Provisioning state of the Namespace. */ @@ -51,6 +59,12 @@ public class EHNamespaceInner extends Resource { @JsonProperty(value = "properties.serviceBusEndpoint", access = JsonProperty.Access.WRITE_ONLY) private String serviceBusEndpoint; + /** + * Cluster ARM ID of the Namespace. + */ + @JsonProperty(value = "properties.clusterArmId") + private String clusterArmId; + /** * Identifier for Azure Insights metrics. */ @@ -85,6 +99,12 @@ public class EHNamespaceInner extends Resource { @JsonProperty(value = "properties.zoneRedundant") private Boolean zoneRedundant; + /** + * Properties of BYOK Encryption description. + */ + @JsonProperty(value = "properties.encryption") + private Encryption encryption; + /** * Get properties of sku resource. * @@ -105,6 +125,26 @@ public EHNamespaceInner withSku(Sku sku) { return this; } + /** + * Get properties of BYOK Identity description. + * + * @return the identity value + */ + public Identity identity() { + return this.identity; + } + + /** + * Set properties of BYOK Identity description. + * + * @param identity the identity value to set + * @return the EHNamespaceInner object itself. + */ + public EHNamespaceInner withIdentity(Identity identity) { + this.identity = identity; + return this; + } + /** * Get provisioning state of the Namespace. * @@ -141,6 +181,26 @@ public String serviceBusEndpoint() { return this.serviceBusEndpoint; } + /** + * Get cluster ARM ID of the Namespace. + * + * @return the clusterArmId value + */ + public String clusterArmId() { + return this.clusterArmId; + } + + /** + * Set cluster ARM ID of the Namespace. + * + * @param clusterArmId the clusterArmId value to set + * @return the EHNamespaceInner object itself. + */ + public EHNamespaceInner withClusterArmId(String clusterArmId) { + this.clusterArmId = clusterArmId; + return this; + } + /** * Get identifier for Azure Insights metrics. * @@ -230,4 +290,24 @@ public EHNamespaceInner withZoneRedundant(Boolean zoneRedundant) { return this; } + /** + * Get properties of BYOK Encryption description. + * + * @return the encryption value + */ + public Encryption encryption() { + return this.encryption; + } + + /** + * Set properties of BYOK Encryption description. + * + * @param encryption the encryption value to set + * @return the EHNamespaceInner object itself. + */ + public EHNamespaceInner withEncryption(Encryption encryption) { + this.encryption = encryption; + return this; + } + } diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/EventHubManagementClientImpl.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/EventHubManagementClientImpl.java new file mode 100644 index 0000000000000..a75ba1d0311ea --- /dev/null +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/EventHubManagementClientImpl.java @@ -0,0 +1,281 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventhubs.v2018_01_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 EventHubManagementClientImpl class. + */ +public class EventHubManagementClientImpl 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; + } + + /** Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. */ + private String subscriptionId; + + /** + * Gets Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public EventHubManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** The preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets The preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets The preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public EventHubManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public EventHubManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public EventHubManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The ClustersInner object to access its operations. + */ + private ClustersInner clusters; + + /** + * Gets the ClustersInner object to access its operations. + * @return the ClustersInner object. + */ + public ClustersInner clusters() { + return this.clusters; + } + + /** + * The NamespacesInner object to access its operations. + */ + private NamespacesInner namespaces; + + /** + * Gets the NamespacesInner object to access its operations. + * @return the NamespacesInner object. + */ + public NamespacesInner namespaces() { + return this.namespaces; + } + + /** + * The ConfigurationsInner object to access its operations. + */ + private ConfigurationsInner configurations; + + /** + * Gets the ConfigurationsInner object to access its operations. + * @return the ConfigurationsInner object. + */ + public ConfigurationsInner configurations() { + return this.configurations; + } + + /** + * The DisasterRecoveryConfigsInner object to access its operations. + */ + private DisasterRecoveryConfigsInner disasterRecoveryConfigs; + + /** + * Gets the DisasterRecoveryConfigsInner object to access its operations. + * @return the DisasterRecoveryConfigsInner object. + */ + public DisasterRecoveryConfigsInner disasterRecoveryConfigs() { + return this.disasterRecoveryConfigs; + } + + /** + * The EventHubsInner object to access its operations. + */ + private EventHubsInner eventHubs; + + /** + * Gets the EventHubsInner object to access its operations. + * @return the EventHubsInner object. + */ + public EventHubsInner eventHubs() { + return this.eventHubs; + } + + /** + * The ConsumerGroupsInner object to access its operations. + */ + private ConsumerGroupsInner consumerGroups; + + /** + * Gets the ConsumerGroupsInner object to access its operations. + * @return the ConsumerGroupsInner object. + */ + public ConsumerGroupsInner consumerGroups() { + return this.consumerGroups; + } + + /** + * 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 RegionsInner object to access its operations. + */ + private RegionsInner regions; + + /** + * Gets the RegionsInner object to access its operations. + * @return the RegionsInner object. + */ + public RegionsInner regions() { + return this.regions; + } + + /** + * Initializes an instance of EventHubManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public EventHubManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of EventHubManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public EventHubManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of EventHubManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public EventHubManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.clusters = new ClustersInner(restClient().retrofit(), this); + this.namespaces = new NamespacesInner(restClient().retrofit(), this); + this.configurations = new ConfigurationsInner(restClient().retrofit(), this); + this.disasterRecoveryConfigs = new DisasterRecoveryConfigsInner(restClient().retrofit(), this); + this.eventHubs = new EventHubsInner(restClient().retrofit(), this); + this.consumerGroups = new ConsumerGroupsInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.regions = new RegionsInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "EventHubManagementClient", "2018-01-01-preiew"); + } +} diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/EventHubsImpl.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/EventHubsImpl.java new file mode 100644 index 0000000000000..29be3a5576b70 --- /dev/null +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/EventHubsImpl.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.eventhubs.v2018_01_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.EventHubs; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.Eventhub; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.EventhubNamespaceAuthorizationRule; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.AccessKeys; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.RegenerateAccessKeyParameters; + +class EventHubsImpl extends WrapperImpl implements EventHubs { + private final EventHubsManager manager; + + EventHubsImpl(EventHubsManager manager) { + super(manager.inner().eventHubs()); + this.manager = manager; + } + + public EventHubsManager manager() { + return this.manager; + } + + @Override + public EventhubImpl define(String name) { + return wrapModel(name); + } + + private EventhubImpl wrapModel(EventhubInner inner) { + return new EventhubImpl(inner, manager()); + } + + private EventhubImpl wrapModel(String name) { + return new EventhubImpl(name, this.manager()); + } + + @Override + public Observable listByNamespaceAsync(final String resourceGroupName, final String namespaceName) { + EventHubsInner client = this.inner(); + return client.listByNamespaceAsync(resourceGroupName, namespaceName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Eventhub call(EventhubInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String namespaceName, String eventHubName) { + EventHubsInner client = this.inner(); + return client.getAsync(resourceGroupName, namespaceName, eventHubName) + .flatMap(new Func1>() { + @Override + public Observable call(EventhubInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((Eventhub)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String namespaceName, String eventHubName) { + EventHubsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, namespaceName, eventHubName).toCompletable(); + } + + @Override + public EventhubNamespaceAuthorizationRuleImpl defineAuthorizationRule(String name) { + return wrapAuthorizationRuleModel(name); + } + + private EventhubNamespaceAuthorizationRuleImpl wrapAuthorizationRuleModel(String name) { + return new EventhubNamespaceAuthorizationRuleImpl(name, this.manager()); + } + + private EventhubNamespaceAuthorizationRuleImpl wrapEventhubNamespaceAuthorizationRuleModel(AuthorizationRuleInner inner) { + return new EventhubNamespaceAuthorizationRuleImpl(inner, manager()); + } + + private Observable getAuthorizationRuleInnerUsingEventHubsInnerAsync(String id) { + String resourceGroupName = IdParsingUtils.getValueFromIdByName(id, "resourceGroups"); + String namespaceName = IdParsingUtils.getValueFromIdByName(id, "namespaces"); + String eventHubName = IdParsingUtils.getValueFromIdByName(id, "eventhubs"); + String authorizationRuleName = IdParsingUtils.getValueFromIdByName(id, "authorizationRules"); + EventHubsInner client = this.inner(); + return client.getAuthorizationRuleAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName); + } + + @Override + public Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName) { + EventHubsInner client = this.inner(); + return client.getAuthorizationRuleAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName) + .flatMap(new Func1>() { + @Override + public Observable call(AuthorizationRuleInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((EventhubNamespaceAuthorizationRule)wrapEventhubNamespaceAuthorizationRuleModel(inner)); + } + } + }); + } + + @Override + public Observable listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final String eventHubName) { + EventHubsInner client = this.inner(); + return client.listAuthorizationRulesAsync(resourceGroupName, namespaceName, eventHubName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public EventhubNamespaceAuthorizationRule call(AuthorizationRuleInner inner) { + return wrapEventhubNamespaceAuthorizationRuleModel(inner); + } + }); + } + + @Override + public Completable deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName) { + EventHubsInner client = this.inner(); + return client.deleteAuthorizationRuleAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName).toCompletable(); + } + + @Override + public Observable listKeysAsync(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName) { + EventHubsInner client = this.inner(); + return client.listKeysAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName) + .map(new Func1() { + @Override + public AccessKeys call(AccessKeysInner inner) { + return new AccessKeysImpl(inner, manager()); + } + }); + } + + @Override + public Observable regenerateKeysAsync(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName, RegenerateAccessKeyParameters parameters) { + EventHubsInner client = this.inner(); + return client.regenerateKeysAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName, parameters) + .map(new Func1() { + @Override + public AccessKeys call(AccessKeysInner inner) { + return new AccessKeysImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/EventHubsInner.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/EventHubsInner.java new file mode 100644 index 0000000000000..0da824055c6f9 --- /dev/null +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/EventHubsInner.java @@ -0,0 +1,1504 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventhubs.v2018_01_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.eventhubs.v2018_01_01_preview.AccessRights; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.ErrorResponseException; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.RegenerateAccessKeyParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.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 EventHubs. + */ +public class EventHubsInner { + /** The Retrofit service to perform REST calls. */ + private EventHubsService service; + /** The service client containing this operation class. */ + private EventHubManagementClientImpl client; + + /** + * Initializes an instance of EventHubsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public EventHubsInner(Retrofit retrofit, EventHubManagementClientImpl client) { + this.service = retrofit.create(EventHubsService.class); + this.client = client; + } + + /** + * The interface defining all the services for EventHubs to be + * used by Retrofit to perform actually REST calls. + */ + interface EventHubsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventhubs.v2018_01_01_preview.EventHubs listAuthorizationRules" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules") + Observable> listAuthorizationRules(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("eventHubName") String eventHubName, @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.eventhubs.v2018_01_01_preview.EventHubs createOrUpdateAuthorizationRule" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}") + Observable> createOrUpdateAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("eventHubName") String eventHubName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body AuthorizationRuleInner parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventhubs.v2018_01_01_preview.EventHubs getAuthorizationRule" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}") + Observable> getAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("eventHubName") String eventHubName, @Path("authorizationRuleName") String authorizationRuleName, @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.eventhubs.v2018_01_01_preview.EventHubs deleteAuthorizationRule" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}", method = "DELETE", hasBody = true) + Observable> deleteAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("eventHubName") String eventHubName, @Path("authorizationRuleName") String authorizationRuleName, @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.eventhubs.v2018_01_01_preview.EventHubs listKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}/listKeys") + Observable> listKeys(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("eventHubName") String eventHubName, @Path("authorizationRuleName") String authorizationRuleName, @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.eventhubs.v2018_01_01_preview.EventHubs regenerateKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}/regenerateKeys") + Observable> regenerateKeys(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("eventHubName") String eventHubName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Body RegenerateAccessKeyParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventhubs.v2018_01_01_preview.EventHubs listByNamespace" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs") + Observable> listByNamespace(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$skip") Integer skip, @Query("$top") Integer top, @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.eventhubs.v2018_01_01_preview.EventHubs createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("eventHubName") String eventHubName, @Path("subscriptionId") String subscriptionId, @Body EventhubInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventhubs.v2018_01_01_preview.EventHubs delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("eventHubName") String eventHubName, @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.eventhubs.v2018_01_01_preview.EventHubs get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("eventHubName") String eventHubName, @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.eventhubs.v2018_01_01_preview.EventHubs listAuthorizationRulesNext" }) + @GET + Observable> listAuthorizationRulesNext(@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.eventhubs.v2018_01_01_preview.EventHubs listByNamespaceNext" }) + @GET + Observable> listByNamespaceNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets the authorization rules for an Event Hub. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AuthorizationRuleInner> object if successful. + */ + public PagedList listAuthorizationRules(final String resourceGroupName, final String namespaceName, final String eventHubName) { + ServiceResponse> response = listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, eventHubName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the authorization rules for an Event Hub. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final String eventHubName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, eventHubName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the authorization rules for an Event Hub. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AuthorizationRuleInner> object + */ + public Observable> listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final String eventHubName) { + return listAuthorizationRulesWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the authorization rules for an Event Hub. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AuthorizationRuleInner> object + */ + public Observable>> listAuthorizationRulesWithServiceResponseAsync(final String resourceGroupName, final String namespaceName, final String eventHubName) { + return listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, eventHubName) + .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(listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the authorization rules for an Event Hub. + * + ServiceResponse> * @param resourceGroupName Name of the resource group within the azure subscription. + ServiceResponse> * @param namespaceName The Namespace name + ServiceResponse> * @param eventHubName The Event Hub name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AuthorizationRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listAuthorizationRulesSinglePageAsync(final String resourceGroupName, final String namespaceName, final String eventHubName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (eventHubName == null) { + throw new IllegalArgumentException("Parameter eventHubName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-04-01"; + return service.listAuthorizationRules(resourceGroupName, namespaceName, eventHubName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listAuthorizationRulesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listAuthorizationRulesDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Creates or updates an AuthorizationRule for the specified Event Hub. Creation/update of the AuthorizationRule will take a few seconds to take effect. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param authorizationRuleName The authorization rule name. + * @param rights The rights associated with the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AuthorizationRuleInner object if successful. + */ + public AuthorizationRuleInner createOrUpdateAuthorizationRule(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName, List rights) { + return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName, rights).toBlocking().single().body(); + } + + /** + * Creates or updates an AuthorizationRule for the specified Event Hub. Creation/update of the AuthorizationRule will take a few seconds to take effect. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param authorizationRuleName The authorization rule name. + * @param rights The rights associated with the rule. + * @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 createOrUpdateAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName, List rights, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName, rights), serviceCallback); + } + + /** + * Creates or updates an AuthorizationRule for the specified Event Hub. Creation/update of the AuthorizationRule will take a few seconds to take effect. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param authorizationRuleName The authorization rule name. + * @param rights The rights associated with the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AuthorizationRuleInner object + */ + public Observable createOrUpdateAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName, List rights) { + return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName, rights).map(new Func1, AuthorizationRuleInner>() { + @Override + public AuthorizationRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates an AuthorizationRule for the specified Event Hub. Creation/update of the AuthorizationRule will take a few seconds to take effect. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param authorizationRuleName The authorization rule name. + * @param rights The rights associated with the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AuthorizationRuleInner object + */ + public Observable> createOrUpdateAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName, List rights) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (eventHubName == null) { + throw new IllegalArgumentException("Parameter eventHubName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName 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 (rights == null) { + throw new IllegalArgumentException("Parameter rights is required and cannot be null."); + } + Validator.validate(rights); + final String apiVersion = "2017-04-01"; + AuthorizationRuleInner parameters = new AuthorizationRuleInner(); + parameters.withRights(rights); + return service.createOrUpdateAuthorizationRule(resourceGroupName, namespaceName, eventHubName, authorizationRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateAuthorizationRuleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateAuthorizationRuleDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets an AuthorizationRule for an Event Hub by rule name. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AuthorizationRuleInner object if successful. + */ + public AuthorizationRuleInner getAuthorizationRule(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName) { + return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName).toBlocking().single().body(); + } + + /** + * Gets an AuthorizationRule for an Event Hub by rule name. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param authorizationRuleName The authorization rule name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName), serviceCallback); + } + + /** + * Gets an AuthorizationRule for an Event Hub by rule name. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AuthorizationRuleInner object + */ + public Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName) { + return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName).map(new Func1, AuthorizationRuleInner>() { + @Override + public AuthorizationRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets an AuthorizationRule for an Event Hub by rule name. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AuthorizationRuleInner object + */ + public Observable> getAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (eventHubName == null) { + throw new IllegalArgumentException("Parameter eventHubName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-04-01"; + return service.getAuthorizationRule(resourceGroupName, namespaceName, eventHubName, authorizationRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getAuthorizationRuleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getAuthorizationRuleDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Deletes an Event Hub AuthorizationRule. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName) { + deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName).toBlocking().single().body(); + } + + /** + * Deletes an Event Hub AuthorizationRule. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param authorizationRuleName The authorization rule name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName), serviceCallback); + } + + /** + * Deletes an Event Hub AuthorizationRule. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName) { + return deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an Event Hub AuthorizationRule. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (eventHubName == null) { + throw new IllegalArgumentException("Parameter eventHubName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-04-01"; + return service.deleteAuthorizationRule(resourceGroupName, namespaceName, eventHubName, authorizationRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteAuthorizationRuleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteAuthorizationRuleDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets the ACS and SAS connection strings for the Event Hub. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AccessKeysInner object if successful. + */ + public AccessKeysInner listKeys(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName) { + return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName).toBlocking().single().body(); + } + + /** + * Gets the ACS and SAS connection strings for the Event Hub. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param authorizationRuleName The authorization rule name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listKeysAsync(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName), serviceCallback); + } + + /** + * Gets the ACS and SAS connection strings for the Event Hub. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AccessKeysInner object + */ + public Observable listKeysAsync(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName) { + return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName).map(new Func1, AccessKeysInner>() { + @Override + public AccessKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the ACS and SAS connection strings for the Event Hub. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AccessKeysInner object + */ + public Observable> listKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (eventHubName == null) { + throw new IllegalArgumentException("Parameter eventHubName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-04-01"; + return service.listKeys(resourceGroupName, namespaceName, eventHubName, authorizationRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listKeysDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Regenerates the ACS and SAS connection strings for the Event Hub. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the AuthorizationRule Keys (PrimaryKey/SecondaryKey). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AccessKeysInner object if successful. + */ + public AccessKeysInner regenerateKeys(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName, RegenerateAccessKeyParameters parameters) { + return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName, parameters).toBlocking().single().body(); + } + + /** + * Regenerates the ACS and SAS connection strings for the Event Hub. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the AuthorizationRule Keys (PrimaryKey/SecondaryKey). + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture regenerateKeysAsync(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName, RegenerateAccessKeyParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName, parameters), serviceCallback); + } + + /** + * Regenerates the ACS and SAS connection strings for the Event Hub. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the AuthorizationRule Keys (PrimaryKey/SecondaryKey). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AccessKeysInner object + */ + public Observable regenerateKeysAsync(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName, RegenerateAccessKeyParameters parameters) { + return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName, parameters).map(new Func1, AccessKeysInner>() { + @Override + public AccessKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Regenerates the ACS and SAS connection strings for the Event Hub. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the AuthorizationRule Keys (PrimaryKey/SecondaryKey). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AccessKeysInner object + */ + public Observable> regenerateKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName, RegenerateAccessKeyParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (eventHubName == null) { + throw new IllegalArgumentException("Parameter eventHubName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2017-04-01"; + return service.regenerateKeys(resourceGroupName, namespaceName, eventHubName, authorizationRuleName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = regenerateKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse regenerateKeysDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets all the Event Hubs in a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EventhubInner> object if successful. + */ + public PagedList listByNamespace(final String resourceGroupName, final String namespaceName) { + ServiceResponse> response = listByNamespaceSinglePageAsync(resourceGroupName, namespaceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByNamespaceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the Event Hubs in a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByNamespaceAsync(final String resourceGroupName, final String namespaceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByNamespaceSinglePageAsync(resourceGroupName, namespaceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByNamespaceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the Event Hubs in a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventhubInner> object + */ + public Observable> listByNamespaceAsync(final String resourceGroupName, final String namespaceName) { + return listByNamespaceWithServiceResponseAsync(resourceGroupName, namespaceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the Event Hubs in a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventhubInner> object + */ + public Observable>> listByNamespaceWithServiceResponseAsync(final String resourceGroupName, final String namespaceName) { + return listByNamespaceSinglePageAsync(resourceGroupName, namespaceName) + .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(listByNamespaceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the Event Hubs in a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventhubInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByNamespaceSinglePageAsync(final String resourceGroupName, final String namespaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-04-01"; + final Integer skip = null; + final Integer top = null; + return service.listByNamespace(resourceGroupName, namespaceName, this.client.subscriptionId(), apiVersion, skip, top, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByNamespaceDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets all the Event Hubs in a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls. + * @param top May be used to limit the number of results to the most recent N usageDetails. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EventhubInner> object if successful. + */ + public PagedList listByNamespace(final String resourceGroupName, final String namespaceName, final Integer skip, final Integer top) { + ServiceResponse> response = listByNamespaceSinglePageAsync(resourceGroupName, namespaceName, skip, top).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByNamespaceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the Event Hubs in a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls. + * @param top May be used to limit the number of results to the most recent N usageDetails. + * @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> listByNamespaceAsync(final String resourceGroupName, final String namespaceName, final Integer skip, final Integer top, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByNamespaceSinglePageAsync(resourceGroupName, namespaceName, skip, top), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByNamespaceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the Event Hubs in a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls. + * @param top May be used to limit the number of results to the most recent N usageDetails. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventhubInner> object + */ + public Observable> listByNamespaceAsync(final String resourceGroupName, final String namespaceName, final Integer skip, final Integer top) { + return listByNamespaceWithServiceResponseAsync(resourceGroupName, namespaceName, skip, top) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the Event Hubs in a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls. + * @param top May be used to limit the number of results to the most recent N usageDetails. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventhubInner> object + */ + public Observable>> listByNamespaceWithServiceResponseAsync(final String resourceGroupName, final String namespaceName, final Integer skip, final Integer top) { + return listByNamespaceSinglePageAsync(resourceGroupName, namespaceName, skip, top) + .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(listByNamespaceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the Event Hubs in a Namespace. + * + ServiceResponse> * @param resourceGroupName Name of the resource group within the azure subscription. + ServiceResponse> * @param namespaceName The Namespace name + ServiceResponse> * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls. + ServiceResponse> * @param top May be used to limit the number of results to the most recent N usageDetails. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventhubInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByNamespaceSinglePageAsync(final String resourceGroupName, final String namespaceName, final Integer skip, final Integer top) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-04-01"; + return service.listByNamespace(resourceGroupName, namespaceName, this.client.subscriptionId(), apiVersion, skip, top, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByNamespaceDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByNamespaceDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Creates or updates a new Event Hub as a nested resource within a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param parameters Parameters supplied to create an Event Hub resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EventhubInner object if successful. + */ + public EventhubInner createOrUpdate(String resourceGroupName, String namespaceName, String eventHubName, EventhubInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates a new Event Hub as a nested resource within a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param parameters Parameters supplied to create an Event Hub resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String namespaceName, String eventHubName, EventhubInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, parameters), serviceCallback); + } + + /** + * Creates or updates a new Event Hub as a nested resource within a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param parameters Parameters supplied to create an Event Hub resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EventhubInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String namespaceName, String eventHubName, EventhubInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, parameters).map(new Func1, EventhubInner>() { + @Override + public EventhubInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a new Event Hub as a nested resource within a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param parameters Parameters supplied to create an Event Hub resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EventhubInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String namespaceName, String eventHubName, EventhubInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (eventHubName == null) { + throw new IllegalArgumentException("Parameter eventHubName 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2017-04-01"; + return service.createOrUpdate(resourceGroupName, namespaceName, eventHubName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Deletes an Event Hub from the specified Namespace and resource group. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String namespaceName, String eventHubName) { + deleteWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName).toBlocking().single().body(); + } + + /** + * Deletes an Event Hub from the specified Namespace and resource group. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String namespaceName, String eventHubName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName), serviceCallback); + } + + /** + * Deletes an Event Hub from the specified Namespace and resource group. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String namespaceName, String eventHubName) { + return deleteWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an Event Hub from the specified Namespace and resource group. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String namespaceName, String eventHubName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (eventHubName == null) { + throw new IllegalArgumentException("Parameter eventHubName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-04-01"; + return service.delete(resourceGroupName, namespaceName, eventHubName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets an Event Hubs description for the specified Event Hub. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EventhubInner object if successful. + */ + public EventhubInner get(String resourceGroupName, String namespaceName, String eventHubName) { + return getWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName).toBlocking().single().body(); + } + + /** + * Gets an Event Hubs description for the specified Event Hub. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String namespaceName, String eventHubName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName), serviceCallback); + } + + /** + * Gets an Event Hubs description for the specified Event Hub. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EventhubInner object + */ + public Observable getAsync(String resourceGroupName, String namespaceName, String eventHubName) { + return getWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName).map(new Func1, EventhubInner>() { + @Override + public EventhubInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets an Event Hubs description for the specified Event Hub. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EventhubInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String namespaceName, String eventHubName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (eventHubName == null) { + throw new IllegalArgumentException("Parameter eventHubName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-04-01"; + return service.get(resourceGroupName, namespaceName, eventHubName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets the authorization rules for an Event Hub. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AuthorizationRuleInner> object if successful. + */ + public PagedList listAuthorizationRulesNext(final String nextPageLink) { + ServiceResponse> response = listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the authorization rules for an Event 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> listAuthorizationRulesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listAuthorizationRulesNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the authorization rules for an Event 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<AuthorizationRuleInner> object + */ + public Observable> listAuthorizationRulesNextAsync(final String nextPageLink) { + return listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the authorization rules for an Event 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<AuthorizationRuleInner> object + */ + public Observable>> listAuthorizationRulesNextWithServiceResponseAsync(final String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(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(listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the authorization rules for an Event 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<AuthorizationRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listAuthorizationRulesNextSinglePageAsync(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.listAuthorizationRulesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listAuthorizationRulesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listAuthorizationRulesNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets all the Event Hubs in a Namespace. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EventhubInner> object if successful. + */ + public PagedList listByNamespaceNext(final String nextPageLink) { + ServiceResponse> response = listByNamespaceNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByNamespaceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the Event Hubs in a Namespace. + * + * @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> listByNamespaceNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByNamespaceNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByNamespaceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the Event Hubs in a Namespace. + * + * @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<EventhubInner> object + */ + public Observable> listByNamespaceNextAsync(final String nextPageLink) { + return listByNamespaceNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the Event Hubs in a Namespace. + * + * @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<EventhubInner> object + */ + public Observable>> listByNamespaceNextWithServiceResponseAsync(final String nextPageLink) { + return listByNamespaceNextSinglePageAsync(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(listByNamespaceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the Event Hubs in a Namespace. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventhubInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByNamespaceNextSinglePageAsync(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.listByNamespaceNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByNamespaceNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByNamespaceNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/EventHubsManager.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/EventHubsManager.java index ed42a636acaa3..aaf566d751a59 100644 --- a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/EventHubsManager.java +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/EventHubsManager.java @@ -16,21 +16,29 @@ import com.microsoft.azure.arm.resources.AzureConfigurable; import com.microsoft.azure.serializer.AzureJacksonAdapter; import com.microsoft.rest.RestClient; -import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.Operations; import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.Clusters; -import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.Configurations; import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.Namespaces; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.Configurations; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.DisasterRecoveryConfigs; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.EventHubs; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.ConsumerGroups; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.Operations; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.Regions; import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; import com.microsoft.azure.arm.resources.implementation.ManagerCore; /** * Entry point to Azure EventHubs resource management. */ -public final class EventHubsManager extends ManagerCore { - private Operations operations; +public final class EventHubsManager extends ManagerCore { private Clusters clusters; - private Configurations configurations; private Namespaces namespaces; + private Configurations configurations; + private DisasterRecoveryConfigs disasterRecoveryConfigs; + private EventHubs eventHubs; + private ConsumerGroups consumerGroups; + private Operations operations; + private Regions regions; /** * Get a Configurable instance that can be used to create EventHubsManager with optional configuration. * @@ -78,16 +86,6 @@ public interface Configurable extends AzureConfigurable { EventHubsManager 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 Clusters. */ @@ -98,6 +96,16 @@ public Clusters clusters() { return this.clusters; } + /** + * @return Entry point to manage Namespaces. + */ + public Namespaces namespaces() { + if (this.namespaces == null) { + this.namespaces = new NamespacesImpl(this); + } + return this.namespaces; + } + /** * @return Entry point to manage Configurations. */ @@ -109,13 +117,53 @@ public Configurations configurations() { } /** - * @return Entry point to manage Namespaces. + * @return Entry point to manage DisasterRecoveryConfigs. */ - public Namespaces namespaces() { - if (this.namespaces == null) { - this.namespaces = new NamespacesImpl(this); + public DisasterRecoveryConfigs disasterRecoveryConfigs() { + if (this.disasterRecoveryConfigs == null) { + this.disasterRecoveryConfigs = new DisasterRecoveryConfigsImpl(this); } - return this.namespaces; + return this.disasterRecoveryConfigs; + } + + /** + * @return Entry point to manage EventHubs. + */ + public EventHubs eventHubs() { + if (this.eventHubs == null) { + this.eventHubs = new EventHubsImpl(this); + } + return this.eventHubs; + } + + /** + * @return Entry point to manage ConsumerGroups. + */ + public ConsumerGroups consumerGroups() { + if (this.consumerGroups == null) { + this.consumerGroups = new ConsumerGroupsImpl(this); + } + return this.consumerGroups; + } + + /** + * @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 Regions. + */ + public Regions regions() { + if (this.regions == null) { + this.regions = new RegionsImpl(this); + } + return this.regions; } /** @@ -130,6 +178,6 @@ private EventHubsManager(RestClient restClient, String subscriptionId) { super( restClient, subscriptionId, - new EventHub2018PreviewManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + new EventHubManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); } } diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/EventhubImpl.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/EventhubImpl.java new file mode 100644 index 0000000000000..bd8e172134534 --- /dev/null +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/EventhubImpl.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.eventhubs.v2018_01_01_preview.implementation; + +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.Eventhub; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.List; +import org.joda.time.DateTime; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.EntityStatus; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.CaptureDescription; + +class EventhubImpl extends CreatableUpdatableImpl implements Eventhub, Eventhub.Definition, Eventhub.Update { + private final EventHubsManager manager; + private String resourceGroupName; + private String namespaceName; + private String eventHubName; + + EventhubImpl(String name, EventHubsManager manager) { + super(name, new EventhubInner()); + this.manager = manager; + // Set resource name + this.eventHubName = name; + // + } + + EventhubImpl(EventhubInner inner, EventHubsManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.eventHubName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.namespaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "namespaces"); + this.eventHubName = IdParsingUtils.getValueFromIdByName(inner.id(), "eventhubs"); + // + } + + @Override + public EventHubsManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + EventHubsInner client = this.manager().inner().eventHubs(); + return client.createOrUpdateAsync(this.resourceGroupName, this.namespaceName, this.eventHubName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + EventHubsInner client = this.manager().inner().eventHubs(); + return client.createOrUpdateAsync(this.resourceGroupName, this.namespaceName, this.eventHubName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + EventHubsInner client = this.manager().inner().eventHubs(); + return client.getAsync(this.resourceGroupName, this.namespaceName, this.eventHubName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public CaptureDescription captureDescription() { + return this.inner().captureDescription(); + } + + @Override + public DateTime createdAt() { + return this.inner().createdAt(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Long messageRetentionInDays() { + return this.inner().messageRetentionInDays(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Long partitionCount() { + return this.inner().partitionCount(); + } + + @Override + public List partitionIds() { + return this.inner().partitionIds(); + } + + @Override + public EntityStatus status() { + return this.inner().status(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public DateTime updatedAt() { + return this.inner().updatedAt(); + } + + @Override + public EventhubImpl withExistingNamespace(String resourceGroupName, String namespaceName) { + this.resourceGroupName = resourceGroupName; + this.namespaceName = namespaceName; + return this; + } + + @Override + public EventhubImpl withCaptureDescription(CaptureDescription captureDescription) { + this.inner().withCaptureDescription(captureDescription); + return this; + } + + @Override + public EventhubImpl withMessageRetentionInDays(Long messageRetentionInDays) { + this.inner().withMessageRetentionInDays(messageRetentionInDays); + return this; + } + + @Override + public EventhubImpl withPartitionCount(Long partitionCount) { + this.inner().withPartitionCount(partitionCount); + return this; + } + + @Override + public EventhubImpl withStatus(EntityStatus status) { + this.inner().withStatus(status); + return this; + } + +} diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/EventhubInner.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/EventhubInner.java new file mode 100644 index 0000000000000..10d8e091b577d --- /dev/null +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/EventhubInner.java @@ -0,0 +1,177 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventhubs.v2018_01_01_preview.implementation; + +import java.util.List; +import org.joda.time.DateTime; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.EntityStatus; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.CaptureDescription; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Single item in List or Get Event Hub operation. + */ +@JsonFlatten +public class EventhubInner extends ProxyResource { + /** + * Current number of shards on the Event Hub. + */ + @JsonProperty(value = "properties.partitionIds", access = JsonProperty.Access.WRITE_ONLY) + private List partitionIds; + + /** + * Exact time the Event Hub was created. + */ + @JsonProperty(value = "properties.createdAt", access = JsonProperty.Access.WRITE_ONLY) + private DateTime createdAt; + + /** + * The exact time the message was updated. + */ + @JsonProperty(value = "properties.updatedAt", access = JsonProperty.Access.WRITE_ONLY) + private DateTime updatedAt; + + /** + * Number of days to retain the events for this Event Hub, value should be + * 1 to 7 days. + */ + @JsonProperty(value = "properties.messageRetentionInDays") + private Long messageRetentionInDays; + + /** + * Number of partitions created for the Event Hub, allowed values are from + * 1 to 32 partitions. + */ + @JsonProperty(value = "properties.partitionCount") + private Long partitionCount; + + /** + * Enumerates the possible values for the status of the Event Hub. Possible + * values include: 'Active', 'Disabled', 'Restoring', 'SendDisabled', + * 'ReceiveDisabled', 'Creating', 'Deleting', 'Renaming', 'Unknown'. + */ + @JsonProperty(value = "properties.status") + private EntityStatus status; + + /** + * Properties of capture description. + */ + @JsonProperty(value = "properties.captureDescription") + private CaptureDescription captureDescription; + + /** + * Get current number of shards on the Event Hub. + * + * @return the partitionIds value + */ + public List partitionIds() { + return this.partitionIds; + } + + /** + * Get exact time the Event Hub was created. + * + * @return the createdAt value + */ + public DateTime createdAt() { + return this.createdAt; + } + + /** + * Get the exact time the message was updated. + * + * @return the updatedAt value + */ + public DateTime updatedAt() { + return this.updatedAt; + } + + /** + * Get number of days to retain the events for this Event Hub, value should be 1 to 7 days. + * + * @return the messageRetentionInDays value + */ + public Long messageRetentionInDays() { + return this.messageRetentionInDays; + } + + /** + * Set number of days to retain the events for this Event Hub, value should be 1 to 7 days. + * + * @param messageRetentionInDays the messageRetentionInDays value to set + * @return the EventhubInner object itself. + */ + public EventhubInner withMessageRetentionInDays(Long messageRetentionInDays) { + this.messageRetentionInDays = messageRetentionInDays; + return this; + } + + /** + * Get number of partitions created for the Event Hub, allowed values are from 1 to 32 partitions. + * + * @return the partitionCount value + */ + public Long partitionCount() { + return this.partitionCount; + } + + /** + * Set number of partitions created for the Event Hub, allowed values are from 1 to 32 partitions. + * + * @param partitionCount the partitionCount value to set + * @return the EventhubInner object itself. + */ + public EventhubInner withPartitionCount(Long partitionCount) { + this.partitionCount = partitionCount; + return this; + } + + /** + * Get enumerates the possible values for the status of the Event Hub. Possible values include: 'Active', 'Disabled', 'Restoring', 'SendDisabled', 'ReceiveDisabled', 'Creating', 'Deleting', 'Renaming', 'Unknown'. + * + * @return the status value + */ + public EntityStatus status() { + return this.status; + } + + /** + * Set enumerates the possible values for the status of the Event Hub. Possible values include: 'Active', 'Disabled', 'Restoring', 'SendDisabled', 'ReceiveDisabled', 'Creating', 'Deleting', 'Renaming', 'Unknown'. + * + * @param status the status value to set + * @return the EventhubInner object itself. + */ + public EventhubInner withStatus(EntityStatus status) { + this.status = status; + return this; + } + + /** + * Get properties of capture description. + * + * @return the captureDescription value + */ + public CaptureDescription captureDescription() { + return this.captureDescription; + } + + /** + * Set properties of capture description. + * + * @param captureDescription the captureDescription value to set + * @return the EventhubInner object itself. + */ + public EventhubInner withCaptureDescription(CaptureDescription captureDescription) { + this.captureDescription = captureDescription; + return this; + } + +} diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/EventhubNamespaceAuthorizationRuleImpl.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/EventhubNamespaceAuthorizationRuleImpl.java new file mode 100644 index 0000000000000..abb79921f021e --- /dev/null +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/EventhubNamespaceAuthorizationRuleImpl.java @@ -0,0 +1,116 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventhubs.v2018_01_01_preview.implementation; + +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.EventhubNamespaceAuthorizationRule; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.AccessRights; + +class EventhubNamespaceAuthorizationRuleImpl extends CreatableUpdatableImpl implements EventhubNamespaceAuthorizationRule, EventhubNamespaceAuthorizationRule.Definition, EventhubNamespaceAuthorizationRule.Update { + private final EventHubsManager manager; + private String resourceGroupName; + private String namespaceName; + private String eventHubName; + private String authorizationRuleName; + private List crights; + private List urights; + + EventhubNamespaceAuthorizationRuleImpl(String name, EventHubsManager manager) { + super(name, new AuthorizationRuleInner()); + this.manager = manager; + // Set resource name + this.authorizationRuleName = name; + // + } + + EventhubNamespaceAuthorizationRuleImpl(AuthorizationRuleInner inner, EventHubsManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.authorizationRuleName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.namespaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "namespaces"); + this.eventHubName = IdParsingUtils.getValueFromIdByName(inner.id(), "eventhubs"); + this.authorizationRuleName = IdParsingUtils.getValueFromIdByName(inner.id(), "authorizationRules"); + // + } + + @Override + public EventHubsManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + EventHubsInner client = this.manager().inner().eventHubs(); + return client.createOrUpdateAuthorizationRuleAsync(this.resourceGroupName, this.namespaceName, this.eventHubName, this.authorizationRuleName, this.crights) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + EventHubsInner client = this.manager().inner().eventHubs(); + return client.createOrUpdateAuthorizationRuleAsync(this.resourceGroupName, this.namespaceName, this.eventHubName, this.authorizationRuleName, this.urights) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + EventHubsInner client = this.manager().inner().eventHubs(); + return client.getAuthorizationRuleAsync(this.resourceGroupName, this.namespaceName, this.eventHubName, this.authorizationRuleName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List rights() { + return this.inner().rights(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public EventhubNamespaceAuthorizationRuleImpl withExistingEventhub(String resourceGroupName, String namespaceName, String eventHubName) { + this.resourceGroupName = resourceGroupName; + this.namespaceName = namespaceName; + this.eventHubName = eventHubName; + return this; + } + + @Override + public EventhubNamespaceAuthorizationRuleImpl withRights(List rights) { + if (isInCreateMode()) { + this.crights = rights; + } else { + this.urights = rights; + } + return this; + } + +} diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/MessagingRegionsImpl.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/MessagingRegionsImpl.java new file mode 100644 index 0000000000000..2193844eb2503 --- /dev/null +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/MessagingRegionsImpl.java @@ -0,0 +1,58 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventhubs.v2018_01_01_preview.implementation; + +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.MessagingRegions; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.MessagingRegionsProperties; +import java.util.Map; + +class MessagingRegionsImpl extends WrapperImpl implements MessagingRegions { + private final EventHubsManager manager; + MessagingRegionsImpl(MessagingRegionsInner inner, EventHubsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public EventHubsManager manager() { + return this.manager; + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public MessagingRegionsProperties properties() { + return this.inner().properties(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/MessagingRegionsInner.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/MessagingRegionsInner.java new file mode 100644 index 0000000000000..e6fb1a29b7b77 --- /dev/null +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/MessagingRegionsInner.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.eventhubs.v2018_01_01_preview.implementation; + +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.MessagingRegionsProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Messaging Region. + */ +@SkipParentValidation +public class MessagingRegionsInner extends Resource { + /** + * Properties of Messaging Region. + */ + @JsonProperty(value = "properties") + private MessagingRegionsProperties properties; + + /** + * Get properties of Messaging Region. + * + * @return the properties value + */ + public MessagingRegionsProperties properties() { + return this.properties; + } + + /** + * Set properties of Messaging Region. + * + * @param properties the properties value to set + * @return the MessagingRegionsInner object itself. + */ + public MessagingRegionsInner withProperties(MessagingRegionsProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/NamespaceAuthorizationRuleImpl.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/NamespaceAuthorizationRuleImpl.java new file mode 100644 index 0000000000000..8e5f6c45ee8cf --- /dev/null +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/NamespaceAuthorizationRuleImpl.java @@ -0,0 +1,113 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventhubs.v2018_01_01_preview.implementation; + +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.NamespaceAuthorizationRule; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.AccessRights; + +class NamespaceAuthorizationRuleImpl extends CreatableUpdatableImpl implements NamespaceAuthorizationRule, NamespaceAuthorizationRule.Definition, NamespaceAuthorizationRule.Update { + private final EventHubsManager manager; + private String resourceGroupName; + private String namespaceName; + private String authorizationRuleName; + private List crights; + private List urights; + + NamespaceAuthorizationRuleImpl(String name, EventHubsManager manager) { + super(name, new AuthorizationRuleInner()); + this.manager = manager; + // Set resource name + this.authorizationRuleName = name; + // + } + + NamespaceAuthorizationRuleImpl(AuthorizationRuleInner inner, EventHubsManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.authorizationRuleName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.namespaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "namespaces"); + this.authorizationRuleName = IdParsingUtils.getValueFromIdByName(inner.id(), "authorizationRules"); + // + } + + @Override + public EventHubsManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + NamespacesInner client = this.manager().inner().namespaces(); + return client.createOrUpdateAuthorizationRuleAsync(this.resourceGroupName, this.namespaceName, this.authorizationRuleName, this.crights) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + NamespacesInner client = this.manager().inner().namespaces(); + return client.createOrUpdateAuthorizationRuleAsync(this.resourceGroupName, this.namespaceName, this.authorizationRuleName, this.urights) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + NamespacesInner client = this.manager().inner().namespaces(); + return client.getAuthorizationRuleAsync(this.resourceGroupName, this.namespaceName, this.authorizationRuleName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List rights() { + return this.inner().rights(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public NamespaceAuthorizationRuleImpl withExistingNamespace(String resourceGroupName, String namespaceName) { + this.resourceGroupName = resourceGroupName; + this.namespaceName = namespaceName; + return this; + } + + @Override + public NamespaceAuthorizationRuleImpl withRights(List rights) { + if (isInCreateMode()) { + this.crights = rights; + } else { + this.urights = rights; + } + return this; + } + +} diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/NamespacesImpl.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/NamespacesImpl.java index 0482ce8b03ff2..97d9713642b06 100644 --- a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/NamespacesImpl.java +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/NamespacesImpl.java @@ -22,9 +22,13 @@ import rx.functions.Func1; import com.microsoft.azure.PagedList; import com.microsoft.azure.Page; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.CheckNameAvailabilityResult; import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.IpFilterRule; import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.VirtualNetworkRule; import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.NetworkRuleSet; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.NamespaceAuthorizationRule; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.AccessKeys; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.RegenerateAccessKeyParameters; class NamespacesImpl extends GroupableResourcesCoreImpl implements Namespaces { protected NamespacesImpl(EventHubsManager manager) { @@ -128,6 +132,18 @@ public EHNamespaceImpl define(String name) { return wrapModel(name); } + @Override + public Observable checkNameAvailabilityAsync(String name) { + NamespacesInner client = this.inner(); + return client.checkNameAvailabilityAsync(name) + .map(new Func1() { + @Override + public CheckNameAvailabilityResult call(CheckNameAvailabilityResultInner inner) { + return new CheckNameAvailabilityResultImpl(inner, manager()); + } + }); + } + @Override protected EHNamespaceImpl wrapModel(EHNamespaceInner inner) { return new EHNamespaceImpl(inner.name(), inner, manager()); @@ -148,6 +164,11 @@ public VirtualNetworkRuleImpl defineVirtualnetworkrule(String name) { return wrapVirtualnetworkruleModel(name); } + @Override + public NamespaceAuthorizationRuleImpl defineAuthorizationRule(String name) { + return wrapAuthorizationRuleModel(name); + } + private IpFilterRuleImpl wrapIpfilterruleModel(String name) { return new IpFilterRuleImpl(name, this.manager()); } @@ -156,6 +177,10 @@ private VirtualNetworkRuleImpl wrapVirtualnetworkruleModel(String name) { return new VirtualNetworkRuleImpl(name, this.manager()); } + private NamespaceAuthorizationRuleImpl wrapAuthorizationRuleModel(String name) { + return new NamespaceAuthorizationRuleImpl(name, this.manager()); + } + private IpFilterRuleImpl wrapIpFilterRuleModel(IpFilterRuleInner inner) { return new IpFilterRuleImpl(inner, manager()); } @@ -164,6 +189,10 @@ private VirtualNetworkRuleImpl wrapVirtualNetworkRuleModel(VirtualNetworkRuleInn return new VirtualNetworkRuleImpl(inner, manager()); } + private NamespaceAuthorizationRuleImpl wrapNamespaceAuthorizationRuleModel(AuthorizationRuleInner inner) { + return new NamespaceAuthorizationRuleImpl(inner, manager()); + } + private Observable getIpFilterRuleInnerUsingNamespacesInnerAsync(String id) { String resourceGroupName = IdParsingUtils.getValueFromIdByName(id, "resourceGroups"); String namespaceName = IdParsingUtils.getValueFromIdByName(id, "namespaces"); @@ -180,14 +209,26 @@ private Observable getVirtualNetworkRuleInnerUsingNames return client.getVirtualNetworkRuleAsync(resourceGroupName, namespaceName, virtualNetworkRuleName); } + private Observable getAuthorizationRuleInnerUsingNamespacesInnerAsync(String id) { + String resourceGroupName = IdParsingUtils.getValueFromIdByName(id, "resourceGroups"); + String namespaceName = IdParsingUtils.getValueFromIdByName(id, "namespaces"); + String authorizationRuleName = IdParsingUtils.getValueFromIdByName(id, "authorizationRules"); + NamespacesInner client = this.inner(); + return client.getAuthorizationRuleAsync(resourceGroupName, namespaceName, authorizationRuleName); + } + @Override public Observable getIpFilterRuleAsync(String resourceGroupName, String namespaceName, String ipFilterRuleName) { NamespacesInner client = this.inner(); return client.getIpFilterRuleAsync(resourceGroupName, namespaceName, ipFilterRuleName) - .map(new Func1() { + .flatMap(new Func1>() { @Override - public IpFilterRule call(IpFilterRuleInner inner) { - return wrapIpFilterRuleModel(inner); + public Observable call(IpFilterRuleInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((IpFilterRule)wrapIpFilterRuleModel(inner)); + } } }); } @@ -220,10 +261,14 @@ public Completable deleteIpFilterRuleAsync(String resourceGroupName, String name public Observable getVirtualNetworkRuleAsync(String resourceGroupName, String namespaceName, String virtualNetworkRuleName) { NamespacesInner client = this.inner(); return client.getVirtualNetworkRuleAsync(resourceGroupName, namespaceName, virtualNetworkRuleName) - .map(new Func1() { + .flatMap(new Func1>() { @Override - public VirtualNetworkRule call(VirtualNetworkRuleInner inner) { - return wrapVirtualNetworkRuleModel(inner); + public Observable call(VirtualNetworkRuleInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((VirtualNetworkRule)wrapVirtualNetworkRuleModel(inner)); + } } }); } @@ -276,4 +321,68 @@ public NetworkRuleSet call(NetworkRuleSetInner inner) { }); } + @Override + public Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + NamespacesInner client = this.inner(); + return client.getAuthorizationRuleAsync(resourceGroupName, namespaceName, authorizationRuleName) + .flatMap(new Func1>() { + @Override + public Observable call(AuthorizationRuleInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((NamespaceAuthorizationRule)wrapNamespaceAuthorizationRuleModel(inner)); + } + } + }); + } + + @Override + public Observable listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName) { + NamespacesInner client = this.inner(); + return client.listAuthorizationRulesAsync(resourceGroupName, namespaceName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NamespaceAuthorizationRule call(AuthorizationRuleInner inner) { + return wrapNamespaceAuthorizationRuleModel(inner); + } + }); + } + + @Override + public Completable deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + NamespacesInner client = this.inner(); + return client.deleteAuthorizationRuleAsync(resourceGroupName, namespaceName, authorizationRuleName).toCompletable(); + } + + @Override + public Observable listKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + NamespacesInner client = this.inner(); + return client.listKeysAsync(resourceGroupName, namespaceName, authorizationRuleName) + .map(new Func1() { + @Override + public AccessKeys call(AccessKeysInner inner) { + return new AccessKeysImpl(inner, manager()); + } + }); + } + + @Override + public Observable regenerateKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, RegenerateAccessKeyParameters parameters) { + NamespacesInner client = this.inner(); + return client.regenerateKeysAsync(resourceGroupName, namespaceName, authorizationRuleName, parameters) + .map(new Func1() { + @Override + public AccessKeys call(AccessKeysInner inner) { + return new AccessKeysImpl(inner, manager()); + } + }); + } + } diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/NamespacesInner.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/NamespacesInner.java index a8879fd6c3b90..fbb83562db7a1 100644 --- a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/NamespacesInner.java +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/NamespacesInner.java @@ -15,7 +15,10 @@ import com.google.common.reflect.TypeToken; import com.microsoft.azure.AzureServiceFuture; import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.AccessRights; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.CheckNameAvailabilityParameter; import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.ErrorResponseException; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.RegenerateAccessKeyParameters; import com.microsoft.azure.Page; import com.microsoft.azure.PagedList; import com.microsoft.rest.ServiceCallback; @@ -32,6 +35,7 @@ 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; @@ -47,7 +51,7 @@ public class NamespacesInner implements InnerSupportsGet, Inne /** The Retrofit service to perform REST calls. */ private NamespacesService service; /** The service client containing this operation class. */ - private EventHub2018PreviewManagementClientImpl client; + private EventHubManagementClientImpl client; /** * Initializes an instance of NamespacesInner. @@ -55,7 +59,7 @@ public class NamespacesInner implements InnerSupportsGet, Inne * @param retrofit the Retrofit instance built from a Retrofit Builder. * @param client the instance of the service client containing this operation class. */ - public NamespacesInner(Retrofit retrofit, EventHub2018PreviewManagementClientImpl client) { + public NamespacesInner(Retrofit retrofit, EventHubManagementClientImpl client) { this.service = retrofit.create(NamespacesService.class); this.client = client; } @@ -65,6 +69,22 @@ public NamespacesInner(Retrofit retrofit, EventHub2018PreviewManagementClientImp * used by Retrofit to perform actually REST calls. */ interface NamespacesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventhubs.v2018_01_01_preview.Namespaces listIPFilterRules" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/ipfilterrules") + Observable> listIPFilterRules(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @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.eventhubs.v2018_01_01_preview.Namespaces createOrUpdateIpFilterRule" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/ipfilterrules/{ipFilterRuleName}") + Observable> createOrUpdateIpFilterRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("ipFilterRuleName") String ipFilterRuleName, @Path("subscriptionId") String subscriptionId, @Body IpFilterRuleInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventhubs.v2018_01_01_preview.Namespaces deleteIpFilterRule" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/ipfilterrules/{ipFilterRuleName}", method = "DELETE", hasBody = true) + Observable> deleteIpFilterRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("ipFilterRuleName") String ipFilterRuleName, @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.eventhubs.v2018_01_01_preview.Namespaces getIpFilterRule" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/ipfilterrules/{ipFilterRuleName}") + Observable> getIpFilterRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("ipFilterRuleName") String ipFilterRuleName, @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.eventhubs.v2018_01_01_preview.Namespaces list" }) @GET("subscriptions/{subscriptionId}/providers/Microsoft.EventHub/namespaces") Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -97,22 +117,6 @@ interface NamespacesService { @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}") Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Body EHNamespaceInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventhubs.v2018_01_01_preview.Namespaces listIPFilterRules" }) - @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/ipfilterrules") - Observable> listIPFilterRules(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @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.eventhubs.v2018_01_01_preview.Namespaces createOrUpdateIpFilterRule" }) - @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/ipfilterrules/{ipFilterRuleName}") - Observable> createOrUpdateIpFilterRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("ipFilterRuleName") String ipFilterRuleName, @Path("subscriptionId") String subscriptionId, @Body IpFilterRuleInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventhubs.v2018_01_01_preview.Namespaces deleteIpFilterRule" }) - @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/ipfilterrules/{ipFilterRuleName}", method = "DELETE", hasBody = true) - Observable> deleteIpFilterRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("ipFilterRuleName") String ipFilterRuleName, @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.eventhubs.v2018_01_01_preview.Namespaces getIpFilterRule" }) - @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/ipfilterrules/{ipFilterRuleName}") - Observable> getIpFilterRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("ipFilterRuleName") String ipFilterRuleName, @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.eventhubs.v2018_01_01_preview.Namespaces listVirtualNetworkRules" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/virtualnetworkrules") Observable> listVirtualNetworkRules(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -137,6 +141,38 @@ interface NamespacesService { @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/networkRuleSets/default") Observable> getNetworkRuleSet(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @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.eventhubs.v2018_01_01_preview.Namespaces listAuthorizationRules" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/authorizationRules") + Observable> listAuthorizationRules(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @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.eventhubs.v2018_01_01_preview.Namespaces createOrUpdateAuthorizationRule" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}") + Observable> createOrUpdateAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body AuthorizationRuleInner parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventhubs.v2018_01_01_preview.Namespaces deleteAuthorizationRule" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}", method = "DELETE", hasBody = true) + Observable> deleteAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("authorizationRuleName") String authorizationRuleName, @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.eventhubs.v2018_01_01_preview.Namespaces getAuthorizationRule" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}") + Observable> getAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("authorizationRuleName") String authorizationRuleName, @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.eventhubs.v2018_01_01_preview.Namespaces listKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}/listKeys") + Observable> listKeys(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("authorizationRuleName") String authorizationRuleName, @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.eventhubs.v2018_01_01_preview.Namespaces regenerateKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}/regenerateKeys") + Observable> regenerateKeys(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Body RegenerateAccessKeyParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventhubs.v2018_01_01_preview.Namespaces checkNameAvailability" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.EventHub/checkNameAvailability") + Observable> checkNameAvailability(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body CheckNameAvailabilityParameter parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventhubs.v2018_01_01_preview.Namespaces listIPFilterRulesNext" }) + @GET + Observable> listIPFilterRulesNext(@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.eventhubs.v2018_01_01_preview.Namespaces listNext" }) @GET Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -145,14 +181,416 @@ interface NamespacesService { @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.eventhubs.v2018_01_01_preview.Namespaces listIPFilterRulesNext" }) - @GET - Observable> listIPFilterRulesNext(@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.eventhubs.v2018_01_01_preview.Namespaces listVirtualNetworkRulesNext" }) @GET Observable> listVirtualNetworkRulesNext(@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.eventhubs.v2018_01_01_preview.Namespaces listAuthorizationRulesNext" }) + @GET + Observable> listAuthorizationRulesNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets a list of IP Filter rules for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<IpFilterRuleInner> object if successful. + */ + public PagedList listIPFilterRules(final String resourceGroupName, final String namespaceName) { + ServiceResponse> response = listIPFilterRulesSinglePageAsync(resourceGroupName, namespaceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listIPFilterRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets a list of IP Filter rules for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listIPFilterRulesAsync(final String resourceGroupName, final String namespaceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listIPFilterRulesSinglePageAsync(resourceGroupName, namespaceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listIPFilterRulesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets a list of IP Filter rules for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<IpFilterRuleInner> object + */ + public Observable> listIPFilterRulesAsync(final String resourceGroupName, final String namespaceName) { + return listIPFilterRulesWithServiceResponseAsync(resourceGroupName, namespaceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of IP Filter rules for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<IpFilterRuleInner> object + */ + public Observable>> listIPFilterRulesWithServiceResponseAsync(final String resourceGroupName, final String namespaceName) { + return listIPFilterRulesSinglePageAsync(resourceGroupName, namespaceName) + .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(listIPFilterRulesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets a list of IP Filter rules for a Namespace. + * + ServiceResponse> * @param resourceGroupName Name of the resource group within the azure subscription. + ServiceResponse> * @param namespaceName The Namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<IpFilterRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listIPFilterRulesSinglePageAsync(final String resourceGroupName, final String namespaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-01-01-preview"; + return service.listIPFilterRules(resourceGroupName, namespaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listIPFilterRulesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listIPFilterRulesDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Creates or updates an IpFilterRule for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param ipFilterRuleName The IP Filter Rule name. + * @param parameters The Namespace IpFilterRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the IpFilterRuleInner object if successful. + */ + public IpFilterRuleInner createOrUpdateIpFilterRule(String resourceGroupName, String namespaceName, String ipFilterRuleName, IpFilterRuleInner parameters) { + return createOrUpdateIpFilterRuleWithServiceResponseAsync(resourceGroupName, namespaceName, ipFilterRuleName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates an IpFilterRule for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param ipFilterRuleName The IP Filter Rule name. + * @param parameters The Namespace IpFilterRule. + * @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 createOrUpdateIpFilterRuleAsync(String resourceGroupName, String namespaceName, String ipFilterRuleName, IpFilterRuleInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateIpFilterRuleWithServiceResponseAsync(resourceGroupName, namespaceName, ipFilterRuleName, parameters), serviceCallback); + } + + /** + * Creates or updates an IpFilterRule for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param ipFilterRuleName The IP Filter Rule name. + * @param parameters The Namespace IpFilterRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IpFilterRuleInner object + */ + public Observable createOrUpdateIpFilterRuleAsync(String resourceGroupName, String namespaceName, String ipFilterRuleName, IpFilterRuleInner parameters) { + return createOrUpdateIpFilterRuleWithServiceResponseAsync(resourceGroupName, namespaceName, ipFilterRuleName, parameters).map(new Func1, IpFilterRuleInner>() { + @Override + public IpFilterRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates an IpFilterRule for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param ipFilterRuleName The IP Filter Rule name. + * @param parameters The Namespace IpFilterRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IpFilterRuleInner object + */ + public Observable> createOrUpdateIpFilterRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String ipFilterRuleName, IpFilterRuleInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (ipFilterRuleName == null) { + throw new IllegalArgumentException("Parameter ipFilterRuleName 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-01-01-preview"; + return service.createOrUpdateIpFilterRule(resourceGroupName, namespaceName, ipFilterRuleName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateIpFilterRuleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateIpFilterRuleDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Deletes an IpFilterRule for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param ipFilterRuleName The IP Filter Rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteIpFilterRule(String resourceGroupName, String namespaceName, String ipFilterRuleName) { + deleteIpFilterRuleWithServiceResponseAsync(resourceGroupName, namespaceName, ipFilterRuleName).toBlocking().single().body(); + } + + /** + * Deletes an IpFilterRule for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param ipFilterRuleName The IP Filter Rule name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteIpFilterRuleAsync(String resourceGroupName, String namespaceName, String ipFilterRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteIpFilterRuleWithServiceResponseAsync(resourceGroupName, namespaceName, ipFilterRuleName), serviceCallback); + } + + /** + * Deletes an IpFilterRule for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param ipFilterRuleName The IP Filter Rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteIpFilterRuleAsync(String resourceGroupName, String namespaceName, String ipFilterRuleName) { + return deleteIpFilterRuleWithServiceResponseAsync(resourceGroupName, namespaceName, ipFilterRuleName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an IpFilterRule for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param ipFilterRuleName The IP Filter Rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteIpFilterRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String ipFilterRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (ipFilterRuleName == null) { + throw new IllegalArgumentException("Parameter ipFilterRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-01-01-preview"; + return service.deleteIpFilterRule(resourceGroupName, namespaceName, ipFilterRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteIpFilterRuleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteIpFilterRuleDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets an IpFilterRule for a Namespace by rule name. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param ipFilterRuleName The IP Filter Rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the IpFilterRuleInner object if successful. + */ + public IpFilterRuleInner getIpFilterRule(String resourceGroupName, String namespaceName, String ipFilterRuleName) { + return getIpFilterRuleWithServiceResponseAsync(resourceGroupName, namespaceName, ipFilterRuleName).toBlocking().single().body(); + } + + /** + * Gets an IpFilterRule for a Namespace by rule name. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param ipFilterRuleName The IP Filter Rule name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getIpFilterRuleAsync(String resourceGroupName, String namespaceName, String ipFilterRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getIpFilterRuleWithServiceResponseAsync(resourceGroupName, namespaceName, ipFilterRuleName), serviceCallback); + } + + /** + * Gets an IpFilterRule for a Namespace by rule name. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param ipFilterRuleName The IP Filter Rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IpFilterRuleInner object + */ + public Observable getIpFilterRuleAsync(String resourceGroupName, String namespaceName, String ipFilterRuleName) { + return getIpFilterRuleWithServiceResponseAsync(resourceGroupName, namespaceName, ipFilterRuleName).map(new Func1, IpFilterRuleInner>() { + @Override + public IpFilterRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets an IpFilterRule for a Namespace by rule name. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param ipFilterRuleName The IP Filter Rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IpFilterRuleInner object + */ + public Observable> getIpFilterRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String ipFilterRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (ipFilterRuleName == null) { + throw new IllegalArgumentException("Parameter ipFilterRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-01-01-preview"; + return service.getIpFilterRule(resourceGroupName, namespaceName, ipFilterRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getIpFilterRuleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getIpFilterRuleDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); } /** @@ -238,15 +676,13 @@ 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()) + final String apiVersion = "2018-01-01-preview"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { try { - ServiceResponse> result = listDelegate(response); + ServiceResponse> result = listDelegate(response); return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); @@ -255,9 +691,9 @@ public Observable>> call(Response> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) .registerError(ErrorResponseException.class) .build(response); } @@ -265,7 +701,7 @@ private ServiceResponse> listDelegate(Response nextPage(String nextPageLink) { /** * Lists the available Namespaces within a resource group. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure 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 @@ -304,7 +740,7 @@ public Observable>> call(String nextPageL /** * Lists the available Namespaces within a resource group. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PagedList<EHNamespaceInner> object */ @@ -321,7 +757,7 @@ public Page call(ServiceResponse> respo /** * Lists the available Namespaces within a resource group. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PagedList<EHNamespaceInner> object */ @@ -342,7 +778,7 @@ public Observable>> call(ServiceResponse< /** * Lists the available Namespaces within a resource group. * - ServiceResponse> * @param resourceGroupName Name of the resource group within the Azure subscription. + ServiceResponse> * @param resourceGroupName Name of the resource group within the azure subscription. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList<EHNamespaceInner> object wrapped in {@link ServiceResponse} if successful. */ @@ -353,15 +789,13 @@ public Observable>> listByResourceGroupSi 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.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + final String apiVersion = "2018-01-01-preview"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { try { - ServiceResponse> result = listByResourceGroupDelegate(response); + ServiceResponse> result = listByResourceGroupDelegate(response); return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); @@ -370,9 +804,9 @@ public Observable>> call(Response> listByResourceGroupDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) + private ServiceResponse> listByResourceGroupDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) .registerError(ErrorResponseException.class) .build(response); } @@ -380,7 +814,7 @@ private ServiceResponse> listByResourceGroupDelegate( /** * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name * @param parameters Parameters for creating a namespace resource. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -395,7 +829,7 @@ public EHNamespaceInner createOrUpdate(String resourceGroupName, String namespac /** * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name * @param parameters Parameters for creating a namespace resource. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -409,7 +843,7 @@ public ServiceFuture createOrUpdateAsync(String resourceGroupN /** * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name * @param parameters Parameters for creating a namespace resource. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -427,7 +861,7 @@ public EHNamespaceInner call(ServiceResponse response) { /** * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name * @param parameters Parameters for creating a namespace resource. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -446,54 +880,294 @@ public Observable> createOrUpdateWithServiceRe if (parameters == null) { throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } Validator.validate(parameters); - Observable> observable = service.createOrUpdate(resourceGroupName, namespaceName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + final String apiVersion = "2018-01-01-preview"; + Observable> observable = service.createOrUpdate(resourceGroupName, namespaceName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); } /** - * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param parameters Parameters for creating a namespace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EHNamespaceInner object if successful. + */ + public EHNamespaceInner beginCreateOrUpdate(String resourceGroupName, String namespaceName, EHNamespaceInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param parameters Parameters for creating a namespace resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String namespaceName, EHNamespaceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters), serviceCallback); + } + + /** + * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param parameters Parameters for creating a namespace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EHNamespaceInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String namespaceName, EHNamespaceInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).map(new Func1, EHNamespaceInner>() { + @Override + public EHNamespaceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param parameters Parameters for creating a namespace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EHNamespaceInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String namespaceName, EHNamespaceInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-01-01-preview"; + return service.beginCreateOrUpdate(resourceGroupName, namespaceName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String namespaceName) { + deleteWithServiceResponseAsync(resourceGroupName, namespaceName).toBlocking().last().body(); + } + + /** + * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String namespaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, namespaceName), serviceCallback); + } + + /** + * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String namespaceName) { + return deleteWithServiceResponseAsync(resourceGroupName, namespaceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String namespaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-01-01-preview"; + Observable> observable = service.delete(resourceGroupName, namespaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String namespaceName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, namespaceName).toBlocking().single().body(); + } + + /** + * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String namespaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, namespaceName), serviceCallback); + } + + /** + * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String namespaceName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, namespaceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String namespaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-01-01-preview"; + return service.beginDelete(resourceGroupName, namespaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets the description of the specified namespace. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param parameters Parameters for creating a namespace resource. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the EHNamespaceInner object if successful. */ - public EHNamespaceInner beginCreateOrUpdate(String resourceGroupName, String namespaceName, EHNamespaceInner parameters) { - return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).toBlocking().single().body(); + public EHNamespaceInner getByResourceGroup(String resourceGroupName, String namespaceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, namespaceName).toBlocking().single().body(); } /** - * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * Gets the description of the specified namespace. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param parameters Parameters for creating a namespace resource. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String namespaceName, EHNamespaceInner parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters), serviceCallback); + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String namespaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, namespaceName), serviceCallback); } /** - * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * Gets the description of the specified namespace. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param parameters Parameters for creating a namespace resource. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the EHNamespaceInner object */ - public Observable beginCreateOrUpdateAsync(String resourceGroupName, String namespaceName, EHNamespaceInner parameters) { - return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).map(new Func1, EHNamespaceInner>() { + public Observable getByResourceGroupAsync(String resourceGroupName, String namespaceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, namespaceName).map(new Func1, EHNamespaceInner>() { @Override public EHNamespaceInner call(ServiceResponse response) { return response.body(); @@ -502,15 +1176,14 @@ public EHNamespaceInner call(ServiceResponse response) { } /** - * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * Gets the description of the specified namespace. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param parameters Parameters for creating a namespace resource. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the EHNamespaceInner object */ - public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String namespaceName, EHNamespaceInner parameters) { + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String namespaceName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -520,19 +1193,13 @@ public Observable> beginCreateOrUpdateWithServ if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - if (parameters == null) { - throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - Validator.validate(parameters); - return service.beginCreateOrUpdate(resourceGroupName, namespaceName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + final String apiVersion = "2018-01-01-preview"; + return service.getByResourceGroup(resourceGroupName, namespaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { try { - ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + ServiceResponse clientResponse = getByResourceGroupDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -541,67 +1208,71 @@ public Observable> call(Response }); } - private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + private ServiceResponse getByResourceGroupDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .register(201, new TypeToken() { }.getType()) - .register(202, new TypeToken() { }.getType()) .registerError(ErrorResponseException.class) .build(response); } /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name + * @param parameters Parameters for updating a namespace resource. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EHNamespaceInner object if successful. */ - public void delete(String resourceGroupName, String namespaceName) { - deleteWithServiceResponseAsync(resourceGroupName, namespaceName).toBlocking().last().body(); + public EHNamespaceInner update(String resourceGroupName, String namespaceName, EHNamespaceInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).toBlocking().single().body(); } /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name + * @param parameters Parameters for updating a namespace resource. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture deleteAsync(String resourceGroupName, String namespaceName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, namespaceName), serviceCallback); + public ServiceFuture updateAsync(String resourceGroupName, String namespaceName, EHNamespaceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters), serviceCallback); } /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name + * @param parameters Parameters for updating a namespace resource. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request + * @return the observable to the EHNamespaceInner object */ - public Observable deleteAsync(String resourceGroupName, String namespaceName) { - return deleteWithServiceResponseAsync(resourceGroupName, namespaceName).map(new Func1, Void>() { + public Observable updateAsync(String resourceGroupName, String namespaceName, EHNamespaceInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).map(new Func1, EHNamespaceInner>() { @Override - public Void call(ServiceResponse response) { + public EHNamespaceInner call(ServiceResponse response) { return response.body(); } }); } /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name + * @param parameters Parameters for updating a namespace resource. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request + * @return the observable to the EHNamespaceInner object */ - public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String namespaceName) { + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String namespaceName, EHNamespaceInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -611,65 +1282,124 @@ public Observable> deleteWithServiceResponseAsync(String r 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); } - Observable> observable = service.delete(resourceGroupName, namespaceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + Validator.validate(parameters); + final String apiVersion = "2018-01-01-preview"; + return service.update(resourceGroupName, namespaceName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); } /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * Gets a list of VirtualNetwork rules for a Namespace. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkRuleInner> object if successful. */ - public void beginDelete(String resourceGroupName, String namespaceName) { - beginDeleteWithServiceResponseAsync(resourceGroupName, namespaceName).toBlocking().single().body(); + public PagedList listVirtualNetworkRules(final String resourceGroupName, final String namespaceName) { + ServiceResponse> response = listVirtualNetworkRulesSinglePageAsync(resourceGroupName, namespaceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listVirtualNetworkRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; } /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * Gets a list of VirtualNetwork rules for a Namespace. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginDeleteAsync(String resourceGroupName, String namespaceName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, namespaceName), serviceCallback); + public ServiceFuture> listVirtualNetworkRulesAsync(final String resourceGroupName, final String namespaceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listVirtualNetworkRulesSinglePageAsync(resourceGroupName, namespaceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listVirtualNetworkRulesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); } /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * Gets a list of VirtualNetwork rules for a Namespace. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. + * @return the observable to the PagedList<VirtualNetworkRuleInner> object */ - public Observable beginDeleteAsync(String resourceGroupName, String namespaceName) { - return beginDeleteWithServiceResponseAsync(resourceGroupName, namespaceName).map(new Func1, Void>() { - @Override - public Void call(ServiceResponse response) { - return response.body(); - } - }); + public Observable> listVirtualNetworkRulesAsync(final String resourceGroupName, final String namespaceName) { + return listVirtualNetworkRulesWithServiceResponseAsync(resourceGroupName, namespaceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); } /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * Gets a list of VirtualNetwork rules for a Namespace. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. + * @return the observable to the PagedList<VirtualNetworkRuleInner> object */ - public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String namespaceName) { + public Observable>> listVirtualNetworkRulesWithServiceResponseAsync(final String resourceGroupName, final String namespaceName) { + return listVirtualNetworkRulesSinglePageAsync(resourceGroupName, namespaceName) + .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(listVirtualNetworkRulesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets a list of VirtualNetwork rules for a Namespace. + * + ServiceResponse> * @param resourceGroupName Name of the resource group within the azure subscription. + ServiceResponse> * @param namespaceName The Namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listVirtualNetworkRulesSinglePageAsync(final String resourceGroupName, final String namespaceName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -679,16 +1409,14 @@ public Observable> beginDeleteWithServiceResponseAsync(Str 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.beginDelete(resourceGroupName, namespaceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + final String apiVersion = "2018-01-01-preview"; + return service.listVirtualNetworkRules(resourceGroupName, namespaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { @Override - public Observable> call(Response response) { + public Observable>> call(Response response) { try { - ServiceResponse clientResponse = beginDeleteDelegate(response); - return Observable.just(clientResponse); + ServiceResponse> result = listVirtualNetworkRulesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } @@ -696,86 +1424,92 @@ public Observable> call(Response response) { }); } - private ServiceResponse beginDeleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .register(202, new TypeToken() { }.getType()) - .register(204, new TypeToken() { }.getType()) + private ServiceResponse> listVirtualNetworkRulesDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) .registerError(ErrorResponseException.class) .build(response); } /** - * Gets the description of the specified namespace. + * Creates or updates an VirtualNetworkRule for a Namespace. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name + * @param virtualNetworkRuleName The Virtual Network Rule name. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the EHNamespaceInner object if successful. + * @return the VirtualNetworkRuleInner object if successful. */ - public EHNamespaceInner getByResourceGroup(String resourceGroupName, String namespaceName) { - return getByResourceGroupWithServiceResponseAsync(resourceGroupName, namespaceName).toBlocking().single().body(); + public VirtualNetworkRuleInner createOrUpdateVirtualNetworkRule(String resourceGroupName, String namespaceName, String virtualNetworkRuleName) { + return createOrUpdateVirtualNetworkRuleWithServiceResponseAsync(resourceGroupName, namespaceName, virtualNetworkRuleName).toBlocking().single().body(); } /** - * Gets the description of the specified namespace. + * Creates or updates an VirtualNetworkRule for a Namespace. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name + * @param virtualNetworkRuleName The Virtual Network Rule name. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String namespaceName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, namespaceName), serviceCallback); + public ServiceFuture createOrUpdateVirtualNetworkRuleAsync(String resourceGroupName, String namespaceName, String virtualNetworkRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateVirtualNetworkRuleWithServiceResponseAsync(resourceGroupName, namespaceName, virtualNetworkRuleName), serviceCallback); } /** - * Gets the description of the specified namespace. + * Creates or updates an VirtualNetworkRule for a Namespace. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name + * @param virtualNetworkRuleName The Virtual Network Rule name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the EHNamespaceInner object + * @return the observable to the VirtualNetworkRuleInner object */ - public Observable getByResourceGroupAsync(String resourceGroupName, String namespaceName) { - return getByResourceGroupWithServiceResponseAsync(resourceGroupName, namespaceName).map(new Func1, EHNamespaceInner>() { + public Observable createOrUpdateVirtualNetworkRuleAsync(String resourceGroupName, String namespaceName, String virtualNetworkRuleName) { + return createOrUpdateVirtualNetworkRuleWithServiceResponseAsync(resourceGroupName, namespaceName, virtualNetworkRuleName).map(new Func1, VirtualNetworkRuleInner>() { @Override - public EHNamespaceInner call(ServiceResponse response) { + public VirtualNetworkRuleInner call(ServiceResponse response) { return response.body(); } }); } /** - * Gets the description of the specified namespace. + * Creates or updates an VirtualNetworkRule for a Namespace. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name + * @param virtualNetworkRuleName The Virtual Network Rule name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the EHNamespaceInner object + * @return the observable to the VirtualNetworkRuleInner object */ - public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String namespaceName) { + public Observable> createOrUpdateVirtualNetworkRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String virtualNetworkRuleName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (namespaceName == null) { throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); } + if (virtualNetworkRuleName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkRuleName is required and cannot be null."); + } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.getByResourceGroup(resourceGroupName, namespaceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + final String apiVersion = "2018-01-01-preview"; + final String virtualNetworkSubnetId = null; + VirtualNetworkRuleInner parameters = new VirtualNetworkRuleInner(); + parameters.withVirtualNetworkSubnetId(null); + return service.createOrUpdateVirtualNetworkRule(resourceGroupName, namespaceName, virtualNetworkRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = getByResourceGroupDelegate(response); + ServiceResponse clientResponse = createOrUpdateVirtualNetworkRuleDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -784,93 +1518,88 @@ public Observable> call(Response }); } - private ServiceResponse getByResourceGroupDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .register(201, new TypeToken() { }.getType()) - .registerError(ErrorResponseException.class) - .build(response); - } - /** - * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * Creates or updates an VirtualNetworkRule for a Namespace. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param parameters Parameters for updating a namespace resource. + * @param virtualNetworkRuleName The Virtual Network Rule name. + * @param virtualNetworkSubnetId ARM ID of Virtual Network Subnet * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the EHNamespaceInner object if successful. + * @return the VirtualNetworkRuleInner object if successful. */ - public EHNamespaceInner update(String resourceGroupName, String namespaceName, EHNamespaceInner parameters) { - return updateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).toBlocking().single().body(); + public VirtualNetworkRuleInner createOrUpdateVirtualNetworkRule(String resourceGroupName, String namespaceName, String virtualNetworkRuleName, String virtualNetworkSubnetId) { + return createOrUpdateVirtualNetworkRuleWithServiceResponseAsync(resourceGroupName, namespaceName, virtualNetworkRuleName, virtualNetworkSubnetId).toBlocking().single().body(); } /** - * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * Creates or updates an VirtualNetworkRule for a Namespace. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param parameters Parameters for updating a namespace resource. + * @param virtualNetworkRuleName The Virtual Network Rule name. + * @param virtualNetworkSubnetId ARM ID of Virtual Network Subnet * @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 namespaceName, EHNamespaceInner parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters), serviceCallback); + public ServiceFuture createOrUpdateVirtualNetworkRuleAsync(String resourceGroupName, String namespaceName, String virtualNetworkRuleName, String virtualNetworkSubnetId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateVirtualNetworkRuleWithServiceResponseAsync(resourceGroupName, namespaceName, virtualNetworkRuleName, virtualNetworkSubnetId), serviceCallback); } /** - * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * Creates or updates an VirtualNetworkRule for a Namespace. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param parameters Parameters for updating a namespace resource. + * @param virtualNetworkRuleName The Virtual Network Rule name. + * @param virtualNetworkSubnetId ARM ID of Virtual Network Subnet * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the EHNamespaceInner object + * @return the observable to the VirtualNetworkRuleInner object */ - public Observable updateAsync(String resourceGroupName, String namespaceName, EHNamespaceInner parameters) { - return updateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).map(new Func1, EHNamespaceInner>() { + public Observable createOrUpdateVirtualNetworkRuleAsync(String resourceGroupName, String namespaceName, String virtualNetworkRuleName, String virtualNetworkSubnetId) { + return createOrUpdateVirtualNetworkRuleWithServiceResponseAsync(resourceGroupName, namespaceName, virtualNetworkRuleName, virtualNetworkSubnetId).map(new Func1, VirtualNetworkRuleInner>() { @Override - public EHNamespaceInner call(ServiceResponse response) { + public VirtualNetworkRuleInner call(ServiceResponse response) { return response.body(); } }); } /** - * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * Creates or updates an VirtualNetworkRule for a Namespace. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param parameters Parameters for updating a namespace resource. + * @param virtualNetworkRuleName The Virtual Network Rule name. + * @param virtualNetworkSubnetId ARM ID of Virtual Network Subnet * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the EHNamespaceInner object + * @return the observable to the VirtualNetworkRuleInner object */ - public Observable> updateWithServiceResponseAsync(String resourceGroupName, String namespaceName, EHNamespaceInner parameters) { + public Observable> createOrUpdateVirtualNetworkRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String virtualNetworkRuleName, String virtualNetworkSubnetId) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (namespaceName == null) { throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); } + if (virtualNetworkRuleName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkRuleName 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 (parameters == null) { - throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - Validator.validate(parameters); - return service.update(resourceGroupName, namespaceName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + final String apiVersion = "2018-01-01-preview"; + VirtualNetworkRuleInner parameters = new VirtualNetworkRuleInner(); + parameters.withVirtualNetworkSubnetId(virtualNetworkSubnetId); + return service.createOrUpdateVirtualNetworkRule(resourceGroupName, namespaceName, virtualNetworkRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = updateDelegate(response); + ServiceResponse clientResponse = createOrUpdateVirtualNetworkRuleDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -879,124 +1608,89 @@ public Observable> call(Response }); } - private ServiceResponse updateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .register(201, new TypeToken() { }.getType()) - .register(202, new TypeToken() { }.getType()) + private ServiceResponse createOrUpdateVirtualNetworkRuleDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(ErrorResponseException.class) .build(response); } /** - * Gets a list of IP Filter rules for a Namespace. + * Deletes an VirtualNetworkRule for a Namespace. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name + * @param virtualNetworkRuleName The Virtual Network Rule name. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the PagedList<IpFilterRuleInner> object if successful. */ - public PagedList listIPFilterRules(final String resourceGroupName, final String namespaceName) { - ServiceResponse> response = listIPFilterRulesSinglePageAsync(resourceGroupName, namespaceName).toBlocking().single(); - return new PagedList(response.body()) { - @Override - public Page nextPage(String nextPageLink) { - return listIPFilterRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); - } - }; + public void deleteVirtualNetworkRule(String resourceGroupName, String namespaceName, String virtualNetworkRuleName) { + deleteVirtualNetworkRuleWithServiceResponseAsync(resourceGroupName, namespaceName, virtualNetworkRuleName).toBlocking().single().body(); } /** - * Gets a list of IP Filter rules for a Namespace. + * Deletes an VirtualNetworkRule for a Namespace. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name + * @param virtualNetworkRuleName The Virtual Network Rule name. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture> listIPFilterRulesAsync(final String resourceGroupName, final String namespaceName, final ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - listIPFilterRulesSinglePageAsync(resourceGroupName, namespaceName), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return listIPFilterRulesNextSinglePageAsync(nextPageLink); - } - }, - serviceCallback); + public ServiceFuture deleteVirtualNetworkRuleAsync(String resourceGroupName, String namespaceName, String virtualNetworkRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteVirtualNetworkRuleWithServiceResponseAsync(resourceGroupName, namespaceName, virtualNetworkRuleName), serviceCallback); } /** - * Gets a list of IP Filter rules for a Namespace. + * Deletes an VirtualNetworkRule for a Namespace. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name + * @param virtualNetworkRuleName The Virtual Network Rule name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<IpFilterRuleInner> object + * @return the {@link ServiceResponse} object if successful. */ - public Observable> listIPFilterRulesAsync(final String resourceGroupName, final String namespaceName) { - return listIPFilterRulesWithServiceResponseAsync(resourceGroupName, namespaceName) - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); + public Observable deleteVirtualNetworkRuleAsync(String resourceGroupName, String namespaceName, String virtualNetworkRuleName) { + return deleteVirtualNetworkRuleWithServiceResponseAsync(resourceGroupName, namespaceName, virtualNetworkRuleName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); } /** - * Gets a list of IP Filter rules for a Namespace. + * Deletes an VirtualNetworkRule for a Namespace. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name + * @param virtualNetworkRuleName The Virtual Network Rule name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<IpFilterRuleInner> object - */ - public Observable>> listIPFilterRulesWithServiceResponseAsync(final String resourceGroupName, final String namespaceName) { - return listIPFilterRulesSinglePageAsync(resourceGroupName, namespaceName) - .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(listIPFilterRulesNextWithServiceResponseAsync(nextPageLink)); - } - }); - } - - /** - * Gets a list of IP Filter rules for a Namespace. - * - ServiceResponse> * @param resourceGroupName Name of the resource group within the Azure subscription. - ServiceResponse> * @param namespaceName The Namespace name - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<IpFilterRuleInner> object wrapped in {@link ServiceResponse} if successful. + * @return the {@link ServiceResponse} object if successful. */ - public Observable>> listIPFilterRulesSinglePageAsync(final String resourceGroupName, final String namespaceName) { + public Observable> deleteVirtualNetworkRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String virtualNetworkRuleName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (namespaceName == null) { throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); } + if (virtualNetworkRuleName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkRuleName is required and cannot be null."); + } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.listIPFilterRules(resourceGroupName, namespaceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + final String apiVersion = "2018-01-01-preview"; + return service.deleteVirtualNetworkRule(resourceGroupName, namespaceName, virtualNetworkRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable>> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse> result = listIPFilterRulesDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); + ServiceResponse clientResponse = deleteVirtualNetworkRuleDelegate(response); + return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } @@ -1004,99 +1698,90 @@ public Observable>> call(Response> listIPFilterRulesDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) + private ServiceResponse deleteVirtualNetworkRuleDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) .registerError(ErrorResponseException.class) .build(response); } /** - * Creates or updates an IpFilterRule for a Namespace. + * Gets an VirtualNetworkRule for a Namespace by rule name. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param ipFilterRuleName The IP Filter Rule name. - * @param parameters The Namespace IpFilterRule. + * @param virtualNetworkRuleName The Virtual Network Rule name. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the IpFilterRuleInner object if successful. + * @return the VirtualNetworkRuleInner object if successful. */ - public IpFilterRuleInner createOrUpdateIpFilterRule(String resourceGroupName, String namespaceName, String ipFilterRuleName, IpFilterRuleInner parameters) { - return createOrUpdateIpFilterRuleWithServiceResponseAsync(resourceGroupName, namespaceName, ipFilterRuleName, parameters).toBlocking().single().body(); + public VirtualNetworkRuleInner getVirtualNetworkRule(String resourceGroupName, String namespaceName, String virtualNetworkRuleName) { + return getVirtualNetworkRuleWithServiceResponseAsync(resourceGroupName, namespaceName, virtualNetworkRuleName).toBlocking().single().body(); } /** - * Creates or updates an IpFilterRule for a Namespace. + * Gets an VirtualNetworkRule for a Namespace by rule name. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param ipFilterRuleName The IP Filter Rule name. - * @param parameters The Namespace IpFilterRule. + * @param virtualNetworkRuleName The Virtual Network Rule name. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture createOrUpdateIpFilterRuleAsync(String resourceGroupName, String namespaceName, String ipFilterRuleName, IpFilterRuleInner parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createOrUpdateIpFilterRuleWithServiceResponseAsync(resourceGroupName, namespaceName, ipFilterRuleName, parameters), serviceCallback); + public ServiceFuture getVirtualNetworkRuleAsync(String resourceGroupName, String namespaceName, String virtualNetworkRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getVirtualNetworkRuleWithServiceResponseAsync(resourceGroupName, namespaceName, virtualNetworkRuleName), serviceCallback); } /** - * Creates or updates an IpFilterRule for a Namespace. + * Gets an VirtualNetworkRule for a Namespace by rule name. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param ipFilterRuleName The IP Filter Rule name. - * @param parameters The Namespace IpFilterRule. + * @param virtualNetworkRuleName The Virtual Network Rule name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the IpFilterRuleInner object + * @return the observable to the VirtualNetworkRuleInner object */ - public Observable createOrUpdateIpFilterRuleAsync(String resourceGroupName, String namespaceName, String ipFilterRuleName, IpFilterRuleInner parameters) { - return createOrUpdateIpFilterRuleWithServiceResponseAsync(resourceGroupName, namespaceName, ipFilterRuleName, parameters).map(new Func1, IpFilterRuleInner>() { + public Observable getVirtualNetworkRuleAsync(String resourceGroupName, String namespaceName, String virtualNetworkRuleName) { + return getVirtualNetworkRuleWithServiceResponseAsync(resourceGroupName, namespaceName, virtualNetworkRuleName).map(new Func1, VirtualNetworkRuleInner>() { @Override - public IpFilterRuleInner call(ServiceResponse response) { + public VirtualNetworkRuleInner call(ServiceResponse response) { return response.body(); } }); } /** - * Creates or updates an IpFilterRule for a Namespace. + * Gets an VirtualNetworkRule for a Namespace by rule name. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param ipFilterRuleName The IP Filter Rule name. - * @param parameters The Namespace IpFilterRule. + * @param virtualNetworkRuleName The Virtual Network Rule name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the IpFilterRuleInner object + * @return the observable to the VirtualNetworkRuleInner object */ - public Observable> createOrUpdateIpFilterRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String ipFilterRuleName, IpFilterRuleInner parameters) { + public Observable> getVirtualNetworkRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String virtualNetworkRuleName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (namespaceName == null) { throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); } - if (ipFilterRuleName == null) { - throw new IllegalArgumentException("Parameter ipFilterRuleName is required and cannot be null."); + if (virtualNetworkRuleName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkRuleName 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 (parameters == null) { - throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - Validator.validate(parameters); - return service.createOrUpdateIpFilterRule(resourceGroupName, namespaceName, ipFilterRuleName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + final String apiVersion = "2018-01-01-preview"; + return service.getVirtualNetworkRule(resourceGroupName, namespaceName, virtualNetworkRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = createOrUpdateIpFilterRuleDelegate(response); + ServiceResponse clientResponse = getVirtualNetworkRuleDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1105,90 +1790,90 @@ public Observable> call(Response createOrUpdateIpFilterRuleDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse getVirtualNetworkRuleDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(ErrorResponseException.class) .build(response); } /** - * Deletes an IpFilterRule for a Namespace. + * Create or update NetworkRuleSet for a Namespace. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param ipFilterRuleName The IP Filter Rule name. + * @param parameters The Namespace IpFilterRule. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkRuleSetInner object if successful. */ - public void deleteIpFilterRule(String resourceGroupName, String namespaceName, String ipFilterRuleName) { - deleteIpFilterRuleWithServiceResponseAsync(resourceGroupName, namespaceName, ipFilterRuleName).toBlocking().single().body(); + public NetworkRuleSetInner createOrUpdateNetworkRuleSet(String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters) { + return createOrUpdateNetworkRuleSetWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).toBlocking().single().body(); } /** - * Deletes an IpFilterRule for a Namespace. + * Create or update NetworkRuleSet for a Namespace. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param ipFilterRuleName The IP Filter Rule name. + * @param parameters The Namespace IpFilterRule. * @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 deleteIpFilterRuleAsync(String resourceGroupName, String namespaceName, String ipFilterRuleName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(deleteIpFilterRuleWithServiceResponseAsync(resourceGroupName, namespaceName, ipFilterRuleName), serviceCallback); + public ServiceFuture createOrUpdateNetworkRuleSetAsync(String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateNetworkRuleSetWithServiceResponseAsync(resourceGroupName, namespaceName, parameters), serviceCallback); } /** - * Deletes an IpFilterRule for a Namespace. + * Create or update NetworkRuleSet for a Namespace. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param ipFilterRuleName The IP Filter Rule name. + * @param parameters The Namespace IpFilterRule. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. + * @return the observable to the NetworkRuleSetInner object */ - public Observable deleteIpFilterRuleAsync(String resourceGroupName, String namespaceName, String ipFilterRuleName) { - return deleteIpFilterRuleWithServiceResponseAsync(resourceGroupName, namespaceName, ipFilterRuleName).map(new Func1, Void>() { + public Observable createOrUpdateNetworkRuleSetAsync(String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters) { + return createOrUpdateNetworkRuleSetWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).map(new Func1, NetworkRuleSetInner>() { @Override - public Void call(ServiceResponse response) { + public NetworkRuleSetInner call(ServiceResponse response) { return response.body(); } }); } /** - * Deletes an IpFilterRule for a Namespace. + * Create or update NetworkRuleSet for a Namespace. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param ipFilterRuleName The IP Filter Rule name. + * @param parameters The Namespace IpFilterRule. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. + * @return the observable to the NetworkRuleSetInner object */ - public Observable> deleteIpFilterRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String ipFilterRuleName) { + public Observable> createOrUpdateNetworkRuleSetWithServiceResponseAsync(String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (namespaceName == null) { throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); } - if (ipFilterRuleName == null) { - throw new IllegalArgumentException("Parameter ipFilterRuleName is required and cannot be null."); - } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); } - return service.deleteIpFilterRule(resourceGroupName, namespaceName, ipFilterRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + Validator.validate(parameters); + final String apiVersion = "2018-01-01-preview"; + return service.createOrUpdateNetworkRuleSet(resourceGroupName, namespaceName, this.client.subscriptionId(), apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = deleteIpFilterRuleDelegate(response); + ServiceResponse clientResponse = createOrUpdateNetworkRuleSetDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1197,92 +1882,82 @@ public Observable> call(Response response) { }); } - private ServiceResponse deleteIpFilterRuleDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .register(204, new TypeToken() { }.getType()) + private ServiceResponse createOrUpdateNetworkRuleSetDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(ErrorResponseException.class) .build(response); } /** - * Gets an IpFilterRule for a Namespace by rule name. + * Gets NetworkRuleSet for a Namespace. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param ipFilterRuleName The IP Filter Rule name. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the IpFilterRuleInner object if successful. + * @return the NetworkRuleSetInner object if successful. */ - public IpFilterRuleInner getIpFilterRule(String resourceGroupName, String namespaceName, String ipFilterRuleName) { - return getIpFilterRuleWithServiceResponseAsync(resourceGroupName, namespaceName, ipFilterRuleName).toBlocking().single().body(); + public NetworkRuleSetInner getNetworkRuleSet(String resourceGroupName, String namespaceName) { + return getNetworkRuleSetWithServiceResponseAsync(resourceGroupName, namespaceName).toBlocking().single().body(); } /** - * Gets an IpFilterRule for a Namespace by rule name. + * Gets NetworkRuleSet for a Namespace. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param ipFilterRuleName The IP Filter Rule name. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture getIpFilterRuleAsync(String resourceGroupName, String namespaceName, String ipFilterRuleName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getIpFilterRuleWithServiceResponseAsync(resourceGroupName, namespaceName, ipFilterRuleName), serviceCallback); + public ServiceFuture getNetworkRuleSetAsync(String resourceGroupName, String namespaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getNetworkRuleSetWithServiceResponseAsync(resourceGroupName, namespaceName), serviceCallback); } /** - * Gets an IpFilterRule for a Namespace by rule name. + * Gets NetworkRuleSet for a Namespace. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param ipFilterRuleName The IP Filter Rule name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the IpFilterRuleInner object + * @return the observable to the NetworkRuleSetInner object */ - public Observable getIpFilterRuleAsync(String resourceGroupName, String namespaceName, String ipFilterRuleName) { - return getIpFilterRuleWithServiceResponseAsync(resourceGroupName, namespaceName, ipFilterRuleName).map(new Func1, IpFilterRuleInner>() { + public Observable getNetworkRuleSetAsync(String resourceGroupName, String namespaceName) { + return getNetworkRuleSetWithServiceResponseAsync(resourceGroupName, namespaceName).map(new Func1, NetworkRuleSetInner>() { @Override - public IpFilterRuleInner call(ServiceResponse response) { + public NetworkRuleSetInner call(ServiceResponse response) { return response.body(); } }); } /** - * Gets an IpFilterRule for a Namespace by rule name. + * Gets NetworkRuleSet for a Namespace. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param ipFilterRuleName The IP Filter Rule name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the IpFilterRuleInner object + * @return the observable to the NetworkRuleSetInner object */ - public Observable> getIpFilterRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String ipFilterRuleName) { + public Observable> getNetworkRuleSetWithServiceResponseAsync(String resourceGroupName, String namespaceName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (namespaceName == null) { throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); } - if (ipFilterRuleName == null) { - throw new IllegalArgumentException("Parameter ipFilterRuleName is required and cannot be null."); - } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.getIpFilterRule(resourceGroupName, namespaceName, ipFilterRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + final String apiVersion = "2018-01-01-preview"; + return service.getNetworkRuleSet(resourceGroupName, namespaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = getIpFilterRuleDelegate(response); + ServiceResponse clientResponse = getNetworkRuleSetDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1291,103 +1966,103 @@ public Observable> call(Response getIpFilterRuleDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse getNetworkRuleSetDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(ErrorResponseException.class) .build(response); } /** - * Gets a list of VirtualNetwork rules for a Namespace. + * Gets a list of authorization rules for a Namespace. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the PagedList<VirtualNetworkRuleInner> object if successful. + * @return the PagedList<AuthorizationRuleInner> object if successful. */ - public PagedList listVirtualNetworkRules(final String resourceGroupName, final String namespaceName) { - ServiceResponse> response = listVirtualNetworkRulesSinglePageAsync(resourceGroupName, namespaceName).toBlocking().single(); - return new PagedList(response.body()) { + public PagedList listAuthorizationRules(final String resourceGroupName, final String namespaceName) { + ServiceResponse> response = listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName).toBlocking().single(); + return new PagedList(response.body()) { @Override - public Page nextPage(String nextPageLink) { - return listVirtualNetworkRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + public Page nextPage(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); } }; } /** - * Gets a list of VirtualNetwork rules for a Namespace. + * Gets a list of authorization rules for a Namespace. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture> listVirtualNetworkRulesAsync(final String resourceGroupName, final String namespaceName, final ListOperationCallback serviceCallback) { + public ServiceFuture> listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final ListOperationCallback serviceCallback) { return AzureServiceFuture.fromPageResponse( - listVirtualNetworkRulesSinglePageAsync(resourceGroupName, namespaceName), - new Func1>>>() { + listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName), + new Func1>>>() { @Override - public Observable>> call(String nextPageLink) { - return listVirtualNetworkRulesNextSinglePageAsync(nextPageLink); + public Observable>> call(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink); } }, serviceCallback); } /** - * Gets a list of VirtualNetwork rules for a Namespace. + * Gets a list of authorization rules for a Namespace. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<VirtualNetworkRuleInner> object + * @return the observable to the PagedList<AuthorizationRuleInner> object */ - public Observable> listVirtualNetworkRulesAsync(final String resourceGroupName, final String namespaceName) { - return listVirtualNetworkRulesWithServiceResponseAsync(resourceGroupName, namespaceName) - .map(new Func1>, Page>() { + public Observable> listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName) { + return listAuthorizationRulesWithServiceResponseAsync(resourceGroupName, namespaceName) + .map(new Func1>, Page>() { @Override - public Page call(ServiceResponse> response) { + public Page call(ServiceResponse> response) { return response.body(); } }); } /** - * Gets a list of VirtualNetwork rules for a Namespace. + * Gets a list of authorization rules for a Namespace. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<VirtualNetworkRuleInner> object + * @return the observable to the PagedList<AuthorizationRuleInner> object */ - public Observable>> listVirtualNetworkRulesWithServiceResponseAsync(final String resourceGroupName, final String namespaceName) { - return listVirtualNetworkRulesSinglePageAsync(resourceGroupName, namespaceName) - .concatMap(new Func1>, Observable>>>() { + public Observable>> listAuthorizationRulesWithServiceResponseAsync(final String resourceGroupName, final String namespaceName) { + return listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName) + .concatMap(new Func1>, Observable>>>() { @Override - public Observable>> call(ServiceResponse> page) { + public Observable>> call(ServiceResponse> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); } - return Observable.just(page).concatWith(listVirtualNetworkRulesNextWithServiceResponseAsync(nextPageLink)); + return Observable.just(page).concatWith(listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink)); } }); } /** - * Gets a list of VirtualNetwork rules for a Namespace. + * Gets a list of authorization rules for a Namespace. * - ServiceResponse> * @param resourceGroupName Name of the resource group within the Azure subscription. - ServiceResponse> * @param namespaceName The Namespace name + ServiceResponse> * @param resourceGroupName Name of the resource group within the azure subscription. + ServiceResponse> * @param namespaceName The Namespace name * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<VirtualNetworkRuleInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<AuthorizationRuleInner> object wrapped in {@link ServiceResponse} if successful. */ - public Observable>> listVirtualNetworkRulesSinglePageAsync(final String resourceGroupName, final String namespaceName) { + public Observable>> listAuthorizationRulesSinglePageAsync(final String resourceGroupName, final String namespaceName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1397,16 +2072,14 @@ public Observable>> listVirtualNet 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.listVirtualNetworkRules(resourceGroupName, namespaceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + final String apiVersion = "2017-04-01"; + return service.listAuthorizationRules(resourceGroupName, namespaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { @Override - public Observable>> call(Response response) { + public Observable>> call(Response response) { try { - ServiceResponse> result = listVirtualNetworkRulesDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); + ServiceResponse> result = listAuthorizationRulesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } @@ -1414,94 +2087,99 @@ public Observable>> call(Response< }); } - private ServiceResponse> listVirtualNetworkRulesDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) + private ServiceResponse> listAuthorizationRulesDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) .registerError(ErrorResponseException.class) .build(response); } /** - * Creates or updates an VirtualNetworkRule for a Namespace. + * Creates or updates an AuthorizationRule for a Namespace. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param virtualNetworkRuleName The Virtual Network Rule name. + * @param authorizationRuleName The authorization rule name. + * @param rights The rights associated with the rule. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the VirtualNetworkRuleInner object if successful. + * @return the AuthorizationRuleInner object if successful. */ - public VirtualNetworkRuleInner createOrUpdateVirtualNetworkRule(String resourceGroupName, String namespaceName, String virtualNetworkRuleName) { - return createOrUpdateVirtualNetworkRuleWithServiceResponseAsync(resourceGroupName, namespaceName, virtualNetworkRuleName).toBlocking().single().body(); + public AuthorizationRuleInner createOrUpdateAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName, List rights) { + return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, rights).toBlocking().single().body(); } /** - * Creates or updates an VirtualNetworkRule for a Namespace. + * Creates or updates an AuthorizationRule for a Namespace. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param virtualNetworkRuleName The Virtual Network Rule name. + * @param authorizationRuleName The authorization rule name. + * @param rights The rights associated with the rule. * @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 createOrUpdateVirtualNetworkRuleAsync(String resourceGroupName, String namespaceName, String virtualNetworkRuleName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createOrUpdateVirtualNetworkRuleWithServiceResponseAsync(resourceGroupName, namespaceName, virtualNetworkRuleName), serviceCallback); + public ServiceFuture createOrUpdateAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, List rights, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, rights), serviceCallback); } /** - * Creates or updates an VirtualNetworkRule for a Namespace. + * Creates or updates an AuthorizationRule for a Namespace. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param virtualNetworkRuleName The Virtual Network Rule name. + * @param authorizationRuleName The authorization rule name. + * @param rights The rights associated with the rule. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the VirtualNetworkRuleInner object + * @return the observable to the AuthorizationRuleInner object */ - public Observable createOrUpdateVirtualNetworkRuleAsync(String resourceGroupName, String namespaceName, String virtualNetworkRuleName) { - return createOrUpdateVirtualNetworkRuleWithServiceResponseAsync(resourceGroupName, namespaceName, virtualNetworkRuleName).map(new Func1, VirtualNetworkRuleInner>() { + public Observable createOrUpdateAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, List rights) { + return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, rights).map(new Func1, AuthorizationRuleInner>() { @Override - public VirtualNetworkRuleInner call(ServiceResponse response) { + public AuthorizationRuleInner call(ServiceResponse response) { return response.body(); } }); } /** - * Creates or updates an VirtualNetworkRule for a Namespace. + * Creates or updates an AuthorizationRule for a Namespace. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param virtualNetworkRuleName The Virtual Network Rule name. + * @param authorizationRuleName The authorization rule name. + * @param rights The rights associated with the rule. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the VirtualNetworkRuleInner object + * @return the observable to the AuthorizationRuleInner object */ - public Observable> createOrUpdateVirtualNetworkRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String virtualNetworkRuleName) { + public Observable> createOrUpdateAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, List rights) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (namespaceName == null) { throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); } - if (virtualNetworkRuleName == null) { - throw new IllegalArgumentException("Parameter virtualNetworkRuleName is required and cannot be null."); + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + if (rights == null) { + throw new IllegalArgumentException("Parameter rights is required and cannot be null."); } - final String virtualNetworkSubnetId = null; - VirtualNetworkRuleInner parameters = new VirtualNetworkRuleInner(); - parameters.withVirtualNetworkSubnetId(null); - return service.createOrUpdateVirtualNetworkRule(resourceGroupName, namespaceName, virtualNetworkRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + Validator.validate(rights); + final String apiVersion = "2017-04-01"; + AuthorizationRuleInner parameters = new AuthorizationRuleInner(); + parameters.withRights(rights); + return service.createOrUpdateAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = createOrUpdateVirtualNetworkRuleDelegate(response); + ServiceResponse clientResponse = createOrUpdateAuthorizationRuleDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1510,90 +2188,88 @@ public Observable> call(Response createOrUpdateAuthorizationRuleDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + /** - * Creates or updates an VirtualNetworkRule for a Namespace. + * Deletes an AuthorizationRule for a Namespace. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param virtualNetworkRuleName The Virtual Network Rule name. - * @param virtualNetworkSubnetId ARM ID of Virtual Network Subnet + * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the VirtualNetworkRuleInner object if successful. */ - public VirtualNetworkRuleInner createOrUpdateVirtualNetworkRule(String resourceGroupName, String namespaceName, String virtualNetworkRuleName, String virtualNetworkSubnetId) { - return createOrUpdateVirtualNetworkRuleWithServiceResponseAsync(resourceGroupName, namespaceName, virtualNetworkRuleName, virtualNetworkSubnetId).toBlocking().single().body(); + public void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName) { + deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).toBlocking().single().body(); } /** - * Creates or updates an VirtualNetworkRule for a Namespace. + * Deletes an AuthorizationRule for a Namespace. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param virtualNetworkRuleName The Virtual Network Rule name. - * @param virtualNetworkSubnetId ARM ID of Virtual Network Subnet + * @param authorizationRuleName The authorization rule name. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture createOrUpdateVirtualNetworkRuleAsync(String resourceGroupName, String namespaceName, String virtualNetworkRuleName, String virtualNetworkSubnetId, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createOrUpdateVirtualNetworkRuleWithServiceResponseAsync(resourceGroupName, namespaceName, virtualNetworkRuleName, virtualNetworkSubnetId), serviceCallback); + public ServiceFuture deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName), serviceCallback); } /** - * Creates or updates an VirtualNetworkRule for a Namespace. + * Deletes an AuthorizationRule for a Namespace. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param virtualNetworkRuleName The Virtual Network Rule name. - * @param virtualNetworkSubnetId ARM ID of Virtual Network Subnet + * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the VirtualNetworkRuleInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable createOrUpdateVirtualNetworkRuleAsync(String resourceGroupName, String namespaceName, String virtualNetworkRuleName, String virtualNetworkSubnetId) { - return createOrUpdateVirtualNetworkRuleWithServiceResponseAsync(resourceGroupName, namespaceName, virtualNetworkRuleName, virtualNetworkSubnetId).map(new Func1, VirtualNetworkRuleInner>() { + public Observable deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + return deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).map(new Func1, Void>() { @Override - public VirtualNetworkRuleInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); } /** - * Creates or updates an VirtualNetworkRule for a Namespace. + * Deletes an AuthorizationRule for a Namespace. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param virtualNetworkRuleName The Virtual Network Rule name. - * @param virtualNetworkSubnetId ARM ID of Virtual Network Subnet + * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the VirtualNetworkRuleInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable> createOrUpdateVirtualNetworkRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String virtualNetworkRuleName, String virtualNetworkSubnetId) { + public Observable> deleteAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (namespaceName == null) { throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); } - if (virtualNetworkRuleName == null) { - throw new IllegalArgumentException("Parameter virtualNetworkRuleName is required and cannot be null."); + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - VirtualNetworkRuleInner parameters = new VirtualNetworkRuleInner(); - parameters.withVirtualNetworkSubnetId(virtualNetworkSubnetId); - return service.createOrUpdateVirtualNetworkRule(resourceGroupName, namespaceName, virtualNetworkRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + final String apiVersion = "2017-04-01"; + return service.deleteAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = createOrUpdateVirtualNetworkRuleDelegate(response); + ServiceResponse clientResponse = deleteAuthorizationRuleDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1602,90 +2278,181 @@ public Observable> call(Response createOrUpdateVirtualNetworkRuleDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse deleteAuthorizationRuleDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) .registerError(ErrorResponseException.class) .build(response); } /** - * Deletes an VirtualNetworkRule for a Namespace. + * Gets an AuthorizationRule for a Namespace by rule name. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param virtualNetworkRuleName The Virtual Network Rule name. + * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AuthorizationRuleInner object if successful. */ - public void deleteVirtualNetworkRule(String resourceGroupName, String namespaceName, String virtualNetworkRuleName) { - deleteVirtualNetworkRuleWithServiceResponseAsync(resourceGroupName, namespaceName, virtualNetworkRuleName).toBlocking().single().body(); + public AuthorizationRuleInner getAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName) { + return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).toBlocking().single().body(); } /** - * Deletes an VirtualNetworkRule for a Namespace. + * Gets an AuthorizationRule for a Namespace by rule name. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param virtualNetworkRuleName The Virtual Network Rule name. + * @param authorizationRuleName The authorization rule name. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture deleteVirtualNetworkRuleAsync(String resourceGroupName, String namespaceName, String virtualNetworkRuleName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(deleteVirtualNetworkRuleWithServiceResponseAsync(resourceGroupName, namespaceName, virtualNetworkRuleName), serviceCallback); + public ServiceFuture getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName), serviceCallback); } /** - * Deletes an VirtualNetworkRule for a Namespace. + * Gets an AuthorizationRule for a Namespace by rule name. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param virtualNetworkRuleName The Virtual Network Rule name. + * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. + * @return the observable to the AuthorizationRuleInner object */ - public Observable deleteVirtualNetworkRuleAsync(String resourceGroupName, String namespaceName, String virtualNetworkRuleName) { - return deleteVirtualNetworkRuleWithServiceResponseAsync(resourceGroupName, namespaceName, virtualNetworkRuleName).map(new Func1, Void>() { + public Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).map(new Func1, AuthorizationRuleInner>() { @Override - public Void call(ServiceResponse response) { + public AuthorizationRuleInner call(ServiceResponse response) { return response.body(); } }); } /** - * Deletes an VirtualNetworkRule for a Namespace. + * Gets an AuthorizationRule for a Namespace by rule name. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param virtualNetworkRuleName The Virtual Network Rule name. + * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. + * @return the observable to the AuthorizationRuleInner object */ - public Observable> deleteVirtualNetworkRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String virtualNetworkRuleName) { + public Observable> getAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (namespaceName == null) { throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); } - if (virtualNetworkRuleName == null) { - throw new IllegalArgumentException("Parameter virtualNetworkRuleName is required and cannot be null."); + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + final String apiVersion = "2017-04-01"; + return service.getAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getAuthorizationRuleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getAuthorizationRuleDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets the primary and secondary connection strings for the Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AccessKeysInner object if successful. + */ + public AccessKeysInner listKeys(String resourceGroupName, String namespaceName, String authorizationRuleName) { + return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).toBlocking().single().body(); + } + + /** + * Gets the primary and secondary connection strings for the Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param authorizationRuleName The authorization rule name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName), serviceCallback); + } + + /** + * Gets the primary and secondary connection strings for the Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AccessKeysInner object + */ + public Observable listKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).map(new Func1, AccessKeysInner>() { + @Override + public AccessKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the primary and secondary connection strings for the Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AccessKeysInner object + */ + public Observable> listKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); } - return service.deleteVirtualNetworkRule(resourceGroupName, namespaceName, virtualNetworkRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-04-01"; + return service.listKeys(resourceGroupName, namespaceName, authorizationRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = deleteVirtualNetworkRuleDelegate(response); + ServiceResponse clientResponse = listKeysDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1694,92 +2461,97 @@ public Observable> call(Response response) { }); } - private ServiceResponse deleteVirtualNetworkRuleDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .register(204, new TypeToken() { }.getType()) + private ServiceResponse listKeysDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(ErrorResponseException.class) .build(response); } /** - * Gets an VirtualNetworkRule for a Namespace by rule name. + * Regenerates the primary or secondary connection strings for the specified Namespace. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param virtualNetworkRuleName The Virtual Network Rule name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters required to regenerate the connection string. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the VirtualNetworkRuleInner object if successful. + * @return the AccessKeysInner object if successful. */ - public VirtualNetworkRuleInner getVirtualNetworkRule(String resourceGroupName, String namespaceName, String virtualNetworkRuleName) { - return getVirtualNetworkRuleWithServiceResponseAsync(resourceGroupName, namespaceName, virtualNetworkRuleName).toBlocking().single().body(); + public AccessKeysInner regenerateKeys(String resourceGroupName, String namespaceName, String authorizationRuleName, RegenerateAccessKeyParameters parameters) { + return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, parameters).toBlocking().single().body(); } /** - * Gets an VirtualNetworkRule for a Namespace by rule name. + * Regenerates the primary or secondary connection strings for the specified Namespace. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param virtualNetworkRuleName The Virtual Network Rule name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters required to regenerate the connection string. * @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 getVirtualNetworkRuleAsync(String resourceGroupName, String namespaceName, String virtualNetworkRuleName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getVirtualNetworkRuleWithServiceResponseAsync(resourceGroupName, namespaceName, virtualNetworkRuleName), serviceCallback); + public ServiceFuture regenerateKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, RegenerateAccessKeyParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, parameters), serviceCallback); } /** - * Gets an VirtualNetworkRule for a Namespace by rule name. + * Regenerates the primary or secondary connection strings for the specified Namespace. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param virtualNetworkRuleName The Virtual Network Rule name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters required to regenerate the connection string. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the VirtualNetworkRuleInner object + * @return the observable to the AccessKeysInner object */ - public Observable getVirtualNetworkRuleAsync(String resourceGroupName, String namespaceName, String virtualNetworkRuleName) { - return getVirtualNetworkRuleWithServiceResponseAsync(resourceGroupName, namespaceName, virtualNetworkRuleName).map(new Func1, VirtualNetworkRuleInner>() { + public Observable regenerateKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, RegenerateAccessKeyParameters parameters) { + return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, parameters).map(new Func1, AccessKeysInner>() { @Override - public VirtualNetworkRuleInner call(ServiceResponse response) { + public AccessKeysInner call(ServiceResponse response) { return response.body(); } }); } /** - * Gets an VirtualNetworkRule for a Namespace by rule name. + * Regenerates the primary or secondary connection strings for the specified Namespace. * - * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param virtualNetworkRuleName The Virtual Network Rule name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters required to regenerate the connection string. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the VirtualNetworkRuleInner object + * @return the observable to the AccessKeysInner object */ - public Observable> getVirtualNetworkRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String virtualNetworkRuleName) { + public Observable> regenerateKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, RegenerateAccessKeyParameters parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (namespaceName == null) { throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); } - if (virtualNetworkRuleName == null) { - throw new IllegalArgumentException("Parameter virtualNetworkRuleName is required and cannot be null."); + if (authorizationRuleName == null) { + throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null."); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); } - return service.getVirtualNetworkRule(resourceGroupName, namespaceName, virtualNetworkRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + Validator.validate(parameters); + final String apiVersion = "2017-04-01"; + return service.regenerateKeys(resourceGroupName, namespaceName, authorizationRuleName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = getVirtualNetworkRuleDelegate(response); + ServiceResponse clientResponse = regenerateKeysDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1788,92 +2560,77 @@ public Observable> call(Response getVirtualNetworkRuleDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse regenerateKeysDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(ErrorResponseException.class) .build(response); } /** - * Create or update NetworkRuleSet for a Namespace. + * Check the give Namespace name availability. * - * @param resourceGroupName Name of the resource group within the Azure subscription. - * @param namespaceName The Namespace name - * @param parameters The Namespace IpFilterRule. + * @param name Name to check the namespace name availability * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the NetworkRuleSetInner object if successful. + * @return the CheckNameAvailabilityResultInner object if successful. */ - public NetworkRuleSetInner createOrUpdateNetworkRuleSet(String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters) { - return createOrUpdateNetworkRuleSetWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).toBlocking().single().body(); + public CheckNameAvailabilityResultInner checkNameAvailability(String name) { + return checkNameAvailabilityWithServiceResponseAsync(name).toBlocking().single().body(); } /** - * Create or update NetworkRuleSet for a Namespace. + * Check the give Namespace name availability. * - * @param resourceGroupName Name of the resource group within the Azure subscription. - * @param namespaceName The Namespace name - * @param parameters The Namespace IpFilterRule. + * @param name Name to check the namespace name availability * @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 createOrUpdateNetworkRuleSetAsync(String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createOrUpdateNetworkRuleSetWithServiceResponseAsync(resourceGroupName, namespaceName, parameters), serviceCallback); + public ServiceFuture checkNameAvailabilityAsync(String name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNameAvailabilityWithServiceResponseAsync(name), serviceCallback); } /** - * Create or update NetworkRuleSet for a Namespace. + * Check the give Namespace name availability. * - * @param resourceGroupName Name of the resource group within the Azure subscription. - * @param namespaceName The Namespace name - * @param parameters The Namespace IpFilterRule. + * @param name Name to check the namespace name availability * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the NetworkRuleSetInner object + * @return the observable to the CheckNameAvailabilityResultInner object */ - public Observable createOrUpdateNetworkRuleSetAsync(String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters) { - return createOrUpdateNetworkRuleSetWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).map(new Func1, NetworkRuleSetInner>() { + public Observable checkNameAvailabilityAsync(String name) { + return checkNameAvailabilityWithServiceResponseAsync(name).map(new Func1, CheckNameAvailabilityResultInner>() { @Override - public NetworkRuleSetInner call(ServiceResponse response) { + public CheckNameAvailabilityResultInner call(ServiceResponse response) { return response.body(); } }); } /** - * Create or update NetworkRuleSet for a Namespace. + * Check the give Namespace name availability. * - * @param resourceGroupName Name of the resource group within the Azure subscription. - * @param namespaceName The Namespace name - * @param parameters The Namespace IpFilterRule. + * @param name Name to check the namespace name availability * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the NetworkRuleSetInner object + * @return the observable to the CheckNameAvailabilityResultInner object */ - public Observable> createOrUpdateNetworkRuleSetWithServiceResponseAsync(String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters) { - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (namespaceName == null) { - throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); - } + 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 (parameters == null) { - throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); } - Validator.validate(parameters); - return service.createOrUpdateNetworkRuleSet(resourceGroupName, namespaceName, this.client.subscriptionId(), this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + final String apiVersion = "2017-04-01"; + CheckNameAvailabilityParameter parameters = new CheckNameAvailabilityParameter(); + parameters.withName(name); + return service.checkNameAvailability(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = createOrUpdateNetworkRuleSetDelegate(response); + ServiceResponse clientResponse = checkNameAvailabilityDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1882,85 +2639,110 @@ public Observable> call(Response createOrUpdateNetworkRuleSetDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse checkNameAvailabilityDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(ErrorResponseException.class) .build(response); } /** - * Gets NetworkRuleSet for a Namespace. + * Gets a list of IP Filter rules for a Namespace. * - * @param resourceGroupName Name of the resource group within the Azure subscription. - * @param namespaceName The Namespace name + * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the NetworkRuleSetInner object if successful. + * @return the PagedList<IpFilterRuleInner> object if successful. */ - public NetworkRuleSetInner getNetworkRuleSet(String resourceGroupName, String namespaceName) { - return getNetworkRuleSetWithServiceResponseAsync(resourceGroupName, namespaceName).toBlocking().single().body(); + public PagedList listIPFilterRulesNext(final String nextPageLink) { + ServiceResponse> response = listIPFilterRulesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listIPFilterRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; } /** - * Gets NetworkRuleSet for a Namespace. + * Gets a list of IP Filter rules for a Namespace. * - * @param resourceGroupName Name of the resource group within the Azure subscription. - * @param namespaceName The Namespace name + * @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 getNetworkRuleSetAsync(String resourceGroupName, String namespaceName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getNetworkRuleSetWithServiceResponseAsync(resourceGroupName, namespaceName), serviceCallback); + public ServiceFuture> listIPFilterRulesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listIPFilterRulesNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listIPFilterRulesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); } /** - * Gets NetworkRuleSet for a Namespace. + * Gets a list of IP Filter rules for a Namespace. * - * @param resourceGroupName Name of the resource group within the Azure subscription. - * @param namespaceName The Namespace name + * @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 NetworkRuleSetInner object + * @return the observable to the PagedList<IpFilterRuleInner> object */ - public Observable getNetworkRuleSetAsync(String resourceGroupName, String namespaceName) { - return getNetworkRuleSetWithServiceResponseAsync(resourceGroupName, namespaceName).map(new Func1, NetworkRuleSetInner>() { - @Override - public NetworkRuleSetInner call(ServiceResponse response) { - return response.body(); - } - }); + public Observable> listIPFilterRulesNextAsync(final String nextPageLink) { + return listIPFilterRulesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); } /** - * Gets NetworkRuleSet for a Namespace. + * Gets a list of IP Filter rules for a Namespace. * - * @param resourceGroupName Name of the resource group within the Azure subscription. - * @param namespaceName The Namespace name + * @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 NetworkRuleSetInner object + * @return the observable to the PagedList<IpFilterRuleInner> object */ - public Observable> getNetworkRuleSetWithServiceResponseAsync(String resourceGroupName, String namespaceName) { - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (namespaceName == null) { - throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); - } - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + public Observable>> listIPFilterRulesNextWithServiceResponseAsync(final String nextPageLink) { + return listIPFilterRulesNextSinglePageAsync(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(listIPFilterRulesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets a list of IP Filter rules for a Namespace. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<IpFilterRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listIPFilterRulesNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); } - return service.getNetworkRuleSet(resourceGroupName, namespaceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + String nextUrl = String.format("%s", nextPageLink); + return service.listIPFilterRulesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { @Override - public Observable> call(Response response) { + public Observable>> call(Response response) { try { - ServiceResponse clientResponse = getNetworkRuleSetDelegate(response); - return Observable.just(clientResponse); + ServiceResponse> result = listIPFilterRulesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } @@ -1968,9 +2750,9 @@ public Observable> call(Response getNetworkRuleSetDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse> listIPFilterRulesNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) .registerError(ErrorResponseException.class) .build(response); } @@ -2056,7 +2838,7 @@ public Observable>> call(ServiceResponse< /** * Lists all the available Namespaces within a subscription, irrespective of the resource groups. * - ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList<EHNamespaceInner> object wrapped in {@link ServiceResponse} if successful. */ @@ -2070,7 +2852,7 @@ public Observable>> listNextSinglePageAsy @Override public Observable>> call(Response response) { try { - ServiceResponse> result = listNextDelegate(response); + ServiceResponse> result = listNextDelegate(response); return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); @@ -2079,9 +2861,9 @@ public Observable>> call(Response> listNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) + private ServiceResponse> listNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) .registerError(ErrorResponseException.class) .build(response); } @@ -2167,7 +2949,7 @@ public Observable>> call(ServiceResponse< /** * Lists the available Namespaces within a resource group. * - ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList<EHNamespaceInner> object wrapped in {@link ServiceResponse} if successful. */ @@ -2181,7 +2963,7 @@ public Observable>> listByResourceGroupNe @Override public Observable>> call(Response response) { try { - ServiceResponse> result = listByResourceGroupNextDelegate(response); + ServiceResponse> result = listByResourceGroupNextDelegate(response); return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); @@ -2190,34 +2972,34 @@ public Observable>> call(Response> listByResourceGroupNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) .registerError(ErrorResponseException.class) .build(response); } /** - * Gets a list of IP Filter rules for a Namespace. + * Gets a list of VirtualNetwork rules for a Namespace. * * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the PagedList<IpFilterRuleInner> object if successful. + * @return the PagedList<VirtualNetworkRuleInner> object if successful. */ - public PagedList listIPFilterRulesNext(final String nextPageLink) { - ServiceResponse> response = listIPFilterRulesNextSinglePageAsync(nextPageLink).toBlocking().single(); - return new PagedList(response.body()) { + public PagedList listVirtualNetworkRulesNext(final String nextPageLink) { + ServiceResponse> response = listVirtualNetworkRulesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { @Override - public Page nextPage(String nextPageLink) { - return listIPFilterRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + public Page nextPage(String nextPageLink) { + return listVirtualNetworkRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); } }; } /** - * Gets a list of IP Filter rules for a Namespace. + * Gets a list of VirtualNetwork rules for a Namespace. * * @param nextPageLink The NextLink from the previous successful call to List operation. * @param serviceFuture the ServiceFuture object tracking the Retrofit calls @@ -2225,75 +3007,75 @@ public Page nextPage(String nextPageLink) { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture> listIPFilterRulesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + public ServiceFuture> listVirtualNetworkRulesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { return AzureServiceFuture.fromPageResponse( - listIPFilterRulesNextSinglePageAsync(nextPageLink), - new Func1>>>() { + listVirtualNetworkRulesNextSinglePageAsync(nextPageLink), + new Func1>>>() { @Override - public Observable>> call(String nextPageLink) { - return listIPFilterRulesNextSinglePageAsync(nextPageLink); + public Observable>> call(String nextPageLink) { + return listVirtualNetworkRulesNextSinglePageAsync(nextPageLink); } }, serviceCallback); } /** - * Gets a list of IP Filter rules for a Namespace. + * Gets a list of VirtualNetwork rules for a Namespace. * * @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<IpFilterRuleInner> object + * @return the observable to the PagedList<VirtualNetworkRuleInner> object */ - public Observable> listIPFilterRulesNextAsync(final String nextPageLink) { - return listIPFilterRulesNextWithServiceResponseAsync(nextPageLink) - .map(new Func1>, Page>() { + public Observable> listVirtualNetworkRulesNextAsync(final String nextPageLink) { + return listVirtualNetworkRulesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { @Override - public Page call(ServiceResponse> response) { + public Page call(ServiceResponse> response) { return response.body(); } }); } /** - * Gets a list of IP Filter rules for a Namespace. + * Gets a list of VirtualNetwork rules for a Namespace. * * @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<IpFilterRuleInner> object + * @return the observable to the PagedList<VirtualNetworkRuleInner> object */ - public Observable>> listIPFilterRulesNextWithServiceResponseAsync(final String nextPageLink) { - return listIPFilterRulesNextSinglePageAsync(nextPageLink) - .concatMap(new Func1>, Observable>>>() { + public Observable>> listVirtualNetworkRulesNextWithServiceResponseAsync(final String nextPageLink) { + return listVirtualNetworkRulesNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { @Override - public Observable>> call(ServiceResponse> page) { + public Observable>> call(ServiceResponse> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); } - return Observable.just(page).concatWith(listIPFilterRulesNextWithServiceResponseAsync(nextPageLink)); + return Observable.just(page).concatWith(listVirtualNetworkRulesNextWithServiceResponseAsync(nextPageLink)); } }); } /** - * Gets a list of IP Filter rules for a Namespace. + * Gets a list of VirtualNetwork rules for a Namespace. * - ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<IpFilterRuleInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<VirtualNetworkRuleInner> object wrapped in {@link ServiceResponse} if successful. */ - public Observable>> listIPFilterRulesNextSinglePageAsync(final String nextPageLink) { + public Observable>> listVirtualNetworkRulesNextSinglePageAsync(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.listIPFilterRulesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + return service.listVirtualNetworkRulesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { @Override - public Observable>> call(Response response) { + public Observable>> call(Response response) { try { - ServiceResponse> result = listIPFilterRulesNextDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); + ServiceResponse> result = listVirtualNetworkRulesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } @@ -2301,34 +3083,34 @@ public Observable>> call(Response> listIPFilterRulesNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) + private ServiceResponse> listVirtualNetworkRulesNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) .registerError(ErrorResponseException.class) .build(response); } /** - * Gets a list of VirtualNetwork rules for a Namespace. + * Gets a list of authorization rules for a Namespace. * * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the PagedList<VirtualNetworkRuleInner> object if successful. + * @return the PagedList<AuthorizationRuleInner> object if successful. */ - public PagedList listVirtualNetworkRulesNext(final String nextPageLink) { - ServiceResponse> response = listVirtualNetworkRulesNextSinglePageAsync(nextPageLink).toBlocking().single(); - return new PagedList(response.body()) { + public PagedList listAuthorizationRulesNext(final String nextPageLink) { + ServiceResponse> response = listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { @Override - public Page nextPage(String nextPageLink) { - return listVirtualNetworkRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + public Page nextPage(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); } }; } /** - * Gets a list of VirtualNetwork rules for a Namespace. + * Gets a list of authorization rules for a Namespace. * * @param nextPageLink The NextLink from the previous successful call to List operation. * @param serviceFuture the ServiceFuture object tracking the Retrofit calls @@ -2336,75 +3118,75 @@ public Page nextPage(String nextPageLink) { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture> listVirtualNetworkRulesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + public ServiceFuture> listAuthorizationRulesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { return AzureServiceFuture.fromPageResponse( - listVirtualNetworkRulesNextSinglePageAsync(nextPageLink), - new Func1>>>() { + listAuthorizationRulesNextSinglePageAsync(nextPageLink), + new Func1>>>() { @Override - public Observable>> call(String nextPageLink) { - return listVirtualNetworkRulesNextSinglePageAsync(nextPageLink); + public Observable>> call(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink); } }, serviceCallback); } /** - * Gets a list of VirtualNetwork rules for a Namespace. + * Gets a list of authorization rules for a Namespace. * * @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<VirtualNetworkRuleInner> object + * @return the observable to the PagedList<AuthorizationRuleInner> object */ - public Observable> listVirtualNetworkRulesNextAsync(final String nextPageLink) { - return listVirtualNetworkRulesNextWithServiceResponseAsync(nextPageLink) - .map(new Func1>, Page>() { + public Observable> listAuthorizationRulesNextAsync(final String nextPageLink) { + return listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { @Override - public Page call(ServiceResponse> response) { + public Page call(ServiceResponse> response) { return response.body(); } }); } /** - * Gets a list of VirtualNetwork rules for a Namespace. + * Gets a list of authorization rules for a Namespace. * * @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<VirtualNetworkRuleInner> object + * @return the observable to the PagedList<AuthorizationRuleInner> object */ - public Observable>> listVirtualNetworkRulesNextWithServiceResponseAsync(final String nextPageLink) { - return listVirtualNetworkRulesNextSinglePageAsync(nextPageLink) - .concatMap(new Func1>, Observable>>>() { + public Observable>> listAuthorizationRulesNextWithServiceResponseAsync(final String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { @Override - public Observable>> call(ServiceResponse> page) { + public Observable>> call(ServiceResponse> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); } - return Observable.just(page).concatWith(listVirtualNetworkRulesNextWithServiceResponseAsync(nextPageLink)); + return Observable.just(page).concatWith(listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink)); } }); } /** - * Gets a list of VirtualNetwork rules for a Namespace. + * Gets a list of authorization rules for a Namespace. * - ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<VirtualNetworkRuleInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<AuthorizationRuleInner> object wrapped in {@link ServiceResponse} if successful. */ - public Observable>> listVirtualNetworkRulesNextSinglePageAsync(final String nextPageLink) { + public Observable>> listAuthorizationRulesNextSinglePageAsync(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.listVirtualNetworkRulesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + return service.listAuthorizationRulesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { @Override - public Observable>> call(Response response) { + public Observable>> call(Response response) { try { - ServiceResponse> result = listVirtualNetworkRulesNextDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); + ServiceResponse> result = listAuthorizationRulesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } @@ -2412,9 +3194,9 @@ public Observable>> call(Response< }); } - private ServiceResponse> listVirtualNetworkRulesNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) + private ServiceResponse> listAuthorizationRulesNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) .registerError(ErrorResponseException.class) .build(response); } diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/OperationsInner.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/OperationsInner.java index 64e9ba017ed8c..8ca4df6373459 100644 --- a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/OperationsInner.java +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/OperationsInner.java @@ -37,7 +37,7 @@ public class OperationsInner { /** The Retrofit service to perform REST calls. */ private OperationsService service; /** The service client containing this operation class. */ - private EventHub2018PreviewManagementClientImpl client; + private EventHubManagementClientImpl client; /** * Initializes an instance of OperationsInner. @@ -45,7 +45,7 @@ public class 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, EventHub2018PreviewManagementClientImpl client) { + public OperationsInner(Retrofit retrofit, EventHubManagementClientImpl client) { this.service = retrofit.create(OperationsService.class); this.client = client; } @@ -145,15 +145,13 @@ public Observable>> call(ServiceResponse>> 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()) + final String apiVersion = "2017-04-01"; + return service.list(apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { try { - ServiceResponse> result = listDelegate(response); + ServiceResponse> result = listDelegate(response); return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); @@ -162,9 +160,9 @@ public Observable>> call(Response> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) .registerError(ErrorResponseException.class) .build(response); } @@ -250,7 +248,7 @@ public Observable>> call(ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + 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. */ @@ -264,7 +262,7 @@ public Observable>> listNextSinglePageAsync @Override public Observable>> call(Response response) { try { - ServiceResponse> result = listNextDelegate(response); + ServiceResponse> result = listNextDelegate(response); return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); @@ -273,9 +271,9 @@ public Observable>> call(Response> listNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) + private ServiceResponse> listNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) .registerError(ErrorResponseException.class) .build(response); } diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/PageImpl.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/PageImpl.java index 8b557af5c4f85..01d5c323fc38a 100644 --- a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/PageImpl.java +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/PageImpl.java @@ -22,7 +22,7 @@ public class PageImpl implements Page { /** * The link to the next page. */ - @JsonProperty("nextLink") + @JsonProperty("") private String nextPageLink; /** diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/PageImpl1.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/PageImpl1.java index eb32eab4148f8..c9dfd74270bf5 100644 --- a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/PageImpl1.java +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/PageImpl1.java @@ -22,7 +22,7 @@ public class PageImpl1 implements Page { /** * The link to the next page. */ - @JsonProperty("") + @JsonProperty("nextLink") private String nextPageLink; /** diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/RegionsImpl.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/RegionsImpl.java new file mode 100644 index 0000000000000..508dde7cb3a5b --- /dev/null +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/RegionsImpl.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.eventhubs.v2018_01_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.Regions; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.MessagingRegions; + +class RegionsImpl extends WrapperImpl implements Regions { + private final EventHubsManager manager; + + RegionsImpl(EventHubsManager manager) { + super(manager.inner().regions()); + this.manager = manager; + } + + public EventHubsManager manager() { + return this.manager; + } + + @Override + public Observable listBySkuAsync(final String sku) { + RegionsInner client = this.inner(); + return client.listBySkuAsync(sku) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public MessagingRegions call(MessagingRegionsInner inner) { + return new MessagingRegionsImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/RegionsInner.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/RegionsInner.java new file mode 100644 index 0000000000000..55e9b9d67b9c3 --- /dev/null +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/RegionsInner.java @@ -0,0 +1,293 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventhubs.v2018_01_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.eventhubs.v2018_01_01_preview.ErrorResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Regions. + */ +public class RegionsInner { + /** The Retrofit service to perform REST calls. */ + private RegionsService service; + /** The service client containing this operation class. */ + private EventHubManagementClientImpl client; + + /** + * Initializes an instance of RegionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public RegionsInner(Retrofit retrofit, EventHubManagementClientImpl client) { + this.service = retrofit.create(RegionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Regions to be + * used by Retrofit to perform actually REST calls. + */ + interface RegionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventhubs.v2018_01_01_preview.Regions listBySku" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.EventHub/sku/{sku}/regions") + Observable> listBySku(@Path("subscriptionId") String subscriptionId, @Path("sku") String sku, @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.eventhubs.v2018_01_01_preview.Regions listBySkuNext" }) + @GET + Observable> listBySkuNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets the available Regions for a given sku. + * + * @param sku The sku type. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<MessagingRegionsInner> object if successful. + */ + public PagedList listBySku(final String sku) { + ServiceResponse> response = listBySkuSinglePageAsync(sku).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listBySkuNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the available Regions for a given sku. + * + * @param sku The sku type. + * @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> listBySkuAsync(final String sku, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listBySkuSinglePageAsync(sku), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listBySkuNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the available Regions for a given sku. + * + * @param sku The sku type. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<MessagingRegionsInner> object + */ + public Observable> listBySkuAsync(final String sku) { + return listBySkuWithServiceResponseAsync(sku) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the available Regions for a given sku. + * + * @param sku The sku type. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<MessagingRegionsInner> object + */ + public Observable>> listBySkuWithServiceResponseAsync(final String sku) { + return listBySkuSinglePageAsync(sku) + .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(listBySkuNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the available Regions for a given sku. + * + ServiceResponse> * @param sku The sku type. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<MessagingRegionsInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listBySkuSinglePageAsync(final String sku) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (sku == null) { + throw new IllegalArgumentException("Parameter sku is required and cannot be null."); + } + final String apiVersion = "2017-04-01"; + return service.listBySku(this.client.subscriptionId(), sku, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listBySkuDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listBySkuDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets the available Regions for a given sku. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<MessagingRegionsInner> object if successful. + */ + public PagedList listBySkuNext(final String nextPageLink) { + ServiceResponse> response = listBySkuNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listBySkuNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the available Regions for a given sku. + * + * @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> listBySkuNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listBySkuNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listBySkuNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the available Regions for a given sku. + * + * @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<MessagingRegionsInner> object + */ + public Observable> listBySkuNextAsync(final String nextPageLink) { + return listBySkuNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the available Regions for a given sku. + * + * @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<MessagingRegionsInner> object + */ + public Observable>> listBySkuNextWithServiceResponseAsync(final String nextPageLink) { + return listBySkuNextSinglePageAsync(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(listBySkuNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the available Regions for a given sku. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<MessagingRegionsInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listBySkuNextSinglePageAsync(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.listBySkuNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listBySkuNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listBySkuNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/package-info.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/package-info.java index 445f6fb491aa2..4ad6684ee1c32 100644 --- a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/package-info.java +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/implementation/package-info.java @@ -5,7 +5,6 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * This package contains the implementation classes for EventHub2018PreviewManagementClient. - * Azure Event Hubs client for managing Event Hubs Cluster, IPFilter Rules and VirtualNetworkRules resources. + * This package contains the implementation classes for EventHubManagementClient. */ package com.microsoft.azure.management.eventhubs.v2018_01_01_preview.implementation; diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/package-info.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/package-info.java index 3378feeb457bd..35a29cb5a7270 100644 --- a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/package-info.java +++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/package-info.java @@ -5,7 +5,6 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * This package contains the classes for EventHub2018PreviewManagementClient. - * Azure Event Hubs client for managing Event Hubs Cluster, IPFilter Rules and VirtualNetworkRules resources. + * This package contains the classes for EventHubManagementClient. */ package com.microsoft.azure.management.eventhubs.v2018_01_01_preview;