diff --git a/sdk/eventhubs/mgmt-v2018_01_01_preview/pom.xml b/sdk/eventhubs/mgmt-v2018_01_01_preview/pom.xml
index d58fee6e6779..b702a03e5233 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 000000000000..27e7706789bb
--- /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 000000000000..e2126a47c1a9
--- /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 000000000000..f3b28131ad4e
--- /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 000000000000..aa488dbf1914
--- /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 000000000000..e5f0889079d5
--- /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 000000000000..6cb18f38a46e
--- /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/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 000000000000..529a130f9210
--- /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 000000000000..45df7db7d3e0
--- /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 000000000000..c6dddb286911
--- /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 000000000000..84740a64eac5
--- /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 000000000000..f6b8986fa451
--- /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 168d7ee6b9de..e3635f3c49f1 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 000000000000..6c746391c924
--- /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 000000000000..e4b5d69cfd6a
--- /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,70 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.eventhubs.v2018_01_01_preview;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * Properties to configure Encryption.
+ */
+public class Encryption {
+ /**
+ * Properties of KeyVault.
+ */
+ @JsonProperty(value = "keyVaultProperties")
+ private KeyVaultProperties 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 KeyVaultProperties keyVaultProperties() {
+ return this.keyVaultProperties;
+ }
+
+ /**
+ * Set properties of KeyVault.
+ *
+ * @param keyVaultProperties the keyVaultProperties value to set
+ * @return the Encryption object itself.
+ */
+ public Encryption withKeyVaultProperties(KeyVaultProperties 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 000000000000..1824ae835b13
--- /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/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 000000000000..9c893e7be366
--- /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 000000000000..17cdb1bf4e7c
--- /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 000000000000..5787f366c462
--- /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 000000000000..86d459330076
--- /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 000000000000..5ba624f01cc3
--- /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/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 000000000000..ed68de3c2ac7
--- /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 000000000000..09268288fe41
--- /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 000000000000..8815909abcd8
--- /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,69 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.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;
+
+ /**
+ * 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;
+ }
+
+}
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 000000000000..af41c821243e
--- /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 000000000000..5b7949c93b17
--- /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;
+
+/**
+ * The MessagingRegionsProperties model.
+ */
+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 000000000000..7f5d49076e88
--- /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 43f0faada39a..b0a36fcf58bc 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
@@ -20,7 +20,9 @@
import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.IpFilterRule;
import rx.Completable;
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.implementation.NetworkRuleSetInner;
+import com.microsoft.azure.management.eventhubs.v2018_01_01_preview.NamespaceAuthorizationRule;
/**
* Type representing Namespaces.
@@ -40,6 +42,22 @@ public interface Namespaces extends SupportsCreating checkNameAvailabilityAsync(String name);
+
/**
* Gets an IpFilterRule for a Namespace by rule name.
*
@@ -104,6 +122,16 @@ public interface Namespaces extends SupportsCreating listNetworkRuleSetsAsync(final String resourceGroupName, final String namespaceName);
+
/**
* Create or update NetworkRuleSet for a Namespace.
*
@@ -125,4 +153,59 @@ 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/NetworkRuleSet.java b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/NetworkRuleSet.java
index 23b2e4cd1060..6a2c9861aeb8 100644
--- a/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/NetworkRuleSet.java
+++ b/sdk/eventhubs/mgmt-v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhubs/v2018_01_01_preview/NetworkRuleSet.java
@@ -9,9 +9,9 @@
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.NetworkRuleSetInner;
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.NetworkRuleSetInner;
import java.util.List;
/**
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 000000000000..9a3c3b44c487
--- /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 000000000000..b9cbfbc5ebd2
--- /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 000000000000..e78411cb3033
--- /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 000000000000..34eec0bd0ca5
--- /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 000000000000..f7e7b473c019
--- /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/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 000000000000..65464fcafe86
--- /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 000000000000..4d6a1262db2a
--- /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 000000000000..54b4eb34296d
--- /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 000000000000..4be691fac4e7
--- /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 000000000000..56280715edb3
--- /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 000000000000..c5f722730bec
--- /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 000000000000..14eb267e7a71
--- /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 0c6cf586b7b8..652aa71dca49 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;
}
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 c9a6e319f164..bf24f8ccebb4 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;
}
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 000000000000..5c70c31eb78c
--- /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 000000000000..5e5dd9c4af0e
--- /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 000000000000..9a6fa3de80e6
--- /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 000000000000..db06a055f098
--- /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,865 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT 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.");
+ }
+ if (this.client.apiVersion() == null) {
+ throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
+ }
+ final String userMetadata = null;
+ ConsumerGroupInner parameters = new ConsumerGroupInner();
+ parameters.withUserMetadata(null);
+ return service.createOrUpdate(resourceGroupName, namespaceName, eventHubName, consumerGroupName, this.client.subscriptionId(), this.client.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.");
+ }
+ if (this.client.apiVersion() == null) {
+ throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
+ }
+ ConsumerGroupInner parameters = new ConsumerGroupInner();
+ parameters.withUserMetadata(userMetadata);
+ return service.createOrUpdate(resourceGroupName, namespaceName, eventHubName, consumerGroupName, this.client.subscriptionId(), this.client.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.");
+ }
+ if (this.client.apiVersion() == null) {
+ throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
+ }
+ return service.delete(resourceGroupName, namespaceName, eventHubName, consumerGroupName, this.client.subscriptionId(), this.client.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.");
+ }
+ if (this.client.apiVersion() == null) {
+ throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
+ }
+ return service.get(resourceGroupName, namespaceName, eventHubName, consumerGroupName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
+ .flatMap(new Func1, Observable>>() {
+ @Override
+ public Observable> call(Response response) {
+ try {
+ ServiceResponse clientResponse = getDelegate(response);
+ return Observable.just(clientResponse);
+ } catch (Throwable t) {
+ return Observable.error(t);
+ }
+ }
+ });
+ }
+
+ private ServiceResponse getDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException {
+ return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter())
+ .register(200, new TypeToken() { }.getType())
+ .registerError(ErrorResponseException.class)
+ .build(response);
+ }
+
+ /**
+ * 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.");
+ }
+ if (this.client.apiVersion() == null) {
+ throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
+ }
+ final Integer skip = null;
+ final Integer top = null;
+ return service.listByEventHub(resourceGroupName, namespaceName, eventHubName, this.client.subscriptionId(), this.client.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.");
+ }
+ if (this.client.apiVersion() == null) {
+ throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
+ }
+ return service.listByEventHub(resourceGroupName, namespaceName, eventHubName, this.client.subscriptionId(), this.client.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