From 6820bcce95cecc9e957e9465eaad0dc608f08070 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 4 Dec 2018 03:28:17 +0000 Subject: [PATCH 1/4] Generated from 7807c4f0b823166755d145a5f08b2d7b411ebf16 added new NetworkRule APIs --- .../v2018_01_01_preview/DefaultAction.java | 41 ++++ .../v2018_01_01_preview/NWRuleSetIpRules.java | 69 +++++++ .../NWRuleSetVirtualNetworkRules.java | 69 +++++++ .../v2018_01_01_preview/Namespaces.java | 22 ++ .../NetworkRuleIPAction.java | 38 ++++ .../v2018_01_01_preview/NetworkRuleSet.java | 51 +++++ .../eventhub/v2018_01_01_preview/Sku.java | 6 +- .../eventhub/v2018_01_01_preview/Subnet.java | 43 ++++ .../implementation/EHNamespaceInner.java | 6 +- .../implementation/NamespacesImpl.java | 25 +++ .../implementation/NamespacesInner.java | 188 ++++++++++++++++++ .../implementation/NetworkRuleSetImpl.java | 60 ++++++ .../implementation/NetworkRuleSetInner.java | 103 ++++++++++ 13 files changed, 715 insertions(+), 6 deletions(-) create mode 100644 eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/DefaultAction.java create mode 100644 eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/NWRuleSetIpRules.java create mode 100644 eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/NWRuleSetVirtualNetworkRules.java create mode 100644 eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/NetworkRuleIPAction.java create mode 100644 eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/NetworkRuleSet.java create mode 100644 eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/Subnet.java create mode 100644 eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/implementation/NetworkRuleSetImpl.java create mode 100644 eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/implementation/NetworkRuleSetInner.java diff --git a/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/DefaultAction.java b/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/DefaultAction.java new file mode 100644 index 0000000000000..442aea8a23e9c --- /dev/null +++ b/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/DefaultAction.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventhub.v2018_01_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for DefaultAction. + */ +public final class DefaultAction extends ExpandableStringEnum { + /** Static value Allow for DefaultAction. */ + public static final DefaultAction ALLOW = fromString("Allow"); + + /** Static value Deny for DefaultAction. */ + public static final DefaultAction DENY = fromString("Deny"); + + /** + * Creates or finds a DefaultAction from its string representation. + * @param name a name to look for + * @return the corresponding DefaultAction + */ + @JsonCreator + public static DefaultAction fromString(String name) { + return fromString(name, DefaultAction.class); + } + + /** + * @return known DefaultAction values + */ + public static Collection values() { + return values(DefaultAction.class); + } +} diff --git a/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/NWRuleSetIpRules.java b/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/NWRuleSetIpRules.java new file mode 100644 index 0000000000000..df670d2e1c0d5 --- /dev/null +++ b/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/NWRuleSetIpRules.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.eventhub.v2018_01_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The response from the List namespace operation. + */ +public class NWRuleSetIpRules { + /** + * IP Mask. + */ + @JsonProperty(value = "ipMask") + private String ipMask; + + /** + * The IP Filter Action. Possible values include: 'Allow'. + */ + @JsonProperty(value = "action") + private NetworkRuleIPAction action; + + /** + * Get iP Mask. + * + * @return the ipMask value + */ + public String ipMask() { + return this.ipMask; + } + + /** + * Set iP Mask. + * + * @param ipMask the ipMask value to set + * @return the NWRuleSetIpRules object itself. + */ + public NWRuleSetIpRules withIpMask(String ipMask) { + this.ipMask = ipMask; + return this; + } + + /** + * Get the IP Filter Action. Possible values include: 'Allow'. + * + * @return the action value + */ + public NetworkRuleIPAction action() { + return this.action; + } + + /** + * Set the IP Filter Action. Possible values include: 'Allow'. + * + * @param action the action value to set + * @return the NWRuleSetIpRules object itself. + */ + public NWRuleSetIpRules withAction(NetworkRuleIPAction action) { + this.action = action; + return this; + } + +} diff --git a/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/NWRuleSetVirtualNetworkRules.java b/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/NWRuleSetVirtualNetworkRules.java new file mode 100644 index 0000000000000..e549780547d4a --- /dev/null +++ b/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/NWRuleSetVirtualNetworkRules.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.eventhub.v2018_01_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The response from the List namespace operation. + */ +public class NWRuleSetVirtualNetworkRules { + /** + * Subnet properties. + */ + @JsonProperty(value = "subnet") + private Subnet subnet; + + /** + * Value that indicates whether to ignore missing Vnet Service Endpoint. + */ + @JsonProperty(value = "ignoreMissingVnetServiceEndpoint") + private Boolean ignoreMissingVnetServiceEndpoint; + + /** + * Get subnet properties. + * + * @return the subnet value + */ + public Subnet subnet() { + return this.subnet; + } + + /** + * Set subnet properties. + * + * @param subnet the subnet value to set + * @return the NWRuleSetVirtualNetworkRules object itself. + */ + public NWRuleSetVirtualNetworkRules withSubnet(Subnet subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get value that indicates whether to ignore missing Vnet Service Endpoint. + * + * @return the ignoreMissingVnetServiceEndpoint value + */ + public Boolean ignoreMissingVnetServiceEndpoint() { + return this.ignoreMissingVnetServiceEndpoint; + } + + /** + * Set value that indicates whether to ignore missing Vnet Service Endpoint. + * + * @param ignoreMissingVnetServiceEndpoint the ignoreMissingVnetServiceEndpoint value to set + * @return the NWRuleSetVirtualNetworkRules object itself. + */ + public NWRuleSetVirtualNetworkRules withIgnoreMissingVnetServiceEndpoint(Boolean ignoreMissingVnetServiceEndpoint) { + this.ignoreMissingVnetServiceEndpoint = ignoreMissingVnetServiceEndpoint; + return this; + } + +} diff --git a/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/Namespaces.java b/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/Namespaces.java index e0d565252a107..4b5435880d383 100644 --- a/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/Namespaces.java +++ b/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/Namespaces.java @@ -15,6 +15,7 @@ import rx.Observable; import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.eventhub.v2018_01_01_preview.implementation.NetworkRuleSetInner; import com.microsoft.azure.management.eventhub.v2018_01_01_preview.implementation.NamespacesInner; import com.microsoft.azure.arm.model.HasInner; import com.microsoft.azure.management.eventhub.v2018_01_01_preview.IpFilterRule; @@ -39,6 +40,27 @@ public interface Namespaces extends SupportsCreating createNetworkRuleSetAsync(String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters); + + /** + * Gets NetworkRuleSet 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 getNetworkRuleSetAsync(String resourceGroupName, String namespaceName); + /** * Gets an IpFilterRule for a Namespace by rule name. * diff --git a/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/NetworkRuleIPAction.java b/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/NetworkRuleIPAction.java new file mode 100644 index 0000000000000..007eccc43f24f --- /dev/null +++ b/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/NetworkRuleIPAction.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventhub.v2018_01_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for NetworkRuleIPAction. + */ +public final class NetworkRuleIPAction extends ExpandableStringEnum { + /** Static value Allow for NetworkRuleIPAction. */ + public static final NetworkRuleIPAction ALLOW = fromString("Allow"); + + /** + * Creates or finds a NetworkRuleIPAction from its string representation. + * @param name a name to look for + * @return the corresponding NetworkRuleIPAction + */ + @JsonCreator + public static NetworkRuleIPAction fromString(String name) { + return fromString(name, NetworkRuleIPAction.class); + } + + /** + * @return known NetworkRuleIPAction values + */ + public static Collection values() { + return values(NetworkRuleIPAction.class); + } +} diff --git a/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/NetworkRuleSet.java b/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/NetworkRuleSet.java new file mode 100644 index 0000000000000..2c0d133892d5e --- /dev/null +++ b/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/NetworkRuleSet.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.eventhub.v2018_01_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.eventhub.v2018_01_01_preview.implementation.EventHubManager; +import com.microsoft.azure.management.eventhub.v2018_01_01_preview.implementation.NetworkRuleSetInner; +import java.util.List; + +/** + * Type representing NetworkRuleSet. + */ +public interface NetworkRuleSet extends HasInner, HasManager { + /** + * @return the defaultAction value. + */ + DefaultAction defaultAction(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the ipRules value. + */ + List ipRules(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the virtualNetworkRules value. + */ + List virtualNetworkRules(); + +} diff --git a/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/Sku.java b/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/Sku.java index 4d782dd05d85c..dde478180c504 100644 --- a/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/Sku.java +++ b/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/Sku.java @@ -28,7 +28,7 @@ public class Sku { private SkuTier tier; /** - * The Event Hubs throughput units, value should be 0 to 20 throughput + * The Event Hubs throughput units, vaule should be 0 to 20 throughput * units. */ @JsonProperty(value = "capacity") @@ -75,7 +75,7 @@ public Sku withTier(SkuTier tier) { } /** - * Get the Event Hubs throughput units, value should be 0 to 20 throughput units. + * Get the Event Hubs throughput units, vaule should be 0 to 20 throughput units. * * @return the capacity value */ @@ -84,7 +84,7 @@ public Integer capacity() { } /** - * Set the Event Hubs throughput units, value should be 0 to 20 throughput units. + * Set the Event Hubs throughput units, vaule should be 0 to 20 throughput units. * * @param capacity the capacity value to set * @return the Sku object itself. diff --git a/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/Subnet.java b/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/Subnet.java new file mode 100644 index 0000000000000..73766a300749a --- /dev/null +++ b/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/Subnet.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.eventhub.v2018_01_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties supplied for Subnet. + */ +public class Subnet { + /** + * Resource ID of Virtual Network Subnet. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get resource ID of Virtual Network Subnet. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID of Virtual Network Subnet. + * + * @param id the id value to set + * @return the Subnet object itself. + */ + public Subnet withId(String id) { + this.id = id; + return this; + } + +} diff --git a/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/implementation/EHNamespaceInner.java b/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/implementation/EHNamespaceInner.java index 6fc3667cfc3e6..43a3a5885ac0b 100644 --- a/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/implementation/EHNamespaceInner.java +++ b/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/implementation/EHNamespaceInner.java @@ -65,7 +65,7 @@ public class EHNamespaceInner extends Resource { private Boolean isAutoInflateEnabled; /** - * Upper limit of throughput units when AutoInflate is enabled, value + * Upper limit of throughput units when AutoInflate is enabled, vaule * should be within 0 to 20 throughput units. ( '0' if AutoInflateEnabled = * true). */ @@ -171,7 +171,7 @@ public EHNamespaceInner withIsAutoInflateEnabled(Boolean isAutoInflateEnabled) { } /** - * Get upper limit of throughput units when AutoInflate is enabled, value should be within 0 to 20 throughput units. ( '0' if AutoInflateEnabled = true). + * Get upper limit of throughput units when AutoInflate is enabled, vaule should be within 0 to 20 throughput units. ( '0' if AutoInflateEnabled = true). * * @return the maximumThroughputUnits value */ @@ -180,7 +180,7 @@ public Integer maximumThroughputUnits() { } /** - * Set upper limit of throughput units when AutoInflate is enabled, value should be within 0 to 20 throughput units. ( '0' if AutoInflateEnabled = true). + * Set upper limit of throughput units when AutoInflate is enabled, vaule should be within 0 to 20 throughput units. ( '0' if AutoInflateEnabled = true). * * @param maximumThroughputUnits the maximumThroughputUnits value to set * @return the EHNamespaceInner object itself. diff --git a/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/implementation/NamespacesImpl.java b/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/implementation/NamespacesImpl.java index a9547aef7b548..1f3bd0a8dec5a 100644 --- a/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/implementation/NamespacesImpl.java +++ b/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/implementation/NamespacesImpl.java @@ -22,6 +22,7 @@ import rx.functions.Func1; import com.microsoft.azure.PagedList; import com.microsoft.azure.Page; +import com.microsoft.azure.management.eventhub.v2018_01_01_preview.NetworkRuleSet; import com.microsoft.azure.management.eventhub.v2018_01_01_preview.IpFilterRule; import com.microsoft.azure.management.eventhub.v2018_01_01_preview.VirtualNetworkRule; @@ -127,6 +128,30 @@ public EHNamespaceImpl define(String name) { return wrapModel(name); } + @Override + public Observable createNetworkRuleSetAsync(String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters) { + NamespacesInner client = this.inner(); + return client.createNetworkRuleSetAsync(resourceGroupName, namespaceName, parameters) + .map(new Func1() { + @Override + public NetworkRuleSet call(NetworkRuleSetInner inner) { + return new NetworkRuleSetImpl(inner, manager()); + } + }); + } + + @Override + public Observable getNetworkRuleSetAsync(String resourceGroupName, String namespaceName) { + NamespacesInner client = this.inner(); + return client.getNetworkRuleSetAsync(resourceGroupName, namespaceName) + .map(new Func1() { + @Override + public NetworkRuleSet call(NetworkRuleSetInner inner) { + return new NetworkRuleSetImpl(inner, manager()); + } + }); + } + @Override protected EHNamespaceImpl wrapModel(EHNamespaceInner inner) { return new EHNamespaceImpl(inner.name(), inner, manager()); diff --git a/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/implementation/NamespacesInner.java b/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/implementation/NamespacesInner.java index d1707a6c63576..260c6c5ad5765 100644 --- a/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/implementation/NamespacesInner.java +++ b/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/implementation/NamespacesInner.java @@ -129,6 +129,14 @@ interface NamespacesService { @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/virtualnetworkrules/{virtualNetworkRuleName}") Observable> getVirtualNetworkRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("virtualNetworkRuleName") String virtualNetworkRuleName, @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.eventhub.v2018_01_01_preview.Namespaces createNetworkRuleSet" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/networkruleset/default") + Observable> createNetworkRuleSet(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body NetworkRuleSetInner parameters, @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.eventhub.v2018_01_01_preview.Namespaces getNetworkRuleSet" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/networkruleset/default") + Observable> getNetworkRuleSet(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventhub.v2018_01_01_preview.Namespaces listNext" }) @GET Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -1787,6 +1795,186 @@ private ServiceResponse getVirtualNetworkRuleDelegate(R .build(response); } + /** + * Gets NetworkRuleSet for a Namespace. + * + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param namespaceName The Namespace name + * @param parameters The Namespace IpFilterRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkRuleSetInner object if successful. + */ + public NetworkRuleSetInner createNetworkRuleSet(String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters) { + return createNetworkRuleSetWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).toBlocking().single().body(); + } + + /** + * Gets NetworkRuleSet for a Namespace. + * + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param namespaceName The Namespace name + * @param parameters The Namespace IpFilterRule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createNetworkRuleSetAsync(String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createNetworkRuleSetWithServiceResponseAsync(resourceGroupName, namespaceName, parameters), serviceCallback); + } + + /** + * Gets NetworkRuleSet for a Namespace. + * + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param namespaceName The Namespace name + * @param parameters The Namespace IpFilterRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkRuleSetInner object + */ + public Observable createNetworkRuleSetAsync(String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters) { + return createNetworkRuleSetWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).map(new Func1, NetworkRuleSetInner>() { + @Override + public NetworkRuleSetInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets NetworkRuleSet for a Namespace. + * + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param namespaceName The Namespace name + * @param parameters The Namespace IpFilterRule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkRuleSetInner object + */ + public Observable> createNetworkRuleSetWithServiceResponseAsync(String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.createNetworkRuleSet(resourceGroupName, namespaceName, this.client.subscriptionId(), this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createNetworkRuleSetDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createNetworkRuleSetDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets NetworkRuleSet for a Namespace. + * + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param namespaceName The Namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkRuleSetInner object if successful. + */ + public NetworkRuleSetInner getNetworkRuleSet(String resourceGroupName, String namespaceName) { + return getNetworkRuleSetWithServiceResponseAsync(resourceGroupName, namespaceName).toBlocking().single().body(); + } + + /** + * Gets NetworkRuleSet for a Namespace. + * + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param namespaceName The Namespace name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getNetworkRuleSetAsync(String resourceGroupName, String namespaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getNetworkRuleSetWithServiceResponseAsync(resourceGroupName, namespaceName), serviceCallback); + } + + /** + * Gets NetworkRuleSet for a Namespace. + * + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param namespaceName The Namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkRuleSetInner object + */ + public Observable getNetworkRuleSetAsync(String resourceGroupName, String namespaceName) { + return getNetworkRuleSetWithServiceResponseAsync(resourceGroupName, namespaceName).map(new Func1, NetworkRuleSetInner>() { + @Override + public NetworkRuleSetInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets NetworkRuleSet for a Namespace. + * + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param namespaceName The Namespace name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkRuleSetInner object + */ + public Observable> getNetworkRuleSetWithServiceResponseAsync(String resourceGroupName, String namespaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (namespaceName == null) { + throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getNetworkRuleSet(resourceGroupName, namespaceName, 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 = getNetworkRuleSetDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getNetworkRuleSetDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + /** * Lists all the available Namespaces within a subscription, irrespective of the resource groups. * diff --git a/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/implementation/NetworkRuleSetImpl.java b/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/implementation/NetworkRuleSetImpl.java new file mode 100644 index 0000000000000..93b0c1d6bfb93 --- /dev/null +++ b/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/implementation/NetworkRuleSetImpl.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventhub.v2018_01_01_preview.implementation; + +import com.microsoft.azure.management.eventhub.v2018_01_01_preview.NetworkRuleSet; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.eventhub.v2018_01_01_preview.DefaultAction; +import java.util.List; +import com.microsoft.azure.management.eventhub.v2018_01_01_preview.NWRuleSetIpRules; +import com.microsoft.azure.management.eventhub.v2018_01_01_preview.NWRuleSetVirtualNetworkRules; + +class NetworkRuleSetImpl extends WrapperImpl implements NetworkRuleSet { + private final EventHubManager manager; + NetworkRuleSetImpl(NetworkRuleSetInner inner, EventHubManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public EventHubManager manager() { + return this.manager; + } + + @Override + public DefaultAction defaultAction() { + return this.inner().defaultAction(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public List ipRules() { + return this.inner().ipRules(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public List virtualNetworkRules() { + return this.inner().virtualNetworkRules(); + } + +} diff --git a/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/implementation/NetworkRuleSetInner.java b/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/implementation/NetworkRuleSetInner.java new file mode 100644 index 0000000000000..ab6d0fa5645f8 --- /dev/null +++ b/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/implementation/NetworkRuleSetInner.java @@ -0,0 +1,103 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventhub.v2018_01_01_preview.implementation; + +import com.microsoft.azure.management.eventhub.v2018_01_01_preview.DefaultAction; +import java.util.List; +import com.microsoft.azure.management.eventhub.v2018_01_01_preview.NWRuleSetVirtualNetworkRules; +import com.microsoft.azure.management.eventhub.v2018_01_01_preview.NWRuleSetIpRules; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Description of topic resource. + */ +@JsonFlatten +public class NetworkRuleSetInner extends ProxyResource { + /** + * Default Action for Network Rule Set. Possible values include: 'Allow', + * 'Deny'. + */ + @JsonProperty(value = "properties.defaultAction") + private DefaultAction defaultAction; + + /** + * List VirtualNetwork Rules. + */ + @JsonProperty(value = "properties.virtualNetworkRules") + private List virtualNetworkRules; + + /** + * List of IpRules. + */ + @JsonProperty(value = "properties.ipRules") + private List ipRules; + + /** + * Get default Action for Network Rule Set. Possible values include: 'Allow', 'Deny'. + * + * @return the defaultAction value + */ + public DefaultAction defaultAction() { + return this.defaultAction; + } + + /** + * Set default Action for Network Rule Set. Possible values include: 'Allow', 'Deny'. + * + * @param defaultAction the defaultAction value to set + * @return the NetworkRuleSetInner object itself. + */ + public NetworkRuleSetInner withDefaultAction(DefaultAction defaultAction) { + this.defaultAction = defaultAction; + return this; + } + + /** + * Get list VirtualNetwork Rules. + * + * @return the virtualNetworkRules value + */ + public List virtualNetworkRules() { + return this.virtualNetworkRules; + } + + /** + * Set list VirtualNetwork Rules. + * + * @param virtualNetworkRules the virtualNetworkRules value to set + * @return the NetworkRuleSetInner object itself. + */ + public NetworkRuleSetInner withVirtualNetworkRules(List virtualNetworkRules) { + this.virtualNetworkRules = virtualNetworkRules; + return this; + } + + /** + * Get list of IpRules. + * + * @return the ipRules value + */ + public List ipRules() { + return this.ipRules; + } + + /** + * Set list of IpRules. + * + * @param ipRules the ipRules value to set + * @return the NetworkRuleSetInner object itself. + */ + public NetworkRuleSetInner withIpRules(List ipRules) { + this.ipRules = ipRules; + return this; + } + +} From 799721d1f0ae703fa5c78f8a2b4fe766b03a7783 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 11 Dec 2018 00:50:31 +0000 Subject: [PATCH 2/4] Generated from a60b308c030848d00a8d37f366a7928eb7d65519 fixed lint errors --- .../v2018_01_01_preview/Namespaces.java | 8 +- .../v2018_01_01_preview/NetworkRuleSets.java | 51 +++++++++ .../implementation/NamespacesImpl.java | 20 ++-- .../implementation/NamespacesInner.java | 78 ++++++------- .../implementation/NetworkRuleSetsImpl.java | 60 ++++++++++ .../implementation/NetworkRuleSetsInner.java | 103 ++++++++++++++++++ 6 files changed, 267 insertions(+), 53 deletions(-) create mode 100644 eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/NetworkRuleSets.java create mode 100644 eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/implementation/NetworkRuleSetsImpl.java create mode 100644 eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/implementation/NetworkRuleSetsInner.java diff --git a/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/Namespaces.java b/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/Namespaces.java index 4b5435880d383..727e130d5756f 100644 --- a/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/Namespaces.java +++ b/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/Namespaces.java @@ -15,7 +15,7 @@ import rx.Observable; import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; import com.microsoft.azure.arm.collection.SupportsListing; -import com.microsoft.azure.management.eventhub.v2018_01_01_preview.implementation.NetworkRuleSetInner; +import com.microsoft.azure.management.eventhub.v2018_01_01_preview.implementation.NetworkRuleSetsInner; import com.microsoft.azure.management.eventhub.v2018_01_01_preview.implementation.NamespacesInner; import com.microsoft.azure.arm.model.HasInner; import com.microsoft.azure.management.eventhub.v2018_01_01_preview.IpFilterRule; @@ -41,7 +41,7 @@ public interface Namespaces extends SupportsCreating createNetworkRuleSetAsync(String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters); + Observable createOrUpdateNetworkRuleSetAsync(String resourceGroupName, String namespaceName, NetworkRuleSetsInner parameters); /** * Gets NetworkRuleSet for a Namespace. @@ -59,7 +59,7 @@ public interface Namespaces extends SupportsCreating getNetworkRuleSetAsync(String resourceGroupName, String namespaceName); + Observable getNetworkRuleSetAsync(String resourceGroupName, String namespaceName); /** * Gets an IpFilterRule for a Namespace by rule name. diff --git a/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/NetworkRuleSets.java b/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/NetworkRuleSets.java new file mode 100644 index 0000000000000..d9d379f063081 --- /dev/null +++ b/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/NetworkRuleSets.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.eventhub.v2018_01_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.eventhub.v2018_01_01_preview.implementation.EventHubManager; +import com.microsoft.azure.management.eventhub.v2018_01_01_preview.implementation.NetworkRuleSetsInner; +import java.util.List; + +/** + * Type representing NetworkRuleSets. + */ +public interface NetworkRuleSets extends HasInner, HasManager { + /** + * @return the defaultAction value. + */ + DefaultAction defaultAction(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the ipRules value. + */ + List ipRules(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the virtualNetworkRules value. + */ + List virtualNetworkRules(); + +} diff --git a/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/implementation/NamespacesImpl.java b/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/implementation/NamespacesImpl.java index 1f3bd0a8dec5a..eb998743e6491 100644 --- a/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/implementation/NamespacesImpl.java +++ b/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/implementation/NamespacesImpl.java @@ -22,7 +22,7 @@ import rx.functions.Func1; import com.microsoft.azure.PagedList; import com.microsoft.azure.Page; -import com.microsoft.azure.management.eventhub.v2018_01_01_preview.NetworkRuleSet; +import com.microsoft.azure.management.eventhub.v2018_01_01_preview.NetworkRuleSets; import com.microsoft.azure.management.eventhub.v2018_01_01_preview.IpFilterRule; import com.microsoft.azure.management.eventhub.v2018_01_01_preview.VirtualNetworkRule; @@ -129,25 +129,25 @@ public EHNamespaceImpl define(String name) { } @Override - public Observable createNetworkRuleSetAsync(String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters) { + public Observable createOrUpdateNetworkRuleSetAsync(String resourceGroupName, String namespaceName, NetworkRuleSetsInner parameters) { NamespacesInner client = this.inner(); - return client.createNetworkRuleSetAsync(resourceGroupName, namespaceName, parameters) - .map(new Func1() { + return client.createOrUpdateNetworkRuleSetAsync(resourceGroupName, namespaceName, parameters) + .map(new Func1() { @Override - public NetworkRuleSet call(NetworkRuleSetInner inner) { - return new NetworkRuleSetImpl(inner, manager()); + public NetworkRuleSets call(NetworkRuleSetsInner inner) { + return new NetworkRuleSetsImpl(inner, manager()); } }); } @Override - public Observable getNetworkRuleSetAsync(String resourceGroupName, String namespaceName) { + public Observable getNetworkRuleSetAsync(String resourceGroupName, String namespaceName) { NamespacesInner client = this.inner(); return client.getNetworkRuleSetAsync(resourceGroupName, namespaceName) - .map(new Func1() { + .map(new Func1() { @Override - public NetworkRuleSet call(NetworkRuleSetInner inner) { - return new NetworkRuleSetImpl(inner, manager()); + public NetworkRuleSets call(NetworkRuleSetsInner inner) { + return new NetworkRuleSetsImpl(inner, manager()); } }); } diff --git a/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/implementation/NamespacesInner.java b/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/implementation/NamespacesInner.java index 260c6c5ad5765..db886e5bbbe3f 100644 --- a/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/implementation/NamespacesInner.java +++ b/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/implementation/NamespacesInner.java @@ -129,9 +129,9 @@ interface NamespacesService { @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/virtualnetworkrules/{virtualNetworkRuleName}") Observable> getVirtualNetworkRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("virtualNetworkRuleName") String virtualNetworkRuleName, @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.eventhub.v2018_01_01_preview.Namespaces createNetworkRuleSet" }) + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventhub.v2018_01_01_preview.Namespaces createOrUpdateNetworkRuleSet" }) @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/networkruleset/default") - Observable> createNetworkRuleSet(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body NetworkRuleSetInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> createOrUpdateNetworkRuleSet(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body NetworkRuleSetsInner parameters, @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.eventhub.v2018_01_01_preview.Namespaces getNetworkRuleSet" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/networkruleset/default") @@ -1796,7 +1796,7 @@ private ServiceResponse getVirtualNetworkRuleDelegate(R } /** - * Gets NetworkRuleSet for a Namespace. + * Create or update NetworkRuleSet for a Namespace. * * @param resourceGroupName Name of the resource group within the Azure subscription. * @param namespaceName The Namespace name @@ -1804,14 +1804,14 @@ private ServiceResponse getVirtualNetworkRuleDelegate(R * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the NetworkRuleSetInner object if successful. + * @return the NetworkRuleSetsInner object if successful. */ - public NetworkRuleSetInner createNetworkRuleSet(String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters) { - return createNetworkRuleSetWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).toBlocking().single().body(); + public NetworkRuleSetsInner createOrUpdateNetworkRuleSet(String resourceGroupName, String namespaceName, NetworkRuleSetsInner parameters) { + return createOrUpdateNetworkRuleSetWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).toBlocking().single().body(); } /** - * Gets NetworkRuleSet for a Namespace. + * Create or update NetworkRuleSet for a Namespace. * * @param resourceGroupName Name of the resource group within the Azure subscription. * @param namespaceName The Namespace name @@ -1820,38 +1820,38 @@ public NetworkRuleSetInner createNetworkRuleSet(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture createNetworkRuleSetAsync(String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createNetworkRuleSetWithServiceResponseAsync(resourceGroupName, namespaceName, parameters), serviceCallback); + public ServiceFuture createOrUpdateNetworkRuleSetAsync(String resourceGroupName, String namespaceName, NetworkRuleSetsInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateNetworkRuleSetWithServiceResponseAsync(resourceGroupName, namespaceName, parameters), serviceCallback); } /** - * Gets NetworkRuleSet for a Namespace. + * Create or update NetworkRuleSet for a Namespace. * * @param resourceGroupName Name of the resource group within the Azure subscription. * @param namespaceName The Namespace name * @param parameters The Namespace IpFilterRule. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the NetworkRuleSetInner object + * @return the observable to the NetworkRuleSetsInner object */ - public Observable createNetworkRuleSetAsync(String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters) { - return createNetworkRuleSetWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).map(new Func1, NetworkRuleSetInner>() { + public Observable createOrUpdateNetworkRuleSetAsync(String resourceGroupName, String namespaceName, NetworkRuleSetsInner parameters) { + return createOrUpdateNetworkRuleSetWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).map(new Func1, NetworkRuleSetsInner>() { @Override - public NetworkRuleSetInner call(ServiceResponse response) { + public NetworkRuleSetsInner call(ServiceResponse response) { return response.body(); } }); } /** - * Gets NetworkRuleSet for a Namespace. + * Create or update NetworkRuleSet for a Namespace. * * @param resourceGroupName Name of the resource group within the Azure subscription. * @param namespaceName The Namespace name * @param parameters The Namespace IpFilterRule. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the NetworkRuleSetInner object + * @return the observable to the NetworkRuleSetsInner object */ - public Observable> createNetworkRuleSetWithServiceResponseAsync(String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters) { + public Observable> createOrUpdateNetworkRuleSetWithServiceResponseAsync(String resourceGroupName, String namespaceName, NetworkRuleSetsInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1868,12 +1868,12 @@ public Observable> createNetworkRuleSetWith throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); } Validator.validate(parameters); - return service.createNetworkRuleSet(resourceGroupName, namespaceName, this.client.subscriptionId(), this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + return service.createOrUpdateNetworkRuleSet(resourceGroupName, namespaceName, this.client.subscriptionId(), this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = createNetworkRuleSetDelegate(response); + ServiceResponse clientResponse = createOrUpdateNetworkRuleSetDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1882,9 +1882,9 @@ public Observable> call(Response createNetworkRuleSetDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse createOrUpdateNetworkRuleSetDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(ErrorResponseException.class) .build(response); } @@ -1897,9 +1897,9 @@ private ServiceResponse createNetworkRuleSetDelegate(Respon * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the NetworkRuleSetInner object if successful. + * @return the NetworkRuleSetsInner object if successful. */ - public NetworkRuleSetInner getNetworkRuleSet(String resourceGroupName, String namespaceName) { + public NetworkRuleSetsInner getNetworkRuleSet(String resourceGroupName, String namespaceName) { return getNetworkRuleSetWithServiceResponseAsync(resourceGroupName, namespaceName).toBlocking().single().body(); } @@ -1912,7 +1912,7 @@ public NetworkRuleSetInner getNetworkRuleSet(String resourceGroupName, String na * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture getNetworkRuleSetAsync(String resourceGroupName, String namespaceName, final ServiceCallback serviceCallback) { + public ServiceFuture getNetworkRuleSetAsync(String resourceGroupName, String namespaceName, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(getNetworkRuleSetWithServiceResponseAsync(resourceGroupName, namespaceName), serviceCallback); } @@ -1922,12 +1922,12 @@ public ServiceFuture getNetworkRuleSetAsync(String resource * @param resourceGroupName Name of the resource group within the Azure subscription. * @param namespaceName The Namespace name * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the NetworkRuleSetInner object + * @return the observable to the NetworkRuleSetsInner object */ - public Observable getNetworkRuleSetAsync(String resourceGroupName, String namespaceName) { - return getNetworkRuleSetWithServiceResponseAsync(resourceGroupName, namespaceName).map(new Func1, NetworkRuleSetInner>() { + public Observable getNetworkRuleSetAsync(String resourceGroupName, String namespaceName) { + return getNetworkRuleSetWithServiceResponseAsync(resourceGroupName, namespaceName).map(new Func1, NetworkRuleSetsInner>() { @Override - public NetworkRuleSetInner call(ServiceResponse response) { + public NetworkRuleSetsInner call(ServiceResponse response) { return response.body(); } }); @@ -1939,9 +1939,9 @@ public NetworkRuleSetInner call(ServiceResponse response) { * @param resourceGroupName Name of the resource group within the Azure subscription. * @param namespaceName The Namespace name * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the NetworkRuleSetInner object + * @return the observable to the NetworkRuleSetsInner object */ - public Observable> getNetworkRuleSetWithServiceResponseAsync(String resourceGroupName, String namespaceName) { + public Observable> getNetworkRuleSetWithServiceResponseAsync(String resourceGroupName, String namespaceName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1955,11 +1955,11 @@ public Observable> getNetworkRuleSetWithSer throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } return service.getNetworkRuleSet(resourceGroupName, namespaceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = getNetworkRuleSetDelegate(response); + ServiceResponse clientResponse = getNetworkRuleSetDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1968,9 +1968,9 @@ public Observable> call(Response getNetworkRuleSetDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse getNetworkRuleSetDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(ErrorResponseException.class) .build(response); } diff --git a/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/implementation/NetworkRuleSetsImpl.java b/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/implementation/NetworkRuleSetsImpl.java new file mode 100644 index 0000000000000..9dd6895ba4463 --- /dev/null +++ b/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/implementation/NetworkRuleSetsImpl.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventhub.v2018_01_01_preview.implementation; + +import com.microsoft.azure.management.eventhub.v2018_01_01_preview.NetworkRuleSets; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.eventhub.v2018_01_01_preview.DefaultAction; +import java.util.List; +import com.microsoft.azure.management.eventhub.v2018_01_01_preview.NWRuleSetIpRules; +import com.microsoft.azure.management.eventhub.v2018_01_01_preview.NWRuleSetVirtualNetworkRules; + +class NetworkRuleSetsImpl extends WrapperImpl implements NetworkRuleSets { + private final EventHubManager manager; + NetworkRuleSetsImpl(NetworkRuleSetsInner inner, EventHubManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public EventHubManager manager() { + return this.manager; + } + + @Override + public DefaultAction defaultAction() { + return this.inner().defaultAction(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public List ipRules() { + return this.inner().ipRules(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public List virtualNetworkRules() { + return this.inner().virtualNetworkRules(); + } + +} diff --git a/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/implementation/NetworkRuleSetsInner.java b/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/implementation/NetworkRuleSetsInner.java new file mode 100644 index 0000000000000..e5777f902a843 --- /dev/null +++ b/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/implementation/NetworkRuleSetsInner.java @@ -0,0 +1,103 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventhub.v2018_01_01_preview.implementation; + +import com.microsoft.azure.management.eventhub.v2018_01_01_preview.DefaultAction; +import java.util.List; +import com.microsoft.azure.management.eventhub.v2018_01_01_preview.NWRuleSetVirtualNetworkRules; +import com.microsoft.azure.management.eventhub.v2018_01_01_preview.NWRuleSetIpRules; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Description of topic resource. + */ +@JsonFlatten +public class NetworkRuleSetsInner extends ProxyResource { + /** + * Default Action for Network Rule Set. Possible values include: 'Allow', + * 'Deny'. + */ + @JsonProperty(value = "properties.defaultAction") + private DefaultAction defaultAction; + + /** + * List VirtualNetwork Rules. + */ + @JsonProperty(value = "properties.virtualNetworkRules") + private List virtualNetworkRules; + + /** + * List of IpRules. + */ + @JsonProperty(value = "properties.ipRules") + private List ipRules; + + /** + * Get default Action for Network Rule Set. Possible values include: 'Allow', 'Deny'. + * + * @return the defaultAction value + */ + public DefaultAction defaultAction() { + return this.defaultAction; + } + + /** + * Set default Action for Network Rule Set. Possible values include: 'Allow', 'Deny'. + * + * @param defaultAction the defaultAction value to set + * @return the NetworkRuleSetsInner object itself. + */ + public NetworkRuleSetsInner withDefaultAction(DefaultAction defaultAction) { + this.defaultAction = defaultAction; + return this; + } + + /** + * Get list VirtualNetwork Rules. + * + * @return the virtualNetworkRules value + */ + public List virtualNetworkRules() { + return this.virtualNetworkRules; + } + + /** + * Set list VirtualNetwork Rules. + * + * @param virtualNetworkRules the virtualNetworkRules value to set + * @return the NetworkRuleSetsInner object itself. + */ + public NetworkRuleSetsInner withVirtualNetworkRules(List virtualNetworkRules) { + this.virtualNetworkRules = virtualNetworkRules; + return this; + } + + /** + * Get list of IpRules. + * + * @return the ipRules value + */ + public List ipRules() { + return this.ipRules; + } + + /** + * Set list of IpRules. + * + * @param ipRules the ipRules value to set + * @return the NetworkRuleSetsInner object itself. + */ + public NetworkRuleSetsInner withIpRules(List ipRules) { + this.ipRules = ipRules; + return this; + } + +} From 59993f8a772e55d328d88afc49dd75cd7a35a532 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 11 Dec 2018 02:16:35 +0000 Subject: [PATCH 3/4] Generated from 3b57de76c54b7554936ce1be5479976688f6f166 fixed typo and updated examples files names for NetworkRuleSets --- .../azure/management/eventhub/v2018_01_01_preview/Sku.java | 6 +++--- .../implementation/EHNamespaceInner.java | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/Sku.java b/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/Sku.java index dde478180c504..4d782dd05d85c 100644 --- a/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/Sku.java +++ b/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/Sku.java @@ -28,7 +28,7 @@ public class Sku { private SkuTier tier; /** - * The Event Hubs throughput units, vaule should be 0 to 20 throughput + * The Event Hubs throughput units, value should be 0 to 20 throughput * units. */ @JsonProperty(value = "capacity") @@ -75,7 +75,7 @@ public Sku withTier(SkuTier tier) { } /** - * Get the Event Hubs throughput units, vaule should be 0 to 20 throughput units. + * Get the Event Hubs throughput units, value should be 0 to 20 throughput units. * * @return the capacity value */ @@ -84,7 +84,7 @@ public Integer capacity() { } /** - * Set the Event Hubs throughput units, vaule should be 0 to 20 throughput units. + * Set the Event Hubs throughput units, value should be 0 to 20 throughput units. * * @param capacity the capacity value to set * @return the Sku object itself. diff --git a/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/implementation/EHNamespaceInner.java b/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/implementation/EHNamespaceInner.java index 43a3a5885ac0b..6fc3667cfc3e6 100644 --- a/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/implementation/EHNamespaceInner.java +++ b/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/implementation/EHNamespaceInner.java @@ -65,7 +65,7 @@ public class EHNamespaceInner extends Resource { private Boolean isAutoInflateEnabled; /** - * Upper limit of throughput units when AutoInflate is enabled, vaule + * Upper limit of throughput units when AutoInflate is enabled, value * should be within 0 to 20 throughput units. ( '0' if AutoInflateEnabled = * true). */ @@ -171,7 +171,7 @@ public EHNamespaceInner withIsAutoInflateEnabled(Boolean isAutoInflateEnabled) { } /** - * Get upper limit of throughput units when AutoInflate is enabled, vaule should be within 0 to 20 throughput units. ( '0' if AutoInflateEnabled = true). + * Get upper limit of throughput units when AutoInflate is enabled, value should be within 0 to 20 throughput units. ( '0' if AutoInflateEnabled = true). * * @return the maximumThroughputUnits value */ @@ -180,7 +180,7 @@ public Integer maximumThroughputUnits() { } /** - * Set upper limit of throughput units when AutoInflate is enabled, vaule should be within 0 to 20 throughput units. ( '0' if AutoInflateEnabled = true). + * Set upper limit of throughput units when AutoInflate is enabled, value should be within 0 to 20 throughput units. ( '0' if AutoInflateEnabled = true). * * @param maximumThroughputUnits the maximumThroughputUnits value to set * @return the EHNamespaceInner object itself. From e21f0d044a05b414d7f453f9e16b5ceed7df64cd Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 12 Dec 2018 17:28:15 +0000 Subject: [PATCH 4/4] Generated from 7d461b5736f870e85cbc48bbb9973536e495301f updated resource type name in url with plural and lowerCamelCase --- .../v2018_01_01_preview/Namespaces.java | 40 +++++------ .../implementation/NamespacesImpl.java | 50 +++++++------- .../implementation/NamespacesInner.java | 66 +++++++++---------- 3 files changed, 78 insertions(+), 78 deletions(-) diff --git a/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/Namespaces.java b/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/Namespaces.java index 727e130d5756f..5cd16f9d63fd7 100644 --- a/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/Namespaces.java +++ b/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/Namespaces.java @@ -15,12 +15,12 @@ import rx.Observable; import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; import com.microsoft.azure.arm.collection.SupportsListing; -import com.microsoft.azure.management.eventhub.v2018_01_01_preview.implementation.NetworkRuleSetsInner; import com.microsoft.azure.management.eventhub.v2018_01_01_preview.implementation.NamespacesInner; import com.microsoft.azure.arm.model.HasInner; import com.microsoft.azure.management.eventhub.v2018_01_01_preview.IpFilterRule; import rx.Completable; import com.microsoft.azure.management.eventhub.v2018_01_01_preview.VirtualNetworkRule; +import com.microsoft.azure.management.eventhub.v2018_01_01_preview.implementation.NetworkRuleSetInner; /** * Type representing Namespaces. @@ -41,28 +41,28 @@ public interface Namespaces extends SupportsCreating createOrUpdateNetworkRuleSetAsync(String resourceGroupName, String namespaceName, NetworkRuleSetsInner parameters); + Observable getIpFilterRuleAsync(String resourceGroupName, String namespaceName, String ipFilterRuleName); /** - * Gets NetworkRuleSet for a Namespace. + * Gets a list of IP Filter rules for a Namespace. * * @param resourceGroupName Name of the resource group within the Azure subscription. * @param namespaceName The Namespace name * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - Observable getNetworkRuleSetAsync(String resourceGroupName, String namespaceName); + Observable listIPFilterRulesAsync(final String resourceGroupName, final String namespaceName); /** - * Gets an IpFilterRule for a Namespace by rule name. + * Deletes an IpFilterRule for a Namespace. * * @param resourceGroupName Name of the resource group within the Azure subscription. * @param namespaceName The Namespace name @@ -70,31 +70,31 @@ public interface Namespaces extends SupportsCreating getIpFilterRuleAsync(String resourceGroupName, String namespaceName, String ipFilterRuleName); + Completable deleteIpFilterRuleAsync(String resourceGroupName, String namespaceName, String ipFilterRuleName); /** - * Gets a list of IP Filter rules for a Namespace. + * Gets an VirtualNetworkRule for a Namespace by rule name. * * @param resourceGroupName Name of the resource group within the Azure subscription. * @param namespaceName The Namespace name + * @param virtualNetworkRuleName The Virtual Network Rule name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - Observable listIPFilterRulesAsync(final String resourceGroupName, final String namespaceName); + Observable getVirtualNetworkRuleAsync(String resourceGroupName, String namespaceName, String virtualNetworkRuleName); /** - * Deletes an IpFilterRule for a Namespace. + * Gets a list of VirtualNetwork rules for a Namespace. * * @param resourceGroupName Name of the resource group within the Azure subscription. * @param namespaceName The Namespace name - * @param ipFilterRuleName The IP Filter Rule name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - Completable deleteIpFilterRuleAsync(String resourceGroupName, String namespaceName, String ipFilterRuleName); + Observable listVirtualNetworkRulesAsync(final String resourceGroupName, final String namespaceName); /** - * Gets an VirtualNetworkRule for a Namespace by rule name. + * Deletes an VirtualNetworkRule for a Namespace. * * @param resourceGroupName Name of the resource group within the Azure subscription. * @param namespaceName The Namespace name @@ -102,27 +102,27 @@ public interface Namespaces extends SupportsCreating getVirtualNetworkRuleAsync(String resourceGroupName, String namespaceName, String virtualNetworkRuleName); + Completable deleteVirtualNetworkRuleAsync(String resourceGroupName, String namespaceName, String virtualNetworkRuleName); /** - * Gets a list of VirtualNetwork rules for a Namespace. + * Create or update NetworkRuleSet for a Namespace. * * @param resourceGroupName Name of the resource group within the Azure subscription. * @param namespaceName The Namespace name + * @param parameters The Namespace IpFilterRule. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - Observable listVirtualNetworkRulesAsync(final String resourceGroupName, final String namespaceName); + Observable createOrUpdateNetworkRuleSetAsync(String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters); /** - * Deletes an VirtualNetworkRule for a Namespace. + * Gets NetworkRuleSet for a Namespace. * * @param resourceGroupName Name of the resource group within the Azure subscription. * @param namespaceName The Namespace name - * @param virtualNetworkRuleName The Virtual Network Rule name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - Completable deleteVirtualNetworkRuleAsync(String resourceGroupName, String namespaceName, String virtualNetworkRuleName); + Observable getNetworkRuleSetAsync(String resourceGroupName, String namespaceName); } diff --git a/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/implementation/NamespacesImpl.java b/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/implementation/NamespacesImpl.java index eb998743e6491..4c18803ec5d02 100644 --- a/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/implementation/NamespacesImpl.java +++ b/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/implementation/NamespacesImpl.java @@ -22,9 +22,9 @@ import rx.functions.Func1; import com.microsoft.azure.PagedList; import com.microsoft.azure.Page; -import com.microsoft.azure.management.eventhub.v2018_01_01_preview.NetworkRuleSets; import com.microsoft.azure.management.eventhub.v2018_01_01_preview.IpFilterRule; import com.microsoft.azure.management.eventhub.v2018_01_01_preview.VirtualNetworkRule; +import com.microsoft.azure.management.eventhub.v2018_01_01_preview.NetworkRuleSet; class NamespacesImpl extends GroupableResourcesCoreImpl implements Namespaces { protected NamespacesImpl(EventHubManager manager) { @@ -128,30 +128,6 @@ public EHNamespaceImpl define(String name) { return wrapModel(name); } - @Override - public Observable createOrUpdateNetworkRuleSetAsync(String resourceGroupName, String namespaceName, NetworkRuleSetsInner parameters) { - NamespacesInner client = this.inner(); - return client.createOrUpdateNetworkRuleSetAsync(resourceGroupName, namespaceName, parameters) - .map(new Func1() { - @Override - public NetworkRuleSets call(NetworkRuleSetsInner inner) { - return new NetworkRuleSetsImpl(inner, manager()); - } - }); - } - - @Override - public Observable getNetworkRuleSetAsync(String resourceGroupName, String namespaceName) { - NamespacesInner client = this.inner(); - return client.getNetworkRuleSetAsync(resourceGroupName, namespaceName) - .map(new Func1() { - @Override - public NetworkRuleSets call(NetworkRuleSetsInner inner) { - return new NetworkRuleSetsImpl(inner, manager()); - } - }); - } - @Override protected EHNamespaceImpl wrapModel(EHNamespaceInner inner) { return new EHNamespaceImpl(inner.name(), inner, manager()); @@ -276,4 +252,28 @@ public Completable deleteVirtualNetworkRuleAsync(String resourceGroupName, Strin return client.deleteVirtualNetworkRuleAsync(resourceGroupName, namespaceName, virtualNetworkRuleName).toCompletable(); } + @Override + public Observable createOrUpdateNetworkRuleSetAsync(String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters) { + NamespacesInner client = this.inner(); + return client.createOrUpdateNetworkRuleSetAsync(resourceGroupName, namespaceName, parameters) + .map(new Func1() { + @Override + public NetworkRuleSet call(NetworkRuleSetInner inner) { + return new NetworkRuleSetImpl(inner, manager()); + } + }); + } + + @Override + public Observable getNetworkRuleSetAsync(String resourceGroupName, String namespaceName) { + NamespacesInner client = this.inner(); + return client.getNetworkRuleSetAsync(resourceGroupName, namespaceName) + .map(new Func1() { + @Override + public NetworkRuleSet call(NetworkRuleSetInner inner) { + return new NetworkRuleSetImpl(inner, manager()); + } + }); + } + } diff --git a/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/implementation/NamespacesInner.java b/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/implementation/NamespacesInner.java index db886e5bbbe3f..19417d46574aa 100644 --- a/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/implementation/NamespacesInner.java +++ b/eventhub/resource-manager/v2018_01_01_preview/src/main/java/com/microsoft/azure/management/eventhub/v2018_01_01_preview/implementation/NamespacesInner.java @@ -130,11 +130,11 @@ interface NamespacesService { Observable> getVirtualNetworkRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("virtualNetworkRuleName") String virtualNetworkRuleName, @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.eventhub.v2018_01_01_preview.Namespaces createOrUpdateNetworkRuleSet" }) - @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/networkruleset/default") - Observable> createOrUpdateNetworkRuleSet(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body NetworkRuleSetsInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/networkRuleSets/default") + Observable> createOrUpdateNetworkRuleSet(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body NetworkRuleSetInner parameters, @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.eventhub.v2018_01_01_preview.Namespaces getNetworkRuleSet" }) - @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/networkruleset/default") + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/networkRuleSets/default") Observable> getNetworkRuleSet(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventhub.v2018_01_01_preview.Namespaces listNext" }) @@ -1804,9 +1804,9 @@ private ServiceResponse getVirtualNetworkRuleDelegate(R * @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 NetworkRuleSetsInner object if successful. + * @return the NetworkRuleSetInner object if successful. */ - public NetworkRuleSetsInner createOrUpdateNetworkRuleSet(String resourceGroupName, String namespaceName, NetworkRuleSetsInner parameters) { + public NetworkRuleSetInner createOrUpdateNetworkRuleSet(String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters) { return createOrUpdateNetworkRuleSetWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).toBlocking().single().body(); } @@ -1820,7 +1820,7 @@ public NetworkRuleSetsInner createOrUpdateNetworkRuleSet(String resourceGroupNam * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture createOrUpdateNetworkRuleSetAsync(String resourceGroupName, String namespaceName, NetworkRuleSetsInner parameters, final ServiceCallback serviceCallback) { + public ServiceFuture createOrUpdateNetworkRuleSetAsync(String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(createOrUpdateNetworkRuleSetWithServiceResponseAsync(resourceGroupName, namespaceName, parameters), serviceCallback); } @@ -1831,12 +1831,12 @@ public ServiceFuture createOrUpdateNetworkRuleSetAsync(Str * @param namespaceName The Namespace name * @param parameters The Namespace IpFilterRule. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the NetworkRuleSetsInner object + * @return the observable to the NetworkRuleSetInner object */ - public Observable createOrUpdateNetworkRuleSetAsync(String resourceGroupName, String namespaceName, NetworkRuleSetsInner parameters) { - return createOrUpdateNetworkRuleSetWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).map(new Func1, NetworkRuleSetsInner>() { + public Observable createOrUpdateNetworkRuleSetAsync(String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters) { + return createOrUpdateNetworkRuleSetWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).map(new Func1, NetworkRuleSetInner>() { @Override - public NetworkRuleSetsInner call(ServiceResponse response) { + public NetworkRuleSetInner call(ServiceResponse response) { return response.body(); } }); @@ -1849,9 +1849,9 @@ public NetworkRuleSetsInner call(ServiceResponse response) * @param namespaceName The Namespace name * @param parameters The Namespace IpFilterRule. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the NetworkRuleSetsInner object + * @return the observable to the NetworkRuleSetInner object */ - public Observable> createOrUpdateNetworkRuleSetWithServiceResponseAsync(String resourceGroupName, String namespaceName, NetworkRuleSetsInner parameters) { + public Observable> createOrUpdateNetworkRuleSetWithServiceResponseAsync(String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1869,11 +1869,11 @@ public Observable> createOrUpdateNetworkRu } Validator.validate(parameters); return service.createOrUpdateNetworkRuleSet(resourceGroupName, namespaceName, this.client.subscriptionId(), this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = createOrUpdateNetworkRuleSetDelegate(response); + ServiceResponse clientResponse = createOrUpdateNetworkRuleSetDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1882,9 +1882,9 @@ public Observable> call(Response createOrUpdateNetworkRuleSetDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse createOrUpdateNetworkRuleSetDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(ErrorResponseException.class) .build(response); } @@ -1897,9 +1897,9 @@ private ServiceResponse createOrUpdateNetworkRuleSetDelega * @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 NetworkRuleSetsInner object if successful. + * @return the NetworkRuleSetInner object if successful. */ - public NetworkRuleSetsInner getNetworkRuleSet(String resourceGroupName, String namespaceName) { + public NetworkRuleSetInner getNetworkRuleSet(String resourceGroupName, String namespaceName) { return getNetworkRuleSetWithServiceResponseAsync(resourceGroupName, namespaceName).toBlocking().single().body(); } @@ -1912,7 +1912,7 @@ public NetworkRuleSetsInner getNetworkRuleSet(String resourceGroupName, String n * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture getNetworkRuleSetAsync(String resourceGroupName, String namespaceName, final ServiceCallback serviceCallback) { + public ServiceFuture getNetworkRuleSetAsync(String resourceGroupName, String namespaceName, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(getNetworkRuleSetWithServiceResponseAsync(resourceGroupName, namespaceName), serviceCallback); } @@ -1922,12 +1922,12 @@ public ServiceFuture getNetworkRuleSetAsync(String resourc * @param resourceGroupName Name of the resource group within the Azure subscription. * @param namespaceName The Namespace name * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the NetworkRuleSetsInner object + * @return the observable to the NetworkRuleSetInner object */ - public Observable getNetworkRuleSetAsync(String resourceGroupName, String namespaceName) { - return getNetworkRuleSetWithServiceResponseAsync(resourceGroupName, namespaceName).map(new Func1, NetworkRuleSetsInner>() { + public Observable getNetworkRuleSetAsync(String resourceGroupName, String namespaceName) { + return getNetworkRuleSetWithServiceResponseAsync(resourceGroupName, namespaceName).map(new Func1, NetworkRuleSetInner>() { @Override - public NetworkRuleSetsInner call(ServiceResponse response) { + public NetworkRuleSetInner call(ServiceResponse response) { return response.body(); } }); @@ -1939,9 +1939,9 @@ public NetworkRuleSetsInner call(ServiceResponse response) * @param resourceGroupName Name of the resource group within the Azure subscription. * @param namespaceName The Namespace name * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the NetworkRuleSetsInner object + * @return the observable to the NetworkRuleSetInner object */ - public Observable> getNetworkRuleSetWithServiceResponseAsync(String resourceGroupName, String namespaceName) { + public Observable> getNetworkRuleSetWithServiceResponseAsync(String resourceGroupName, String namespaceName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1955,11 +1955,11 @@ public Observable> getNetworkRuleSetWithSe throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } return service.getNetworkRuleSet(resourceGroupName, namespaceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = getNetworkRuleSetDelegate(response); + ServiceResponse clientResponse = getNetworkRuleSetDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1968,9 +1968,9 @@ public Observable> call(Response getNetworkRuleSetDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse getNetworkRuleSetDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(ErrorResponseException.class) .build(response); }