diff --git a/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/VpnConnection.java b/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/VpnConnection.java index 8ec38becb93a..aaddc4fd5823 100644 --- a/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/VpnConnection.java +++ b/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/VpnConnection.java @@ -26,9 +26,9 @@ */ public interface VpnConnection extends HasInner, Indexable, Refreshable, Updatable, HasManager { /** - * @return the connectionBandwidthInMbps value. + * @return the connectionBandwidth value. */ - Integer connectionBandwidthInMbps(); + Integer connectionBandwidth(); /** * @return the connectionStatus value. diff --git a/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/VpnConnections.java b/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/VpnConnections.java index 7e13ff1d563b..698ed08d775f 100644 --- a/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/VpnConnections.java +++ b/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/VpnConnections.java @@ -32,11 +32,12 @@ public interface VpnConnections extends SupportsCreating listByVpnGatewayAsync(final String gatewayName); + Observable listByVpnGatewayAsync(final String resourceGroupName, final String gatewayName); /** * Deletes a vpn connection. diff --git a/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VpnConnectionImpl.java b/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VpnConnectionImpl.java index badeeb2e785a..1e8ced5f9823 100644 --- a/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VpnConnectionImpl.java +++ b/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VpnConnectionImpl.java @@ -76,8 +76,8 @@ public boolean isInCreateMode() { @Override - public Integer connectionBandwidthInMbps() { - return this.inner().connectionBandwidthInMbps(); + public Integer connectionBandwidth() { + return this.inner().connectionBandwidth(); } @Override diff --git a/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VpnConnectionInner.java b/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VpnConnectionInner.java index 4b3e7ea3624e..3e49cc16ef8e 100644 --- a/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VpnConnectionInner.java +++ b/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VpnConnectionInner.java @@ -58,8 +58,8 @@ public class VpnConnectionInner extends Resource { /** * Expected bandwidth in MBPS. */ - @JsonProperty(value = "properties.connectionBandwidthInMbps", access = JsonProperty.Access.WRITE_ONLY) - private Integer connectionBandwidthInMbps; + @JsonProperty(value = "properties.connectionBandwidth", access = JsonProperty.Access.WRITE_ONLY) + private Integer connectionBandwidth; /** * SharedKey for the vpn connection. @@ -180,10 +180,10 @@ public Long egressBytesTransferred() { /** * Get expected bandwidth in MBPS. * - * @return the connectionBandwidthInMbps value + * @return the connectionBandwidth value */ - public Integer connectionBandwidthInMbps() { - return this.connectionBandwidthInMbps; + public Integer connectionBandwidth() { + return this.connectionBandwidth; } /** diff --git a/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VpnConnectionsImpl.java b/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VpnConnectionsImpl.java index c018b93f4165..d43923dc9fd4 100644 --- a/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VpnConnectionsImpl.java +++ b/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VpnConnectionsImpl.java @@ -43,9 +43,9 @@ private VpnConnectionImpl wrapModel(String name) { } @Override - public Observable listByVpnGatewayAsync(final String gatewayName) { + public Observable listByVpnGatewayAsync(final String resourceGroupName, final String gatewayName) { VpnConnectionsInner client = this.inner(); - return client.listByVpnGatewayAsync(gatewayName) + return client.listByVpnGatewayAsync(resourceGroupName, gatewayName) .flatMapIterable(new Func1, Iterable>() { @Override public Iterable call(Page page) { diff --git a/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VpnConnectionsInner.java b/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VpnConnectionsInner.java index ef25d54c8267..96fee0c2e34e 100644 --- a/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VpnConnectionsInner.java +++ b/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VpnConnectionsInner.java @@ -82,8 +82,8 @@ interface VpnConnectionsService { Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Path("connectionName") String connectionName, @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.network.v2018_04_01.VpnConnections listByVpnGateway" }) - @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections") - Observable> listByVpnGateway(@Path("subscriptionId") String subscriptionId, @Path("gatewayName") String gatewayName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections") + Observable> listByVpnGateway(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @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.network.v2018_04_01.VpnConnections listByVpnGatewayNext" }) @GET @@ -532,14 +532,15 @@ private ServiceResponse beginDeleteDelegate(Response respons /** * Retrieves all vpn connections for a particular virtual wan vpn gateway. * + * @param resourceGroupName The resource group name of the VpnGateway. * @param gatewayName The name of the gateway. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorException 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<VpnConnectionInner> object if successful. */ - public PagedList listByVpnGateway(final String gatewayName) { - ServiceResponse> response = listByVpnGatewaySinglePageAsync(gatewayName).toBlocking().single(); + public PagedList listByVpnGateway(final String resourceGroupName, final String gatewayName) { + ServiceResponse> response = listByVpnGatewaySinglePageAsync(resourceGroupName, gatewayName).toBlocking().single(); return new PagedList(response.body()) { @Override public Page nextPage(String nextPageLink) { @@ -551,14 +552,15 @@ public Page nextPage(String nextPageLink) { /** * Retrieves all vpn connections for a particular virtual wan vpn gateway. * + * @param resourceGroupName The resource group name of the VpnGateway. * @param gatewayName The name of the gateway. * @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> listByVpnGatewayAsync(final String gatewayName, final ListOperationCallback serviceCallback) { + public ServiceFuture> listByVpnGatewayAsync(final String resourceGroupName, final String gatewayName, final ListOperationCallback serviceCallback) { return AzureServiceFuture.fromPageResponse( - listByVpnGatewaySinglePageAsync(gatewayName), + listByVpnGatewaySinglePageAsync(resourceGroupName, gatewayName), new Func1>>>() { @Override public Observable>> call(String nextPageLink) { @@ -571,12 +573,13 @@ public Observable>> call(String nextPag /** * Retrieves all vpn connections for a particular virtual wan vpn gateway. * + * @param resourceGroupName The resource group name of the VpnGateway. * @param gatewayName The name of the gateway. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PagedList<VpnConnectionInner> object */ - public Observable> listByVpnGatewayAsync(final String gatewayName) { - return listByVpnGatewayWithServiceResponseAsync(gatewayName) + public Observable> listByVpnGatewayAsync(final String resourceGroupName, final String gatewayName) { + return listByVpnGatewayWithServiceResponseAsync(resourceGroupName, gatewayName) .map(new Func1>, Page>() { @Override public Page call(ServiceResponse> response) { @@ -588,12 +591,13 @@ public Page call(ServiceResponse> r /** * Retrieves all vpn connections for a particular virtual wan vpn gateway. * + * @param resourceGroupName The resource group name of the VpnGateway. * @param gatewayName The name of the gateway. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PagedList<VpnConnectionInner> object */ - public Observable>> listByVpnGatewayWithServiceResponseAsync(final String gatewayName) { - return listByVpnGatewaySinglePageAsync(gatewayName) + public Observable>> listByVpnGatewayWithServiceResponseAsync(final String resourceGroupName, final String gatewayName) { + return listByVpnGatewaySinglePageAsync(resourceGroupName, gatewayName) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { @@ -609,19 +613,23 @@ public Observable>> call(ServiceRespons /** * Retrieves all vpn connections for a particular virtual wan vpn gateway. * + ServiceResponse> * @param resourceGroupName The resource group name of the VpnGateway. ServiceResponse> * @param gatewayName The name of the gateway. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList<VpnConnectionInner> object wrapped in {@link ServiceResponse} if successful. */ - public Observable>> listByVpnGatewaySinglePageAsync(final String gatewayName) { + public Observable>> listByVpnGatewaySinglePageAsync(final String resourceGroupName, final String gatewayName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } if (gatewayName == null) { throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); } final String apiVersion = "2018-04-01"; - return service.listByVpnGateway(this.client.subscriptionId(), gatewayName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + return service.listByVpnGateway(this.client.subscriptionId(), resourceGroupName, gatewayName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { diff --git a/network/resource-manager/v2018_06_01/pom.xml b/network/resource-manager/v2018_06_01/pom.xml new file mode 100644 index 000000000000..3f4d33385d81 --- /dev/null +++ b/network/resource-manager/v2018_06_01/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.network.v2018_06_01 + + com.microsoft.azure + azure-arm-parent + 0.0.2-beta + ../../../pom.xml + + azure-mgmt-network + 1.0.0-beta + jar + Microsoft Azure SDK for Network Management + This package contains Microsoft Network Management SDK. + https://github.com/Azure/azure-libraries-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-libraries-for-java + scm:git:git@github.com:Azure/azure-libraries-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/Access.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/Access.java new file mode 100644 index 000000000000..1d7d3583b2a5 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/Access.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for Access. + */ +public final class Access extends ExpandableStringEnum { + /** Static value Allow for Access. */ + public static final Access ALLOW = fromString("Allow"); + + /** Static value Deny for Access. */ + public static final Access DENY = fromString("Deny"); + + /** + * Creates or finds a Access from its string representation. + * @param name a name to look for + * @return the corresponding Access + */ + @JsonCreator + public static Access fromString(String name) { + return fromString(name, Access.class); + } + + /** + * @return known Access values + */ + public static Collection values() { + return values(Access.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AddressSpace.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AddressSpace.java new file mode 100644 index 000000000000..4f8fbb88d4bf --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AddressSpace.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * AddressSpace contains an array of IP address ranges that can be used by + * subnets of the virtual network. + */ +public class AddressSpace { + /** + * A list of address blocks reserved for this virtual network in CIDR + * notation. + */ + @JsonProperty(value = "addressPrefixes") + private List addressPrefixes; + + /** + * Get a list of address blocks reserved for this virtual network in CIDR notation. + * + * @return the addressPrefixes value + */ + public List addressPrefixes() { + return this.addressPrefixes; + } + + /** + * Set a list of address blocks reserved for this virtual network in CIDR notation. + * + * @param addressPrefixes the addressPrefixes value to set + * @return the AddressSpace object itself. + */ + public AddressSpace withAddressPrefixes(List addressPrefixes) { + this.addressPrefixes = addressPrefixes; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGateway.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGateway.java new file mode 100644 index 000000000000..8be2fe0e81f7 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGateway.java @@ -0,0 +1,624 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.implementation.ApplicationGatewayInner; + +/** + * Type representing ApplicationGateway. + */ +public interface ApplicationGateway extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the authenticationCertificates value. + */ + List authenticationCertificates(); + + /** + * @return the autoscaleConfiguration value. + */ + ApplicationGatewayAutoscaleConfiguration autoscaleConfiguration(); + + /** + * @return the backendAddressPools value. + */ + List backendAddressPools(); + + /** + * @return the backendHttpSettingsCollection value. + */ + List backendHttpSettingsCollection(); + + /** + * @return the enableFips value. + */ + Boolean enableFips(); + + /** + * @return the enableHttp2 value. + */ + Boolean enableHttp2(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the frontendIPConfigurations value. + */ + List frontendIPConfigurations(); + + /** + * @return the frontendPorts value. + */ + List frontendPorts(); + + /** + * @return the gatewayIPConfigurations value. + */ + List gatewayIPConfigurations(); + + /** + * @return the httpListeners value. + */ + List httpListeners(); + + /** + * @return the operationalState value. + */ + ApplicationGatewayOperationalState operationalState(); + + /** + * @return the probes value. + */ + List probes(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the redirectConfigurations value. + */ + List redirectConfigurations(); + + /** + * @return the requestRoutingRules value. + */ + List requestRoutingRules(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * @return the sku value. + */ + ApplicationGatewaySku sku(); + + /** + * @return the sslCertificates value. + */ + List sslCertificates(); + + /** + * @return the sslPolicy value. + */ + ApplicationGatewaySslPolicy sslPolicy(); + + /** + * @return the urlPathMaps value. + */ + List urlPathMaps(); + + /** + * @return the webApplicationFirewallConfiguration value. + */ + ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration(); + + /** + * @return the zones value. + */ + List zones(); + + /** + * The entirety of the ApplicationGateway definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of ApplicationGateway definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ApplicationGateway definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the ApplicationGateway definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the applicationgateway update allowing to specify AuthenticationCertificates. + */ + interface WithAuthenticationCertificates { + /** + * Specifies authenticationCertificates. + */ + WithCreate withAuthenticationCertificates(List authenticationCertificates); + } + + /** + * The stage of the applicationgateway update allowing to specify AutoscaleConfiguration. + */ + interface WithAutoscaleConfiguration { + /** + * Specifies autoscaleConfiguration. + */ + WithCreate withAutoscaleConfiguration(ApplicationGatewayAutoscaleConfiguration autoscaleConfiguration); + } + + /** + * The stage of the applicationgateway update allowing to specify BackendAddressPools. + */ + interface WithBackendAddressPools { + /** + * Specifies backendAddressPools. + */ + WithCreate withBackendAddressPools(List backendAddressPools); + } + + /** + * The stage of the applicationgateway update allowing to specify BackendHttpSettingsCollection. + */ + interface WithBackendHttpSettingsCollection { + /** + * Specifies backendHttpSettingsCollection. + */ + WithCreate withBackendHttpSettingsCollection(List backendHttpSettingsCollection); + } + + /** + * The stage of the applicationgateway update allowing to specify EnableFips. + */ + interface WithEnableFips { + /** + * Specifies enableFips. + */ + WithCreate withEnableFips(Boolean enableFips); + } + + /** + * The stage of the applicationgateway update allowing to specify EnableHttp2. + */ + interface WithEnableHttp2 { + /** + * Specifies enableHttp2. + */ + WithCreate withEnableHttp2(Boolean enableHttp2); + } + + /** + * The stage of the applicationgateway update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the applicationgateway update allowing to specify FrontendIPConfigurations. + */ + interface WithFrontendIPConfigurations { + /** + * Specifies frontendIPConfigurations. + */ + WithCreate withFrontendIPConfigurations(List frontendIPConfigurations); + } + + /** + * The stage of the applicationgateway update allowing to specify FrontendPorts. + */ + interface WithFrontendPorts { + /** + * Specifies frontendPorts. + */ + WithCreate withFrontendPorts(List frontendPorts); + } + + /** + * The stage of the applicationgateway update allowing to specify GatewayIPConfigurations. + */ + interface WithGatewayIPConfigurations { + /** + * Specifies gatewayIPConfigurations. + */ + WithCreate withGatewayIPConfigurations(List gatewayIPConfigurations); + } + + /** + * The stage of the applicationgateway update allowing to specify HttpListeners. + */ + interface WithHttpListeners { + /** + * Specifies httpListeners. + */ + WithCreate withHttpListeners(List httpListeners); + } + + /** + * The stage of the applicationgateway update allowing to specify Probes. + */ + interface WithProbes { + /** + * Specifies probes. + */ + WithCreate withProbes(List probes); + } + + /** + * The stage of the applicationgateway update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the applicationgateway update allowing to specify RedirectConfigurations. + */ + interface WithRedirectConfigurations { + /** + * Specifies redirectConfigurations. + */ + WithCreate withRedirectConfigurations(List redirectConfigurations); + } + + /** + * The stage of the applicationgateway update allowing to specify RequestRoutingRules. + */ + interface WithRequestRoutingRules { + /** + * Specifies requestRoutingRules. + */ + WithCreate withRequestRoutingRules(List requestRoutingRules); + } + + /** + * The stage of the applicationgateway update allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + */ + WithCreate withResourceGuid(String resourceGuid); + } + + /** + * The stage of the applicationgateway update allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + */ + WithCreate withSku(ApplicationGatewaySku sku); + } + + /** + * The stage of the applicationgateway update allowing to specify SslCertificates. + */ + interface WithSslCertificates { + /** + * Specifies sslCertificates. + */ + WithCreate withSslCertificates(List sslCertificates); + } + + /** + * The stage of the applicationgateway update allowing to specify SslPolicy. + */ + interface WithSslPolicy { + /** + * Specifies sslPolicy. + */ + WithCreate withSslPolicy(ApplicationGatewaySslPolicy sslPolicy); + } + + /** + * The stage of the applicationgateway update allowing to specify UrlPathMaps. + */ + interface WithUrlPathMaps { + /** + * Specifies urlPathMaps. + */ + WithCreate withUrlPathMaps(List urlPathMaps); + } + + /** + * The stage of the applicationgateway update allowing to specify WebApplicationFirewallConfiguration. + */ + interface WithWebApplicationFirewallConfiguration { + /** + * Specifies webApplicationFirewallConfiguration. + */ + WithCreate withWebApplicationFirewallConfiguration(ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration); + } + + /** + * The stage of the applicationgateway update allowing to specify Zones. + */ + interface WithZones { + /** + * Specifies zones. + */ + WithCreate withZones(List zones); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithAuthenticationCertificates, DefinitionStages.WithAutoscaleConfiguration, DefinitionStages.WithBackendAddressPools, DefinitionStages.WithBackendHttpSettingsCollection, DefinitionStages.WithEnableFips, DefinitionStages.WithEnableHttp2, DefinitionStages.WithEtag, DefinitionStages.WithFrontendIPConfigurations, DefinitionStages.WithFrontendPorts, DefinitionStages.WithGatewayIPConfigurations, DefinitionStages.WithHttpListeners, DefinitionStages.WithProbes, DefinitionStages.WithProvisioningState, DefinitionStages.WithRedirectConfigurations, DefinitionStages.WithRequestRoutingRules, DefinitionStages.WithResourceGuid, DefinitionStages.WithSku, DefinitionStages.WithSslCertificates, DefinitionStages.WithSslPolicy, DefinitionStages.WithUrlPathMaps, DefinitionStages.WithWebApplicationFirewallConfiguration, DefinitionStages.WithZones { + } + } + /** + * The template for a ApplicationGateway update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithAuthenticationCertificates, UpdateStages.WithAutoscaleConfiguration, UpdateStages.WithBackendAddressPools, UpdateStages.WithBackendHttpSettingsCollection, UpdateStages.WithEnableFips, UpdateStages.WithEnableHttp2, UpdateStages.WithEtag, UpdateStages.WithFrontendIPConfigurations, UpdateStages.WithFrontendPorts, UpdateStages.WithGatewayIPConfigurations, UpdateStages.WithHttpListeners, UpdateStages.WithProbes, UpdateStages.WithProvisioningState, UpdateStages.WithRedirectConfigurations, UpdateStages.WithRequestRoutingRules, UpdateStages.WithResourceGuid, UpdateStages.WithSku, UpdateStages.WithSslCertificates, UpdateStages.WithSslPolicy, UpdateStages.WithUrlPathMaps, UpdateStages.WithWebApplicationFirewallConfiguration, UpdateStages.WithZones { + } + + /** + * Grouping of ApplicationGateway update stages. + */ + interface UpdateStages { + /** + * The stage of the applicationgateway {0} allowing to specify AuthenticationCertificates. + */ + interface WithAuthenticationCertificates { + /** + * Specifies authenticationCertificates. + */ + Update withAuthenticationCertificates(List authenticationCertificates); + } + + /** + * The stage of the applicationgateway {0} allowing to specify AutoscaleConfiguration. + */ + interface WithAutoscaleConfiguration { + /** + * Specifies autoscaleConfiguration. + */ + Update withAutoscaleConfiguration(ApplicationGatewayAutoscaleConfiguration autoscaleConfiguration); + } + + /** + * The stage of the applicationgateway {0} allowing to specify BackendAddressPools. + */ + interface WithBackendAddressPools { + /** + * Specifies backendAddressPools. + */ + Update withBackendAddressPools(List backendAddressPools); + } + + /** + * The stage of the applicationgateway {0} allowing to specify BackendHttpSettingsCollection. + */ + interface WithBackendHttpSettingsCollection { + /** + * Specifies backendHttpSettingsCollection. + */ + Update withBackendHttpSettingsCollection(List backendHttpSettingsCollection); + } + + /** + * The stage of the applicationgateway {0} allowing to specify EnableFips. + */ + interface WithEnableFips { + /** + * Specifies enableFips. + */ + Update withEnableFips(Boolean enableFips); + } + + /** + * The stage of the applicationgateway {0} allowing to specify EnableHttp2. + */ + interface WithEnableHttp2 { + /** + * Specifies enableHttp2. + */ + Update withEnableHttp2(Boolean enableHttp2); + } + + /** + * The stage of the applicationgateway {0} allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + */ + Update withEtag(String etag); + } + + /** + * The stage of the applicationgateway {0} allowing to specify FrontendIPConfigurations. + */ + interface WithFrontendIPConfigurations { + /** + * Specifies frontendIPConfigurations. + */ + Update withFrontendIPConfigurations(List frontendIPConfigurations); + } + + /** + * The stage of the applicationgateway {0} allowing to specify FrontendPorts. + */ + interface WithFrontendPorts { + /** + * Specifies frontendPorts. + */ + Update withFrontendPorts(List frontendPorts); + } + + /** + * The stage of the applicationgateway {0} allowing to specify GatewayIPConfigurations. + */ + interface WithGatewayIPConfigurations { + /** + * Specifies gatewayIPConfigurations. + */ + Update withGatewayIPConfigurations(List gatewayIPConfigurations); + } + + /** + * The stage of the applicationgateway {0} allowing to specify HttpListeners. + */ + interface WithHttpListeners { + /** + * Specifies httpListeners. + */ + Update withHttpListeners(List httpListeners); + } + + /** + * The stage of the applicationgateway {0} allowing to specify Probes. + */ + interface WithProbes { + /** + * Specifies probes. + */ + Update withProbes(List probes); + } + + /** + * The stage of the applicationgateway {0} allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + */ + Update withProvisioningState(String provisioningState); + } + + /** + * The stage of the applicationgateway {0} allowing to specify RedirectConfigurations. + */ + interface WithRedirectConfigurations { + /** + * Specifies redirectConfigurations. + */ + Update withRedirectConfigurations(List redirectConfigurations); + } + + /** + * The stage of the applicationgateway {0} allowing to specify RequestRoutingRules. + */ + interface WithRequestRoutingRules { + /** + * Specifies requestRoutingRules. + */ + Update withRequestRoutingRules(List requestRoutingRules); + } + + /** + * The stage of the applicationgateway {0} allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + */ + Update withResourceGuid(String resourceGuid); + } + + /** + * The stage of the applicationgateway {0} allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + */ + Update withSku(ApplicationGatewaySku sku); + } + + /** + * The stage of the applicationgateway {0} allowing to specify SslCertificates. + */ + interface WithSslCertificates { + /** + * Specifies sslCertificates. + */ + Update withSslCertificates(List sslCertificates); + } + + /** + * The stage of the applicationgateway {0} allowing to specify SslPolicy. + */ + interface WithSslPolicy { + /** + * Specifies sslPolicy. + */ + Update withSslPolicy(ApplicationGatewaySslPolicy sslPolicy); + } + + /** + * The stage of the applicationgateway {0} allowing to specify UrlPathMaps. + */ + interface WithUrlPathMaps { + /** + * Specifies urlPathMaps. + */ + Update withUrlPathMaps(List urlPathMaps); + } + + /** + * The stage of the applicationgateway {0} allowing to specify WebApplicationFirewallConfiguration. + */ + interface WithWebApplicationFirewallConfiguration { + /** + * Specifies webApplicationFirewallConfiguration. + */ + Update withWebApplicationFirewallConfiguration(ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration); + } + + /** + * The stage of the applicationgateway {0} allowing to specify Zones. + */ + interface WithZones { + /** + * Specifies zones. + */ + Update withZones(List zones); + } + + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayAuthenticationCertificate.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayAuthenticationCertificate.java new file mode 100644 index 000000000000..256308ee6fa6 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayAuthenticationCertificate.java @@ -0,0 +1,152 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Authentication certificates of an application gateway. + */ +@JsonFlatten +public class ApplicationGatewayAuthenticationCertificate extends SubResource { + /** + * Certificate public data. + */ + @JsonProperty(value = "properties.data") + private String data; + + /** + * Provisioning state of the authentication certificate resource. Possible + * values are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Name of the authentication certificate that is unique within an + * Application Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get certificate public data. + * + * @return the data value + */ + public String data() { + return this.data; + } + + /** + * Set certificate public data. + * + * @param data the data value to set + * @return the ApplicationGatewayAuthenticationCertificate object itself. + */ + public ApplicationGatewayAuthenticationCertificate withData(String data) { + this.data = data; + return this; + } + + /** + * Get provisioning state of the authentication certificate resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the authentication certificate resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ApplicationGatewayAuthenticationCertificate object itself. + */ + public ApplicationGatewayAuthenticationCertificate withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get name of the authentication certificate that is unique within an Application Gateway. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the authentication certificate that is unique within an Application Gateway. + * + * @param name the name value to set + * @return the ApplicationGatewayAuthenticationCertificate object itself. + */ + public ApplicationGatewayAuthenticationCertificate withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ApplicationGatewayAuthenticationCertificate object itself. + */ + public ApplicationGatewayAuthenticationCertificate withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set type of the resource. + * + * @param type the type value to set + * @return the ApplicationGatewayAuthenticationCertificate object itself. + */ + public ApplicationGatewayAuthenticationCertificate withType(String type) { + this.type = type; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayAutoscaleBounds.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayAutoscaleBounds.java new file mode 100644 index 000000000000..f671876a392d --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayAutoscaleBounds.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.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Application Gateway autoscale bounds on number of Application Gateway + * instance. + */ +public class ApplicationGatewayAutoscaleBounds { + /** + * Lower bound on number of Application Gateway instances. + */ + @JsonProperty(value = "min", required = true) + private int min; + + /** + * Upper bound on number of Application Gateway instances. + */ + @JsonProperty(value = "max", required = true) + private int max; + + /** + * Get lower bound on number of Application Gateway instances. + * + * @return the min value + */ + public int min() { + return this.min; + } + + /** + * Set lower bound on number of Application Gateway instances. + * + * @param min the min value to set + * @return the ApplicationGatewayAutoscaleBounds object itself. + */ + public ApplicationGatewayAutoscaleBounds withMin(int min) { + this.min = min; + return this; + } + + /** + * Get upper bound on number of Application Gateway instances. + * + * @return the max value + */ + public int max() { + return this.max; + } + + /** + * Set upper bound on number of Application Gateway instances. + * + * @param max the max value to set + * @return the ApplicationGatewayAutoscaleBounds object itself. + */ + public ApplicationGatewayAutoscaleBounds withMax(int max) { + this.max = max; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayAutoscaleConfiguration.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayAutoscaleConfiguration.java new file mode 100644 index 000000000000..14904eea419f --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayAutoscaleConfiguration.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.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Application Gateway autoscale configuration. + */ +public class ApplicationGatewayAutoscaleConfiguration { + /** + * Autoscale bounds. + */ + @JsonProperty(value = "bounds", required = true) + private ApplicationGatewayAutoscaleBounds bounds; + + /** + * Get autoscale bounds. + * + * @return the bounds value + */ + public ApplicationGatewayAutoscaleBounds bounds() { + return this.bounds; + } + + /** + * Set autoscale bounds. + * + * @param bounds the bounds value to set + * @return the ApplicationGatewayAutoscaleConfiguration object itself. + */ + public ApplicationGatewayAutoscaleConfiguration withBounds(ApplicationGatewayAutoscaleBounds bounds) { + this.bounds = bounds; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayAvailableSslOptions.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayAvailableSslOptions.java new file mode 100644 index 000000000000..f1ecfe471af1 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayAvailableSslOptions.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.ApplicationGatewayAvailableSslOptionsInner; +import java.util.List; +import com.microsoft.azure.SubResource; +import java.util.Map; + +/** + * Type representing ApplicationGatewayAvailableSslOptions. + */ +public interface ApplicationGatewayAvailableSslOptions extends HasInner, HasManager { + /** + * @return the availableCipherSuites value. + */ + List availableCipherSuites(); + + /** + * @return the availableProtocols value. + */ + List availableProtocols(); + + /** + * @return the defaultPolicy value. + */ + ApplicationGatewaySslPolicyName defaultPolicy(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the predefinedPolicies value. + */ + List predefinedPolicies(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayAvailableWafRuleSetsResult.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayAvailableWafRuleSetsResult.java new file mode 100644 index 000000000000..56722b9f390f --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayAvailableWafRuleSetsResult.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.ApplicationGatewayAvailableWafRuleSetsResultInner; +import java.util.List; + +/** + * Type representing ApplicationGatewayAvailableWafRuleSetsResult. + */ +public interface ApplicationGatewayAvailableWafRuleSetsResult extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayBackendAddress.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayBackendAddress.java new file mode 100644 index 000000000000..96e14e62a819 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayBackendAddress.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.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Backend address of an application gateway. + */ +public class ApplicationGatewayBackendAddress { + /** + * Fully qualified domain name (FQDN). + */ + @JsonProperty(value = "fqdn") + private String fqdn; + + /** + * IP address. + */ + @JsonProperty(value = "ipAddress") + private String ipAddress; + + /** + * Get fully qualified domain name (FQDN). + * + * @return the fqdn value + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Set fully qualified domain name (FQDN). + * + * @param fqdn the fqdn value to set + * @return the ApplicationGatewayBackendAddress object itself. + */ + public ApplicationGatewayBackendAddress withFqdn(String fqdn) { + this.fqdn = fqdn; + return this; + } + + /** + * Get iP address. + * + * @return the ipAddress value + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Set iP address. + * + * @param ipAddress the ipAddress value to set + * @return the ApplicationGatewayBackendAddress object itself. + */ + public ApplicationGatewayBackendAddress withIpAddress(String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayBackendAddressPool.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayBackendAddressPool.java new file mode 100644 index 000000000000..1788b3259080 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayBackendAddressPool.java @@ -0,0 +1,180 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkInterfaceIPConfigurationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Backend Address Pool of an application gateway. + */ +@JsonFlatten +public class ApplicationGatewayBackendAddressPool extends SubResource { + /** + * Collection of references to IPs defined in network interfaces. + */ + @JsonProperty(value = "properties.backendIPConfigurations") + private List backendIPConfigurations; + + /** + * Backend addresses. + */ + @JsonProperty(value = "properties.backendAddresses") + private List backendAddresses; + + /** + * Provisioning state of the backend address pool resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Name of the backend address pool that is unique within an Application + * Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get collection of references to IPs defined in network interfaces. + * + * @return the backendIPConfigurations value + */ + public List backendIPConfigurations() { + return this.backendIPConfigurations; + } + + /** + * Set collection of references to IPs defined in network interfaces. + * + * @param backendIPConfigurations the backendIPConfigurations value to set + * @return the ApplicationGatewayBackendAddressPool object itself. + */ + public ApplicationGatewayBackendAddressPool withBackendIPConfigurations(List backendIPConfigurations) { + this.backendIPConfigurations = backendIPConfigurations; + return this; + } + + /** + * Get backend addresses. + * + * @return the backendAddresses value + */ + public List backendAddresses() { + return this.backendAddresses; + } + + /** + * Set backend addresses. + * + * @param backendAddresses the backendAddresses value to set + * @return the ApplicationGatewayBackendAddressPool object itself. + */ + public ApplicationGatewayBackendAddressPool withBackendAddresses(List backendAddresses) { + this.backendAddresses = backendAddresses; + return this; + } + + /** + * Get provisioning state of the backend address pool resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the backend address pool resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ApplicationGatewayBackendAddressPool object itself. + */ + public ApplicationGatewayBackendAddressPool withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get name of the backend address pool that is unique within an Application Gateway. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the backend address pool that is unique within an Application Gateway. + * + * @param name the name value to set + * @return the ApplicationGatewayBackendAddressPool object itself. + */ + public ApplicationGatewayBackendAddressPool withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ApplicationGatewayBackendAddressPool object itself. + */ + public ApplicationGatewayBackendAddressPool withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set type of the resource. + * + * @param type the type value to set + * @return the ApplicationGatewayBackendAddressPool object itself. + */ + public ApplicationGatewayBackendAddressPool withType(String type) { + this.type = type; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayBackendHealth.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayBackendHealth.java new file mode 100644 index 000000000000..a7d82ba4477c --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayBackendHealth.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.ApplicationGatewayBackendHealthInner; +import java.util.List; + +/** + * Type representing ApplicationGatewayBackendHealth. + */ +public interface ApplicationGatewayBackendHealth extends HasInner, HasManager { + /** + * @return the backendAddressPools value. + */ + List backendAddressPools(); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayBackendHealthHttpSettings.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayBackendHealthHttpSettings.java new file mode 100644 index 000000000000..e122c7d3bb62 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayBackendHealthHttpSettings.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.network.v2018_06_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Application gateway BackendHealthHttp settings. + */ +public class ApplicationGatewayBackendHealthHttpSettings { + /** + * Reference of an ApplicationGatewayBackendHttpSettings resource. + */ + @JsonProperty(value = "backendHttpSettings") + private ApplicationGatewayBackendHttpSettings backendHttpSettings; + + /** + * List of ApplicationGatewayBackendHealthServer resources. + */ + @JsonProperty(value = "servers") + private List servers; + + /** + * Get reference of an ApplicationGatewayBackendHttpSettings resource. + * + * @return the backendHttpSettings value + */ + public ApplicationGatewayBackendHttpSettings backendHttpSettings() { + return this.backendHttpSettings; + } + + /** + * Set reference of an ApplicationGatewayBackendHttpSettings resource. + * + * @param backendHttpSettings the backendHttpSettings value to set + * @return the ApplicationGatewayBackendHealthHttpSettings object itself. + */ + public ApplicationGatewayBackendHealthHttpSettings withBackendHttpSettings(ApplicationGatewayBackendHttpSettings backendHttpSettings) { + this.backendHttpSettings = backendHttpSettings; + return this; + } + + /** + * Get list of ApplicationGatewayBackendHealthServer resources. + * + * @return the servers value + */ + public List servers() { + return this.servers; + } + + /** + * Set list of ApplicationGatewayBackendHealthServer resources. + * + * @param servers the servers value to set + * @return the ApplicationGatewayBackendHealthHttpSettings object itself. + */ + public ApplicationGatewayBackendHealthHttpSettings withServers(List servers) { + this.servers = servers; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayBackendHealthPool.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayBackendHealthPool.java new file mode 100644 index 000000000000..62cba4e13c4a --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayBackendHealthPool.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.network.v2018_06_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Application gateway BackendHealth pool. + */ +public class ApplicationGatewayBackendHealthPool { + /** + * Reference of an ApplicationGatewayBackendAddressPool resource. + */ + @JsonProperty(value = "backendAddressPool") + private ApplicationGatewayBackendAddressPool backendAddressPool; + + /** + * List of ApplicationGatewayBackendHealthHttpSettings resources. + */ + @JsonProperty(value = "backendHttpSettingsCollection") + private List backendHttpSettingsCollection; + + /** + * Get reference of an ApplicationGatewayBackendAddressPool resource. + * + * @return the backendAddressPool value + */ + public ApplicationGatewayBackendAddressPool backendAddressPool() { + return this.backendAddressPool; + } + + /** + * Set reference of an ApplicationGatewayBackendAddressPool resource. + * + * @param backendAddressPool the backendAddressPool value to set + * @return the ApplicationGatewayBackendHealthPool object itself. + */ + public ApplicationGatewayBackendHealthPool withBackendAddressPool(ApplicationGatewayBackendAddressPool backendAddressPool) { + this.backendAddressPool = backendAddressPool; + return this; + } + + /** + * Get list of ApplicationGatewayBackendHealthHttpSettings resources. + * + * @return the backendHttpSettingsCollection value + */ + public List backendHttpSettingsCollection() { + return this.backendHttpSettingsCollection; + } + + /** + * Set list of ApplicationGatewayBackendHealthHttpSettings resources. + * + * @param backendHttpSettingsCollection the backendHttpSettingsCollection value to set + * @return the ApplicationGatewayBackendHealthPool object itself. + */ + public ApplicationGatewayBackendHealthPool withBackendHttpSettingsCollection(List backendHttpSettingsCollection) { + this.backendHttpSettingsCollection = backendHttpSettingsCollection; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayBackendHealthServer.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayBackendHealthServer.java new file mode 100644 index 000000000000..aa02b4e6cac0 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayBackendHealthServer.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkInterfaceIPConfigurationInner; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Application gateway backendhealth http settings. + */ +public class ApplicationGatewayBackendHealthServer { + /** + * IP address or FQDN of backend server. + */ + @JsonProperty(value = "address") + private String address; + + /** + * Reference of IP configuration of backend server. + */ + @JsonProperty(value = "ipConfiguration") + private NetworkInterfaceIPConfigurationInner ipConfiguration; + + /** + * Health of backend server. Possible values include: 'Unknown', 'Up', + * 'Down', 'Partial', 'Draining'. + */ + @JsonProperty(value = "health") + private ApplicationGatewayBackendHealthServerHealth health; + + /** + * Get iP address or FQDN of backend server. + * + * @return the address value + */ + public String address() { + return this.address; + } + + /** + * Set iP address or FQDN of backend server. + * + * @param address the address value to set + * @return the ApplicationGatewayBackendHealthServer object itself. + */ + public ApplicationGatewayBackendHealthServer withAddress(String address) { + this.address = address; + return this; + } + + /** + * Get reference of IP configuration of backend server. + * + * @return the ipConfiguration value + */ + public NetworkInterfaceIPConfigurationInner ipConfiguration() { + return this.ipConfiguration; + } + + /** + * Set reference of IP configuration of backend server. + * + * @param ipConfiguration the ipConfiguration value to set + * @return the ApplicationGatewayBackendHealthServer object itself. + */ + public ApplicationGatewayBackendHealthServer withIpConfiguration(NetworkInterfaceIPConfigurationInner ipConfiguration) { + this.ipConfiguration = ipConfiguration; + return this; + } + + /** + * Get health of backend server. Possible values include: 'Unknown', 'Up', 'Down', 'Partial', 'Draining'. + * + * @return the health value + */ + public ApplicationGatewayBackendHealthServerHealth health() { + return this.health; + } + + /** + * Set health of backend server. Possible values include: 'Unknown', 'Up', 'Down', 'Partial', 'Draining'. + * + * @param health the health value to set + * @return the ApplicationGatewayBackendHealthServer object itself. + */ + public ApplicationGatewayBackendHealthServer withHealth(ApplicationGatewayBackendHealthServerHealth health) { + this.health = health; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayBackendHealthServerHealth.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayBackendHealthServerHealth.java new file mode 100644 index 000000000000..b2f841dc7a25 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayBackendHealthServerHealth.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ApplicationGatewayBackendHealthServerHealth. + */ +public final class ApplicationGatewayBackendHealthServerHealth extends ExpandableStringEnum { + /** Static value Unknown for ApplicationGatewayBackendHealthServerHealth. */ + public static final ApplicationGatewayBackendHealthServerHealth UNKNOWN = fromString("Unknown"); + + /** Static value Up for ApplicationGatewayBackendHealthServerHealth. */ + public static final ApplicationGatewayBackendHealthServerHealth UP = fromString("Up"); + + /** Static value Down for ApplicationGatewayBackendHealthServerHealth. */ + public static final ApplicationGatewayBackendHealthServerHealth DOWN = fromString("Down"); + + /** Static value Partial for ApplicationGatewayBackendHealthServerHealth. */ + public static final ApplicationGatewayBackendHealthServerHealth PARTIAL = fromString("Partial"); + + /** Static value Draining for ApplicationGatewayBackendHealthServerHealth. */ + public static final ApplicationGatewayBackendHealthServerHealth DRAINING = fromString("Draining"); + + /** + * Creates or finds a ApplicationGatewayBackendHealthServerHealth from its string representation. + * @param name a name to look for + * @return the corresponding ApplicationGatewayBackendHealthServerHealth + */ + @JsonCreator + public static ApplicationGatewayBackendHealthServerHealth fromString(String name) { + return fromString(name, ApplicationGatewayBackendHealthServerHealth.class); + } + + /** + * @return known ApplicationGatewayBackendHealthServerHealth values + */ + public static Collection values() { + return values(ApplicationGatewayBackendHealthServerHealth.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayBackendHttpSettings.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayBackendHttpSettings.java new file mode 100644 index 000000000000..3f2230875d9e --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayBackendHttpSettings.java @@ -0,0 +1,444 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.SubResource; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Backend address pool settings of an application gateway. + */ +@JsonFlatten +public class ApplicationGatewayBackendHttpSettings extends SubResource { + /** + * The destination port on the backend. + */ + @JsonProperty(value = "properties.port") + private Integer port; + + /** + * The protocol used to communicate with the backend. Possible values are + * 'Http' and 'Https'. Possible values include: 'Http', 'Https'. + */ + @JsonProperty(value = "properties.protocol") + private ApplicationGatewayProtocol protocol; + + /** + * Cookie based affinity. Possible values include: 'Enabled', 'Disabled'. + */ + @JsonProperty(value = "properties.cookieBasedAffinity") + private ApplicationGatewayCookieBasedAffinity cookieBasedAffinity; + + /** + * Request timeout in seconds. Application Gateway will fail the request if + * response is not received within RequestTimeout. Acceptable values are + * from 1 second to 86400 seconds. + */ + @JsonProperty(value = "properties.requestTimeout") + private Integer requestTimeout; + + /** + * Probe resource of an application gateway. + */ + @JsonProperty(value = "properties.probe") + private SubResource probe; + + /** + * Array of references to application gateway authentication certificates. + */ + @JsonProperty(value = "properties.authenticationCertificates") + private List authenticationCertificates; + + /** + * Connection draining of the backend http settings resource. + */ + @JsonProperty(value = "properties.connectionDraining") + private ApplicationGatewayConnectionDraining connectionDraining; + + /** + * Host header to be sent to the backend servers. + */ + @JsonProperty(value = "properties.hostName") + private String hostName; + + /** + * Whether to pick host header should be picked from the host name of the + * backend server. Default value is false. + */ + @JsonProperty(value = "properties.pickHostNameFromBackendAddress") + private Boolean pickHostNameFromBackendAddress; + + /** + * Cookie name to use for the affinity cookie. + */ + @JsonProperty(value = "properties.affinityCookieName") + private String affinityCookieName; + + /** + * Whether the probe is enabled. Default value is false. + */ + @JsonProperty(value = "properties.probeEnabled") + private Boolean probeEnabled; + + /** + * Path which should be used as a prefix for all HTTP requests. Null means + * no path will be prefixed. Default value is null. + */ + @JsonProperty(value = "properties.path") + private String path; + + /** + * Provisioning state of the backend http settings resource. Possible + * values are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Name of the backend http settings that is unique within an Application + * Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get the destination port on the backend. + * + * @return the port value + */ + public Integer port() { + return this.port; + } + + /** + * Set the destination port on the backend. + * + * @param port the port value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withPort(Integer port) { + this.port = port; + return this; + } + + /** + * Get the protocol used to communicate with the backend. Possible values are 'Http' and 'Https'. Possible values include: 'Http', 'Https'. + * + * @return the protocol value + */ + public ApplicationGatewayProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol used to communicate with the backend. Possible values are 'Http' and 'Https'. Possible values include: 'Http', 'Https'. + * + * @param protocol the protocol value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withProtocol(ApplicationGatewayProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get cookie based affinity. Possible values include: 'Enabled', 'Disabled'. + * + * @return the cookieBasedAffinity value + */ + public ApplicationGatewayCookieBasedAffinity cookieBasedAffinity() { + return this.cookieBasedAffinity; + } + + /** + * Set cookie based affinity. Possible values include: 'Enabled', 'Disabled'. + * + * @param cookieBasedAffinity the cookieBasedAffinity value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withCookieBasedAffinity(ApplicationGatewayCookieBasedAffinity cookieBasedAffinity) { + this.cookieBasedAffinity = cookieBasedAffinity; + return this; + } + + /** + * Get request timeout in seconds. Application Gateway will fail the request if response is not received within RequestTimeout. Acceptable values are from 1 second to 86400 seconds. + * + * @return the requestTimeout value + */ + public Integer requestTimeout() { + return this.requestTimeout; + } + + /** + * Set request timeout in seconds. Application Gateway will fail the request if response is not received within RequestTimeout. Acceptable values are from 1 second to 86400 seconds. + * + * @param requestTimeout the requestTimeout value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withRequestTimeout(Integer requestTimeout) { + this.requestTimeout = requestTimeout; + return this; + } + + /** + * Get probe resource of an application gateway. + * + * @return the probe value + */ + public SubResource probe() { + return this.probe; + } + + /** + * Set probe resource of an application gateway. + * + * @param probe the probe value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withProbe(SubResource probe) { + this.probe = probe; + return this; + } + + /** + * Get array of references to application gateway authentication certificates. + * + * @return the authenticationCertificates value + */ + public List authenticationCertificates() { + return this.authenticationCertificates; + } + + /** + * Set array of references to application gateway authentication certificates. + * + * @param authenticationCertificates the authenticationCertificates value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withAuthenticationCertificates(List authenticationCertificates) { + this.authenticationCertificates = authenticationCertificates; + return this; + } + + /** + * Get connection draining of the backend http settings resource. + * + * @return the connectionDraining value + */ + public ApplicationGatewayConnectionDraining connectionDraining() { + return this.connectionDraining; + } + + /** + * Set connection draining of the backend http settings resource. + * + * @param connectionDraining the connectionDraining value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withConnectionDraining(ApplicationGatewayConnectionDraining connectionDraining) { + this.connectionDraining = connectionDraining; + return this; + } + + /** + * Get host header to be sent to the backend servers. + * + * @return the hostName value + */ + public String hostName() { + return this.hostName; + } + + /** + * Set host header to be sent to the backend servers. + * + * @param hostName the hostName value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withHostName(String hostName) { + this.hostName = hostName; + return this; + } + + /** + * Get whether to pick host header should be picked from the host name of the backend server. Default value is false. + * + * @return the pickHostNameFromBackendAddress value + */ + public Boolean pickHostNameFromBackendAddress() { + return this.pickHostNameFromBackendAddress; + } + + /** + * Set whether to pick host header should be picked from the host name of the backend server. Default value is false. + * + * @param pickHostNameFromBackendAddress the pickHostNameFromBackendAddress value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withPickHostNameFromBackendAddress(Boolean pickHostNameFromBackendAddress) { + this.pickHostNameFromBackendAddress = pickHostNameFromBackendAddress; + return this; + } + + /** + * Get cookie name to use for the affinity cookie. + * + * @return the affinityCookieName value + */ + public String affinityCookieName() { + return this.affinityCookieName; + } + + /** + * Set cookie name to use for the affinity cookie. + * + * @param affinityCookieName the affinityCookieName value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withAffinityCookieName(String affinityCookieName) { + this.affinityCookieName = affinityCookieName; + return this; + } + + /** + * Get whether the probe is enabled. Default value is false. + * + * @return the probeEnabled value + */ + public Boolean probeEnabled() { + return this.probeEnabled; + } + + /** + * Set whether the probe is enabled. Default value is false. + * + * @param probeEnabled the probeEnabled value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withProbeEnabled(Boolean probeEnabled) { + this.probeEnabled = probeEnabled; + return this; + } + + /** + * Get path which should be used as a prefix for all HTTP requests. Null means no path will be prefixed. Default value is null. + * + * @return the path value + */ + public String path() { + return this.path; + } + + /** + * Set path which should be used as a prefix for all HTTP requests. Null means no path will be prefixed. Default value is null. + * + * @param path the path value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withPath(String path) { + this.path = path; + return this; + } + + /** + * Get provisioning state of the backend http settings resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the backend http settings resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get name of the backend http settings that is unique within an Application Gateway. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the backend http settings that is unique within an Application Gateway. + * + * @param name the name value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set type of the resource. + * + * @param type the type value to set + * @return the ApplicationGatewayBackendHttpSettings object itself. + */ + public ApplicationGatewayBackendHttpSettings withType(String type) { + this.type = type; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayConnectionDraining.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayConnectionDraining.java new file mode 100644 index 000000000000..35d7a988f11d --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayConnectionDraining.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.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Connection draining allows open connections to a backend server to be active + * for a specified time after the backend server got removed from the + * configuration. + */ +public class ApplicationGatewayConnectionDraining { + /** + * Whether connection draining is enabled or not. + */ + @JsonProperty(value = "enabled", required = true) + private boolean enabled; + + /** + * The number of seconds connection draining is active. Acceptable values + * are from 1 second to 3600 seconds. + */ + @JsonProperty(value = "drainTimeoutInSec", required = true) + private int drainTimeoutInSec; + + /** + * Get whether connection draining is enabled or not. + * + * @return the enabled value + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set whether connection draining is enabled or not. + * + * @param enabled the enabled value to set + * @return the ApplicationGatewayConnectionDraining object itself. + */ + public ApplicationGatewayConnectionDraining withEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the number of seconds connection draining is active. Acceptable values are from 1 second to 3600 seconds. + * + * @return the drainTimeoutInSec value + */ + public int drainTimeoutInSec() { + return this.drainTimeoutInSec; + } + + /** + * Set the number of seconds connection draining is active. Acceptable values are from 1 second to 3600 seconds. + * + * @param drainTimeoutInSec the drainTimeoutInSec value to set + * @return the ApplicationGatewayConnectionDraining object itself. + */ + public ApplicationGatewayConnectionDraining withDrainTimeoutInSec(int drainTimeoutInSec) { + this.drainTimeoutInSec = drainTimeoutInSec; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayCookieBasedAffinity.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayCookieBasedAffinity.java new file mode 100644 index 000000000000..b7c942620336 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayCookieBasedAffinity.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ApplicationGatewayCookieBasedAffinity. + */ +public final class ApplicationGatewayCookieBasedAffinity extends ExpandableStringEnum { + /** Static value Enabled for ApplicationGatewayCookieBasedAffinity. */ + public static final ApplicationGatewayCookieBasedAffinity ENABLED = fromString("Enabled"); + + /** Static value Disabled for ApplicationGatewayCookieBasedAffinity. */ + public static final ApplicationGatewayCookieBasedAffinity DISABLED = fromString("Disabled"); + + /** + * Creates or finds a ApplicationGatewayCookieBasedAffinity from its string representation. + * @param name a name to look for + * @return the corresponding ApplicationGatewayCookieBasedAffinity + */ + @JsonCreator + public static ApplicationGatewayCookieBasedAffinity fromString(String name) { + return fromString(name, ApplicationGatewayCookieBasedAffinity.class); + } + + /** + * @return known ApplicationGatewayCookieBasedAffinity values + */ + public static Collection values() { + return values(ApplicationGatewayCookieBasedAffinity.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayFirewallDisabledRuleGroup.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayFirewallDisabledRuleGroup.java new file mode 100644 index 000000000000..0564abd5febc --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayFirewallDisabledRuleGroup.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Allows to disable rules within a rule group or an entire rule group. + */ +public class ApplicationGatewayFirewallDisabledRuleGroup { + /** + * The name of the rule group that will be disabled. + */ + @JsonProperty(value = "ruleGroupName", required = true) + private String ruleGroupName; + + /** + * The list of rules that will be disabled. If null, all rules of the rule + * group will be disabled. + */ + @JsonProperty(value = "rules") + private List rules; + + /** + * Get the name of the rule group that will be disabled. + * + * @return the ruleGroupName value + */ + public String ruleGroupName() { + return this.ruleGroupName; + } + + /** + * Set the name of the rule group that will be disabled. + * + * @param ruleGroupName the ruleGroupName value to set + * @return the ApplicationGatewayFirewallDisabledRuleGroup object itself. + */ + public ApplicationGatewayFirewallDisabledRuleGroup withRuleGroupName(String ruleGroupName) { + this.ruleGroupName = ruleGroupName; + return this; + } + + /** + * Get the list of rules that will be disabled. If null, all rules of the rule group will be disabled. + * + * @return the rules value + */ + public List rules() { + return this.rules; + } + + /** + * Set the list of rules that will be disabled. If null, all rules of the rule group will be disabled. + * + * @param rules the rules value to set + * @return the ApplicationGatewayFirewallDisabledRuleGroup object itself. + */ + public ApplicationGatewayFirewallDisabledRuleGroup withRules(List rules) { + this.rules = rules; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayFirewallMode.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayFirewallMode.java new file mode 100644 index 000000000000..09debe0f09cb --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayFirewallMode.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ApplicationGatewayFirewallMode. + */ +public final class ApplicationGatewayFirewallMode extends ExpandableStringEnum { + /** Static value Detection for ApplicationGatewayFirewallMode. */ + public static final ApplicationGatewayFirewallMode DETECTION = fromString("Detection"); + + /** Static value Prevention for ApplicationGatewayFirewallMode. */ + public static final ApplicationGatewayFirewallMode PREVENTION = fromString("Prevention"); + + /** + * Creates or finds a ApplicationGatewayFirewallMode from its string representation. + * @param name a name to look for + * @return the corresponding ApplicationGatewayFirewallMode + */ + @JsonCreator + public static ApplicationGatewayFirewallMode fromString(String name) { + return fromString(name, ApplicationGatewayFirewallMode.class); + } + + /** + * @return known ApplicationGatewayFirewallMode values + */ + public static Collection values() { + return values(ApplicationGatewayFirewallMode.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayFirewallRule.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayFirewallRule.java new file mode 100644 index 000000000000..88f6c27c2344 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayFirewallRule.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.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A web application firewall rule. + */ +public class ApplicationGatewayFirewallRule { + /** + * The identifier of the web application firewall rule. + */ + @JsonProperty(value = "ruleId", required = true) + private int ruleId; + + /** + * The description of the web application firewall rule. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the identifier of the web application firewall rule. + * + * @return the ruleId value + */ + public int ruleId() { + return this.ruleId; + } + + /** + * Set the identifier of the web application firewall rule. + * + * @param ruleId the ruleId value to set + * @return the ApplicationGatewayFirewallRule object itself. + */ + public ApplicationGatewayFirewallRule withRuleId(int ruleId) { + this.ruleId = ruleId; + return this; + } + + /** + * Get the description of the web application firewall rule. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the description of the web application firewall rule. + * + * @param description the description value to set + * @return the ApplicationGatewayFirewallRule object itself. + */ + public ApplicationGatewayFirewallRule withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayFirewallRuleGroup.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayFirewallRuleGroup.java new file mode 100644 index 000000000000..585cdfa02310 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayFirewallRuleGroup.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.network.v2018_06_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A web application firewall rule group. + */ +public class ApplicationGatewayFirewallRuleGroup { + /** + * The name of the web application firewall rule group. + */ + @JsonProperty(value = "ruleGroupName", required = true) + private String ruleGroupName; + + /** + * The description of the web application firewall rule group. + */ + @JsonProperty(value = "description") + private String description; + + /** + * The rules of the web application firewall rule group. + */ + @JsonProperty(value = "rules", required = true) + private List rules; + + /** + * Get the name of the web application firewall rule group. + * + * @return the ruleGroupName value + */ + public String ruleGroupName() { + return this.ruleGroupName; + } + + /** + * Set the name of the web application firewall rule group. + * + * @param ruleGroupName the ruleGroupName value to set + * @return the ApplicationGatewayFirewallRuleGroup object itself. + */ + public ApplicationGatewayFirewallRuleGroup withRuleGroupName(String ruleGroupName) { + this.ruleGroupName = ruleGroupName; + return this; + } + + /** + * Get the description of the web application firewall rule group. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the description of the web application firewall rule group. + * + * @param description the description value to set + * @return the ApplicationGatewayFirewallRuleGroup object itself. + */ + public ApplicationGatewayFirewallRuleGroup withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the rules of the web application firewall rule group. + * + * @return the rules value + */ + public List rules() { + return this.rules; + } + + /** + * Set the rules of the web application firewall rule group. + * + * @param rules the rules value to set + * @return the ApplicationGatewayFirewallRuleGroup object itself. + */ + public ApplicationGatewayFirewallRuleGroup withRules(List rules) { + this.rules = rules; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayFirewallRuleSet.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayFirewallRuleSet.java new file mode 100644 index 000000000000..11f17bd3a248 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayFirewallRuleSet.java @@ -0,0 +1,153 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * A web application firewall rule set. + */ +@JsonFlatten +@SkipParentValidation +public class ApplicationGatewayFirewallRuleSet extends Resource { + /** + * The provisioning state of the web application firewall rule set. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * The type of the web application firewall rule set. + */ + @JsonProperty(value = "properties.ruleSetType", required = true) + private String ruleSetType; + + /** + * The version of the web application firewall rule set type. + */ + @JsonProperty(value = "properties.ruleSetVersion", required = true) + private String ruleSetVersion; + + /** + * The rule groups of the web application firewall rule set. + */ + @JsonProperty(value = "properties.ruleGroups", required = true) + private List ruleGroups; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the provisioning state of the web application firewall rule set. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the web application firewall rule set. + * + * @param provisioningState the provisioningState value to set + * @return the ApplicationGatewayFirewallRuleSet object itself. + */ + public ApplicationGatewayFirewallRuleSet withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the type of the web application firewall rule set. + * + * @return the ruleSetType value + */ + public String ruleSetType() { + return this.ruleSetType; + } + + /** + * Set the type of the web application firewall rule set. + * + * @param ruleSetType the ruleSetType value to set + * @return the ApplicationGatewayFirewallRuleSet object itself. + */ + public ApplicationGatewayFirewallRuleSet withRuleSetType(String ruleSetType) { + this.ruleSetType = ruleSetType; + return this; + } + + /** + * Get the version of the web application firewall rule set type. + * + * @return the ruleSetVersion value + */ + public String ruleSetVersion() { + return this.ruleSetVersion; + } + + /** + * Set the version of the web application firewall rule set type. + * + * @param ruleSetVersion the ruleSetVersion value to set + * @return the ApplicationGatewayFirewallRuleSet object itself. + */ + public ApplicationGatewayFirewallRuleSet withRuleSetVersion(String ruleSetVersion) { + this.ruleSetVersion = ruleSetVersion; + return this; + } + + /** + * Get the rule groups of the web application firewall rule set. + * + * @return the ruleGroups value + */ + public List ruleGroups() { + return this.ruleGroups; + } + + /** + * Set the rule groups of the web application firewall rule set. + * + * @param ruleGroups the ruleGroups value to set + * @return the ApplicationGatewayFirewallRuleSet object itself. + */ + public ApplicationGatewayFirewallRuleSet withRuleGroups(List ruleGroups) { + this.ruleGroups = ruleGroups; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the ApplicationGatewayFirewallRuleSet object itself. + */ + public ApplicationGatewayFirewallRuleSet withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayFrontendIPConfiguration.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayFrontendIPConfiguration.java new file mode 100644 index 000000000000..3af9e29a9911 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayFrontendIPConfiguration.java @@ -0,0 +1,231 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Frontend IP configuration of an application gateway. + */ +@JsonFlatten +public class ApplicationGatewayFrontendIPConfiguration extends SubResource { + /** + * PrivateIPAddress of the network interface IP Configuration. + */ + @JsonProperty(value = "properties.privateIPAddress") + private String privateIPAddress; + + /** + * PrivateIP allocation method. Possible values include: 'Static', + * 'Dynamic'. + */ + @JsonProperty(value = "properties.privateIPAllocationMethod") + private IPAllocationMethod privateIPAllocationMethod; + + /** + * Reference of the subnet resource. + */ + @JsonProperty(value = "properties.subnet") + private SubResource subnet; + + /** + * Reference of the PublicIP resource. + */ + @JsonProperty(value = "properties.publicIPAddress") + private SubResource publicIPAddress; + + /** + * Provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Name of the frontend IP configuration that is unique within an + * Application Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get privateIPAddress of the network interface IP Configuration. + * + * @return the privateIPAddress value + */ + public String privateIPAddress() { + return this.privateIPAddress; + } + + /** + * Set privateIPAddress of the network interface IP Configuration. + * + * @param privateIPAddress the privateIPAddress value to set + * @return the ApplicationGatewayFrontendIPConfiguration object itself. + */ + public ApplicationGatewayFrontendIPConfiguration withPrivateIPAddress(String privateIPAddress) { + this.privateIPAddress = privateIPAddress; + return this; + } + + /** + * Get privateIP allocation method. Possible values include: 'Static', 'Dynamic'. + * + * @return the privateIPAllocationMethod value + */ + public IPAllocationMethod privateIPAllocationMethod() { + return this.privateIPAllocationMethod; + } + + /** + * Set privateIP allocation method. Possible values include: 'Static', 'Dynamic'. + * + * @param privateIPAllocationMethod the privateIPAllocationMethod value to set + * @return the ApplicationGatewayFrontendIPConfiguration object itself. + */ + public ApplicationGatewayFrontendIPConfiguration withPrivateIPAllocationMethod(IPAllocationMethod privateIPAllocationMethod) { + this.privateIPAllocationMethod = privateIPAllocationMethod; + return this; + } + + /** + * Get reference of the subnet resource. + * + * @return the subnet value + */ + public SubResource subnet() { + return this.subnet; + } + + /** + * Set reference of the subnet resource. + * + * @param subnet the subnet value to set + * @return the ApplicationGatewayFrontendIPConfiguration object itself. + */ + public ApplicationGatewayFrontendIPConfiguration withSubnet(SubResource subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get reference of the PublicIP resource. + * + * @return the publicIPAddress value + */ + public SubResource publicIPAddress() { + return this.publicIPAddress; + } + + /** + * Set reference of the PublicIP resource. + * + * @param publicIPAddress the publicIPAddress value to set + * @return the ApplicationGatewayFrontendIPConfiguration object itself. + */ + public ApplicationGatewayFrontendIPConfiguration withPublicIPAddress(SubResource publicIPAddress) { + this.publicIPAddress = publicIPAddress; + return this; + } + + /** + * Get provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ApplicationGatewayFrontendIPConfiguration object itself. + */ + public ApplicationGatewayFrontendIPConfiguration withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get name of the frontend IP configuration that is unique within an Application Gateway. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the frontend IP configuration that is unique within an Application Gateway. + * + * @param name the name value to set + * @return the ApplicationGatewayFrontendIPConfiguration object itself. + */ + public ApplicationGatewayFrontendIPConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ApplicationGatewayFrontendIPConfiguration object itself. + */ + public ApplicationGatewayFrontendIPConfiguration withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set type of the resource. + * + * @param type the type value to set + * @return the ApplicationGatewayFrontendIPConfiguration object itself. + */ + public ApplicationGatewayFrontendIPConfiguration withType(String type) { + this.type = type; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayFrontendPort.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayFrontendPort.java new file mode 100644 index 000000000000..d3216c1ef385 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayFrontendPort.java @@ -0,0 +1,151 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Frontend port of an application gateway. + */ +@JsonFlatten +public class ApplicationGatewayFrontendPort extends SubResource { + /** + * Frontend port. + */ + @JsonProperty(value = "properties.port") + private Integer port; + + /** + * Provisioning state of the frontend port resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Name of the frontend port that is unique within an Application Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get frontend port. + * + * @return the port value + */ + public Integer port() { + return this.port; + } + + /** + * Set frontend port. + * + * @param port the port value to set + * @return the ApplicationGatewayFrontendPort object itself. + */ + public ApplicationGatewayFrontendPort withPort(Integer port) { + this.port = port; + return this; + } + + /** + * Get provisioning state of the frontend port resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the frontend port resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ApplicationGatewayFrontendPort object itself. + */ + public ApplicationGatewayFrontendPort withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get name of the frontend port that is unique within an Application Gateway. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the frontend port that is unique within an Application Gateway. + * + * @param name the name value to set + * @return the ApplicationGatewayFrontendPort object itself. + */ + public ApplicationGatewayFrontendPort withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ApplicationGatewayFrontendPort object itself. + */ + public ApplicationGatewayFrontendPort withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set type of the resource. + * + * @param type the type value to set + * @return the ApplicationGatewayFrontendPort object itself. + */ + public ApplicationGatewayFrontendPort withType(String type) { + this.type = type; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayHttpListener.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayHttpListener.java new file mode 100644 index 000000000000..836bb0a303ca --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayHttpListener.java @@ -0,0 +1,282 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Http listener of an application gateway. + */ +@JsonFlatten +public class ApplicationGatewayHttpListener extends SubResource { + /** + * Frontend IP configuration resource of an application gateway. + */ + @JsonProperty(value = "properties.frontendIPConfiguration") + private SubResource frontendIPConfiguration; + + /** + * Frontend port resource of an application gateway. + */ + @JsonProperty(value = "properties.frontendPort") + private SubResource frontendPort; + + /** + * Protocol of the HTTP listener. Possible values are 'Http' and 'Https'. + * Possible values include: 'Http', 'Https'. + */ + @JsonProperty(value = "properties.protocol") + private ApplicationGatewayProtocol protocol; + + /** + * Host name of HTTP listener. + */ + @JsonProperty(value = "properties.hostName") + private String hostName; + + /** + * SSL certificate resource of an application gateway. + */ + @JsonProperty(value = "properties.sslCertificate") + private SubResource sslCertificate; + + /** + * Applicable only if protocol is https. Enables SNI for multi-hosting. + */ + @JsonProperty(value = "properties.requireServerNameIndication") + private Boolean requireServerNameIndication; + + /** + * Provisioning state of the HTTP listener resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Name of the HTTP listener that is unique within an Application Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get frontend IP configuration resource of an application gateway. + * + * @return the frontendIPConfiguration value + */ + public SubResource frontendIPConfiguration() { + return this.frontendIPConfiguration; + } + + /** + * Set frontend IP configuration resource of an application gateway. + * + * @param frontendIPConfiguration the frontendIPConfiguration value to set + * @return the ApplicationGatewayHttpListener object itself. + */ + public ApplicationGatewayHttpListener withFrontendIPConfiguration(SubResource frontendIPConfiguration) { + this.frontendIPConfiguration = frontendIPConfiguration; + return this; + } + + /** + * Get frontend port resource of an application gateway. + * + * @return the frontendPort value + */ + public SubResource frontendPort() { + return this.frontendPort; + } + + /** + * Set frontend port resource of an application gateway. + * + * @param frontendPort the frontendPort value to set + * @return the ApplicationGatewayHttpListener object itself. + */ + public ApplicationGatewayHttpListener withFrontendPort(SubResource frontendPort) { + this.frontendPort = frontendPort; + return this; + } + + /** + * Get protocol of the HTTP listener. Possible values are 'Http' and 'Https'. Possible values include: 'Http', 'Https'. + * + * @return the protocol value + */ + public ApplicationGatewayProtocol protocol() { + return this.protocol; + } + + /** + * Set protocol of the HTTP listener. Possible values are 'Http' and 'Https'. Possible values include: 'Http', 'Https'. + * + * @param protocol the protocol value to set + * @return the ApplicationGatewayHttpListener object itself. + */ + public ApplicationGatewayHttpListener withProtocol(ApplicationGatewayProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get host name of HTTP listener. + * + * @return the hostName value + */ + public String hostName() { + return this.hostName; + } + + /** + * Set host name of HTTP listener. + * + * @param hostName the hostName value to set + * @return the ApplicationGatewayHttpListener object itself. + */ + public ApplicationGatewayHttpListener withHostName(String hostName) { + this.hostName = hostName; + return this; + } + + /** + * Get sSL certificate resource of an application gateway. + * + * @return the sslCertificate value + */ + public SubResource sslCertificate() { + return this.sslCertificate; + } + + /** + * Set sSL certificate resource of an application gateway. + * + * @param sslCertificate the sslCertificate value to set + * @return the ApplicationGatewayHttpListener object itself. + */ + public ApplicationGatewayHttpListener withSslCertificate(SubResource sslCertificate) { + this.sslCertificate = sslCertificate; + return this; + } + + /** + * Get applicable only if protocol is https. Enables SNI for multi-hosting. + * + * @return the requireServerNameIndication value + */ + public Boolean requireServerNameIndication() { + return this.requireServerNameIndication; + } + + /** + * Set applicable only if protocol is https. Enables SNI for multi-hosting. + * + * @param requireServerNameIndication the requireServerNameIndication value to set + * @return the ApplicationGatewayHttpListener object itself. + */ + public ApplicationGatewayHttpListener withRequireServerNameIndication(Boolean requireServerNameIndication) { + this.requireServerNameIndication = requireServerNameIndication; + return this; + } + + /** + * Get provisioning state of the HTTP listener resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the HTTP listener resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ApplicationGatewayHttpListener object itself. + */ + public ApplicationGatewayHttpListener withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get name of the HTTP listener that is unique within an Application Gateway. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the HTTP listener that is unique within an Application Gateway. + * + * @param name the name value to set + * @return the ApplicationGatewayHttpListener object itself. + */ + public ApplicationGatewayHttpListener withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ApplicationGatewayHttpListener object itself. + */ + public ApplicationGatewayHttpListener withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set type of the resource. + * + * @param type the type value to set + * @return the ApplicationGatewayHttpListener object itself. + */ + public ApplicationGatewayHttpListener withType(String type) { + this.type = type; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayIPConfiguration.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayIPConfiguration.java new file mode 100644 index 000000000000..dd2daa61b0ec --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayIPConfiguration.java @@ -0,0 +1,154 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * IP configuration of an application gateway. Currently 1 public and 1 private + * IP configuration is allowed. + */ +@JsonFlatten +public class ApplicationGatewayIPConfiguration extends SubResource { + /** + * Reference of the subnet resource. A subnet from where application + * gateway gets its private address. + */ + @JsonProperty(value = "properties.subnet") + private SubResource subnet; + + /** + * Provisioning state of the application gateway subnet resource. Possible + * values are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Name of the IP configuration that is unique within an Application + * Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get reference of the subnet resource. A subnet from where application gateway gets its private address. + * + * @return the subnet value + */ + public SubResource subnet() { + return this.subnet; + } + + /** + * Set reference of the subnet resource. A subnet from where application gateway gets its private address. + * + * @param subnet the subnet value to set + * @return the ApplicationGatewayIPConfiguration object itself. + */ + public ApplicationGatewayIPConfiguration withSubnet(SubResource subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get provisioning state of the application gateway subnet resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the application gateway subnet resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ApplicationGatewayIPConfiguration object itself. + */ + public ApplicationGatewayIPConfiguration withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get name of the IP configuration that is unique within an Application Gateway. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the IP configuration that is unique within an Application Gateway. + * + * @param name the name value to set + * @return the ApplicationGatewayIPConfiguration object itself. + */ + public ApplicationGatewayIPConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ApplicationGatewayIPConfiguration object itself. + */ + public ApplicationGatewayIPConfiguration withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set type of the resource. + * + * @param type the type value to set + * @return the ApplicationGatewayIPConfiguration object itself. + */ + public ApplicationGatewayIPConfiguration withType(String type) { + this.type = type; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayOperationalState.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayOperationalState.java new file mode 100644 index 000000000000..547a29a8b796 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayOperationalState.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ApplicationGatewayOperationalState. + */ +public final class ApplicationGatewayOperationalState extends ExpandableStringEnum { + /** Static value Stopped for ApplicationGatewayOperationalState. */ + public static final ApplicationGatewayOperationalState STOPPED = fromString("Stopped"); + + /** Static value Starting for ApplicationGatewayOperationalState. */ + public static final ApplicationGatewayOperationalState STARTING = fromString("Starting"); + + /** Static value Running for ApplicationGatewayOperationalState. */ + public static final ApplicationGatewayOperationalState RUNNING = fromString("Running"); + + /** Static value Stopping for ApplicationGatewayOperationalState. */ + public static final ApplicationGatewayOperationalState STOPPING = fromString("Stopping"); + + /** + * Creates or finds a ApplicationGatewayOperationalState from its string representation. + * @param name a name to look for + * @return the corresponding ApplicationGatewayOperationalState + */ + @JsonCreator + public static ApplicationGatewayOperationalState fromString(String name) { + return fromString(name, ApplicationGatewayOperationalState.class); + } + + /** + * @return known ApplicationGatewayOperationalState values + */ + public static Collection values() { + return values(ApplicationGatewayOperationalState.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayPathRule.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayPathRule.java new file mode 100644 index 000000000000..2a90bfefccc8 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayPathRule.java @@ -0,0 +1,230 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import java.util.List; +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Path rule of URL path map of an application gateway. + */ +@JsonFlatten +public class ApplicationGatewayPathRule extends SubResource { + /** + * Path rules of URL path map. + */ + @JsonProperty(value = "properties.paths") + private List paths; + + /** + * Backend address pool resource of URL path map path rule. + */ + @JsonProperty(value = "properties.backendAddressPool") + private SubResource backendAddressPool; + + /** + * Backend http settings resource of URL path map path rule. + */ + @JsonProperty(value = "properties.backendHttpSettings") + private SubResource backendHttpSettings; + + /** + * Redirect configuration resource of URL path map path rule. + */ + @JsonProperty(value = "properties.redirectConfiguration") + private SubResource redirectConfiguration; + + /** + * Path rule of URL path map resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Name of the path rule that is unique within an Application Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get path rules of URL path map. + * + * @return the paths value + */ + public List paths() { + return this.paths; + } + + /** + * Set path rules of URL path map. + * + * @param paths the paths value to set + * @return the ApplicationGatewayPathRule object itself. + */ + public ApplicationGatewayPathRule withPaths(List paths) { + this.paths = paths; + return this; + } + + /** + * Get backend address pool resource of URL path map path rule. + * + * @return the backendAddressPool value + */ + public SubResource backendAddressPool() { + return this.backendAddressPool; + } + + /** + * Set backend address pool resource of URL path map path rule. + * + * @param backendAddressPool the backendAddressPool value to set + * @return the ApplicationGatewayPathRule object itself. + */ + public ApplicationGatewayPathRule withBackendAddressPool(SubResource backendAddressPool) { + this.backendAddressPool = backendAddressPool; + return this; + } + + /** + * Get backend http settings resource of URL path map path rule. + * + * @return the backendHttpSettings value + */ + public SubResource backendHttpSettings() { + return this.backendHttpSettings; + } + + /** + * Set backend http settings resource of URL path map path rule. + * + * @param backendHttpSettings the backendHttpSettings value to set + * @return the ApplicationGatewayPathRule object itself. + */ + public ApplicationGatewayPathRule withBackendHttpSettings(SubResource backendHttpSettings) { + this.backendHttpSettings = backendHttpSettings; + return this; + } + + /** + * Get redirect configuration resource of URL path map path rule. + * + * @return the redirectConfiguration value + */ + public SubResource redirectConfiguration() { + return this.redirectConfiguration; + } + + /** + * Set redirect configuration resource of URL path map path rule. + * + * @param redirectConfiguration the redirectConfiguration value to set + * @return the ApplicationGatewayPathRule object itself. + */ + public ApplicationGatewayPathRule withRedirectConfiguration(SubResource redirectConfiguration) { + this.redirectConfiguration = redirectConfiguration; + return this; + } + + /** + * Get path rule of URL path map resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set path rule of URL path map resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ApplicationGatewayPathRule object itself. + */ + public ApplicationGatewayPathRule withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get name of the path rule that is unique within an Application Gateway. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the path rule that is unique within an Application Gateway. + * + * @param name the name value to set + * @return the ApplicationGatewayPathRule object itself. + */ + public ApplicationGatewayPathRule withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ApplicationGatewayPathRule object itself. + */ + public ApplicationGatewayPathRule withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set type of the resource. + * + * @param type the type value to set + * @return the ApplicationGatewayPathRule object itself. + */ + public ApplicationGatewayPathRule withType(String type) { + this.type = type; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayProbe.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayProbe.java new file mode 100644 index 000000000000..6d4399ebb9ce --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayProbe.java @@ -0,0 +1,369 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Probe of the application gateway. + */ +@JsonFlatten +public class ApplicationGatewayProbe extends SubResource { + /** + * The protocol used for the probe. Possible values are 'Http' and 'Https'. + * Possible values include: 'Http', 'Https'. + */ + @JsonProperty(value = "properties.protocol") + private ApplicationGatewayProtocol protocol; + + /** + * Host name to send the probe to. + */ + @JsonProperty(value = "properties.host") + private String host; + + /** + * Relative path of probe. Valid path starts from '/'. Probe is sent to + * <Protocol>://<host>:<port><path>. + */ + @JsonProperty(value = "properties.path") + private String path; + + /** + * The probing interval in seconds. This is the time interval between two + * consecutive probes. Acceptable values are from 1 second to 86400 + * seconds. + */ + @JsonProperty(value = "properties.interval") + private Integer interval; + + /** + * the probe timeout in seconds. Probe marked as failed if valid response + * is not received with this timeout period. Acceptable values are from 1 + * second to 86400 seconds. + */ + @JsonProperty(value = "properties.timeout") + private Integer timeout; + + /** + * The probe retry count. Backend server is marked down after consecutive + * probe failure count reaches UnhealthyThreshold. Acceptable values are + * from 1 second to 20. + */ + @JsonProperty(value = "properties.unhealthyThreshold") + private Integer unhealthyThreshold; + + /** + * Whether the host header should be picked from the backend http settings. + * Default value is false. + */ + @JsonProperty(value = "properties.pickHostNameFromBackendHttpSettings") + private Boolean pickHostNameFromBackendHttpSettings; + + /** + * Minimum number of servers that are always marked healthy. Default value + * is 0. + */ + @JsonProperty(value = "properties.minServers") + private Integer minServers; + + /** + * Criterion for classifying a healthy probe response. + */ + @JsonProperty(value = "properties.match") + private ApplicationGatewayProbeHealthResponseMatch match; + + /** + * Provisioning state of the backend http settings resource. Possible + * values are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Name of the probe that is unique within an Application Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get the protocol used for the probe. Possible values are 'Http' and 'Https'. Possible values include: 'Http', 'Https'. + * + * @return the protocol value + */ + public ApplicationGatewayProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol used for the probe. Possible values are 'Http' and 'Https'. Possible values include: 'Http', 'Https'. + * + * @param protocol the protocol value to set + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withProtocol(ApplicationGatewayProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get host name to send the probe to. + * + * @return the host value + */ + public String host() { + return this.host; + } + + /** + * Set host name to send the probe to. + * + * @param host the host value to set + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withHost(String host) { + this.host = host; + return this; + } + + /** + * Get relative path of probe. Valid path starts from '/'. Probe is sent to <Protocol>://<host>:<port><path>. + * + * @return the path value + */ + public String path() { + return this.path; + } + + /** + * Set relative path of probe. Valid path starts from '/'. Probe is sent to <Protocol>://<host>:<port><path>. + * + * @param path the path value to set + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withPath(String path) { + this.path = path; + return this; + } + + /** + * Get the probing interval in seconds. This is the time interval between two consecutive probes. Acceptable values are from 1 second to 86400 seconds. + * + * @return the interval value + */ + public Integer interval() { + return this.interval; + } + + /** + * Set the probing interval in seconds. This is the time interval between two consecutive probes. Acceptable values are from 1 second to 86400 seconds. + * + * @param interval the interval value to set + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withInterval(Integer interval) { + this.interval = interval; + return this; + } + + /** + * Get the probe timeout in seconds. Probe marked as failed if valid response is not received with this timeout period. Acceptable values are from 1 second to 86400 seconds. + * + * @return the timeout value + */ + public Integer timeout() { + return this.timeout; + } + + /** + * Set the probe timeout in seconds. Probe marked as failed if valid response is not received with this timeout period. Acceptable values are from 1 second to 86400 seconds. + * + * @param timeout the timeout value to set + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withTimeout(Integer timeout) { + this.timeout = timeout; + return this; + } + + /** + * Get the probe retry count. Backend server is marked down after consecutive probe failure count reaches UnhealthyThreshold. Acceptable values are from 1 second to 20. + * + * @return the unhealthyThreshold value + */ + public Integer unhealthyThreshold() { + return this.unhealthyThreshold; + } + + /** + * Set the probe retry count. Backend server is marked down after consecutive probe failure count reaches UnhealthyThreshold. Acceptable values are from 1 second to 20. + * + * @param unhealthyThreshold the unhealthyThreshold value to set + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withUnhealthyThreshold(Integer unhealthyThreshold) { + this.unhealthyThreshold = unhealthyThreshold; + return this; + } + + /** + * Get whether the host header should be picked from the backend http settings. Default value is false. + * + * @return the pickHostNameFromBackendHttpSettings value + */ + public Boolean pickHostNameFromBackendHttpSettings() { + return this.pickHostNameFromBackendHttpSettings; + } + + /** + * Set whether the host header should be picked from the backend http settings. Default value is false. + * + * @param pickHostNameFromBackendHttpSettings the pickHostNameFromBackendHttpSettings value to set + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withPickHostNameFromBackendHttpSettings(Boolean pickHostNameFromBackendHttpSettings) { + this.pickHostNameFromBackendHttpSettings = pickHostNameFromBackendHttpSettings; + return this; + } + + /** + * Get minimum number of servers that are always marked healthy. Default value is 0. + * + * @return the minServers value + */ + public Integer minServers() { + return this.minServers; + } + + /** + * Set minimum number of servers that are always marked healthy. Default value is 0. + * + * @param minServers the minServers value to set + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withMinServers(Integer minServers) { + this.minServers = minServers; + return this; + } + + /** + * Get criterion for classifying a healthy probe response. + * + * @return the match value + */ + public ApplicationGatewayProbeHealthResponseMatch match() { + return this.match; + } + + /** + * Set criterion for classifying a healthy probe response. + * + * @param match the match value to set + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withMatch(ApplicationGatewayProbeHealthResponseMatch match) { + this.match = match; + return this; + } + + /** + * Get provisioning state of the backend http settings resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the backend http settings resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get name of the probe that is unique within an Application Gateway. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the probe that is unique within an Application Gateway. + * + * @param name the name value to set + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set type of the resource. + * + * @param type the type value to set + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withType(String type) { + this.type = type; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayProbeHealthResponseMatch.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayProbeHealthResponseMatch.java new file mode 100644 index 000000000000..8291ea68906d --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayProbeHealthResponseMatch.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.network.v2018_06_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Application gateway probe health response match. + */ +public class ApplicationGatewayProbeHealthResponseMatch { + /** + * Body that must be contained in the health response. Default value is + * empty. + */ + @JsonProperty(value = "body") + private String body; + + /** + * Allowed ranges of healthy status codes. Default range of healthy status + * codes is 200-399. + */ + @JsonProperty(value = "statusCodes") + private List statusCodes; + + /** + * Get body that must be contained in the health response. Default value is empty. + * + * @return the body value + */ + public String body() { + return this.body; + } + + /** + * Set body that must be contained in the health response. Default value is empty. + * + * @param body the body value to set + * @return the ApplicationGatewayProbeHealthResponseMatch object itself. + */ + public ApplicationGatewayProbeHealthResponseMatch withBody(String body) { + this.body = body; + return this; + } + + /** + * Get allowed ranges of healthy status codes. Default range of healthy status codes is 200-399. + * + * @return the statusCodes value + */ + public List statusCodes() { + return this.statusCodes; + } + + /** + * Set allowed ranges of healthy status codes. Default range of healthy status codes is 200-399. + * + * @param statusCodes the statusCodes value to set + * @return the ApplicationGatewayProbeHealthResponseMatch object itself. + */ + public ApplicationGatewayProbeHealthResponseMatch withStatusCodes(List statusCodes) { + this.statusCodes = statusCodes; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayProtocol.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayProtocol.java new file mode 100644 index 000000000000..415e9238c33f --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayProtocol.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ApplicationGatewayProtocol. + */ +public final class ApplicationGatewayProtocol extends ExpandableStringEnum { + /** Static value Http for ApplicationGatewayProtocol. */ + public static final ApplicationGatewayProtocol HTTP = fromString("Http"); + + /** Static value Https for ApplicationGatewayProtocol. */ + public static final ApplicationGatewayProtocol HTTPS = fromString("Https"); + + /** + * Creates or finds a ApplicationGatewayProtocol from its string representation. + * @param name a name to look for + * @return the corresponding ApplicationGatewayProtocol + */ + @JsonCreator + public static ApplicationGatewayProtocol fromString(String name) { + return fromString(name, ApplicationGatewayProtocol.class); + } + + /** + * @return known ApplicationGatewayProtocol values + */ + public static Collection values() { + return values(ApplicationGatewayProtocol.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayRedirectConfiguration.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayRedirectConfiguration.java new file mode 100644 index 000000000000..b400d4e3020d --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayRedirectConfiguration.java @@ -0,0 +1,310 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.SubResource; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Redirect configuration of an application gateway. + */ +@JsonFlatten +public class ApplicationGatewayRedirectConfiguration extends SubResource { + /** + * Supported http redirection types - Permanent, Temporary, Found, + * SeeOther. Possible values include: 'Permanent', 'Found', 'SeeOther', + * 'Temporary'. + */ + @JsonProperty(value = "properties.redirectType") + private ApplicationGatewayRedirectType redirectType; + + /** + * Reference to a listener to redirect the request to. + */ + @JsonProperty(value = "properties.targetListener") + private SubResource targetListener; + + /** + * Url to redirect the request to. + */ + @JsonProperty(value = "properties.targetUrl") + private String targetUrl; + + /** + * Include path in the redirected url. + */ + @JsonProperty(value = "properties.includePath") + private Boolean includePath; + + /** + * Include query string in the redirected url. + */ + @JsonProperty(value = "properties.includeQueryString") + private Boolean includeQueryString; + + /** + * Request routing specifying redirect configuration. + */ + @JsonProperty(value = "properties.requestRoutingRules") + private List requestRoutingRules; + + /** + * Url path maps specifying default redirect configuration. + */ + @JsonProperty(value = "properties.urlPathMaps") + private List urlPathMaps; + + /** + * Path rules specifying redirect configuration. + */ + @JsonProperty(value = "properties.pathRules") + private List pathRules; + + /** + * Name of the redirect configuration that is unique within an Application + * Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get supported http redirection types - Permanent, Temporary, Found, SeeOther. Possible values include: 'Permanent', 'Found', 'SeeOther', 'Temporary'. + * + * @return the redirectType value + */ + public ApplicationGatewayRedirectType redirectType() { + return this.redirectType; + } + + /** + * Set supported http redirection types - Permanent, Temporary, Found, SeeOther. Possible values include: 'Permanent', 'Found', 'SeeOther', 'Temporary'. + * + * @param redirectType the redirectType value to set + * @return the ApplicationGatewayRedirectConfiguration object itself. + */ + public ApplicationGatewayRedirectConfiguration withRedirectType(ApplicationGatewayRedirectType redirectType) { + this.redirectType = redirectType; + return this; + } + + /** + * Get reference to a listener to redirect the request to. + * + * @return the targetListener value + */ + public SubResource targetListener() { + return this.targetListener; + } + + /** + * Set reference to a listener to redirect the request to. + * + * @param targetListener the targetListener value to set + * @return the ApplicationGatewayRedirectConfiguration object itself. + */ + public ApplicationGatewayRedirectConfiguration withTargetListener(SubResource targetListener) { + this.targetListener = targetListener; + return this; + } + + /** + * Get url to redirect the request to. + * + * @return the targetUrl value + */ + public String targetUrl() { + return this.targetUrl; + } + + /** + * Set url to redirect the request to. + * + * @param targetUrl the targetUrl value to set + * @return the ApplicationGatewayRedirectConfiguration object itself. + */ + public ApplicationGatewayRedirectConfiguration withTargetUrl(String targetUrl) { + this.targetUrl = targetUrl; + return this; + } + + /** + * Get include path in the redirected url. + * + * @return the includePath value + */ + public Boolean includePath() { + return this.includePath; + } + + /** + * Set include path in the redirected url. + * + * @param includePath the includePath value to set + * @return the ApplicationGatewayRedirectConfiguration object itself. + */ + public ApplicationGatewayRedirectConfiguration withIncludePath(Boolean includePath) { + this.includePath = includePath; + return this; + } + + /** + * Get include query string in the redirected url. + * + * @return the includeQueryString value + */ + public Boolean includeQueryString() { + return this.includeQueryString; + } + + /** + * Set include query string in the redirected url. + * + * @param includeQueryString the includeQueryString value to set + * @return the ApplicationGatewayRedirectConfiguration object itself. + */ + public ApplicationGatewayRedirectConfiguration withIncludeQueryString(Boolean includeQueryString) { + this.includeQueryString = includeQueryString; + return this; + } + + /** + * Get request routing specifying redirect configuration. + * + * @return the requestRoutingRules value + */ + public List requestRoutingRules() { + return this.requestRoutingRules; + } + + /** + * Set request routing specifying redirect configuration. + * + * @param requestRoutingRules the requestRoutingRules value to set + * @return the ApplicationGatewayRedirectConfiguration object itself. + */ + public ApplicationGatewayRedirectConfiguration withRequestRoutingRules(List requestRoutingRules) { + this.requestRoutingRules = requestRoutingRules; + return this; + } + + /** + * Get url path maps specifying default redirect configuration. + * + * @return the urlPathMaps value + */ + public List urlPathMaps() { + return this.urlPathMaps; + } + + /** + * Set url path maps specifying default redirect configuration. + * + * @param urlPathMaps the urlPathMaps value to set + * @return the ApplicationGatewayRedirectConfiguration object itself. + */ + public ApplicationGatewayRedirectConfiguration withUrlPathMaps(List urlPathMaps) { + this.urlPathMaps = urlPathMaps; + return this; + } + + /** + * Get path rules specifying redirect configuration. + * + * @return the pathRules value + */ + public List pathRules() { + return this.pathRules; + } + + /** + * Set path rules specifying redirect configuration. + * + * @param pathRules the pathRules value to set + * @return the ApplicationGatewayRedirectConfiguration object itself. + */ + public ApplicationGatewayRedirectConfiguration withPathRules(List pathRules) { + this.pathRules = pathRules; + return this; + } + + /** + * Get name of the redirect configuration that is unique within an Application Gateway. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the redirect configuration that is unique within an Application Gateway. + * + * @param name the name value to set + * @return the ApplicationGatewayRedirectConfiguration object itself. + */ + public ApplicationGatewayRedirectConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ApplicationGatewayRedirectConfiguration object itself. + */ + public ApplicationGatewayRedirectConfiguration withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set type of the resource. + * + * @param type the type value to set + * @return the ApplicationGatewayRedirectConfiguration object itself. + */ + public ApplicationGatewayRedirectConfiguration withType(String type) { + this.type = type; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayRedirectType.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayRedirectType.java new file mode 100644 index 000000000000..c8ba23061ccd --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayRedirectType.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ApplicationGatewayRedirectType. + */ +public final class ApplicationGatewayRedirectType extends ExpandableStringEnum { + /** Static value Permanent for ApplicationGatewayRedirectType. */ + public static final ApplicationGatewayRedirectType PERMANENT = fromString("Permanent"); + + /** Static value Found for ApplicationGatewayRedirectType. */ + public static final ApplicationGatewayRedirectType FOUND = fromString("Found"); + + /** Static value SeeOther for ApplicationGatewayRedirectType. */ + public static final ApplicationGatewayRedirectType SEE_OTHER = fromString("SeeOther"); + + /** Static value Temporary for ApplicationGatewayRedirectType. */ + public static final ApplicationGatewayRedirectType TEMPORARY = fromString("Temporary"); + + /** + * Creates or finds a ApplicationGatewayRedirectType from its string representation. + * @param name a name to look for + * @return the corresponding ApplicationGatewayRedirectType + */ + @JsonCreator + public static ApplicationGatewayRedirectType fromString(String name) { + return fromString(name, ApplicationGatewayRedirectType.class); + } + + /** + * @return known ApplicationGatewayRedirectType values + */ + public static Collection values() { + return values(ApplicationGatewayRedirectType.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayRequestRoutingRule.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayRequestRoutingRule.java new file mode 100644 index 000000000000..07347895a6fe --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayRequestRoutingRule.java @@ -0,0 +1,282 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Request routing rule of an application gateway. + */ +@JsonFlatten +public class ApplicationGatewayRequestRoutingRule extends SubResource { + /** + * Rule type. Possible values include: 'Basic', 'PathBasedRouting'. + */ + @JsonProperty(value = "properties.ruleType") + private ApplicationGatewayRequestRoutingRuleType ruleType; + + /** + * Backend address pool resource of the application gateway. + */ + @JsonProperty(value = "properties.backendAddressPool") + private SubResource backendAddressPool; + + /** + * Backend http settings resource of the application gateway. + */ + @JsonProperty(value = "properties.backendHttpSettings") + private SubResource backendHttpSettings; + + /** + * Http listener resource of the application gateway. + */ + @JsonProperty(value = "properties.httpListener") + private SubResource httpListener; + + /** + * URL path map resource of the application gateway. + */ + @JsonProperty(value = "properties.urlPathMap") + private SubResource urlPathMap; + + /** + * Redirect configuration resource of the application gateway. + */ + @JsonProperty(value = "properties.redirectConfiguration") + private SubResource redirectConfiguration; + + /** + * Provisioning state of the request routing rule resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Name of the request routing rule that is unique within an Application + * Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get rule type. Possible values include: 'Basic', 'PathBasedRouting'. + * + * @return the ruleType value + */ + public ApplicationGatewayRequestRoutingRuleType ruleType() { + return this.ruleType; + } + + /** + * Set rule type. Possible values include: 'Basic', 'PathBasedRouting'. + * + * @param ruleType the ruleType value to set + * @return the ApplicationGatewayRequestRoutingRule object itself. + */ + public ApplicationGatewayRequestRoutingRule withRuleType(ApplicationGatewayRequestRoutingRuleType ruleType) { + this.ruleType = ruleType; + return this; + } + + /** + * Get backend address pool resource of the application gateway. + * + * @return the backendAddressPool value + */ + public SubResource backendAddressPool() { + return this.backendAddressPool; + } + + /** + * Set backend address pool resource of the application gateway. + * + * @param backendAddressPool the backendAddressPool value to set + * @return the ApplicationGatewayRequestRoutingRule object itself. + */ + public ApplicationGatewayRequestRoutingRule withBackendAddressPool(SubResource backendAddressPool) { + this.backendAddressPool = backendAddressPool; + return this; + } + + /** + * Get backend http settings resource of the application gateway. + * + * @return the backendHttpSettings value + */ + public SubResource backendHttpSettings() { + return this.backendHttpSettings; + } + + /** + * Set backend http settings resource of the application gateway. + * + * @param backendHttpSettings the backendHttpSettings value to set + * @return the ApplicationGatewayRequestRoutingRule object itself. + */ + public ApplicationGatewayRequestRoutingRule withBackendHttpSettings(SubResource backendHttpSettings) { + this.backendHttpSettings = backendHttpSettings; + return this; + } + + /** + * Get http listener resource of the application gateway. + * + * @return the httpListener value + */ + public SubResource httpListener() { + return this.httpListener; + } + + /** + * Set http listener resource of the application gateway. + * + * @param httpListener the httpListener value to set + * @return the ApplicationGatewayRequestRoutingRule object itself. + */ + public ApplicationGatewayRequestRoutingRule withHttpListener(SubResource httpListener) { + this.httpListener = httpListener; + return this; + } + + /** + * Get uRL path map resource of the application gateway. + * + * @return the urlPathMap value + */ + public SubResource urlPathMap() { + return this.urlPathMap; + } + + /** + * Set uRL path map resource of the application gateway. + * + * @param urlPathMap the urlPathMap value to set + * @return the ApplicationGatewayRequestRoutingRule object itself. + */ + public ApplicationGatewayRequestRoutingRule withUrlPathMap(SubResource urlPathMap) { + this.urlPathMap = urlPathMap; + return this; + } + + /** + * Get redirect configuration resource of the application gateway. + * + * @return the redirectConfiguration value + */ + public SubResource redirectConfiguration() { + return this.redirectConfiguration; + } + + /** + * Set redirect configuration resource of the application gateway. + * + * @param redirectConfiguration the redirectConfiguration value to set + * @return the ApplicationGatewayRequestRoutingRule object itself. + */ + public ApplicationGatewayRequestRoutingRule withRedirectConfiguration(SubResource redirectConfiguration) { + this.redirectConfiguration = redirectConfiguration; + return this; + } + + /** + * Get provisioning state of the request routing rule resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the request routing rule resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ApplicationGatewayRequestRoutingRule object itself. + */ + public ApplicationGatewayRequestRoutingRule withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get name of the request routing rule that is unique within an Application Gateway. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the request routing rule that is unique within an Application Gateway. + * + * @param name the name value to set + * @return the ApplicationGatewayRequestRoutingRule object itself. + */ + public ApplicationGatewayRequestRoutingRule withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ApplicationGatewayRequestRoutingRule object itself. + */ + public ApplicationGatewayRequestRoutingRule withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set type of the resource. + * + * @param type the type value to set + * @return the ApplicationGatewayRequestRoutingRule object itself. + */ + public ApplicationGatewayRequestRoutingRule withType(String type) { + this.type = type; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayRequestRoutingRuleType.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayRequestRoutingRuleType.java new file mode 100644 index 000000000000..fbc54df310d2 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayRequestRoutingRuleType.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ApplicationGatewayRequestRoutingRuleType. + */ +public final class ApplicationGatewayRequestRoutingRuleType extends ExpandableStringEnum { + /** Static value Basic for ApplicationGatewayRequestRoutingRuleType. */ + public static final ApplicationGatewayRequestRoutingRuleType BASIC = fromString("Basic"); + + /** Static value PathBasedRouting for ApplicationGatewayRequestRoutingRuleType. */ + public static final ApplicationGatewayRequestRoutingRuleType PATH_BASED_ROUTING = fromString("PathBasedRouting"); + + /** + * Creates or finds a ApplicationGatewayRequestRoutingRuleType from its string representation. + * @param name a name to look for + * @return the corresponding ApplicationGatewayRequestRoutingRuleType + */ + @JsonCreator + public static ApplicationGatewayRequestRoutingRuleType fromString(String name) { + return fromString(name, ApplicationGatewayRequestRoutingRuleType.class); + } + + /** + * @return known ApplicationGatewayRequestRoutingRuleType values + */ + public static Collection values() { + return values(ApplicationGatewayRequestRoutingRuleType.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewaySku.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewaySku.java new file mode 100644 index 000000000000..9e9502f025d7 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewaySku.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * SKU of an application gateway. + */ +public class ApplicationGatewaySku { + /** + * Name of an application gateway SKU. Possible values include: + * 'Standard_Small', 'Standard_Medium', 'Standard_Large', 'WAF_Medium', + * 'WAF_Large', 'Standard_v2', 'WAF_v2'. + */ + @JsonProperty(value = "name") + private ApplicationGatewaySkuName name; + + /** + * Tier of an application gateway. Possible values include: 'Standard', + * 'WAF', 'Standard_v2', 'WAF_v2'. + */ + @JsonProperty(value = "tier") + private ApplicationGatewayTier tier; + + /** + * Capacity (instance count) of an application gateway. + */ + @JsonProperty(value = "capacity") + private Integer capacity; + + /** + * Get name of an application gateway SKU. Possible values include: 'Standard_Small', 'Standard_Medium', 'Standard_Large', 'WAF_Medium', 'WAF_Large', 'Standard_v2', 'WAF_v2'. + * + * @return the name value + */ + public ApplicationGatewaySkuName name() { + return this.name; + } + + /** + * Set name of an application gateway SKU. Possible values include: 'Standard_Small', 'Standard_Medium', 'Standard_Large', 'WAF_Medium', 'WAF_Large', 'Standard_v2', 'WAF_v2'. + * + * @param name the name value to set + * @return the ApplicationGatewaySku object itself. + */ + public ApplicationGatewaySku withName(ApplicationGatewaySkuName name) { + this.name = name; + return this; + } + + /** + * Get tier of an application gateway. Possible values include: 'Standard', 'WAF', 'Standard_v2', 'WAF_v2'. + * + * @return the tier value + */ + public ApplicationGatewayTier tier() { + return this.tier; + } + + /** + * Set tier of an application gateway. Possible values include: 'Standard', 'WAF', 'Standard_v2', 'WAF_v2'. + * + * @param tier the tier value to set + * @return the ApplicationGatewaySku object itself. + */ + public ApplicationGatewaySku withTier(ApplicationGatewayTier tier) { + this.tier = tier; + return this; + } + + /** + * Get capacity (instance count) of an application gateway. + * + * @return the capacity value + */ + public Integer capacity() { + return this.capacity; + } + + /** + * Set capacity (instance count) of an application gateway. + * + * @param capacity the capacity value to set + * @return the ApplicationGatewaySku object itself. + */ + public ApplicationGatewaySku withCapacity(Integer capacity) { + this.capacity = capacity; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewaySkuName.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewaySkuName.java new file mode 100644 index 000000000000..484a130a29eb --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewaySkuName.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ApplicationGatewaySkuName. + */ +public final class ApplicationGatewaySkuName extends ExpandableStringEnum { + /** Static value Standard_Small for ApplicationGatewaySkuName. */ + public static final ApplicationGatewaySkuName STANDARD_SMALL = fromString("Standard_Small"); + + /** Static value Standard_Medium for ApplicationGatewaySkuName. */ + public static final ApplicationGatewaySkuName STANDARD_MEDIUM = fromString("Standard_Medium"); + + /** Static value Standard_Large for ApplicationGatewaySkuName. */ + public static final ApplicationGatewaySkuName STANDARD_LARGE = fromString("Standard_Large"); + + /** Static value WAF_Medium for ApplicationGatewaySkuName. */ + public static final ApplicationGatewaySkuName WAF_MEDIUM = fromString("WAF_Medium"); + + /** Static value WAF_Large for ApplicationGatewaySkuName. */ + public static final ApplicationGatewaySkuName WAF_LARGE = fromString("WAF_Large"); + + /** Static value Standard_v2 for ApplicationGatewaySkuName. */ + public static final ApplicationGatewaySkuName STANDARD_V2 = fromString("Standard_v2"); + + /** Static value WAF_v2 for ApplicationGatewaySkuName. */ + public static final ApplicationGatewaySkuName WAF_V2 = fromString("WAF_v2"); + + /** + * Creates or finds a ApplicationGatewaySkuName from its string representation. + * @param name a name to look for + * @return the corresponding ApplicationGatewaySkuName + */ + @JsonCreator + public static ApplicationGatewaySkuName fromString(String name) { + return fromString(name, ApplicationGatewaySkuName.class); + } + + /** + * @return known ApplicationGatewaySkuName values + */ + public static Collection values() { + return values(ApplicationGatewaySkuName.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewaySslCertificate.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewaySslCertificate.java new file mode 100644 index 000000000000..3bfa65ce6137 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewaySslCertificate.java @@ -0,0 +1,206 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * SSL certificates of an application gateway. + */ +@JsonFlatten +public class ApplicationGatewaySslCertificate extends SubResource { + /** + * Base-64 encoded pfx certificate. Only applicable in PUT Request. + */ + @JsonProperty(value = "properties.data") + private String data; + + /** + * Password for the pfx file specified in data. Only applicable in PUT + * request. + */ + @JsonProperty(value = "properties.password") + private String password; + + /** + * Base-64 encoded Public cert data corresponding to pfx specified in data. + * Only applicable in GET request. + */ + @JsonProperty(value = "properties.publicCertData") + private String publicCertData; + + /** + * Provisioning state of the SSL certificate resource Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Name of the SSL certificate that is unique within an Application + * Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get base-64 encoded pfx certificate. Only applicable in PUT Request. + * + * @return the data value + */ + public String data() { + return this.data; + } + + /** + * Set base-64 encoded pfx certificate. Only applicable in PUT Request. + * + * @param data the data value to set + * @return the ApplicationGatewaySslCertificate object itself. + */ + public ApplicationGatewaySslCertificate withData(String data) { + this.data = data; + return this; + } + + /** + * Get password for the pfx file specified in data. Only applicable in PUT request. + * + * @return the password value + */ + public String password() { + return this.password; + } + + /** + * Set password for the pfx file specified in data. Only applicable in PUT request. + * + * @param password the password value to set + * @return the ApplicationGatewaySslCertificate object itself. + */ + public ApplicationGatewaySslCertificate withPassword(String password) { + this.password = password; + return this; + } + + /** + * Get base-64 encoded Public cert data corresponding to pfx specified in data. Only applicable in GET request. + * + * @return the publicCertData value + */ + public String publicCertData() { + return this.publicCertData; + } + + /** + * Set base-64 encoded Public cert data corresponding to pfx specified in data. Only applicable in GET request. + * + * @param publicCertData the publicCertData value to set + * @return the ApplicationGatewaySslCertificate object itself. + */ + public ApplicationGatewaySslCertificate withPublicCertData(String publicCertData) { + this.publicCertData = publicCertData; + return this; + } + + /** + * Get provisioning state of the SSL certificate resource Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the SSL certificate resource Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ApplicationGatewaySslCertificate object itself. + */ + public ApplicationGatewaySslCertificate withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get name of the SSL certificate that is unique within an Application Gateway. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the SSL certificate that is unique within an Application Gateway. + * + * @param name the name value to set + * @return the ApplicationGatewaySslCertificate object itself. + */ + public ApplicationGatewaySslCertificate withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ApplicationGatewaySslCertificate object itself. + */ + public ApplicationGatewaySslCertificate withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set type of the resource. + * + * @param type the type value to set + * @return the ApplicationGatewaySslCertificate object itself. + */ + public ApplicationGatewaySslCertificate withType(String type) { + this.type = type; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewaySslCipherSuite.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewaySslCipherSuite.java new file mode 100644 index 000000000000..e3c82d311289 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewaySslCipherSuite.java @@ -0,0 +1,110 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ApplicationGatewaySslCipherSuite. + */ +public final class ApplicationGatewaySslCipherSuite extends ExpandableStringEnum { + /** Static value TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 = fromString("TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384"); + + /** Static value TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 = fromString("TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256"); + + /** Static value TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA = fromString("TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA"); + + /** Static value TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA = fromString("TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA"); + + /** Static value TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 = fromString("TLS_DHE_RSA_WITH_AES_256_GCM_SHA384"); + + /** Static value TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 = fromString("TLS_DHE_RSA_WITH_AES_128_GCM_SHA256"); + + /** Static value TLS_DHE_RSA_WITH_AES_256_CBC_SHA for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_DHE_RSA_WITH_AES_256_CBC_SHA = fromString("TLS_DHE_RSA_WITH_AES_256_CBC_SHA"); + + /** Static value TLS_DHE_RSA_WITH_AES_128_CBC_SHA for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_DHE_RSA_WITH_AES_128_CBC_SHA = fromString("TLS_DHE_RSA_WITH_AES_128_CBC_SHA"); + + /** Static value TLS_RSA_WITH_AES_256_GCM_SHA384 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_RSA_WITH_AES_256_GCM_SHA384 = fromString("TLS_RSA_WITH_AES_256_GCM_SHA384"); + + /** Static value TLS_RSA_WITH_AES_128_GCM_SHA256 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_RSA_WITH_AES_128_GCM_SHA256 = fromString("TLS_RSA_WITH_AES_128_GCM_SHA256"); + + /** Static value TLS_RSA_WITH_AES_256_CBC_SHA256 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_RSA_WITH_AES_256_CBC_SHA256 = fromString("TLS_RSA_WITH_AES_256_CBC_SHA256"); + + /** Static value TLS_RSA_WITH_AES_128_CBC_SHA256 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_RSA_WITH_AES_128_CBC_SHA256 = fromString("TLS_RSA_WITH_AES_128_CBC_SHA256"); + + /** Static value TLS_RSA_WITH_AES_256_CBC_SHA for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_RSA_WITH_AES_256_CBC_SHA = fromString("TLS_RSA_WITH_AES_256_CBC_SHA"); + + /** Static value TLS_RSA_WITH_AES_128_CBC_SHA for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_RSA_WITH_AES_128_CBC_SHA = fromString("TLS_RSA_WITH_AES_128_CBC_SHA"); + + /** Static value TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 = fromString("TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384"); + + /** Static value TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 = fromString("TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256"); + + /** Static value TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 = fromString("TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384"); + + /** Static value TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 = fromString("TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256"); + + /** Static value TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA = fromString("TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA"); + + /** Static value TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA = fromString("TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA"); + + /** Static value TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 = fromString("TLS_DHE_DSS_WITH_AES_256_CBC_SHA256"); + + /** Static value TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 = fromString("TLS_DHE_DSS_WITH_AES_128_CBC_SHA256"); + + /** Static value TLS_DHE_DSS_WITH_AES_256_CBC_SHA for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_DHE_DSS_WITH_AES_256_CBC_SHA = fromString("TLS_DHE_DSS_WITH_AES_256_CBC_SHA"); + + /** Static value TLS_DHE_DSS_WITH_AES_128_CBC_SHA for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_DHE_DSS_WITH_AES_128_CBC_SHA = fromString("TLS_DHE_DSS_WITH_AES_128_CBC_SHA"); + + /** Static value TLS_RSA_WITH_3DES_EDE_CBC_SHA for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_RSA_WITH_3DES_EDE_CBC_SHA = fromString("TLS_RSA_WITH_3DES_EDE_CBC_SHA"); + + /** + * Creates or finds a ApplicationGatewaySslCipherSuite from its string representation. + * @param name a name to look for + * @return the corresponding ApplicationGatewaySslCipherSuite + */ + @JsonCreator + public static ApplicationGatewaySslCipherSuite fromString(String name) { + return fromString(name, ApplicationGatewaySslCipherSuite.class); + } + + /** + * @return known ApplicationGatewaySslCipherSuite values + */ + public static Collection values() { + return values(ApplicationGatewaySslCipherSuite.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewaySslPolicy.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewaySslPolicy.java new file mode 100644 index 000000000000..75afd719020c --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewaySslPolicy.java @@ -0,0 +1,152 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Application Gateway Ssl policy. + */ +public class ApplicationGatewaySslPolicy { + /** + * Ssl protocols to be disabled on application gateway. + */ + @JsonProperty(value = "disabledSslProtocols") + private List disabledSslProtocols; + + /** + * Type of Ssl Policy. Possible values include: 'Predefined', 'Custom'. + */ + @JsonProperty(value = "policyType") + private ApplicationGatewaySslPolicyType policyType; + + /** + * Name of Ssl predefined policy. Possible values include: + * 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', + * 'AppGwSslPolicy20170401S'. + */ + @JsonProperty(value = "policyName") + private ApplicationGatewaySslPolicyName policyName; + + /** + * Ssl cipher suites to be enabled in the specified order to application + * gateway. + */ + @JsonProperty(value = "cipherSuites") + private List cipherSuites; + + /** + * Minimum version of Ssl protocol to be supported on application gateway. + * Possible values include: 'TLSv1_0', 'TLSv1_1', 'TLSv1_2'. + */ + @JsonProperty(value = "minProtocolVersion") + private ApplicationGatewaySslProtocol minProtocolVersion; + + /** + * Get ssl protocols to be disabled on application gateway. + * + * @return the disabledSslProtocols value + */ + public List disabledSslProtocols() { + return this.disabledSslProtocols; + } + + /** + * Set ssl protocols to be disabled on application gateway. + * + * @param disabledSslProtocols the disabledSslProtocols value to set + * @return the ApplicationGatewaySslPolicy object itself. + */ + public ApplicationGatewaySslPolicy withDisabledSslProtocols(List disabledSslProtocols) { + this.disabledSslProtocols = disabledSslProtocols; + return this; + } + + /** + * Get type of Ssl Policy. Possible values include: 'Predefined', 'Custom'. + * + * @return the policyType value + */ + public ApplicationGatewaySslPolicyType policyType() { + return this.policyType; + } + + /** + * Set type of Ssl Policy. Possible values include: 'Predefined', 'Custom'. + * + * @param policyType the policyType value to set + * @return the ApplicationGatewaySslPolicy object itself. + */ + public ApplicationGatewaySslPolicy withPolicyType(ApplicationGatewaySslPolicyType policyType) { + this.policyType = policyType; + return this; + } + + /** + * Get name of Ssl predefined policy. Possible values include: 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S'. + * + * @return the policyName value + */ + public ApplicationGatewaySslPolicyName policyName() { + return this.policyName; + } + + /** + * Set name of Ssl predefined policy. Possible values include: 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S'. + * + * @param policyName the policyName value to set + * @return the ApplicationGatewaySslPolicy object itself. + */ + public ApplicationGatewaySslPolicy withPolicyName(ApplicationGatewaySslPolicyName policyName) { + this.policyName = policyName; + return this; + } + + /** + * Get ssl cipher suites to be enabled in the specified order to application gateway. + * + * @return the cipherSuites value + */ + public List cipherSuites() { + return this.cipherSuites; + } + + /** + * Set ssl cipher suites to be enabled in the specified order to application gateway. + * + * @param cipherSuites the cipherSuites value to set + * @return the ApplicationGatewaySslPolicy object itself. + */ + public ApplicationGatewaySslPolicy withCipherSuites(List cipherSuites) { + this.cipherSuites = cipherSuites; + return this; + } + + /** + * Get minimum version of Ssl protocol to be supported on application gateway. Possible values include: 'TLSv1_0', 'TLSv1_1', 'TLSv1_2'. + * + * @return the minProtocolVersion value + */ + public ApplicationGatewaySslProtocol minProtocolVersion() { + return this.minProtocolVersion; + } + + /** + * Set minimum version of Ssl protocol to be supported on application gateway. Possible values include: 'TLSv1_0', 'TLSv1_1', 'TLSv1_2'. + * + * @param minProtocolVersion the minProtocolVersion value to set + * @return the ApplicationGatewaySslPolicy object itself. + */ + public ApplicationGatewaySslPolicy withMinProtocolVersion(ApplicationGatewaySslProtocol minProtocolVersion) { + this.minProtocolVersion = minProtocolVersion; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewaySslPolicyName.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewaySslPolicyName.java new file mode 100644 index 000000000000..e0bc8ee1bb79 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewaySslPolicyName.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ApplicationGatewaySslPolicyName. + */ +public final class ApplicationGatewaySslPolicyName extends ExpandableStringEnum { + /** Static value AppGwSslPolicy20150501 for ApplicationGatewaySslPolicyName. */ + public static final ApplicationGatewaySslPolicyName APP_GW_SSL_POLICY20150501 = fromString("AppGwSslPolicy20150501"); + + /** Static value AppGwSslPolicy20170401 for ApplicationGatewaySslPolicyName. */ + public static final ApplicationGatewaySslPolicyName APP_GW_SSL_POLICY20170401 = fromString("AppGwSslPolicy20170401"); + + /** Static value AppGwSslPolicy20170401S for ApplicationGatewaySslPolicyName. */ + public static final ApplicationGatewaySslPolicyName APP_GW_SSL_POLICY20170401S = fromString("AppGwSslPolicy20170401S"); + + /** + * Creates or finds a ApplicationGatewaySslPolicyName from its string representation. + * @param name a name to look for + * @return the corresponding ApplicationGatewaySslPolicyName + */ + @JsonCreator + public static ApplicationGatewaySslPolicyName fromString(String name) { + return fromString(name, ApplicationGatewaySslPolicyName.class); + } + + /** + * @return known ApplicationGatewaySslPolicyName values + */ + public static Collection values() { + return values(ApplicationGatewaySslPolicyName.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewaySslPolicyType.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewaySslPolicyType.java new file mode 100644 index 000000000000..ebf4461656ed --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewaySslPolicyType.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ApplicationGatewaySslPolicyType. + */ +public final class ApplicationGatewaySslPolicyType extends ExpandableStringEnum { + /** Static value Predefined for ApplicationGatewaySslPolicyType. */ + public static final ApplicationGatewaySslPolicyType PREDEFINED = fromString("Predefined"); + + /** Static value Custom for ApplicationGatewaySslPolicyType. */ + public static final ApplicationGatewaySslPolicyType CUSTOM = fromString("Custom"); + + /** + * Creates or finds a ApplicationGatewaySslPolicyType from its string representation. + * @param name a name to look for + * @return the corresponding ApplicationGatewaySslPolicyType + */ + @JsonCreator + public static ApplicationGatewaySslPolicyType fromString(String name) { + return fromString(name, ApplicationGatewaySslPolicyType.class); + } + + /** + * @return known ApplicationGatewaySslPolicyType values + */ + public static Collection values() { + return values(ApplicationGatewaySslPolicyType.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewaySslPredefinedPolicy.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewaySslPredefinedPolicy.java new file mode 100644 index 000000000000..68deceb7aa9a --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewaySslPredefinedPolicy.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.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.ApplicationGatewaySslPredefinedPolicyInner; +import java.util.List; + +/** + * Type representing ApplicationGatewaySslPredefinedPolicy. + */ +public interface ApplicationGatewaySslPredefinedPolicy extends HasInner, HasManager { + /** + * @return the cipherSuites value. + */ + List cipherSuites(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the minProtocolVersion value. + */ + ApplicationGatewaySslProtocol minProtocolVersion(); + + /** + * @return the name value. + */ + String name(); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewaySslProtocol.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewaySslProtocol.java new file mode 100644 index 000000000000..ec51b7ba03ff --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewaySslProtocol.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ApplicationGatewaySslProtocol. + */ +public final class ApplicationGatewaySslProtocol extends ExpandableStringEnum { + /** Static value TLSv1_0 for ApplicationGatewaySslProtocol. */ + public static final ApplicationGatewaySslProtocol TLSV1_0 = fromString("TLSv1_0"); + + /** Static value TLSv1_1 for ApplicationGatewaySslProtocol. */ + public static final ApplicationGatewaySslProtocol TLSV1_1 = fromString("TLSv1_1"); + + /** Static value TLSv1_2 for ApplicationGatewaySslProtocol. */ + public static final ApplicationGatewaySslProtocol TLSV1_2 = fromString("TLSv1_2"); + + /** + * Creates or finds a ApplicationGatewaySslProtocol from its string representation. + * @param name a name to look for + * @return the corresponding ApplicationGatewaySslProtocol + */ + @JsonCreator + public static ApplicationGatewaySslProtocol fromString(String name) { + return fromString(name, ApplicationGatewaySslProtocol.class); + } + + /** + * @return known ApplicationGatewaySslProtocol values + */ + public static Collection values() { + return values(ApplicationGatewaySslProtocol.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayTier.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayTier.java new file mode 100644 index 000000000000..d94a56b133e2 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayTier.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ApplicationGatewayTier. + */ +public final class ApplicationGatewayTier extends ExpandableStringEnum { + /** Static value Standard for ApplicationGatewayTier. */ + public static final ApplicationGatewayTier STANDARD = fromString("Standard"); + + /** Static value WAF for ApplicationGatewayTier. */ + public static final ApplicationGatewayTier WAF = fromString("WAF"); + + /** Static value Standard_v2 for ApplicationGatewayTier. */ + public static final ApplicationGatewayTier STANDARD_V2 = fromString("Standard_v2"); + + /** Static value WAF_v2 for ApplicationGatewayTier. */ + public static final ApplicationGatewayTier WAF_V2 = fromString("WAF_v2"); + + /** + * Creates or finds a ApplicationGatewayTier from its string representation. + * @param name a name to look for + * @return the corresponding ApplicationGatewayTier + */ + @JsonCreator + public static ApplicationGatewayTier fromString(String name) { + return fromString(name, ApplicationGatewayTier.class); + } + + /** + * @return known ApplicationGatewayTier values + */ + public static Collection values() { + return values(ApplicationGatewayTier.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayUrlPathMap.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayUrlPathMap.java new file mode 100644 index 000000000000..0feb124a9d63 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayUrlPathMap.java @@ -0,0 +1,231 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.SubResource; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * UrlPathMaps give a url path to the backend mapping information for + * PathBasedRouting. + */ +@JsonFlatten +public class ApplicationGatewayUrlPathMap extends SubResource { + /** + * Default backend address pool resource of URL path map. + */ + @JsonProperty(value = "properties.defaultBackendAddressPool") + private SubResource defaultBackendAddressPool; + + /** + * Default backend http settings resource of URL path map. + */ + @JsonProperty(value = "properties.defaultBackendHttpSettings") + private SubResource defaultBackendHttpSettings; + + /** + * Default redirect configuration resource of URL path map. + */ + @JsonProperty(value = "properties.defaultRedirectConfiguration") + private SubResource defaultRedirectConfiguration; + + /** + * Path rule of URL path map resource. + */ + @JsonProperty(value = "properties.pathRules") + private List pathRules; + + /** + * Provisioning state of the backend http settings resource. Possible + * values are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Name of the URL path map that is unique within an Application Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get default backend address pool resource of URL path map. + * + * @return the defaultBackendAddressPool value + */ + public SubResource defaultBackendAddressPool() { + return this.defaultBackendAddressPool; + } + + /** + * Set default backend address pool resource of URL path map. + * + * @param defaultBackendAddressPool the defaultBackendAddressPool value to set + * @return the ApplicationGatewayUrlPathMap object itself. + */ + public ApplicationGatewayUrlPathMap withDefaultBackendAddressPool(SubResource defaultBackendAddressPool) { + this.defaultBackendAddressPool = defaultBackendAddressPool; + return this; + } + + /** + * Get default backend http settings resource of URL path map. + * + * @return the defaultBackendHttpSettings value + */ + public SubResource defaultBackendHttpSettings() { + return this.defaultBackendHttpSettings; + } + + /** + * Set default backend http settings resource of URL path map. + * + * @param defaultBackendHttpSettings the defaultBackendHttpSettings value to set + * @return the ApplicationGatewayUrlPathMap object itself. + */ + public ApplicationGatewayUrlPathMap withDefaultBackendHttpSettings(SubResource defaultBackendHttpSettings) { + this.defaultBackendHttpSettings = defaultBackendHttpSettings; + return this; + } + + /** + * Get default redirect configuration resource of URL path map. + * + * @return the defaultRedirectConfiguration value + */ + public SubResource defaultRedirectConfiguration() { + return this.defaultRedirectConfiguration; + } + + /** + * Set default redirect configuration resource of URL path map. + * + * @param defaultRedirectConfiguration the defaultRedirectConfiguration value to set + * @return the ApplicationGatewayUrlPathMap object itself. + */ + public ApplicationGatewayUrlPathMap withDefaultRedirectConfiguration(SubResource defaultRedirectConfiguration) { + this.defaultRedirectConfiguration = defaultRedirectConfiguration; + return this; + } + + /** + * Get path rule of URL path map resource. + * + * @return the pathRules value + */ + public List pathRules() { + return this.pathRules; + } + + /** + * Set path rule of URL path map resource. + * + * @param pathRules the pathRules value to set + * @return the ApplicationGatewayUrlPathMap object itself. + */ + public ApplicationGatewayUrlPathMap withPathRules(List pathRules) { + this.pathRules = pathRules; + return this; + } + + /** + * Get provisioning state of the backend http settings resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the backend http settings resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ApplicationGatewayUrlPathMap object itself. + */ + public ApplicationGatewayUrlPathMap withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get name of the URL path map that is unique within an Application Gateway. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the URL path map that is unique within an Application Gateway. + * + * @param name the name value to set + * @return the ApplicationGatewayUrlPathMap object itself. + */ + public ApplicationGatewayUrlPathMap withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ApplicationGatewayUrlPathMap object itself. + */ + public ApplicationGatewayUrlPathMap withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get type of the resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set type of the resource. + * + * @param type the type value to set + * @return the ApplicationGatewayUrlPathMap object itself. + */ + public ApplicationGatewayUrlPathMap withType(String type) { + this.type = type; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayWebApplicationFirewallConfiguration.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayWebApplicationFirewallConfiguration.java new file mode 100644 index 000000000000..cf6f24f8a8f7 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGatewayWebApplicationFirewallConfiguration.java @@ -0,0 +1,202 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Application gateway web application firewall configuration. + */ +public class ApplicationGatewayWebApplicationFirewallConfiguration { + /** + * Whether the web application firewall is enabled or not. + */ + @JsonProperty(value = "enabled", required = true) + private boolean enabled; + + /** + * Web application firewall mode. Possible values include: 'Detection', + * 'Prevention'. + */ + @JsonProperty(value = "firewallMode", required = true) + private ApplicationGatewayFirewallMode firewallMode; + + /** + * The type of the web application firewall rule set. Possible values are: + * 'OWASP'. + */ + @JsonProperty(value = "ruleSetType", required = true) + private String ruleSetType; + + /** + * The version of the rule set type. + */ + @JsonProperty(value = "ruleSetVersion", required = true) + private String ruleSetVersion; + + /** + * The disabled rule groups. + */ + @JsonProperty(value = "disabledRuleGroups") + private List disabledRuleGroups; + + /** + * Whether allow WAF to check request Body. + */ + @JsonProperty(value = "requestBodyCheck") + private Boolean requestBodyCheck; + + /** + * Maxium request body size for WAF. + */ + @JsonProperty(value = "maxRequestBodySize") + private Integer maxRequestBodySize; + + /** + * Get whether the web application firewall is enabled or not. + * + * @return the enabled value + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set whether the web application firewall is enabled or not. + * + * @param enabled the enabled value to set + * @return the ApplicationGatewayWebApplicationFirewallConfiguration object itself. + */ + public ApplicationGatewayWebApplicationFirewallConfiguration withEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get web application firewall mode. Possible values include: 'Detection', 'Prevention'. + * + * @return the firewallMode value + */ + public ApplicationGatewayFirewallMode firewallMode() { + return this.firewallMode; + } + + /** + * Set web application firewall mode. Possible values include: 'Detection', 'Prevention'. + * + * @param firewallMode the firewallMode value to set + * @return the ApplicationGatewayWebApplicationFirewallConfiguration object itself. + */ + public ApplicationGatewayWebApplicationFirewallConfiguration withFirewallMode(ApplicationGatewayFirewallMode firewallMode) { + this.firewallMode = firewallMode; + return this; + } + + /** + * Get the type of the web application firewall rule set. Possible values are: 'OWASP'. + * + * @return the ruleSetType value + */ + public String ruleSetType() { + return this.ruleSetType; + } + + /** + * Set the type of the web application firewall rule set. Possible values are: 'OWASP'. + * + * @param ruleSetType the ruleSetType value to set + * @return the ApplicationGatewayWebApplicationFirewallConfiguration object itself. + */ + public ApplicationGatewayWebApplicationFirewallConfiguration withRuleSetType(String ruleSetType) { + this.ruleSetType = ruleSetType; + return this; + } + + /** + * Get the version of the rule set type. + * + * @return the ruleSetVersion value + */ + public String ruleSetVersion() { + return this.ruleSetVersion; + } + + /** + * Set the version of the rule set type. + * + * @param ruleSetVersion the ruleSetVersion value to set + * @return the ApplicationGatewayWebApplicationFirewallConfiguration object itself. + */ + public ApplicationGatewayWebApplicationFirewallConfiguration withRuleSetVersion(String ruleSetVersion) { + this.ruleSetVersion = ruleSetVersion; + return this; + } + + /** + * Get the disabled rule groups. + * + * @return the disabledRuleGroups value + */ + public List disabledRuleGroups() { + return this.disabledRuleGroups; + } + + /** + * Set the disabled rule groups. + * + * @param disabledRuleGroups the disabledRuleGroups value to set + * @return the ApplicationGatewayWebApplicationFirewallConfiguration object itself. + */ + public ApplicationGatewayWebApplicationFirewallConfiguration withDisabledRuleGroups(List disabledRuleGroups) { + this.disabledRuleGroups = disabledRuleGroups; + return this; + } + + /** + * Get whether allow WAF to check request Body. + * + * @return the requestBodyCheck value + */ + public Boolean requestBodyCheck() { + return this.requestBodyCheck; + } + + /** + * Set whether allow WAF to check request Body. + * + * @param requestBodyCheck the requestBodyCheck value to set + * @return the ApplicationGatewayWebApplicationFirewallConfiguration object itself. + */ + public ApplicationGatewayWebApplicationFirewallConfiguration withRequestBodyCheck(Boolean requestBodyCheck) { + this.requestBodyCheck = requestBodyCheck; + return this; + } + + /** + * Get maxium request body size for WAF. + * + * @return the maxRequestBodySize value + */ + public Integer maxRequestBodySize() { + return this.maxRequestBodySize; + } + + /** + * Set maxium request body size for WAF. + * + * @param maxRequestBodySize the maxRequestBodySize value to set + * @return the ApplicationGatewayWebApplicationFirewallConfiguration object itself. + */ + public ApplicationGatewayWebApplicationFirewallConfiguration withMaxRequestBodySize(Integer maxRequestBodySize) { + this.maxRequestBodySize = maxRequestBodySize; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGateways.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGateways.java new file mode 100644 index 000000000000..28716f560f5b --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationGateways.java @@ -0,0 +1,89 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import rx.Completable; +import com.microsoft.azure.management.network.v2018_06_01.implementation.ApplicationGatewaysInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ApplicationGateways. + */ +public interface ApplicationGateways extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Starts the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable startAsync(String resourceGroupName, String applicationGatewayName); + + /** + * Stops the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable stopAsync(String resourceGroupName, String applicationGatewayName); + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable backendHealthAsync(String resourceGroupName, String applicationGatewayName); + + /** + * Lists all available web application firewall rule sets. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAvailableWafRuleSetsAsync(); + + /** + * Lists available Ssl options for configuring Ssl policy. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAvailableSslOptionsAsync(); + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAvailableSslPredefinedPoliciesAsync(); + + /** + * Gets Ssl predefined policy with the specified policy name. + * + * @param predefinedPolicyName Name of Ssl predefined policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getSslPredefinedPolicyAsync(String predefinedPolicyName); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationSecurityGroup.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationSecurityGroup.java new file mode 100644 index 000000000000..909a4014b740 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationSecurityGroup.java @@ -0,0 +1,83 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.ApplicationSecurityGroupInner; + +/** + * Type representing ApplicationSecurityGroup. + */ +public interface ApplicationSecurityGroup extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * The entirety of the ApplicationSecurityGroup definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of ApplicationSecurityGroup definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ApplicationSecurityGroup definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the ApplicationSecurityGroup definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags { + } + } + /** + * The template for a ApplicationSecurityGroup update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags { + } + + /** + * Grouping of ApplicationSecurityGroup update stages. + */ + interface UpdateStages { + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationSecurityGroups.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationSecurityGroups.java new file mode 100644 index 000000000000..99a122261eb1 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ApplicationSecurityGroups.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_06_01.implementation.ApplicationSecurityGroupsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ApplicationSecurityGroups. + */ +public interface ApplicationSecurityGroups extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AssociationType.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AssociationType.java new file mode 100644 index 000000000000..7f68204dac33 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AssociationType.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for AssociationType. + */ +public final class AssociationType extends ExpandableStringEnum { + /** Static value Associated for AssociationType. */ + public static final AssociationType ASSOCIATED = fromString("Associated"); + + /** Static value Contains for AssociationType. */ + public static final AssociationType CONTAINS = fromString("Contains"); + + /** + * Creates or finds a AssociationType from its string representation. + * @param name a name to look for + * @return the corresponding AssociationType + */ + @JsonCreator + public static AssociationType fromString(String name) { + return fromString(name, AssociationType.class); + } + + /** + * @return known AssociationType values + */ + public static Collection values() { + return values(AssociationType.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AuthenticationMethod.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AuthenticationMethod.java new file mode 100644 index 000000000000..0b4e0c28f113 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AuthenticationMethod.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for AuthenticationMethod. + */ +public final class AuthenticationMethod extends ExpandableStringEnum { + /** Static value EAPTLS for AuthenticationMethod. */ + public static final AuthenticationMethod EAPTLS = fromString("EAPTLS"); + + /** Static value EAPMSCHAPv2 for AuthenticationMethod. */ + public static final AuthenticationMethod EAPMSCHAPV2 = fromString("EAPMSCHAPv2"); + + /** + * Creates or finds a AuthenticationMethod from its string representation. + * @param name a name to look for + * @return the corresponding AuthenticationMethod + */ + @JsonCreator + public static AuthenticationMethod fromString(String name) { + return fromString(name, AuthenticationMethod.class); + } + + /** + * @return known AuthenticationMethod values + */ + public static Collection values() { + return values(AuthenticationMethod.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AuthorizationUseStatus.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AuthorizationUseStatus.java new file mode 100644 index 000000000000..14957782e543 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AuthorizationUseStatus.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for AuthorizationUseStatus. + */ +public final class AuthorizationUseStatus extends ExpandableStringEnum { + /** Static value Available for AuthorizationUseStatus. */ + public static final AuthorizationUseStatus AVAILABLE = fromString("Available"); + + /** Static value InUse for AuthorizationUseStatus. */ + public static final AuthorizationUseStatus IN_USE = fromString("InUse"); + + /** + * Creates or finds a AuthorizationUseStatus from its string representation. + * @param name a name to look for + * @return the corresponding AuthorizationUseStatus + */ + @JsonCreator + public static AuthorizationUseStatus fromString(String name) { + return fromString(name, AuthorizationUseStatus.class); + } + + /** + * @return known AuthorizationUseStatus values + */ + public static Collection values() { + return values(AuthorizationUseStatus.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/Availability.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/Availability.java new file mode 100644 index 000000000000..673549b705fc --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/Availability.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Availability of the metric. + */ +public class Availability { + /** + * The time grain of the availability. + */ + @JsonProperty(value = "timeGrain") + private String timeGrain; + + /** + * The retention of the availability. + */ + @JsonProperty(value = "retention") + private String retention; + + /** + * Duration of the availability blob. + */ + @JsonProperty(value = "blobDuration") + private String blobDuration; + + /** + * Get the time grain of the availability. + * + * @return the timeGrain value + */ + public String timeGrain() { + return this.timeGrain; + } + + /** + * Set the time grain of the availability. + * + * @param timeGrain the timeGrain value to set + * @return the Availability object itself. + */ + public Availability withTimeGrain(String timeGrain) { + this.timeGrain = timeGrain; + return this; + } + + /** + * Get the retention of the availability. + * + * @return the retention value + */ + public String retention() { + return this.retention; + } + + /** + * Set the retention of the availability. + * + * @param retention the retention value to set + * @return the Availability object itself. + */ + public Availability withRetention(String retention) { + this.retention = retention; + return this; + } + + /** + * Get duration of the availability blob. + * + * @return the blobDuration value + */ + public String blobDuration() { + return this.blobDuration; + } + + /** + * Set duration of the availability blob. + * + * @param blobDuration the blobDuration value to set + * @return the Availability object itself. + */ + public Availability withBlobDuration(String blobDuration) { + this.blobDuration = blobDuration; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AvailableEndpointServices.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AvailableEndpointServices.java new file mode 100644 index 000000000000..e78c54e046a0 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AvailableEndpointServices.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import rx.Observable; +import com.microsoft.azure.management.network.v2018_06_01.EndpointServiceResult; + +/** + * Type representing AvailableEndpointServices. + */ +public interface AvailableEndpointServices { + /** + * List what values of endpoint services are available for use. + * + * @param location The location to check available endpoint services. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String location); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AvailableProvidersList.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AvailableProvidersList.java new file mode 100644 index 000000000000..aeeb12122923 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AvailableProvidersList.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.AvailableProvidersListInner; +import java.util.List; + +/** + * Type representing AvailableProvidersList. + */ +public interface AvailableProvidersList extends HasInner, HasManager { + /** + * @return the countries value. + */ + List countries(); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AvailableProvidersListCity.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AvailableProvidersListCity.java new file mode 100644 index 000000000000..c6aa8afdae30 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AvailableProvidersListCity.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.network.v2018_06_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * City or town details. + */ +public class AvailableProvidersListCity { + /** + * The city or town name. + */ + @JsonProperty(value = "cityName") + private String cityName; + + /** + * A list of Internet service providers. + */ + @JsonProperty(value = "providers") + private List providers; + + /** + * Get the city or town name. + * + * @return the cityName value + */ + public String cityName() { + return this.cityName; + } + + /** + * Set the city or town name. + * + * @param cityName the cityName value to set + * @return the AvailableProvidersListCity object itself. + */ + public AvailableProvidersListCity withCityName(String cityName) { + this.cityName = cityName; + return this; + } + + /** + * Get a list of Internet service providers. + * + * @return the providers value + */ + public List providers() { + return this.providers; + } + + /** + * Set a list of Internet service providers. + * + * @param providers the providers value to set + * @return the AvailableProvidersListCity object itself. + */ + public AvailableProvidersListCity withProviders(List providers) { + this.providers = providers; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AvailableProvidersListCountry.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AvailableProvidersListCountry.java new file mode 100644 index 000000000000..a77a332ba0df --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AvailableProvidersListCountry.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.network.v2018_06_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Country details. + */ +public class AvailableProvidersListCountry { + /** + * The country name. + */ + @JsonProperty(value = "countryName") + private String countryName; + + /** + * A list of Internet service providers. + */ + @JsonProperty(value = "providers") + private List providers; + + /** + * List of available states in the country. + */ + @JsonProperty(value = "states") + private List states; + + /** + * Get the country name. + * + * @return the countryName value + */ + public String countryName() { + return this.countryName; + } + + /** + * Set the country name. + * + * @param countryName the countryName value to set + * @return the AvailableProvidersListCountry object itself. + */ + public AvailableProvidersListCountry withCountryName(String countryName) { + this.countryName = countryName; + return this; + } + + /** + * Get a list of Internet service providers. + * + * @return the providers value + */ + public List providers() { + return this.providers; + } + + /** + * Set a list of Internet service providers. + * + * @param providers the providers value to set + * @return the AvailableProvidersListCountry object itself. + */ + public AvailableProvidersListCountry withProviders(List providers) { + this.providers = providers; + return this; + } + + /** + * Get list of available states in the country. + * + * @return the states value + */ + public List states() { + return this.states; + } + + /** + * Set list of available states in the country. + * + * @param states the states value to set + * @return the AvailableProvidersListCountry object itself. + */ + public AvailableProvidersListCountry withStates(List states) { + this.states = states; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AvailableProvidersListParameters.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AvailableProvidersListParameters.java new file mode 100644 index 000000000000..c52602d24b88 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AvailableProvidersListParameters.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.network.v2018_06_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Constraints that determine the list of available Internet service providers. + */ +public class AvailableProvidersListParameters { + /** + * A list of Azure regions. + */ + @JsonProperty(value = "azureLocations") + private List azureLocations; + + /** + * The country for available providers list. + */ + @JsonProperty(value = "country") + private String country; + + /** + * The state for available providers list. + */ + @JsonProperty(value = "state") + private String state; + + /** + * The city or town for available providers list. + */ + @JsonProperty(value = "city") + private String city; + + /** + * Get a list of Azure regions. + * + * @return the azureLocations value + */ + public List azureLocations() { + return this.azureLocations; + } + + /** + * Set a list of Azure regions. + * + * @param azureLocations the azureLocations value to set + * @return the AvailableProvidersListParameters object itself. + */ + public AvailableProvidersListParameters withAzureLocations(List azureLocations) { + this.azureLocations = azureLocations; + return this; + } + + /** + * Get the country for available providers list. + * + * @return the country value + */ + public String country() { + return this.country; + } + + /** + * Set the country for available providers list. + * + * @param country the country value to set + * @return the AvailableProvidersListParameters object itself. + */ + public AvailableProvidersListParameters withCountry(String country) { + this.country = country; + return this; + } + + /** + * Get the state for available providers list. + * + * @return the state value + */ + public String state() { + return this.state; + } + + /** + * Set the state for available providers list. + * + * @param state the state value to set + * @return the AvailableProvidersListParameters object itself. + */ + public AvailableProvidersListParameters withState(String state) { + this.state = state; + return this; + } + + /** + * Get the city or town for available providers list. + * + * @return the city value + */ + public String city() { + return this.city; + } + + /** + * Set the city or town for available providers list. + * + * @param city the city value to set + * @return the AvailableProvidersListParameters object itself. + */ + public AvailableProvidersListParameters withCity(String city) { + this.city = city; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AvailableProvidersListState.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AvailableProvidersListState.java new file mode 100644 index 000000000000..dd82fd0d2e5b --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AvailableProvidersListState.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.network.v2018_06_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * State details. + */ +public class AvailableProvidersListState { + /** + * The state name. + */ + @JsonProperty(value = "stateName") + private String stateName; + + /** + * A list of Internet service providers. + */ + @JsonProperty(value = "providers") + private List providers; + + /** + * List of available cities or towns in the state. + */ + @JsonProperty(value = "cities") + private List cities; + + /** + * Get the state name. + * + * @return the stateName value + */ + public String stateName() { + return this.stateName; + } + + /** + * Set the state name. + * + * @param stateName the stateName value to set + * @return the AvailableProvidersListState object itself. + */ + public AvailableProvidersListState withStateName(String stateName) { + this.stateName = stateName; + return this; + } + + /** + * Get a list of Internet service providers. + * + * @return the providers value + */ + public List providers() { + return this.providers; + } + + /** + * Set a list of Internet service providers. + * + * @param providers the providers value to set + * @return the AvailableProvidersListState object itself. + */ + public AvailableProvidersListState withProviders(List providers) { + this.providers = providers; + return this; + } + + /** + * Get list of available cities or towns in the state. + * + * @return the cities value + */ + public List cities() { + return this.cities; + } + + /** + * Set list of available cities or towns in the state. + * + * @param cities the cities value to set + * @return the AvailableProvidersListState object itself. + */ + public AvailableProvidersListState withCities(List cities) { + this.cities = cities; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AzureAsyncOperationResult.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AzureAsyncOperationResult.java new file mode 100644 index 000000000000..85d67d0fc8d0 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AzureAsyncOperationResult.java @@ -0,0 +1,78 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The response body contains the status of the specified asynchronous + * operation, indicating whether it has succeeded, is in progress, or has + * failed. Note that this status is distinct from the HTTP status code returned + * for the Get Operation Status operation itself. If the asynchronous operation + * succeeded, the response body includes the HTTP status code for the + * successful request. If the asynchronous operation failed, the response body + * includes the HTTP status code for the failed request and error information + * regarding the failure. + */ +public class AzureAsyncOperationResult { + /** + * Status of the Azure async operation. Possible values are: 'InProgress', + * 'Succeeded', and 'Failed'. Possible values include: 'InProgress', + * 'Succeeded', 'Failed'. + */ + @JsonProperty(value = "status") + private NetworkOperationStatus status; + + /** + * The error property. + */ + @JsonProperty(value = "error") + private Error error; + + /** + * Get status of the Azure async operation. Possible values are: 'InProgress', 'Succeeded', and 'Failed'. Possible values include: 'InProgress', 'Succeeded', 'Failed'. + * + * @return the status value + */ + public NetworkOperationStatus status() { + return this.status; + } + + /** + * Set status of the Azure async operation. Possible values are: 'InProgress', 'Succeeded', and 'Failed'. Possible values include: 'InProgress', 'Succeeded', 'Failed'. + * + * @param status the status value to set + * @return the AzureAsyncOperationResult object itself. + */ + public AzureAsyncOperationResult withStatus(NetworkOperationStatus status) { + this.status = status; + return this; + } + + /** + * Get the error value. + * + * @return the error value + */ + public Error error() { + return this.error; + } + + /** + * Set the error value. + * + * @param error the error value to set + * @return the AzureAsyncOperationResult object itself. + */ + public AzureAsyncOperationResult withError(Error error) { + this.error = error; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AzureFirewall.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AzureFirewall.java new file mode 100644 index 000000000000..e38ed6e0a79a --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AzureFirewall.java @@ -0,0 +1,174 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.implementation.AzureFirewallInner; + +/** + * Type representing AzureFirewall. + */ +public interface AzureFirewall extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the applicationRuleCollections value. + */ + List applicationRuleCollections(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the ipConfigurations value. + */ + List ipConfigurations(); + + /** + * @return the networkRuleCollections value. + */ + List networkRuleCollections(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * The entirety of the AzureFirewall definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of AzureFirewall definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a AzureFirewall definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the AzureFirewall definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the azurefirewall update allowing to specify ApplicationRuleCollections. + */ + interface WithApplicationRuleCollections { + /** + * Specifies applicationRuleCollections. + */ + WithCreate withApplicationRuleCollections(List applicationRuleCollections); + } + + /** + * The stage of the azurefirewall update allowing to specify IpConfigurations. + */ + interface WithIpConfigurations { + /** + * Specifies ipConfigurations. + */ + WithCreate withIpConfigurations(List ipConfigurations); + } + + /** + * The stage of the azurefirewall update allowing to specify NetworkRuleCollections. + */ + interface WithNetworkRuleCollections { + /** + * Specifies networkRuleCollections. + */ + WithCreate withNetworkRuleCollections(List networkRuleCollections); + } + + /** + * The stage of the azurefirewall update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + */ + WithCreate withProvisioningState(ProvisioningState provisioningState); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithApplicationRuleCollections, DefinitionStages.WithIpConfigurations, DefinitionStages.WithNetworkRuleCollections, DefinitionStages.WithProvisioningState { + } + } + /** + * The template for a AzureFirewall update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithApplicationRuleCollections, UpdateStages.WithIpConfigurations, UpdateStages.WithNetworkRuleCollections, UpdateStages.WithProvisioningState { + } + + /** + * Grouping of AzureFirewall update stages. + */ + interface UpdateStages { + /** + * The stage of the azurefirewall {0} allowing to specify ApplicationRuleCollections. + */ + interface WithApplicationRuleCollections { + /** + * Specifies applicationRuleCollections. + */ + Update withApplicationRuleCollections(List applicationRuleCollections); + } + + /** + * The stage of the azurefirewall {0} allowing to specify IpConfigurations. + */ + interface WithIpConfigurations { + /** + * Specifies ipConfigurations. + */ + Update withIpConfigurations(List ipConfigurations); + } + + /** + * The stage of the azurefirewall {0} allowing to specify NetworkRuleCollections. + */ + interface WithNetworkRuleCollections { + /** + * Specifies networkRuleCollections. + */ + Update withNetworkRuleCollections(List networkRuleCollections); + } + + /** + * The stage of the azurefirewall {0} allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + */ + Update withProvisioningState(ProvisioningState provisioningState); + } + + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AzureFirewallApplicationRule.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AzureFirewallApplicationRule.java new file mode 100644 index 000000000000..53d28fdba75f --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AzureFirewallApplicationRule.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties of an application rule. + */ +public class AzureFirewallApplicationRule { + /** + * Name of the application rule. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Description of the rule. + */ + @JsonProperty(value = "description") + private String description; + + /** + * List of source IP addresses for this rule. + */ + @JsonProperty(value = "sourceAddresses") + private List sourceAddresses; + + /** + * Array of ApplicationRuleProtocols. + */ + @JsonProperty(value = "protocols") + private List protocols; + + /** + * List of URLs for this rule. + */ + @JsonProperty(value = "targetUrls") + private List targetUrls; + + /** + * Get name of the application rule. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the application rule. + * + * @param name the name value to set + * @return the AzureFirewallApplicationRule object itself. + */ + public AzureFirewallApplicationRule withName(String name) { + this.name = name; + return this; + } + + /** + * Get description of the rule. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of the rule. + * + * @param description the description value to set + * @return the AzureFirewallApplicationRule object itself. + */ + public AzureFirewallApplicationRule withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get list of source IP addresses for this rule. + * + * @return the sourceAddresses value + */ + public List sourceAddresses() { + return this.sourceAddresses; + } + + /** + * Set list of source IP addresses for this rule. + * + * @param sourceAddresses the sourceAddresses value to set + * @return the AzureFirewallApplicationRule object itself. + */ + public AzureFirewallApplicationRule withSourceAddresses(List sourceAddresses) { + this.sourceAddresses = sourceAddresses; + return this; + } + + /** + * Get array of ApplicationRuleProtocols. + * + * @return the protocols value + */ + public List protocols() { + return this.protocols; + } + + /** + * Set array of ApplicationRuleProtocols. + * + * @param protocols the protocols value to set + * @return the AzureFirewallApplicationRule object itself. + */ + public AzureFirewallApplicationRule withProtocols(List protocols) { + this.protocols = protocols; + return this; + } + + /** + * Get list of URLs for this rule. + * + * @return the targetUrls value + */ + public List targetUrls() { + return this.targetUrls; + } + + /** + * Set list of URLs for this rule. + * + * @param targetUrls the targetUrls value to set + * @return the AzureFirewallApplicationRule object itself. + */ + public AzureFirewallApplicationRule withTargetUrls(List targetUrls) { + this.targetUrls = targetUrls; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AzureFirewallApplicationRuleCollection.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AzureFirewallApplicationRuleCollection.java new file mode 100644 index 000000000000..6466eb1ffd34 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AzureFirewallApplicationRuleCollection.java @@ -0,0 +1,169 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Application rule collection resource. + */ +@JsonFlatten +public class AzureFirewallApplicationRuleCollection extends SubResource { + /** + * Priority of the application rule collection resource. + */ + @JsonProperty(value = "properties.priority") + private Integer priority; + + /** + * The action type of a rule collection. + */ + @JsonProperty(value = "properties.action") + private AzureFirewallRCAction action; + + /** + * Collection of rules used by a application rule collection. + */ + @JsonProperty(value = "properties.rules") + private List rules; + + /** + * The provisioning state of the resource. Possible values include: + * 'Succeeded', 'Updating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningState provisioningState; + + /** + * Gets name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get priority of the application rule collection resource. + * + * @return the priority value + */ + public Integer priority() { + return this.priority; + } + + /** + * Set priority of the application rule collection resource. + * + * @param priority the priority value to set + * @return the AzureFirewallApplicationRuleCollection object itself. + */ + public AzureFirewallApplicationRuleCollection withPriority(Integer priority) { + this.priority = priority; + return this; + } + + /** + * Get the action type of a rule collection. + * + * @return the action value + */ + public AzureFirewallRCAction action() { + return this.action; + } + + /** + * Set the action type of a rule collection. + * + * @param action the action value to set + * @return the AzureFirewallApplicationRuleCollection object itself. + */ + public AzureFirewallApplicationRuleCollection withAction(AzureFirewallRCAction action) { + this.action = action; + return this; + } + + /** + * Get collection of rules used by a application rule collection. + * + * @return the rules value + */ + public List rules() { + return this.rules; + } + + /** + * Set collection of rules used by a application rule collection. + * + * @param rules the rules value to set + * @return the AzureFirewallApplicationRuleCollection object itself. + */ + public AzureFirewallApplicationRuleCollection withRules(List rules) { + this.rules = rules; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the AzureFirewallApplicationRuleCollection object itself. + */ + public AzureFirewallApplicationRuleCollection withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get gets name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set gets name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the AzureFirewallApplicationRuleCollection object itself. + */ + public AzureFirewallApplicationRuleCollection withName(String name) { + this.name = name; + return this; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AzureFirewallApplicationRuleProtocol.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AzureFirewallApplicationRuleProtocol.java new file mode 100644 index 000000000000..82be432390ba --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AzureFirewallApplicationRuleProtocol.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.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties of the application rule protocol. + */ +public class AzureFirewallApplicationRuleProtocol { + /** + * Protocol type. Possible values include: 'Http', 'Https'. + */ + @JsonProperty(value = "protocolType") + private AzureFirewallApplicationRuleProtocolType protocolType; + + /** + * Port number for the protocol, cannot be greater than 64000. This field + * is optional. + */ + @JsonProperty(value = "port") + private Integer port; + + /** + * Get protocol type. Possible values include: 'Http', 'Https'. + * + * @return the protocolType value + */ + public AzureFirewallApplicationRuleProtocolType protocolType() { + return this.protocolType; + } + + /** + * Set protocol type. Possible values include: 'Http', 'Https'. + * + * @param protocolType the protocolType value to set + * @return the AzureFirewallApplicationRuleProtocol object itself. + */ + public AzureFirewallApplicationRuleProtocol withProtocolType(AzureFirewallApplicationRuleProtocolType protocolType) { + this.protocolType = protocolType; + return this; + } + + /** + * Get port number for the protocol, cannot be greater than 64000. This field is optional. + * + * @return the port value + */ + public Integer port() { + return this.port; + } + + /** + * Set port number for the protocol, cannot be greater than 64000. This field is optional. + * + * @param port the port value to set + * @return the AzureFirewallApplicationRuleProtocol object itself. + */ + public AzureFirewallApplicationRuleProtocol withPort(Integer port) { + this.port = port; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AzureFirewallApplicationRuleProtocolType.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AzureFirewallApplicationRuleProtocolType.java new file mode 100644 index 000000000000..fa6384f79060 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AzureFirewallApplicationRuleProtocolType.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for AzureFirewallApplicationRuleProtocolType. + */ +public final class AzureFirewallApplicationRuleProtocolType extends ExpandableStringEnum { + /** Static value Http for AzureFirewallApplicationRuleProtocolType. */ + public static final AzureFirewallApplicationRuleProtocolType HTTP = fromString("Http"); + + /** Static value Https for AzureFirewallApplicationRuleProtocolType. */ + public static final AzureFirewallApplicationRuleProtocolType HTTPS = fromString("Https"); + + /** + * Creates or finds a AzureFirewallApplicationRuleProtocolType from its string representation. + * @param name a name to look for + * @return the corresponding AzureFirewallApplicationRuleProtocolType + */ + @JsonCreator + public static AzureFirewallApplicationRuleProtocolType fromString(String name) { + return fromString(name, AzureFirewallApplicationRuleProtocolType.class); + } + + /** + * @return known AzureFirewallApplicationRuleProtocolType values + */ + public static Collection values() { + return values(AzureFirewallApplicationRuleProtocolType.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AzureFirewallIPConfiguration.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AzureFirewallIPConfiguration.java new file mode 100644 index 000000000000..f6419c453415 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AzureFirewallIPConfiguration.java @@ -0,0 +1,207 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * IP configuration of an Azure Firewall. + */ +@JsonFlatten +public class AzureFirewallIPConfiguration extends SubResource { + /** + * The Firewall Internal Load Balancer IP to be used as the next hop in + * User Defined Routes. + */ + @JsonProperty(value = "properties.privateIPAddress") + private String privateIPAddress; + + /** + * Reference of the subnet resource. This resource must be named + * 'AzureFirewallSubnet'. + */ + @JsonProperty(value = "properties.subnet") + private SubResource subnet; + + /** + * Reference of the PublicIP resource. This field is a mandatory input. + */ + @JsonProperty(value = "properties.internalPublicIpAddress") + private SubResource internalPublicIpAddress; + + /** + * Reference of the PublicIP resource. This field is populated in the + * output. + */ + @JsonProperty(value = "properties.publicIPAddress") + private SubResource publicIPAddress; + + /** + * The provisioning state of the resource. Possible values include: + * 'Succeeded', 'Updating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningState provisioningState; + + /** + * Name of the resource that is unique within a resource group. This name + * can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get the Firewall Internal Load Balancer IP to be used as the next hop in User Defined Routes. + * + * @return the privateIPAddress value + */ + public String privateIPAddress() { + return this.privateIPAddress; + } + + /** + * Set the Firewall Internal Load Balancer IP to be used as the next hop in User Defined Routes. + * + * @param privateIPAddress the privateIPAddress value to set + * @return the AzureFirewallIPConfiguration object itself. + */ + public AzureFirewallIPConfiguration withPrivateIPAddress(String privateIPAddress) { + this.privateIPAddress = privateIPAddress; + return this; + } + + /** + * Get reference of the subnet resource. This resource must be named 'AzureFirewallSubnet'. + * + * @return the subnet value + */ + public SubResource subnet() { + return this.subnet; + } + + /** + * Set reference of the subnet resource. This resource must be named 'AzureFirewallSubnet'. + * + * @param subnet the subnet value to set + * @return the AzureFirewallIPConfiguration object itself. + */ + public AzureFirewallIPConfiguration withSubnet(SubResource subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get reference of the PublicIP resource. This field is a mandatory input. + * + * @return the internalPublicIpAddress value + */ + public SubResource internalPublicIpAddress() { + return this.internalPublicIpAddress; + } + + /** + * Set reference of the PublicIP resource. This field is a mandatory input. + * + * @param internalPublicIpAddress the internalPublicIpAddress value to set + * @return the AzureFirewallIPConfiguration object itself. + */ + public AzureFirewallIPConfiguration withInternalPublicIpAddress(SubResource internalPublicIpAddress) { + this.internalPublicIpAddress = internalPublicIpAddress; + return this; + } + + /** + * Get reference of the PublicIP resource. This field is populated in the output. + * + * @return the publicIPAddress value + */ + public SubResource publicIPAddress() { + return this.publicIPAddress; + } + + /** + * Set reference of the PublicIP resource. This field is populated in the output. + * + * @param publicIPAddress the publicIPAddress value to set + * @return the AzureFirewallIPConfiguration object itself. + */ + public AzureFirewallIPConfiguration withPublicIPAddress(SubResource publicIPAddress) { + this.publicIPAddress = publicIPAddress; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the AzureFirewallIPConfiguration object itself. + */ + public AzureFirewallIPConfiguration withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the AzureFirewallIPConfiguration object itself. + */ + public AzureFirewallIPConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the AzureFirewallIPConfiguration object itself. + */ + public AzureFirewallIPConfiguration withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AzureFirewallNetworkRule.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AzureFirewallNetworkRule.java new file mode 100644 index 000000000000..7ff0e0282308 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AzureFirewallNetworkRule.java @@ -0,0 +1,174 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties of the network rule. + */ +public class AzureFirewallNetworkRule { + /** + * Name of the network rule. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Description of the rule. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Array of AzureFirewallNetworkRuleProtocols. + */ + @JsonProperty(value = "protocols") + private List protocols; + + /** + * List of source IP addresses for this rule. + */ + @JsonProperty(value = "sourceAddresses") + private List sourceAddresses; + + /** + * List of destination IP addresses. + */ + @JsonProperty(value = "destinationAddresses") + private List destinationAddresses; + + /** + * List of destination ports. + */ + @JsonProperty(value = "destinationPorts") + private List destinationPorts; + + /** + * Get name of the network rule. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the network rule. + * + * @param name the name value to set + * @return the AzureFirewallNetworkRule object itself. + */ + public AzureFirewallNetworkRule withName(String name) { + this.name = name; + return this; + } + + /** + * Get description of the rule. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of the rule. + * + * @param description the description value to set + * @return the AzureFirewallNetworkRule object itself. + */ + public AzureFirewallNetworkRule withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get array of AzureFirewallNetworkRuleProtocols. + * + * @return the protocols value + */ + public List protocols() { + return this.protocols; + } + + /** + * Set array of AzureFirewallNetworkRuleProtocols. + * + * @param protocols the protocols value to set + * @return the AzureFirewallNetworkRule object itself. + */ + public AzureFirewallNetworkRule withProtocols(List protocols) { + this.protocols = protocols; + return this; + } + + /** + * Get list of source IP addresses for this rule. + * + * @return the sourceAddresses value + */ + public List sourceAddresses() { + return this.sourceAddresses; + } + + /** + * Set list of source IP addresses for this rule. + * + * @param sourceAddresses the sourceAddresses value to set + * @return the AzureFirewallNetworkRule object itself. + */ + public AzureFirewallNetworkRule withSourceAddresses(List sourceAddresses) { + this.sourceAddresses = sourceAddresses; + return this; + } + + /** + * Get list of destination IP addresses. + * + * @return the destinationAddresses value + */ + public List destinationAddresses() { + return this.destinationAddresses; + } + + /** + * Set list of destination IP addresses. + * + * @param destinationAddresses the destinationAddresses value to set + * @return the AzureFirewallNetworkRule object itself. + */ + public AzureFirewallNetworkRule withDestinationAddresses(List destinationAddresses) { + this.destinationAddresses = destinationAddresses; + return this; + } + + /** + * Get list of destination ports. + * + * @return the destinationPorts value + */ + public List destinationPorts() { + return this.destinationPorts; + } + + /** + * Set list of destination ports. + * + * @param destinationPorts the destinationPorts value to set + * @return the AzureFirewallNetworkRule object itself. + */ + public AzureFirewallNetworkRule withDestinationPorts(List destinationPorts) { + this.destinationPorts = destinationPorts; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AzureFirewallNetworkRuleCollection.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AzureFirewallNetworkRuleCollection.java new file mode 100644 index 000000000000..8da8973c77c6 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AzureFirewallNetworkRuleCollection.java @@ -0,0 +1,169 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Network rule collection resource. + */ +@JsonFlatten +public class AzureFirewallNetworkRuleCollection extends SubResource { + /** + * Priority of the network rule collection resource. + */ + @JsonProperty(value = "properties.priority") + private Integer priority; + + /** + * The action type of a rule collection. + */ + @JsonProperty(value = "properties.action") + private AzureFirewallRCAction action; + + /** + * Collection of rules used by a network rule collection. + */ + @JsonProperty(value = "properties.rules") + private List rules; + + /** + * The provisioning state of the resource. Possible values include: + * 'Succeeded', 'Updating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningState provisioningState; + + /** + * Gets name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get priority of the network rule collection resource. + * + * @return the priority value + */ + public Integer priority() { + return this.priority; + } + + /** + * Set priority of the network rule collection resource. + * + * @param priority the priority value to set + * @return the AzureFirewallNetworkRuleCollection object itself. + */ + public AzureFirewallNetworkRuleCollection withPriority(Integer priority) { + this.priority = priority; + return this; + } + + /** + * Get the action type of a rule collection. + * + * @return the action value + */ + public AzureFirewallRCAction action() { + return this.action; + } + + /** + * Set the action type of a rule collection. + * + * @param action the action value to set + * @return the AzureFirewallNetworkRuleCollection object itself. + */ + public AzureFirewallNetworkRuleCollection withAction(AzureFirewallRCAction action) { + this.action = action; + return this; + } + + /** + * Get collection of rules used by a network rule collection. + * + * @return the rules value + */ + public List rules() { + return this.rules; + } + + /** + * Set collection of rules used by a network rule collection. + * + * @param rules the rules value to set + * @return the AzureFirewallNetworkRuleCollection object itself. + */ + public AzureFirewallNetworkRuleCollection withRules(List rules) { + this.rules = rules; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the AzureFirewallNetworkRuleCollection object itself. + */ + public AzureFirewallNetworkRuleCollection withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get gets name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set gets name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the AzureFirewallNetworkRuleCollection object itself. + */ + public AzureFirewallNetworkRuleCollection withName(String name) { + this.name = name; + return this; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AzureFirewallNetworkRuleProtocol.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AzureFirewallNetworkRuleProtocol.java new file mode 100644 index 000000000000..3350886f9375 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AzureFirewallNetworkRuleProtocol.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for AzureFirewallNetworkRuleProtocol. + */ +public final class AzureFirewallNetworkRuleProtocol extends ExpandableStringEnum { + /** Static value TCP for AzureFirewallNetworkRuleProtocol. */ + public static final AzureFirewallNetworkRuleProtocol TCP = fromString("TCP"); + + /** Static value UDP for AzureFirewallNetworkRuleProtocol. */ + public static final AzureFirewallNetworkRuleProtocol UDP = fromString("UDP"); + + /** Static value Any for AzureFirewallNetworkRuleProtocol. */ + public static final AzureFirewallNetworkRuleProtocol ANY = fromString("Any"); + + /** Static value ICMP for AzureFirewallNetworkRuleProtocol. */ + public static final AzureFirewallNetworkRuleProtocol ICMP = fromString("ICMP"); + + /** + * Creates or finds a AzureFirewallNetworkRuleProtocol from its string representation. + * @param name a name to look for + * @return the corresponding AzureFirewallNetworkRuleProtocol + */ + @JsonCreator + public static AzureFirewallNetworkRuleProtocol fromString(String name) { + return fromString(name, AzureFirewallNetworkRuleProtocol.class); + } + + /** + * @return known AzureFirewallNetworkRuleProtocol values + */ + public static Collection values() { + return values(AzureFirewallNetworkRuleProtocol.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AzureFirewallRCAction.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AzureFirewallRCAction.java new file mode 100644 index 000000000000..12d1fd8dc843 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AzureFirewallRCAction.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.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties of the AzureFirewallRCAction. + */ +public class AzureFirewallRCAction { + /** + * The type of action. Possible values include: 'Allow', 'Deny'. + */ + @JsonProperty(value = "type") + private AzureFirewallRCActionType type; + + /** + * Get the type of action. Possible values include: 'Allow', 'Deny'. + * + * @return the type value + */ + public AzureFirewallRCActionType type() { + return this.type; + } + + /** + * Set the type of action. Possible values include: 'Allow', 'Deny'. + * + * @param type the type value to set + * @return the AzureFirewallRCAction object itself. + */ + public AzureFirewallRCAction withType(AzureFirewallRCActionType type) { + this.type = type; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AzureFirewallRCActionType.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AzureFirewallRCActionType.java new file mode 100644 index 000000000000..748a30b1ddc9 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AzureFirewallRCActionType.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for AzureFirewallRCActionType. + */ +public final class AzureFirewallRCActionType extends ExpandableStringEnum { + /** Static value Allow for AzureFirewallRCActionType. */ + public static final AzureFirewallRCActionType ALLOW = fromString("Allow"); + + /** Static value Deny for AzureFirewallRCActionType. */ + public static final AzureFirewallRCActionType DENY = fromString("Deny"); + + /** + * Creates or finds a AzureFirewallRCActionType from its string representation. + * @param name a name to look for + * @return the corresponding AzureFirewallRCActionType + */ + @JsonCreator + public static AzureFirewallRCActionType fromString(String name) { + return fromString(name, AzureFirewallRCActionType.class); + } + + /** + * @return known AzureFirewallRCActionType values + */ + public static Collection values() { + return values(AzureFirewallRCActionType.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AzureFirewalls.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AzureFirewalls.java new file mode 100644 index 000000000000..9d6811ae1a02 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AzureFirewalls.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_06_01.implementation.AzureFirewallsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing AzureFirewalls. + */ +public interface AzureFirewalls extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AzureReachabilityReport.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AzureReachabilityReport.java new file mode 100644 index 000000000000..ed5e712968f9 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AzureReachabilityReport.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.AzureReachabilityReportInner; +import java.util.List; + +/** + * Type representing AzureReachabilityReport. + */ +public interface AzureReachabilityReport extends HasInner, HasManager { + /** + * @return the aggregationLevel value. + */ + String aggregationLevel(); + + /** + * @return the providerLocation value. + */ + AzureReachabilityReportLocation providerLocation(); + + /** + * @return the reachabilityReport value. + */ + List reachabilityReport(); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AzureReachabilityReportItem.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AzureReachabilityReportItem.java new file mode 100644 index 000000000000..dba634f22767 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AzureReachabilityReportItem.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.network.v2018_06_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Azure reachability report details for a given provider location. + */ +public class AzureReachabilityReportItem { + /** + * The Internet service provider. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * The Azure region. + */ + @JsonProperty(value = "azureLocation") + private String azureLocation; + + /** + * List of latency details for each of the time series. + */ + @JsonProperty(value = "latencies") + private List latencies; + + /** + * Get the Internet service provider. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set the Internet service provider. + * + * @param provider the provider value to set + * @return the AzureReachabilityReportItem object itself. + */ + public AzureReachabilityReportItem withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the Azure region. + * + * @return the azureLocation value + */ + public String azureLocation() { + return this.azureLocation; + } + + /** + * Set the Azure region. + * + * @param azureLocation the azureLocation value to set + * @return the AzureReachabilityReportItem object itself. + */ + public AzureReachabilityReportItem withAzureLocation(String azureLocation) { + this.azureLocation = azureLocation; + return this; + } + + /** + * Get list of latency details for each of the time series. + * + * @return the latencies value + */ + public List latencies() { + return this.latencies; + } + + /** + * Set list of latency details for each of the time series. + * + * @param latencies the latencies value to set + * @return the AzureReachabilityReportItem object itself. + */ + public AzureReachabilityReportItem withLatencies(List latencies) { + this.latencies = latencies; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AzureReachabilityReportLatencyInfo.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AzureReachabilityReportLatencyInfo.java new file mode 100644 index 000000000000..ffbc70b29daf --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AzureReachabilityReportLatencyInfo.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Details on latency for a time series. + */ +public class AzureReachabilityReportLatencyInfo { + /** + * The time stamp. + */ + @JsonProperty(value = "timeStamp") + private DateTime timeStamp; + + /** + * The relative latency score between 1 and 100, higher values indicating a + * faster connection. + */ + @JsonProperty(value = "score") + private Integer score; + + /** + * Get the time stamp. + * + * @return the timeStamp value + */ + public DateTime timeStamp() { + return this.timeStamp; + } + + /** + * Set the time stamp. + * + * @param timeStamp the timeStamp value to set + * @return the AzureReachabilityReportLatencyInfo object itself. + */ + public AzureReachabilityReportLatencyInfo withTimeStamp(DateTime timeStamp) { + this.timeStamp = timeStamp; + return this; + } + + /** + * Get the relative latency score between 1 and 100, higher values indicating a faster connection. + * + * @return the score value + */ + public Integer score() { + return this.score; + } + + /** + * Set the relative latency score between 1 and 100, higher values indicating a faster connection. + * + * @param score the score value to set + * @return the AzureReachabilityReportLatencyInfo object itself. + */ + public AzureReachabilityReportLatencyInfo withScore(Integer score) { + this.score = score; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AzureReachabilityReportLocation.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AzureReachabilityReportLocation.java new file mode 100644 index 000000000000..202a678e298c --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AzureReachabilityReportLocation.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters that define a geographic location. + */ +public class AzureReachabilityReportLocation { + /** + * The name of the country. + */ + @JsonProperty(value = "country", required = true) + private String country; + + /** + * The name of the state. + */ + @JsonProperty(value = "state") + private String state; + + /** + * The name of the city or town. + */ + @JsonProperty(value = "city") + private String city; + + /** + * Get the name of the country. + * + * @return the country value + */ + public String country() { + return this.country; + } + + /** + * Set the name of the country. + * + * @param country the country value to set + * @return the AzureReachabilityReportLocation object itself. + */ + public AzureReachabilityReportLocation withCountry(String country) { + this.country = country; + return this; + } + + /** + * Get the name of the state. + * + * @return the state value + */ + public String state() { + return this.state; + } + + /** + * Set the name of the state. + * + * @param state the state value to set + * @return the AzureReachabilityReportLocation object itself. + */ + public AzureReachabilityReportLocation withState(String state) { + this.state = state; + return this; + } + + /** + * Get the name of the city or town. + * + * @return the city value + */ + public String city() { + return this.city; + } + + /** + * Set the name of the city or town. + * + * @param city the city value to set + * @return the AzureReachabilityReportLocation object itself. + */ + public AzureReachabilityReportLocation withCity(String city) { + this.city = city; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AzureReachabilityReportParameters.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AzureReachabilityReportParameters.java new file mode 100644 index 000000000000..1453bb683db6 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/AzureReachabilityReportParameters.java @@ -0,0 +1,149 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import java.util.List; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Geographic and time constraints for Azure reachability report. + */ +public class AzureReachabilityReportParameters { + /** + * The providerLocation property. + */ + @JsonProperty(value = "providerLocation", required = true) + private AzureReachabilityReportLocation providerLocation; + + /** + * List of Internet service providers. + */ + @JsonProperty(value = "providers") + private List providers; + + /** + * Optional Azure regions to scope the query to. + */ + @JsonProperty(value = "azureLocations") + private List azureLocations; + + /** + * The start time for the Azure reachability report. + */ + @JsonProperty(value = "startTime", required = true) + private DateTime startTime; + + /** + * The end time for the Azure reachability report. + */ + @JsonProperty(value = "endTime", required = true) + private DateTime endTime; + + /** + * Get the providerLocation value. + * + * @return the providerLocation value + */ + public AzureReachabilityReportLocation providerLocation() { + return this.providerLocation; + } + + /** + * Set the providerLocation value. + * + * @param providerLocation the providerLocation value to set + * @return the AzureReachabilityReportParameters object itself. + */ + public AzureReachabilityReportParameters withProviderLocation(AzureReachabilityReportLocation providerLocation) { + this.providerLocation = providerLocation; + return this; + } + + /** + * Get list of Internet service providers. + * + * @return the providers value + */ + public List providers() { + return this.providers; + } + + /** + * Set list of Internet service providers. + * + * @param providers the providers value to set + * @return the AzureReachabilityReportParameters object itself. + */ + public AzureReachabilityReportParameters withProviders(List providers) { + this.providers = providers; + return this; + } + + /** + * Get optional Azure regions to scope the query to. + * + * @return the azureLocations value + */ + public List azureLocations() { + return this.azureLocations; + } + + /** + * Set optional Azure regions to scope the query to. + * + * @param azureLocations the azureLocations value to set + * @return the AzureReachabilityReportParameters object itself. + */ + public AzureReachabilityReportParameters withAzureLocations(List azureLocations) { + this.azureLocations = azureLocations; + return this; + } + + /** + * Get the start time for the Azure reachability report. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set the start time for the Azure reachability report. + * + * @param startTime the startTime value to set + * @return the AzureReachabilityReportParameters object itself. + */ + public AzureReachabilityReportParameters withStartTime(DateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the end time for the Azure reachability report. + * + * @return the endTime value + */ + public DateTime endTime() { + return this.endTime; + } + + /** + * Set the end time for the Azure reachability report. + * + * @param endTime the endTime value to set + * @return the AzureReachabilityReportParameters object itself. + */ + public AzureReachabilityReportParameters withEndTime(DateTime endTime) { + this.endTime = endTime; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/BGPCommunity.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/BGPCommunity.java new file mode 100644 index 000000000000..eb7e42a5000f --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/BGPCommunity.java @@ -0,0 +1,175 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains bgp community information offered in Service Community resources. + */ +public class BGPCommunity { + /** + * The region which the service support. e.g. For O365, region is Global. + */ + @JsonProperty(value = "serviceSupportedRegion") + private String serviceSupportedRegion; + + /** + * The name of the bgp community. e.g. Skype. + */ + @JsonProperty(value = "communityName") + private String communityName; + + /** + * The value of the bgp community. For more information: + * https://docs.microsoft.com/en-us/azure/expressroute/expressroute-routing. + */ + @JsonProperty(value = "communityValue") + private String communityValue; + + /** + * The prefixes that the bgp community contains. + */ + @JsonProperty(value = "communityPrefixes") + private List communityPrefixes; + + /** + * Customer is authorized to use bgp community or not. + */ + @JsonProperty(value = "isAuthorizedToUse") + private Boolean isAuthorizedToUse; + + /** + * The service group of the bgp community contains. + */ + @JsonProperty(value = "serviceGroup") + private String serviceGroup; + + /** + * Get the region which the service support. e.g. For O365, region is Global. + * + * @return the serviceSupportedRegion value + */ + public String serviceSupportedRegion() { + return this.serviceSupportedRegion; + } + + /** + * Set the region which the service support. e.g. For O365, region is Global. + * + * @param serviceSupportedRegion the serviceSupportedRegion value to set + * @return the BGPCommunity object itself. + */ + public BGPCommunity withServiceSupportedRegion(String serviceSupportedRegion) { + this.serviceSupportedRegion = serviceSupportedRegion; + return this; + } + + /** + * Get the name of the bgp community. e.g. Skype. + * + * @return the communityName value + */ + public String communityName() { + return this.communityName; + } + + /** + * Set the name of the bgp community. e.g. Skype. + * + * @param communityName the communityName value to set + * @return the BGPCommunity object itself. + */ + public BGPCommunity withCommunityName(String communityName) { + this.communityName = communityName; + return this; + } + + /** + * Get the value of the bgp community. For more information: https://docs.microsoft.com/en-us/azure/expressroute/expressroute-routing. + * + * @return the communityValue value + */ + public String communityValue() { + return this.communityValue; + } + + /** + * Set the value of the bgp community. For more information: https://docs.microsoft.com/en-us/azure/expressroute/expressroute-routing. + * + * @param communityValue the communityValue value to set + * @return the BGPCommunity object itself. + */ + public BGPCommunity withCommunityValue(String communityValue) { + this.communityValue = communityValue; + return this; + } + + /** + * Get the prefixes that the bgp community contains. + * + * @return the communityPrefixes value + */ + public List communityPrefixes() { + return this.communityPrefixes; + } + + /** + * Set the prefixes that the bgp community contains. + * + * @param communityPrefixes the communityPrefixes value to set + * @return the BGPCommunity object itself. + */ + public BGPCommunity withCommunityPrefixes(List communityPrefixes) { + this.communityPrefixes = communityPrefixes; + return this; + } + + /** + * Get customer is authorized to use bgp community or not. + * + * @return the isAuthorizedToUse value + */ + public Boolean isAuthorizedToUse() { + return this.isAuthorizedToUse; + } + + /** + * Set customer is authorized to use bgp community or not. + * + * @param isAuthorizedToUse the isAuthorizedToUse value to set + * @return the BGPCommunity object itself. + */ + public BGPCommunity withIsAuthorizedToUse(Boolean isAuthorizedToUse) { + this.isAuthorizedToUse = isAuthorizedToUse; + return this; + } + + /** + * Get the service group of the bgp community contains. + * + * @return the serviceGroup value + */ + public String serviceGroup() { + return this.serviceGroup; + } + + /** + * Set the service group of the bgp community contains. + * + * @param serviceGroup the serviceGroup value to set + * @return the BGPCommunity object itself. + */ + public BGPCommunity withServiceGroup(String serviceGroup) { + this.serviceGroup = serviceGroup; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/BackendAddressPool.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/BackendAddressPool.java new file mode 100644 index 000000000000..cb9007afe37a --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/BackendAddressPool.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_06_01.implementation.BackendAddressPoolInner; +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.network.v2018_06_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.SubResource; + +/** + * Type representing BackendAddressPool. + */ +public interface BackendAddressPool extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the backendIPConfigurations value. + */ + List backendIPConfigurations(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the loadBalancingRules value. + */ + List loadBalancingRules(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the outboundNatRule value. + */ + SubResource outboundNatRule(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/BgpPeerState.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/BgpPeerState.java new file mode 100644 index 000000000000..b628c4398c66 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/BgpPeerState.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for BgpPeerState. + */ +public final class BgpPeerState extends ExpandableStringEnum { + /** Static value Unknown for BgpPeerState. */ + public static final BgpPeerState UNKNOWN = fromString("Unknown"); + + /** Static value Stopped for BgpPeerState. */ + public static final BgpPeerState STOPPED = fromString("Stopped"); + + /** Static value Idle for BgpPeerState. */ + public static final BgpPeerState IDLE = fromString("Idle"); + + /** Static value Connecting for BgpPeerState. */ + public static final BgpPeerState CONNECTING = fromString("Connecting"); + + /** Static value Connected for BgpPeerState. */ + public static final BgpPeerState CONNECTED = fromString("Connected"); + + /** + * Creates or finds a BgpPeerState from its string representation. + * @param name a name to look for + * @return the corresponding BgpPeerState + */ + @JsonCreator + public static BgpPeerState fromString(String name) { + return fromString(name, BgpPeerState.class); + } + + /** + * @return known BgpPeerState values + */ + public static Collection values() { + return values(BgpPeerState.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/BgpPeerStatus.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/BgpPeerStatus.java new file mode 100644 index 000000000000..99a12e146891 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/BgpPeerStatus.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * BGP peer status details. + */ +public class BgpPeerStatus { + /** + * The virtual network gateway's local address. + */ + @JsonProperty(value = "localAddress", access = JsonProperty.Access.WRITE_ONLY) + private String localAddress; + + /** + * The remote BGP peer. + */ + @JsonProperty(value = "neighbor", access = JsonProperty.Access.WRITE_ONLY) + private String neighbor; + + /** + * The autonomous system number of the remote BGP peer. + */ + @JsonProperty(value = "asn", access = JsonProperty.Access.WRITE_ONLY) + private Integer asn; + + /** + * The BGP peer state. Possible values include: 'Unknown', 'Stopped', + * 'Idle', 'Connecting', 'Connected'. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private BgpPeerState state; + + /** + * For how long the peering has been up. + */ + @JsonProperty(value = "connectedDuration", access = JsonProperty.Access.WRITE_ONLY) + private String connectedDuration; + + /** + * The number of routes learned from this peer. + */ + @JsonProperty(value = "routesReceived", access = JsonProperty.Access.WRITE_ONLY) + private Long routesReceived; + + /** + * The number of BGP messages sent. + */ + @JsonProperty(value = "messagesSent", access = JsonProperty.Access.WRITE_ONLY) + private Long messagesSent; + + /** + * The number of BGP messages received. + */ + @JsonProperty(value = "messagesReceived", access = JsonProperty.Access.WRITE_ONLY) + private Long messagesReceived; + + /** + * Get the virtual network gateway's local address. + * + * @return the localAddress value + */ + public String localAddress() { + return this.localAddress; + } + + /** + * Get the remote BGP peer. + * + * @return the neighbor value + */ + public String neighbor() { + return this.neighbor; + } + + /** + * Get the autonomous system number of the remote BGP peer. + * + * @return the asn value + */ + public Integer asn() { + return this.asn; + } + + /** + * Get the BGP peer state. Possible values include: 'Unknown', 'Stopped', 'Idle', 'Connecting', 'Connected'. + * + * @return the state value + */ + public BgpPeerState state() { + return this.state; + } + + /** + * Get for how long the peering has been up. + * + * @return the connectedDuration value + */ + public String connectedDuration() { + return this.connectedDuration; + } + + /** + * Get the number of routes learned from this peer. + * + * @return the routesReceived value + */ + public Long routesReceived() { + return this.routesReceived; + } + + /** + * Get the number of BGP messages sent. + * + * @return the messagesSent value + */ + public Long messagesSent() { + return this.messagesSent; + } + + /** + * Get the number of BGP messages received. + * + * @return the messagesReceived value + */ + public Long messagesReceived() { + return this.messagesReceived; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/BgpPeerStatusListResult.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/BgpPeerStatusListResult.java new file mode 100644 index 000000000000..271943a5aa1f --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/BgpPeerStatusListResult.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.BgpPeerStatusListResultInner; +import java.util.List; + +/** + * Type representing BgpPeerStatusListResult. + */ +public interface BgpPeerStatusListResult extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/BgpServiceCommunities.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/BgpServiceCommunities.java new file mode 100644 index 000000000000..a60b2e730e18 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/BgpServiceCommunities.java @@ -0,0 +1,19 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_06_01.implementation.BgpServiceCommunitiesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing BgpServiceCommunities. + */ +public interface BgpServiceCommunities extends SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/BgpServiceCommunity.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/BgpServiceCommunity.java new file mode 100644 index 000000000000..17ec6e3966c1 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/BgpServiceCommunity.java @@ -0,0 +1,34 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.implementation.BgpServiceCommunityInner; + +/** + * Type representing BgpServiceCommunity. + */ +public interface BgpServiceCommunity extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, HasManager { + /** + * @return the bgpCommunities value. + */ + List bgpCommunities(); + + /** + * @return the serviceName value. + */ + String serviceName(); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/BgpSettings.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/BgpSettings.java new file mode 100644 index 000000000000..0dbddd61eb45 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/BgpSettings.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * BGP settings details. + */ +public class BgpSettings { + /** + * The BGP speaker's ASN. + */ + @JsonProperty(value = "asn") + private Long asn; + + /** + * The BGP peering address and BGP identifier of this BGP speaker. + */ + @JsonProperty(value = "bgpPeeringAddress") + private String bgpPeeringAddress; + + /** + * The weight added to routes learned from this BGP speaker. + */ + @JsonProperty(value = "peerWeight") + private Integer peerWeight; + + /** + * Get the BGP speaker's ASN. + * + * @return the asn value + */ + public Long asn() { + return this.asn; + } + + /** + * Set the BGP speaker's ASN. + * + * @param asn the asn value to set + * @return the BgpSettings object itself. + */ + public BgpSettings withAsn(Long asn) { + this.asn = asn; + return this; + } + + /** + * Get the BGP peering address and BGP identifier of this BGP speaker. + * + * @return the bgpPeeringAddress value + */ + public String bgpPeeringAddress() { + return this.bgpPeeringAddress; + } + + /** + * Set the BGP peering address and BGP identifier of this BGP speaker. + * + * @param bgpPeeringAddress the bgpPeeringAddress value to set + * @return the BgpSettings object itself. + */ + public BgpSettings withBgpPeeringAddress(String bgpPeeringAddress) { + this.bgpPeeringAddress = bgpPeeringAddress; + return this; + } + + /** + * Get the weight added to routes learned from this BGP speaker. + * + * @return the peerWeight value + */ + public Integer peerWeight() { + return this.peerWeight; + } + + /** + * Set the weight added to routes learned from this BGP speaker. + * + * @param peerWeight the peerWeight value to set + * @return the BgpSettings object itself. + */ + public BgpSettings withPeerWeight(Integer peerWeight) { + this.peerWeight = peerWeight; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/CircuitConnectionStatus.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/CircuitConnectionStatus.java new file mode 100644 index 000000000000..b0fb9524f030 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/CircuitConnectionStatus.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for CircuitConnectionStatus. + */ +public final class CircuitConnectionStatus extends ExpandableStringEnum { + /** Static value Connected for CircuitConnectionStatus. */ + public static final CircuitConnectionStatus CONNECTED = fromString("Connected"); + + /** Static value Connecting for CircuitConnectionStatus. */ + public static final CircuitConnectionStatus CONNECTING = fromString("Connecting"); + + /** Static value Disconnected for CircuitConnectionStatus. */ + public static final CircuitConnectionStatus DISCONNECTED = fromString("Disconnected"); + + /** + * Creates or finds a CircuitConnectionStatus from its string representation. + * @param name a name to look for + * @return the corresponding CircuitConnectionStatus + */ + @JsonCreator + public static CircuitConnectionStatus fromString(String name) { + return fromString(name, CircuitConnectionStatus.class); + } + + /** + * @return known CircuitConnectionStatus values + */ + public static Collection values() { + return values(CircuitConnectionStatus.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectionMonitorDestination.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectionMonitorDestination.java new file mode 100644 index 000000000000..88142e8d892e --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectionMonitorDestination.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the destination of connection monitor. + */ +public class ConnectionMonitorDestination { + /** + * The ID of the resource used as the destination by connection monitor. + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /** + * Address of the connection monitor destination (IP or domain name). + */ + @JsonProperty(value = "address") + private String address; + + /** + * The destination port used by connection monitor. + */ + @JsonProperty(value = "port") + private Integer port; + + /** + * Get the ID of the resource used as the destination by connection monitor. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the ID of the resource used as the destination by connection monitor. + * + * @param resourceId the resourceId value to set + * @return the ConnectionMonitorDestination object itself. + */ + public ConnectionMonitorDestination withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get address of the connection monitor destination (IP or domain name). + * + * @return the address value + */ + public String address() { + return this.address; + } + + /** + * Set address of the connection monitor destination (IP or domain name). + * + * @param address the address value to set + * @return the ConnectionMonitorDestination object itself. + */ + public ConnectionMonitorDestination withAddress(String address) { + this.address = address; + return this; + } + + /** + * Get the destination port used by connection monitor. + * + * @return the port value + */ + public Integer port() { + return this.port; + } + + /** + * Set the destination port used by connection monitor. + * + * @param port the port value to set + * @return the ConnectionMonitorDestination object itself. + */ + public ConnectionMonitorDestination withPort(Integer port) { + this.port = port; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectionMonitorParameters.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectionMonitorParameters.java new file mode 100644 index 000000000000..5aa580f8061c --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectionMonitorParameters.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.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters that define the operation to create a connection monitor. + */ +public class ConnectionMonitorParameters { + /** + * The source property. + */ + @JsonProperty(value = "source", required = true) + private ConnectionMonitorSource source; + + /** + * The destination property. + */ + @JsonProperty(value = "destination", required = true) + private ConnectionMonitorDestination destination; + + /** + * Determines if the connection monitor will start automatically once + * created. + */ + @JsonProperty(value = "autoStart") + private Boolean autoStart; + + /** + * Monitoring interval in seconds. + */ + @JsonProperty(value = "monitoringIntervalInSeconds") + private Integer monitoringIntervalInSeconds; + + /** + * Get the source value. + * + * @return the source value + */ + public ConnectionMonitorSource source() { + return this.source; + } + + /** + * Set the source value. + * + * @param source the source value to set + * @return the ConnectionMonitorParameters object itself. + */ + public ConnectionMonitorParameters withSource(ConnectionMonitorSource source) { + this.source = source; + return this; + } + + /** + * Get the destination value. + * + * @return the destination value + */ + public ConnectionMonitorDestination destination() { + return this.destination; + } + + /** + * Set the destination value. + * + * @param destination the destination value to set + * @return the ConnectionMonitorParameters object itself. + */ + public ConnectionMonitorParameters withDestination(ConnectionMonitorDestination destination) { + this.destination = destination; + return this; + } + + /** + * Get determines if the connection monitor will start automatically once created. + * + * @return the autoStart value + */ + public Boolean autoStart() { + return this.autoStart; + } + + /** + * Set determines if the connection monitor will start automatically once created. + * + * @param autoStart the autoStart value to set + * @return the ConnectionMonitorParameters object itself. + */ + public ConnectionMonitorParameters withAutoStart(Boolean autoStart) { + this.autoStart = autoStart; + return this; + } + + /** + * Get monitoring interval in seconds. + * + * @return the monitoringIntervalInSeconds value + */ + public Integer monitoringIntervalInSeconds() { + return this.monitoringIntervalInSeconds; + } + + /** + * Set monitoring interval in seconds. + * + * @param monitoringIntervalInSeconds the monitoringIntervalInSeconds value to set + * @return the ConnectionMonitorParameters object itself. + */ + public ConnectionMonitorParameters withMonitoringIntervalInSeconds(Integer monitoringIntervalInSeconds) { + this.monitoringIntervalInSeconds = monitoringIntervalInSeconds; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectionMonitorQueryResult.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectionMonitorQueryResult.java new file mode 100644 index 000000000000..cf097b65e465 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectionMonitorQueryResult.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.ConnectionMonitorQueryResultInner; +import java.util.List; + +/** + * Type representing ConnectionMonitorQueryResult. + */ +public interface ConnectionMonitorQueryResult extends HasInner, HasManager { + /** + * @return the sourceStatus value. + */ + ConnectionMonitorSourceStatus sourceStatus(); + + /** + * @return the states value. + */ + List states(); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectionMonitorResult.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectionMonitorResult.java new file mode 100644 index 000000000000..3087945673e1 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectionMonitorResult.java @@ -0,0 +1,237 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_06_01.implementation.ConnectionMonitorResultInner; +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.network.v2018_06_01.implementation.NetworkManager; +import java.util.Map; +import org.joda.time.DateTime; + +/** + * Type representing ConnectionMonitorResult. + */ +public interface ConnectionMonitorResult extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the autoStart value. + */ + Boolean autoStart(); + + /** + * @return the destination value. + */ + ConnectionMonitorDestination destination(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the monitoringIntervalInSeconds value. + */ + Integer monitoringIntervalInSeconds(); + + /** + * @return the monitoringStatus value. + */ + String monitoringStatus(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the source value. + */ + ConnectionMonitorSource source(); + + /** + * @return the startTime value. + */ + DateTime startTime(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the ConnectionMonitorResult definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithNetworkWatcher, DefinitionStages.WithDestination, DefinitionStages.WithSource, DefinitionStages.WithCreate { + } + + /** + * Grouping of ConnectionMonitorResult definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ConnectionMonitorResult definition. + */ + interface Blank extends WithNetworkWatcher { + } + + /** + * The stage of the connectionmonitorresult definition allowing to specify NetworkWatcher. + */ + interface WithNetworkWatcher { + /** + * Specifies resourceGroupName, networkWatcherName. + */ + WithDestination withExistingNetworkWatcher(String resourceGroupName, String networkWatcherName); + } + + /** + * The stage of the connectionmonitorresult definition allowing to specify Destination. + */ + interface WithDestination { + /** + * Specifies destination. + */ + WithSource withDestination(ConnectionMonitorDestination destination); + } + + /** + * The stage of the connectionmonitorresult definition allowing to specify Source. + */ + interface WithSource { + /** + * Specifies source. + */ + WithCreate withSource(ConnectionMonitorSource source); + } + + /** + * The stage of the connectionmonitorresult definition allowing to specify AutoStart. + */ + interface WithAutoStart { + /** + * Specifies autoStart. + */ + WithCreate withAutoStart(Boolean autoStart); + } + + /** + * The stage of the connectionmonitorresult definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + */ + WithCreate withLocation(String location); + } + + /** + * The stage of the connectionmonitorresult definition allowing to specify MonitoringIntervalInSeconds. + */ + interface WithMonitoringIntervalInSeconds { + /** + * Specifies monitoringIntervalInSeconds. + */ + WithCreate withMonitoringIntervalInSeconds(Integer monitoringIntervalInSeconds); + } + + /** + * The stage of the connectionmonitorresult definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + */ + WithCreate withTags(Map tags); + } + + /** + * 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.WithAutoStart, DefinitionStages.WithLocation, DefinitionStages.WithMonitoringIntervalInSeconds, DefinitionStages.WithTags { + } + } + /** + * The template for a ConnectionMonitorResult update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAutoStart, UpdateStages.WithLocation, UpdateStages.WithMonitoringIntervalInSeconds, UpdateStages.WithTags { + } + + /** + * Grouping of ConnectionMonitorResult update stages. + */ + interface UpdateStages { + /** + * The stage of the connectionmonitorresult update allowing to specify AutoStart. + */ + interface WithAutoStart { + /** + * Specifies autoStart. + */ + Update withAutoStart(Boolean autoStart); + } + + /** + * The stage of the connectionmonitorresult update allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + */ + Update withLocation(String location); + } + + /** + * The stage of the connectionmonitorresult update allowing to specify MonitoringIntervalInSeconds. + */ + interface WithMonitoringIntervalInSeconds { + /** + * Specifies monitoringIntervalInSeconds. + */ + Update withMonitoringIntervalInSeconds(Integer monitoringIntervalInSeconds); + } + + /** + * The stage of the connectionmonitorresult update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + */ + Update withTags(Map tags); + } + + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectionMonitorSource.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectionMonitorSource.java new file mode 100644 index 000000000000..577b287161d0 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectionMonitorSource.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.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the source of connection monitor. + */ +public class ConnectionMonitorSource { + /** + * The ID of the resource used as the source by connection monitor. + */ + @JsonProperty(value = "resourceId", required = true) + private String resourceId; + + /** + * The source port used by connection monitor. + */ + @JsonProperty(value = "port") + private Integer port; + + /** + * Get the ID of the resource used as the source by connection monitor. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the ID of the resource used as the source by connection monitor. + * + * @param resourceId the resourceId value to set + * @return the ConnectionMonitorSource object itself. + */ + public ConnectionMonitorSource withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the source port used by connection monitor. + * + * @return the port value + */ + public Integer port() { + return this.port; + } + + /** + * Set the source port used by connection monitor. + * + * @param port the port value to set + * @return the ConnectionMonitorSource object itself. + */ + public ConnectionMonitorSource withPort(Integer port) { + this.port = port; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectionMonitorSourceStatus.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectionMonitorSourceStatus.java new file mode 100644 index 000000000000..f665ff3de378 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectionMonitorSourceStatus.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ConnectionMonitorSourceStatus. + */ +public final class ConnectionMonitorSourceStatus extends ExpandableStringEnum { + /** Static value Uknown for ConnectionMonitorSourceStatus. */ + public static final ConnectionMonitorSourceStatus UKNOWN = fromString("Uknown"); + + /** Static value Active for ConnectionMonitorSourceStatus. */ + public static final ConnectionMonitorSourceStatus ACTIVE = fromString("Active"); + + /** Static value Inactive for ConnectionMonitorSourceStatus. */ + public static final ConnectionMonitorSourceStatus INACTIVE = fromString("Inactive"); + + /** + * Creates or finds a ConnectionMonitorSourceStatus from its string representation. + * @param name a name to look for + * @return the corresponding ConnectionMonitorSourceStatus + */ + @JsonCreator + public static ConnectionMonitorSourceStatus fromString(String name) { + return fromString(name, ConnectionMonitorSourceStatus.class); + } + + /** + * @return known ConnectionMonitorSourceStatus values + */ + public static Collection values() { + return values(ConnectionMonitorSourceStatus.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectionMonitors.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectionMonitors.java new file mode 100644 index 000000000000..fd51825be613 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectionMonitors.java @@ -0,0 +1,86 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_06_01.implementation.ConnectionMonitorsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ConnectionMonitors. + */ +public interface ConnectionMonitors extends SupportsCreating, HasInner { + /** + * Stops the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable stopAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName); + + /** + * Starts the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable startAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName); + + /** + * Query a snapshot of the most recent connection states. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name given to the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable queryAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName); + + /** + * Gets a connection monitor by name. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName); + + /** + * Lists all connection monitors for the specified Network Watcher. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String networkWatcherName); + + /** + * Deletes the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectionResetSharedKey.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectionResetSharedKey.java new file mode 100644 index 000000000000..ff8f69a1dd7a --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectionResetSharedKey.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.ConnectionResetSharedKeyInner; + +/** + * Type representing ConnectionResetSharedKey. + */ +public interface ConnectionResetSharedKey extends HasInner, HasManager { + /** + * @return the keyLength value. + */ + int keyLength(); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectionSharedKey.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectionSharedKey.java new file mode 100644 index 000000000000..fb449447bf6c --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectionSharedKey.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.ConnectionSharedKeyInner; + +/** + * Type representing ConnectionSharedKey. + */ +public interface ConnectionSharedKey extends HasInner, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the value value. + */ + String value(); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectionState.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectionState.java new file mode 100644 index 000000000000..35dc1ff378c9 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectionState.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ConnectionState. + */ +public final class ConnectionState extends ExpandableStringEnum { + /** Static value Reachable for ConnectionState. */ + public static final ConnectionState REACHABLE = fromString("Reachable"); + + /** Static value Unreachable for ConnectionState. */ + public static final ConnectionState UNREACHABLE = fromString("Unreachable"); + + /** Static value Unknown for ConnectionState. */ + public static final ConnectionState UNKNOWN = fromString("Unknown"); + + /** + * Creates or finds a ConnectionState from its string representation. + * @param name a name to look for + * @return the corresponding ConnectionState + */ + @JsonCreator + public static ConnectionState fromString(String name) { + return fromString(name, ConnectionState.class); + } + + /** + * @return known ConnectionState values + */ + public static Collection values() { + return values(ConnectionState.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectionStateSnapshot.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectionStateSnapshot.java new file mode 100644 index 000000000000..7048fd55a4b8 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectionStateSnapshot.java @@ -0,0 +1,140 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import org.joda.time.DateTime; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Connection state snapshot. + */ +public class ConnectionStateSnapshot { + /** + * The connection state. Possible values include: 'Reachable', + * 'Unreachable', 'Unknown'. + */ + @JsonProperty(value = "connectionState") + private ConnectionState connectionState; + + /** + * The start time of the connection snapshot. + */ + @JsonProperty(value = "startTime") + private DateTime startTime; + + /** + * The end time of the connection snapshot. + */ + @JsonProperty(value = "endTime") + private DateTime endTime; + + /** + * Connectivity analysis evaluation state. Possible values include: + * 'NotStarted', 'InProgress', 'Completed'. + */ + @JsonProperty(value = "evaluationState") + private EvaluationState evaluationState; + + /** + * List of hops between the source and the destination. + */ + @JsonProperty(value = "hops", access = JsonProperty.Access.WRITE_ONLY) + private List hops; + + /** + * Get the connection state. Possible values include: 'Reachable', 'Unreachable', 'Unknown'. + * + * @return the connectionState value + */ + public ConnectionState connectionState() { + return this.connectionState; + } + + /** + * Set the connection state. Possible values include: 'Reachable', 'Unreachable', 'Unknown'. + * + * @param connectionState the connectionState value to set + * @return the ConnectionStateSnapshot object itself. + */ + public ConnectionStateSnapshot withConnectionState(ConnectionState connectionState) { + this.connectionState = connectionState; + return this; + } + + /** + * Get the start time of the connection snapshot. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set the start time of the connection snapshot. + * + * @param startTime the startTime value to set + * @return the ConnectionStateSnapshot object itself. + */ + public ConnectionStateSnapshot withStartTime(DateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the end time of the connection snapshot. + * + * @return the endTime value + */ + public DateTime endTime() { + return this.endTime; + } + + /** + * Set the end time of the connection snapshot. + * + * @param endTime the endTime value to set + * @return the ConnectionStateSnapshot object itself. + */ + public ConnectionStateSnapshot withEndTime(DateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get connectivity analysis evaluation state. Possible values include: 'NotStarted', 'InProgress', 'Completed'. + * + * @return the evaluationState value + */ + public EvaluationState evaluationState() { + return this.evaluationState; + } + + /** + * Set connectivity analysis evaluation state. Possible values include: 'NotStarted', 'InProgress', 'Completed'. + * + * @param evaluationState the evaluationState value to set + * @return the ConnectionStateSnapshot object itself. + */ + public ConnectionStateSnapshot withEvaluationState(EvaluationState evaluationState) { + this.evaluationState = evaluationState; + return this; + } + + /** + * Get list of hops between the source and the destination. + * + * @return the hops value + */ + public List hops() { + return this.hops; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectionStatus.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectionStatus.java new file mode 100644 index 000000000000..25cdce2c54cc --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectionStatus.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ConnectionStatus. + */ +public final class ConnectionStatus extends ExpandableStringEnum { + /** Static value Unknown for ConnectionStatus. */ + public static final ConnectionStatus UNKNOWN = fromString("Unknown"); + + /** Static value Connected for ConnectionStatus. */ + public static final ConnectionStatus CONNECTED = fromString("Connected"); + + /** Static value Disconnected for ConnectionStatus. */ + public static final ConnectionStatus DISCONNECTED = fromString("Disconnected"); + + /** Static value Degraded for ConnectionStatus. */ + public static final ConnectionStatus DEGRADED = fromString("Degraded"); + + /** + * Creates or finds a ConnectionStatus from its string representation. + * @param name a name to look for + * @return the corresponding ConnectionStatus + */ + @JsonCreator + public static ConnectionStatus fromString(String name) { + return fromString(name, ConnectionStatus.class); + } + + /** + * @return known ConnectionStatus values + */ + public static Collection values() { + return values(ConnectionStatus.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectivityDestination.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectivityDestination.java new file mode 100644 index 000000000000..731d4e062e79 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectivityDestination.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.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters that define destination of connection. + */ +public class ConnectivityDestination { + /** + * The ID of the resource to which a connection attempt will be made. + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /** + * The IP address or URI the resource to which a connection attempt will be + * made. + */ + @JsonProperty(value = "address") + private String address; + + /** + * Port on which check connectivity will be performed. + */ + @JsonProperty(value = "port") + private Integer port; + + /** + * Get the ID of the resource to which a connection attempt will be made. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the ID of the resource to which a connection attempt will be made. + * + * @param resourceId the resourceId value to set + * @return the ConnectivityDestination object itself. + */ + public ConnectivityDestination withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the IP address or URI the resource to which a connection attempt will be made. + * + * @return the address value + */ + public String address() { + return this.address; + } + + /** + * Set the IP address or URI the resource to which a connection attempt will be made. + * + * @param address the address value to set + * @return the ConnectivityDestination object itself. + */ + public ConnectivityDestination withAddress(String address) { + this.address = address; + return this; + } + + /** + * Get port on which check connectivity will be performed. + * + * @return the port value + */ + public Integer port() { + return this.port; + } + + /** + * Set port on which check connectivity will be performed. + * + * @param port the port value to set + * @return the ConnectivityDestination object itself. + */ + public ConnectivityDestination withPort(Integer port) { + this.port = port; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectivityHop.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectivityHop.java new file mode 100644 index 000000000000..15c7a2f8434c --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectivityHop.java @@ -0,0 +1,108 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about a hop between the source and the destination. + */ +public class ConnectivityHop { + /** + * The type of the hop. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * The ID of the hop. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * The IP address of the hop. + */ + @JsonProperty(value = "address", access = JsonProperty.Access.WRITE_ONLY) + private String address; + + /** + * The ID of the resource corresponding to this hop. + */ + @JsonProperty(value = "resourceId", access = JsonProperty.Access.WRITE_ONLY) + private String resourceId; + + /** + * List of next hop identifiers. + */ + @JsonProperty(value = "nextHopIds", access = JsonProperty.Access.WRITE_ONLY) + private List nextHopIds; + + /** + * List of issues. + */ + @JsonProperty(value = "issues", access = JsonProperty.Access.WRITE_ONLY) + private List issues; + + /** + * Get the type of the hop. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Get the ID of the hop. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get the IP address of the hop. + * + * @return the address value + */ + public String address() { + return this.address; + } + + /** + * Get the ID of the resource corresponding to this hop. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Get list of next hop identifiers. + * + * @return the nextHopIds value + */ + public List nextHopIds() { + return this.nextHopIds; + } + + /** + * Get list of issues. + * + * @return the issues value + */ + public List issues() { + return this.issues; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectivityInformation.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectivityInformation.java new file mode 100644 index 000000000000..210a369bc480 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectivityInformation.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.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.ConnectivityInformationInner; +import java.util.List; + +/** + * Type representing ConnectivityInformation. + */ +public interface ConnectivityInformation extends HasInner, HasManager { + /** + * @return the avgLatencyInMs value. + */ + Integer avgLatencyInMs(); + + /** + * @return the connectionStatus value. + */ + ConnectionStatus connectionStatus(); + + /** + * @return the hops value. + */ + List hops(); + + /** + * @return the maxLatencyInMs value. + */ + Integer maxLatencyInMs(); + + /** + * @return the minLatencyInMs value. + */ + Integer minLatencyInMs(); + + /** + * @return the probesFailed value. + */ + Integer probesFailed(); + + /** + * @return the probesSent value. + */ + Integer probesSent(); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectivityIssue.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectivityIssue.java new file mode 100644 index 000000000000..e77640dac36e --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectivityIssue.java @@ -0,0 +1,83 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about an issue encountered in the process of checking for + * connectivity. + */ +public class ConnectivityIssue { + /** + * The origin of the issue. Possible values include: 'Local', 'Inbound', + * 'Outbound'. + */ + @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) + private Origin origin; + + /** + * The severity of the issue. Possible values include: 'Error', 'Warning'. + */ + @JsonProperty(value = "severity", access = JsonProperty.Access.WRITE_ONLY) + private Severity severity; + + /** + * The type of issue. Possible values include: 'Unknown', 'AgentStopped', + * 'GuestFirewall', 'DnsResolution', 'SocketBind', 'NetworkSecurityRule', + * 'UserDefinedRoute', 'PortThrottled', 'Platform'. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private IssueType type; + + /** + * Provides additional context on the issue. + */ + @JsonProperty(value = "context", access = JsonProperty.Access.WRITE_ONLY) + private List> context; + + /** + * Get the origin of the issue. Possible values include: 'Local', 'Inbound', 'Outbound'. + * + * @return the origin value + */ + public Origin origin() { + return this.origin; + } + + /** + * Get the severity of the issue. Possible values include: 'Error', 'Warning'. + * + * @return the severity value + */ + public Severity severity() { + return this.severity; + } + + /** + * Get the type of issue. Possible values include: 'Unknown', 'AgentStopped', 'GuestFirewall', 'DnsResolution', 'SocketBind', 'NetworkSecurityRule', 'UserDefinedRoute', 'PortThrottled', 'Platform'. + * + * @return the type value + */ + public IssueType type() { + return this.type; + } + + /** + * Get provides additional context on the issue. + * + * @return the context value + */ + public List> context() { + return this.context; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectivityParameters.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectivityParameters.java new file mode 100644 index 000000000000..92fa4c625c87 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectivityParameters.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.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters that determine how the connectivity check will be performed. + */ +public class ConnectivityParameters { + /** + * The source property. + */ + @JsonProperty(value = "source", required = true) + private ConnectivitySource source; + + /** + * The destination property. + */ + @JsonProperty(value = "destination", required = true) + private ConnectivityDestination destination; + + /** + * Network protocol. Possible values include: 'Tcp', 'Http', 'Https', + * 'Icmp'. + */ + @JsonProperty(value = "protocol") + private Protocol protocol; + + /** + * The protocolConfiguration property. + */ + @JsonProperty(value = "protocolConfiguration") + private ProtocolConfiguration protocolConfiguration; + + /** + * Get the source value. + * + * @return the source value + */ + public ConnectivitySource source() { + return this.source; + } + + /** + * Set the source value. + * + * @param source the source value to set + * @return the ConnectivityParameters object itself. + */ + public ConnectivityParameters withSource(ConnectivitySource source) { + this.source = source; + return this; + } + + /** + * Get the destination value. + * + * @return the destination value + */ + public ConnectivityDestination destination() { + return this.destination; + } + + /** + * Set the destination value. + * + * @param destination the destination value to set + * @return the ConnectivityParameters object itself. + */ + public ConnectivityParameters withDestination(ConnectivityDestination destination) { + this.destination = destination; + return this; + } + + /** + * Get network protocol. Possible values include: 'Tcp', 'Http', 'Https', 'Icmp'. + * + * @return the protocol value + */ + public Protocol protocol() { + return this.protocol; + } + + /** + * Set network protocol. Possible values include: 'Tcp', 'Http', 'Https', 'Icmp'. + * + * @param protocol the protocol value to set + * @return the ConnectivityParameters object itself. + */ + public ConnectivityParameters withProtocol(Protocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the protocolConfiguration value. + * + * @return the protocolConfiguration value + */ + public ProtocolConfiguration protocolConfiguration() { + return this.protocolConfiguration; + } + + /** + * Set the protocolConfiguration value. + * + * @param protocolConfiguration the protocolConfiguration value to set + * @return the ConnectivityParameters object itself. + */ + public ConnectivityParameters withProtocolConfiguration(ProtocolConfiguration protocolConfiguration) { + this.protocolConfiguration = protocolConfiguration; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectivitySource.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectivitySource.java new file mode 100644 index 000000000000..6628552b6922 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ConnectivitySource.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.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters that define the source of the connection. + */ +public class ConnectivitySource { + /** + * The ID of the resource from which a connectivity check will be + * initiated. + */ + @JsonProperty(value = "resourceId", required = true) + private String resourceId; + + /** + * The source port from which a connectivity check will be performed. + */ + @JsonProperty(value = "port") + private Integer port; + + /** + * Get the ID of the resource from which a connectivity check will be initiated. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the ID of the resource from which a connectivity check will be initiated. + * + * @param resourceId the resourceId value to set + * @return the ConnectivitySource object itself. + */ + public ConnectivitySource withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the source port from which a connectivity check will be performed. + * + * @return the port value + */ + public Integer port() { + return this.port; + } + + /** + * Set the source port from which a connectivity check will be performed. + * + * @param port the port value to set + * @return the ConnectivitySource object itself. + */ + public ConnectivitySource withPort(Integer port) { + this.port = port; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/DdosProtectionPlan.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/DdosProtectionPlan.java new file mode 100644 index 000000000000..c67050c360c9 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/DdosProtectionPlan.java @@ -0,0 +1,90 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_06_01.implementation.DdosProtectionPlanInner; + +/** + * Type representing DdosProtectionPlan. + */ +public interface DdosProtectionPlan extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * @return the virtualNetworks value. + */ + List virtualNetworks(); + + /** + * The entirety of the DdosProtectionPlan definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of DdosProtectionPlan definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a DdosProtectionPlan definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the DdosProtectionPlan definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags { + } + } + /** + * The template for a DdosProtectionPlan update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags { + } + + /** + * Grouping of DdosProtectionPlan update stages. + */ + interface UpdateStages { + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/DdosProtectionPlans.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/DdosProtectionPlans.java new file mode 100644 index 000000000000..fe5ecfca28e0 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/DdosProtectionPlans.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_06_01.implementation.DdosProtectionPlansInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing DdosProtectionPlans. + */ +public interface DdosProtectionPlans extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/DefaultSecurityRules.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/DefaultSecurityRules.java new file mode 100644 index 000000000000..a6d80a6c13d1 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/DefaultSecurityRules.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import rx.Observable; +import com.microsoft.azure.management.network.v2018_06_01.implementation.DefaultSecurityRulesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing DefaultSecurityRules. + */ +public interface DefaultSecurityRules extends HasInner { + /** + * Get the specified default network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param defaultSecurityRuleName The name of the default security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String networkSecurityGroupName, String defaultSecurityRuleName); + + /** + * Gets all default security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String networkSecurityGroupName); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/DeviceProperties.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/DeviceProperties.java new file mode 100644 index 000000000000..917ab717471c --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/DeviceProperties.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * List of properties of the device. + */ +public class DeviceProperties { + /** + * Name of the device Vendor. + */ + @JsonProperty(value = "deviceVendor") + private String deviceVendor; + + /** + * Model of the device. + */ + @JsonProperty(value = "deviceModel") + private String deviceModel; + + /** + * Link speed. + */ + @JsonProperty(value = "linkSpeedInMbps") + private Integer linkSpeedInMbps; + + /** + * Get name of the device Vendor. + * + * @return the deviceVendor value + */ + public String deviceVendor() { + return this.deviceVendor; + } + + /** + * Set name of the device Vendor. + * + * @param deviceVendor the deviceVendor value to set + * @return the DeviceProperties object itself. + */ + public DeviceProperties withDeviceVendor(String deviceVendor) { + this.deviceVendor = deviceVendor; + return this; + } + + /** + * Get model of the device. + * + * @return the deviceModel value + */ + public String deviceModel() { + return this.deviceModel; + } + + /** + * Set model of the device. + * + * @param deviceModel the deviceModel value to set + * @return the DeviceProperties object itself. + */ + public DeviceProperties withDeviceModel(String deviceModel) { + this.deviceModel = deviceModel; + return this; + } + + /** + * Get link speed. + * + * @return the linkSpeedInMbps value + */ + public Integer linkSpeedInMbps() { + return this.linkSpeedInMbps; + } + + /** + * Set link speed. + * + * @param linkSpeedInMbps the linkSpeedInMbps value to set + * @return the DeviceProperties object itself. + */ + public DeviceProperties withLinkSpeedInMbps(Integer linkSpeedInMbps) { + this.linkSpeedInMbps = linkSpeedInMbps; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/DhGroup.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/DhGroup.java new file mode 100644 index 000000000000..92ddde7355d5 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/DhGroup.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for DhGroup. + */ +public final class DhGroup extends ExpandableStringEnum { + /** Static value None for DhGroup. */ + public static final DhGroup NONE = fromString("None"); + + /** Static value DHGroup1 for DhGroup. */ + public static final DhGroup DHGROUP1 = fromString("DHGroup1"); + + /** Static value DHGroup2 for DhGroup. */ + public static final DhGroup DHGROUP2 = fromString("DHGroup2"); + + /** Static value DHGroup14 for DhGroup. */ + public static final DhGroup DHGROUP14 = fromString("DHGroup14"); + + /** Static value DHGroup2048 for DhGroup. */ + public static final DhGroup DHGROUP2048 = fromString("DHGroup2048"); + + /** Static value ECP256 for DhGroup. */ + public static final DhGroup ECP256 = fromString("ECP256"); + + /** Static value ECP384 for DhGroup. */ + public static final DhGroup ECP384 = fromString("ECP384"); + + /** Static value DHGroup24 for DhGroup. */ + public static final DhGroup DHGROUP24 = fromString("DHGroup24"); + + /** + * Creates or finds a DhGroup from its string representation. + * @param name a name to look for + * @return the corresponding DhGroup + */ + @JsonCreator + public static DhGroup fromString(String name) { + return fromString(name, DhGroup.class); + } + + /** + * @return known DhGroup values + */ + public static Collection values() { + return values(DhGroup.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/DhcpOptions.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/DhcpOptions.java new file mode 100644 index 000000000000..9e5276b4a248 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/DhcpOptions.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * DhcpOptions contains an array of DNS servers available to VMs deployed in + * the virtual network. Standard DHCP option for a subnet overrides VNET DHCP + * options. + */ +public class DhcpOptions { + /** + * The list of DNS servers IP addresses. + */ + @JsonProperty(value = "dnsServers") + private List dnsServers; + + /** + * Get the list of DNS servers IP addresses. + * + * @return the dnsServers value + */ + public List dnsServers() { + return this.dnsServers; + } + + /** + * Set the list of DNS servers IP addresses. + * + * @param dnsServers the dnsServers value to set + * @return the DhcpOptions object itself. + */ + public DhcpOptions withDnsServers(List dnsServers) { + this.dnsServers = dnsServers; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/Dimension.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/Dimension.java new file mode 100644 index 000000000000..39e8b356c689 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/Dimension.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Dimension of the metric. + */ +public class Dimension { + /** + * The name of the dimension. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The display name of the dimension. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * The internal name of the dimension. + */ + @JsonProperty(value = "internalName") + private String internalName; + + /** + * Get the name of the dimension. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the dimension. + * + * @param name the name value to set + * @return the Dimension object itself. + */ + public Dimension withName(String name) { + this.name = name; + return this; + } + + /** + * Get the display name of the dimension. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the display name of the dimension. + * + * @param displayName the displayName value to set + * @return the Dimension object itself. + */ + public Dimension withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the internal name of the dimension. + * + * @return the internalName value + */ + public String internalName() { + return this.internalName; + } + + /** + * Set the internal name of the dimension. + * + * @param internalName the internalName value to set + * @return the Dimension object itself. + */ + public Dimension withInternalName(String internalName) { + this.internalName = internalName; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/Direction.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/Direction.java new file mode 100644 index 000000000000..184186caf9fa --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/Direction.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for Direction. + */ +public final class Direction extends ExpandableStringEnum { + /** Static value Inbound for Direction. */ + public static final Direction INBOUND = fromString("Inbound"); + + /** Static value Outbound for Direction. */ + public static final Direction OUTBOUND = fromString("Outbound"); + + /** + * Creates or finds a Direction from its string representation. + * @param name a name to look for + * @return the corresponding Direction + */ + @JsonCreator + public static Direction fromString(String name) { + return fromString(name, Direction.class); + } + + /** + * @return known Direction values + */ + public static Collection values() { + return values(Direction.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/EffectiveNetworkSecurityGroup.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/EffectiveNetworkSecurityGroup.java new file mode 100644 index 000000000000..53d48b0e8a0d --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/EffectiveNetworkSecurityGroup.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.network.v2018_06_01; + +import com.microsoft.azure.SubResource; +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Effective network security group. + */ +public class EffectiveNetworkSecurityGroup { + /** + * The ID of network security group that is applied. + */ + @JsonProperty(value = "networkSecurityGroup") + private SubResource networkSecurityGroup; + + /** + * Associated resources. + */ + @JsonProperty(value = "association") + private EffectiveNetworkSecurityGroupAssociation association; + + /** + * A collection of effective security rules. + */ + @JsonProperty(value = "effectiveSecurityRules") + private List effectiveSecurityRules; + + /** + * Mapping of tags to list of IP Addresses included within the tag. + */ + @JsonProperty(value = "tagMap") + private Map> tagMap; + + /** + * Get the ID of network security group that is applied. + * + * @return the networkSecurityGroup value + */ + public SubResource networkSecurityGroup() { + return this.networkSecurityGroup; + } + + /** + * Set the ID of network security group that is applied. + * + * @param networkSecurityGroup the networkSecurityGroup value to set + * @return the EffectiveNetworkSecurityGroup object itself. + */ + public EffectiveNetworkSecurityGroup withNetworkSecurityGroup(SubResource networkSecurityGroup) { + this.networkSecurityGroup = networkSecurityGroup; + return this; + } + + /** + * Get associated resources. + * + * @return the association value + */ + public EffectiveNetworkSecurityGroupAssociation association() { + return this.association; + } + + /** + * Set associated resources. + * + * @param association the association value to set + * @return the EffectiveNetworkSecurityGroup object itself. + */ + public EffectiveNetworkSecurityGroup withAssociation(EffectiveNetworkSecurityGroupAssociation association) { + this.association = association; + return this; + } + + /** + * Get a collection of effective security rules. + * + * @return the effectiveSecurityRules value + */ + public List effectiveSecurityRules() { + return this.effectiveSecurityRules; + } + + /** + * Set a collection of effective security rules. + * + * @param effectiveSecurityRules the effectiveSecurityRules value to set + * @return the EffectiveNetworkSecurityGroup object itself. + */ + public EffectiveNetworkSecurityGroup withEffectiveSecurityRules(List effectiveSecurityRules) { + this.effectiveSecurityRules = effectiveSecurityRules; + return this; + } + + /** + * Get mapping of tags to list of IP Addresses included within the tag. + * + * @return the tagMap value + */ + public Map> tagMap() { + return this.tagMap; + } + + /** + * Set mapping of tags to list of IP Addresses included within the tag. + * + * @param tagMap the tagMap value to set + * @return the EffectiveNetworkSecurityGroup object itself. + */ + public EffectiveNetworkSecurityGroup withTagMap(Map> tagMap) { + this.tagMap = tagMap; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/EffectiveNetworkSecurityGroupAssociation.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/EffectiveNetworkSecurityGroupAssociation.java new file mode 100644 index 000000000000..05266b3f8dd8 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/EffectiveNetworkSecurityGroupAssociation.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.network.v2018_06_01; + +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The effective network security group association. + */ +public class EffectiveNetworkSecurityGroupAssociation { + /** + * The ID of the subnet if assigned. + */ + @JsonProperty(value = "subnet") + private SubResource subnet; + + /** + * The ID of the network interface if assigned. + */ + @JsonProperty(value = "networkInterface") + private SubResource networkInterface; + + /** + * Get the ID of the subnet if assigned. + * + * @return the subnet value + */ + public SubResource subnet() { + return this.subnet; + } + + /** + * Set the ID of the subnet if assigned. + * + * @param subnet the subnet value to set + * @return the EffectiveNetworkSecurityGroupAssociation object itself. + */ + public EffectiveNetworkSecurityGroupAssociation withSubnet(SubResource subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get the ID of the network interface if assigned. + * + * @return the networkInterface value + */ + public SubResource networkInterface() { + return this.networkInterface; + } + + /** + * Set the ID of the network interface if assigned. + * + * @param networkInterface the networkInterface value to set + * @return the EffectiveNetworkSecurityGroupAssociation object itself. + */ + public EffectiveNetworkSecurityGroupAssociation withNetworkInterface(SubResource networkInterface) { + this.networkInterface = networkInterface; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/EffectiveNetworkSecurityGroupListResult.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/EffectiveNetworkSecurityGroupListResult.java new file mode 100644 index 000000000000..f9618403a032 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/EffectiveNetworkSecurityGroupListResult.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.EffectiveNetworkSecurityGroupListResultInner; +import java.util.List; + +/** + * Type representing EffectiveNetworkSecurityGroupListResult. + */ +public interface EffectiveNetworkSecurityGroupListResult extends HasInner, HasManager { + /** + * @return the nextLink value. + */ + String nextLink(); + + /** + * @return the value value. + */ + List value(); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/EffectiveNetworkSecurityRule.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/EffectiveNetworkSecurityRule.java new file mode 100644 index 000000000000..5601e0850c4d --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/EffectiveNetworkSecurityRule.java @@ -0,0 +1,420 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Effective network security rules. + */ +public class EffectiveNetworkSecurityRule { + /** + * The name of the security rule specified by the user (if created by the + * user). + */ + @JsonProperty(value = "name") + private String name; + + /** + * The network protocol this rule applies to. Possible values are: 'Tcp', + * 'Udp', and 'All'. Possible values include: 'Tcp', 'Udp', 'All'. + */ + @JsonProperty(value = "protocol") + private EffectiveSecurityRuleProtocol protocol; + + /** + * The source port or range. + */ + @JsonProperty(value = "sourcePortRange") + private String sourcePortRange; + + /** + * The destination port or range. + */ + @JsonProperty(value = "destinationPortRange") + private String destinationPortRange; + + /** + * The source port ranges. Expected values include a single integer between + * 0 and 65535, a range using '-' as seperator (e.g. 100-400), or an + * asterix (*). + */ + @JsonProperty(value = "sourcePortRanges") + private List sourcePortRanges; + + /** + * The destination port ranges. Expected values include a single integer + * between 0 and 65535, a range using '-' as seperator (e.g. 100-400), or + * an asterix (*). + */ + @JsonProperty(value = "destinationPortRanges") + private List destinationPortRanges; + + /** + * The source address prefix. + */ + @JsonProperty(value = "sourceAddressPrefix") + private String sourceAddressPrefix; + + /** + * The destination address prefix. + */ + @JsonProperty(value = "destinationAddressPrefix") + private String destinationAddressPrefix; + + /** + * The source address prefixes. Expected values include CIDR IP ranges, + * Default Tags (VirtualNetwork, AureLoadBalancer, Internet), System Tags, + * and the asterix (*). + */ + @JsonProperty(value = "sourceAddressPrefixes") + private List sourceAddressPrefixes; + + /** + * The destination address prefixes. Expected values include CIDR IP + * ranges, Default Tags (VirtualNetwork, AureLoadBalancer, Internet), + * System Tags, and the asterix (*). + */ + @JsonProperty(value = "destinationAddressPrefixes") + private List destinationAddressPrefixes; + + /** + * The expanded source address prefix. + */ + @JsonProperty(value = "expandedSourceAddressPrefix") + private List expandedSourceAddressPrefix; + + /** + * Expanded destination address prefix. + */ + @JsonProperty(value = "expandedDestinationAddressPrefix") + private List expandedDestinationAddressPrefix; + + /** + * Whether network traffic is allowed or denied. Possible values are: + * 'Allow' and 'Deny'. Possible values include: 'Allow', 'Deny'. + */ + @JsonProperty(value = "access") + private SecurityRuleAccess access; + + /** + * The priority of the rule. + */ + @JsonProperty(value = "priority") + private Integer priority; + + /** + * The direction of the rule. Possible values are: 'Inbound and Outbound'. + * Possible values include: 'Inbound', 'Outbound'. + */ + @JsonProperty(value = "direction") + private SecurityRuleDirection direction; + + /** + * Get the name of the security rule specified by the user (if created by the user). + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the security rule specified by the user (if created by the user). + * + * @param name the name value to set + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withName(String name) { + this.name = name; + return this; + } + + /** + * Get the network protocol this rule applies to. Possible values are: 'Tcp', 'Udp', and 'All'. Possible values include: 'Tcp', 'Udp', 'All'. + * + * @return the protocol value + */ + public EffectiveSecurityRuleProtocol protocol() { + return this.protocol; + } + + /** + * Set the network protocol this rule applies to. Possible values are: 'Tcp', 'Udp', and 'All'. Possible values include: 'Tcp', 'Udp', 'All'. + * + * @param protocol the protocol value to set + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withProtocol(EffectiveSecurityRuleProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the source port or range. + * + * @return the sourcePortRange value + */ + public String sourcePortRange() { + return this.sourcePortRange; + } + + /** + * Set the source port or range. + * + * @param sourcePortRange the sourcePortRange value to set + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withSourcePortRange(String sourcePortRange) { + this.sourcePortRange = sourcePortRange; + return this; + } + + /** + * Get the destination port or range. + * + * @return the destinationPortRange value + */ + public String destinationPortRange() { + return this.destinationPortRange; + } + + /** + * Set the destination port or range. + * + * @param destinationPortRange the destinationPortRange value to set + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withDestinationPortRange(String destinationPortRange) { + this.destinationPortRange = destinationPortRange; + return this; + } + + /** + * Get the source port ranges. Expected values include a single integer between 0 and 65535, a range using '-' as seperator (e.g. 100-400), or an asterix (*). + * + * @return the sourcePortRanges value + */ + public List sourcePortRanges() { + return this.sourcePortRanges; + } + + /** + * Set the source port ranges. Expected values include a single integer between 0 and 65535, a range using '-' as seperator (e.g. 100-400), or an asterix (*). + * + * @param sourcePortRanges the sourcePortRanges value to set + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withSourcePortRanges(List sourcePortRanges) { + this.sourcePortRanges = sourcePortRanges; + return this; + } + + /** + * Get the destination port ranges. Expected values include a single integer between 0 and 65535, a range using '-' as seperator (e.g. 100-400), or an asterix (*). + * + * @return the destinationPortRanges value + */ + public List destinationPortRanges() { + return this.destinationPortRanges; + } + + /** + * Set the destination port ranges. Expected values include a single integer between 0 and 65535, a range using '-' as seperator (e.g. 100-400), or an asterix (*). + * + * @param destinationPortRanges the destinationPortRanges value to set + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withDestinationPortRanges(List destinationPortRanges) { + this.destinationPortRanges = destinationPortRanges; + return this; + } + + /** + * Get the source address prefix. + * + * @return the sourceAddressPrefix value + */ + public String sourceAddressPrefix() { + return this.sourceAddressPrefix; + } + + /** + * Set the source address prefix. + * + * @param sourceAddressPrefix the sourceAddressPrefix value to set + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withSourceAddressPrefix(String sourceAddressPrefix) { + this.sourceAddressPrefix = sourceAddressPrefix; + return this; + } + + /** + * Get the destination address prefix. + * + * @return the destinationAddressPrefix value + */ + public String destinationAddressPrefix() { + return this.destinationAddressPrefix; + } + + /** + * Set the destination address prefix. + * + * @param destinationAddressPrefix the destinationAddressPrefix value to set + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withDestinationAddressPrefix(String destinationAddressPrefix) { + this.destinationAddressPrefix = destinationAddressPrefix; + return this; + } + + /** + * Get the source address prefixes. Expected values include CIDR IP ranges, Default Tags (VirtualNetwork, AureLoadBalancer, Internet), System Tags, and the asterix (*). + * + * @return the sourceAddressPrefixes value + */ + public List sourceAddressPrefixes() { + return this.sourceAddressPrefixes; + } + + /** + * Set the source address prefixes. Expected values include CIDR IP ranges, Default Tags (VirtualNetwork, AureLoadBalancer, Internet), System Tags, and the asterix (*). + * + * @param sourceAddressPrefixes the sourceAddressPrefixes value to set + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withSourceAddressPrefixes(List sourceAddressPrefixes) { + this.sourceAddressPrefixes = sourceAddressPrefixes; + return this; + } + + /** + * Get the destination address prefixes. Expected values include CIDR IP ranges, Default Tags (VirtualNetwork, AureLoadBalancer, Internet), System Tags, and the asterix (*). + * + * @return the destinationAddressPrefixes value + */ + public List destinationAddressPrefixes() { + return this.destinationAddressPrefixes; + } + + /** + * Set the destination address prefixes. Expected values include CIDR IP ranges, Default Tags (VirtualNetwork, AureLoadBalancer, Internet), System Tags, and the asterix (*). + * + * @param destinationAddressPrefixes the destinationAddressPrefixes value to set + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withDestinationAddressPrefixes(List destinationAddressPrefixes) { + this.destinationAddressPrefixes = destinationAddressPrefixes; + return this; + } + + /** + * Get the expanded source address prefix. + * + * @return the expandedSourceAddressPrefix value + */ + public List expandedSourceAddressPrefix() { + return this.expandedSourceAddressPrefix; + } + + /** + * Set the expanded source address prefix. + * + * @param expandedSourceAddressPrefix the expandedSourceAddressPrefix value to set + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withExpandedSourceAddressPrefix(List expandedSourceAddressPrefix) { + this.expandedSourceAddressPrefix = expandedSourceAddressPrefix; + return this; + } + + /** + * Get expanded destination address prefix. + * + * @return the expandedDestinationAddressPrefix value + */ + public List expandedDestinationAddressPrefix() { + return this.expandedDestinationAddressPrefix; + } + + /** + * Set expanded destination address prefix. + * + * @param expandedDestinationAddressPrefix the expandedDestinationAddressPrefix value to set + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withExpandedDestinationAddressPrefix(List expandedDestinationAddressPrefix) { + this.expandedDestinationAddressPrefix = expandedDestinationAddressPrefix; + return this; + } + + /** + * Get whether network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'. Possible values include: 'Allow', 'Deny'. + * + * @return the access value + */ + public SecurityRuleAccess access() { + return this.access; + } + + /** + * Set whether network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'. Possible values include: 'Allow', 'Deny'. + * + * @param access the access value to set + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withAccess(SecurityRuleAccess access) { + this.access = access; + return this; + } + + /** + * Get the priority of the rule. + * + * @return the priority value + */ + public Integer priority() { + return this.priority; + } + + /** + * Set the priority of the rule. + * + * @param priority the priority value to set + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withPriority(Integer priority) { + this.priority = priority; + return this; + } + + /** + * Get the direction of the rule. Possible values are: 'Inbound and Outbound'. Possible values include: 'Inbound', 'Outbound'. + * + * @return the direction value + */ + public SecurityRuleDirection direction() { + return this.direction; + } + + /** + * Set the direction of the rule. Possible values are: 'Inbound and Outbound'. Possible values include: 'Inbound', 'Outbound'. + * + * @param direction the direction value to set + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withDirection(SecurityRuleDirection direction) { + this.direction = direction; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/EffectiveRoute.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/EffectiveRoute.java new file mode 100644 index 000000000000..b2103d68cae9 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/EffectiveRoute.java @@ -0,0 +1,180 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Effective Route. + */ +public class EffectiveRoute { + /** + * The name of the user defined route. This is optional. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Who created the route. Possible values are: 'Unknown', 'User', + * 'VirtualNetworkGateway', and 'Default'. Possible values include: + * 'Unknown', 'User', 'VirtualNetworkGateway', 'Default'. + */ + @JsonProperty(value = "source") + private EffectiveRouteSource source; + + /** + * The value of effective route. Possible values are: 'Active' and + * 'Invalid'. Possible values include: 'Active', 'Invalid'. + */ + @JsonProperty(value = "state") + private EffectiveRouteState state; + + /** + * The address prefixes of the effective routes in CIDR notation. + */ + @JsonProperty(value = "addressPrefix") + private List addressPrefix; + + /** + * The IP address of the next hop of the effective route. + */ + @JsonProperty(value = "nextHopIpAddress") + private List nextHopIpAddress; + + /** + * The type of Azure hop the packet should be sent to. Possible values are: + * 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', + * and 'None'. Possible values include: 'VirtualNetworkGateway', + * 'VnetLocal', 'Internet', 'VirtualAppliance', 'None'. + */ + @JsonProperty(value = "nextHopType") + private RouteNextHopType nextHopType; + + /** + * Get the name of the user defined route. This is optional. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the user defined route. This is optional. + * + * @param name the name value to set + * @return the EffectiveRoute object itself. + */ + public EffectiveRoute withName(String name) { + this.name = name; + return this; + } + + /** + * Get who created the route. Possible values are: 'Unknown', 'User', 'VirtualNetworkGateway', and 'Default'. Possible values include: 'Unknown', 'User', 'VirtualNetworkGateway', 'Default'. + * + * @return the source value + */ + public EffectiveRouteSource source() { + return this.source; + } + + /** + * Set who created the route. Possible values are: 'Unknown', 'User', 'VirtualNetworkGateway', and 'Default'. Possible values include: 'Unknown', 'User', 'VirtualNetworkGateway', 'Default'. + * + * @param source the source value to set + * @return the EffectiveRoute object itself. + */ + public EffectiveRoute withSource(EffectiveRouteSource source) { + this.source = source; + return this; + } + + /** + * Get the value of effective route. Possible values are: 'Active' and 'Invalid'. Possible values include: 'Active', 'Invalid'. + * + * @return the state value + */ + public EffectiveRouteState state() { + return this.state; + } + + /** + * Set the value of effective route. Possible values are: 'Active' and 'Invalid'. Possible values include: 'Active', 'Invalid'. + * + * @param state the state value to set + * @return the EffectiveRoute object itself. + */ + public EffectiveRoute withState(EffectiveRouteState state) { + this.state = state; + return this; + } + + /** + * Get the address prefixes of the effective routes in CIDR notation. + * + * @return the addressPrefix value + */ + public List addressPrefix() { + return this.addressPrefix; + } + + /** + * Set the address prefixes of the effective routes in CIDR notation. + * + * @param addressPrefix the addressPrefix value to set + * @return the EffectiveRoute object itself. + */ + public EffectiveRoute withAddressPrefix(List addressPrefix) { + this.addressPrefix = addressPrefix; + return this; + } + + /** + * Get the IP address of the next hop of the effective route. + * + * @return the nextHopIpAddress value + */ + public List nextHopIpAddress() { + return this.nextHopIpAddress; + } + + /** + * Set the IP address of the next hop of the effective route. + * + * @param nextHopIpAddress the nextHopIpAddress value to set + * @return the EffectiveRoute object itself. + */ + public EffectiveRoute withNextHopIpAddress(List nextHopIpAddress) { + this.nextHopIpAddress = nextHopIpAddress; + return this; + } + + /** + * Get the type of Azure hop the packet should be sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'. Possible values include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', 'None'. + * + * @return the nextHopType value + */ + public RouteNextHopType nextHopType() { + return this.nextHopType; + } + + /** + * Set the type of Azure hop the packet should be sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'. Possible values include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', 'None'. + * + * @param nextHopType the nextHopType value to set + * @return the EffectiveRoute object itself. + */ + public EffectiveRoute withNextHopType(RouteNextHopType nextHopType) { + this.nextHopType = nextHopType; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/EffectiveRouteListResult.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/EffectiveRouteListResult.java new file mode 100644 index 000000000000..5e1b2eb1df73 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/EffectiveRouteListResult.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.EffectiveRouteListResultInner; +import java.util.List; + +/** + * Type representing EffectiveRouteListResult. + */ +public interface EffectiveRouteListResult extends HasInner, HasManager { + /** + * @return the nextLink value. + */ + String nextLink(); + + /** + * @return the value value. + */ + List value(); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/EffectiveRouteSource.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/EffectiveRouteSource.java new file mode 100644 index 000000000000..2e69b5a34782 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/EffectiveRouteSource.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for EffectiveRouteSource. + */ +public final class EffectiveRouteSource extends ExpandableStringEnum { + /** Static value Unknown for EffectiveRouteSource. */ + public static final EffectiveRouteSource UNKNOWN = fromString("Unknown"); + + /** Static value User for EffectiveRouteSource. */ + public static final EffectiveRouteSource USER = fromString("User"); + + /** Static value VirtualNetworkGateway for EffectiveRouteSource. */ + public static final EffectiveRouteSource VIRTUAL_NETWORK_GATEWAY = fromString("VirtualNetworkGateway"); + + /** Static value Default for EffectiveRouteSource. */ + public static final EffectiveRouteSource DEFAULT = fromString("Default"); + + /** + * Creates or finds a EffectiveRouteSource from its string representation. + * @param name a name to look for + * @return the corresponding EffectiveRouteSource + */ + @JsonCreator + public static EffectiveRouteSource fromString(String name) { + return fromString(name, EffectiveRouteSource.class); + } + + /** + * @return known EffectiveRouteSource values + */ + public static Collection values() { + return values(EffectiveRouteSource.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/EffectiveRouteState.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/EffectiveRouteState.java new file mode 100644 index 000000000000..737860adbe3a --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/EffectiveRouteState.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for EffectiveRouteState. + */ +public final class EffectiveRouteState extends ExpandableStringEnum { + /** Static value Active for EffectiveRouteState. */ + public static final EffectiveRouteState ACTIVE = fromString("Active"); + + /** Static value Invalid for EffectiveRouteState. */ + public static final EffectiveRouteState INVALID = fromString("Invalid"); + + /** + * Creates or finds a EffectiveRouteState from its string representation. + * @param name a name to look for + * @return the corresponding EffectiveRouteState + */ + @JsonCreator + public static EffectiveRouteState fromString(String name) { + return fromString(name, EffectiveRouteState.class); + } + + /** + * @return known EffectiveRouteState values + */ + public static Collection values() { + return values(EffectiveRouteState.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/EffectiveSecurityRuleProtocol.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/EffectiveSecurityRuleProtocol.java new file mode 100644 index 000000000000..727c38bca3bb --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/EffectiveSecurityRuleProtocol.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for EffectiveSecurityRuleProtocol. + */ +public final class EffectiveSecurityRuleProtocol extends ExpandableStringEnum { + /** Static value Tcp for EffectiveSecurityRuleProtocol. */ + public static final EffectiveSecurityRuleProtocol TCP = fromString("Tcp"); + + /** Static value Udp for EffectiveSecurityRuleProtocol. */ + public static final EffectiveSecurityRuleProtocol UDP = fromString("Udp"); + + /** Static value All for EffectiveSecurityRuleProtocol. */ + public static final EffectiveSecurityRuleProtocol ALL = fromString("All"); + + /** + * Creates or finds a EffectiveSecurityRuleProtocol from its string representation. + * @param name a name to look for + * @return the corresponding EffectiveSecurityRuleProtocol + */ + @JsonCreator + public static EffectiveSecurityRuleProtocol fromString(String name) { + return fromString(name, EffectiveSecurityRuleProtocol.class); + } + + /** + * @return known EffectiveSecurityRuleProtocol values + */ + public static Collection values() { + return values(EffectiveSecurityRuleProtocol.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/EndpointServiceResult.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/EndpointServiceResult.java new file mode 100644 index 000000000000..ebd76c2593c7 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/EndpointServiceResult.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.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_06_01.implementation.EndpointServiceResultInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager; + +/** + * Type representing EndpointServiceResult. + */ +public interface EndpointServiceResult extends HasInner, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/Error.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/Error.java new file mode 100644 index 000000000000..318710fd87df --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/Error.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Error model. + */ +public class Error { + /** + * The code property. + */ + @JsonProperty(value = "code") + private String code; + + /** + * The message property. + */ + @JsonProperty(value = "message") + private String message; + + /** + * The target property. + */ + @JsonProperty(value = "target") + private String target; + + /** + * The details property. + */ + @JsonProperty(value = "details") + private List details; + + /** + * The innerError property. + */ + @JsonProperty(value = "innerError") + private String innerError; + + /** + * Get the code value. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set the code value. + * + * @param code the code value to set + * @return the Error object itself. + */ + public Error withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the message value. + * + * @param message the message value to set + * @return the Error object itself. + */ + public Error withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the target value. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Set the target value. + * + * @param target the target value to set + * @return the Error object itself. + */ + public Error withTarget(String target) { + this.target = target; + return this; + } + + /** + * Get the details value. + * + * @return the details value + */ + public List details() { + return this.details; + } + + /** + * Set the details value. + * + * @param details the details value to set + * @return the Error object itself. + */ + public Error withDetails(List details) { + this.details = details; + return this; + } + + /** + * Get the innerError value. + * + * @return the innerError value + */ + public String innerError() { + return this.innerError; + } + + /** + * Set the innerError value. + * + * @param innerError the innerError value to set + * @return the Error object itself. + */ + public Error withInnerError(String innerError) { + this.innerError = innerError; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ErrorDetails.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ErrorDetails.java new file mode 100644 index 000000000000..300cce0ff051 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ErrorDetails.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ErrorDetails model. + */ +public class ErrorDetails { + /** + * The code property. + */ + @JsonProperty(value = "code") + private String code; + + /** + * The target property. + */ + @JsonProperty(value = "target") + private String target; + + /** + * The message property. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the code value. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set the code value. + * + * @param code the code value to set + * @return the ErrorDetails object itself. + */ + public ErrorDetails withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the target value. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Set the target value. + * + * @param target the target value to set + * @return the ErrorDetails object itself. + */ + public ErrorDetails withTarget(String target) { + this.target = target; + return this; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the message value. + * + * @param message the message value to set + * @return the ErrorDetails object itself. + */ + public ErrorDetails withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ErrorException.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ErrorException.java new file mode 100644 index 000000000000..6b5efe92830b --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ErrorException.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.network.v2018_06_01; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with Error information. + */ +public class ErrorException extends RestException { + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorException(final String message, final Response response, final Error body) { + super(message, response, body); + } + + @Override + public Error body() { + return (Error) super.body(); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/EvaluationState.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/EvaluationState.java new file mode 100644 index 000000000000..9acb7906e9b7 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/EvaluationState.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for EvaluationState. + */ +public final class EvaluationState extends ExpandableStringEnum { + /** Static value NotStarted for EvaluationState. */ + public static final EvaluationState NOT_STARTED = fromString("NotStarted"); + + /** Static value InProgress for EvaluationState. */ + public static final EvaluationState IN_PROGRESS = fromString("InProgress"); + + /** Static value Completed for EvaluationState. */ + public static final EvaluationState COMPLETED = fromString("Completed"); + + /** + * Creates or finds a EvaluationState from its string representation. + * @param name a name to look for + * @return the corresponding EvaluationState + */ + @JsonCreator + public static EvaluationState fromString(String name) { + return fromString(name, EvaluationState.class); + } + + /** + * @return known EvaluationState values + */ + public static Collection values() { + return values(EvaluationState.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuit.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuit.java new file mode 100644 index 000000000000..562c380bf1c5 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuit.java @@ -0,0 +1,351 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.implementation.ExpressRouteCircuitAuthorizationInner; +import com.microsoft.azure.management.network.v2018_06_01.implementation.ExpressRouteCircuitPeeringInner; +import com.microsoft.azure.management.network.v2018_06_01.implementation.ExpressRouteCircuitInner; + +/** + * Type representing ExpressRouteCircuit. + */ +public interface ExpressRouteCircuit extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the allowClassicOperations value. + */ + Boolean allowClassicOperations(); + + /** + * @return the authorizations value. + */ + List authorizations(); + + /** + * @return the circuitProvisioningState value. + */ + String circuitProvisioningState(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the gatewayManagerEtag value. + */ + String gatewayManagerEtag(); + + /** + * @return the peerings value. + */ + List peerings(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the serviceKey value. + */ + String serviceKey(); + + /** + * @return the serviceProviderNotes value. + */ + String serviceProviderNotes(); + + /** + * @return the serviceProviderProperties value. + */ + ExpressRouteCircuitServiceProviderProperties serviceProviderProperties(); + + /** + * @return the serviceProviderProvisioningState value. + */ + ServiceProviderProvisioningState serviceProviderProvisioningState(); + + /** + * @return the sku value. + */ + ExpressRouteCircuitSku sku(); + + /** + * The entirety of the ExpressRouteCircuit definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of ExpressRouteCircuit definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ExpressRouteCircuit definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the ExpressRouteCircuit definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the expressroutecircuit update allowing to specify AllowClassicOperations. + */ + interface WithAllowClassicOperations { + /** + * Specifies allowClassicOperations. + */ + WithCreate withAllowClassicOperations(Boolean allowClassicOperations); + } + + /** + * The stage of the expressroutecircuit update allowing to specify Authorizations. + */ + interface WithAuthorizations { + /** + * Specifies authorizations. + */ + WithCreate withAuthorizations(List authorizations); + } + + /** + * The stage of the expressroutecircuit update allowing to specify CircuitProvisioningState. + */ + interface WithCircuitProvisioningState { + /** + * Specifies circuitProvisioningState. + */ + WithCreate withCircuitProvisioningState(String circuitProvisioningState); + } + + /** + * The stage of the expressroutecircuit update allowing to specify GatewayManagerEtag. + */ + interface WithGatewayManagerEtag { + /** + * Specifies gatewayManagerEtag. + */ + WithCreate withGatewayManagerEtag(String gatewayManagerEtag); + } + + /** + * The stage of the expressroutecircuit update allowing to specify Peerings. + */ + interface WithPeerings { + /** + * Specifies peerings. + */ + WithCreate withPeerings(List peerings); + } + + /** + * The stage of the expressroutecircuit update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the expressroutecircuit update allowing to specify ServiceKey. + */ + interface WithServiceKey { + /** + * Specifies serviceKey. + */ + WithCreate withServiceKey(String serviceKey); + } + + /** + * The stage of the expressroutecircuit update allowing to specify ServiceProviderNotes. + */ + interface WithServiceProviderNotes { + /** + * Specifies serviceProviderNotes. + */ + WithCreate withServiceProviderNotes(String serviceProviderNotes); + } + + /** + * The stage of the expressroutecircuit update allowing to specify ServiceProviderProperties. + */ + interface WithServiceProviderProperties { + /** + * Specifies serviceProviderProperties. + */ + WithCreate withServiceProviderProperties(ExpressRouteCircuitServiceProviderProperties serviceProviderProperties); + } + + /** + * The stage of the expressroutecircuit update allowing to specify ServiceProviderProvisioningState. + */ + interface WithServiceProviderProvisioningState { + /** + * Specifies serviceProviderProvisioningState. + */ + WithCreate withServiceProviderProvisioningState(ServiceProviderProvisioningState serviceProviderProvisioningState); + } + + /** + * The stage of the expressroutecircuit update allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + */ + WithCreate withSku(ExpressRouteCircuitSku sku); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithAllowClassicOperations, DefinitionStages.WithAuthorizations, DefinitionStages.WithCircuitProvisioningState, DefinitionStages.WithGatewayManagerEtag, DefinitionStages.WithPeerings, DefinitionStages.WithProvisioningState, DefinitionStages.WithServiceKey, DefinitionStages.WithServiceProviderNotes, DefinitionStages.WithServiceProviderProperties, DefinitionStages.WithServiceProviderProvisioningState, DefinitionStages.WithSku { + } + } + /** + * The template for a ExpressRouteCircuit update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithAllowClassicOperations, UpdateStages.WithAuthorizations, UpdateStages.WithCircuitProvisioningState, UpdateStages.WithGatewayManagerEtag, UpdateStages.WithPeerings, UpdateStages.WithProvisioningState, UpdateStages.WithServiceKey, UpdateStages.WithServiceProviderNotes, UpdateStages.WithServiceProviderProperties, UpdateStages.WithServiceProviderProvisioningState, UpdateStages.WithSku { + } + + /** + * Grouping of ExpressRouteCircuit update stages. + */ + interface UpdateStages { + /** + * The stage of the expressroutecircuit {0} allowing to specify AllowClassicOperations. + */ + interface WithAllowClassicOperations { + /** + * Specifies allowClassicOperations. + */ + Update withAllowClassicOperations(Boolean allowClassicOperations); + } + + /** + * The stage of the expressroutecircuit {0} allowing to specify Authorizations. + */ + interface WithAuthorizations { + /** + * Specifies authorizations. + */ + Update withAuthorizations(List authorizations); + } + + /** + * The stage of the expressroutecircuit {0} allowing to specify CircuitProvisioningState. + */ + interface WithCircuitProvisioningState { + /** + * Specifies circuitProvisioningState. + */ + Update withCircuitProvisioningState(String circuitProvisioningState); + } + + /** + * The stage of the expressroutecircuit {0} allowing to specify GatewayManagerEtag. + */ + interface WithGatewayManagerEtag { + /** + * Specifies gatewayManagerEtag. + */ + Update withGatewayManagerEtag(String gatewayManagerEtag); + } + + /** + * The stage of the expressroutecircuit {0} allowing to specify Peerings. + */ + interface WithPeerings { + /** + * Specifies peerings. + */ + Update withPeerings(List peerings); + } + + /** + * The stage of the expressroutecircuit {0} allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + */ + Update withProvisioningState(String provisioningState); + } + + /** + * The stage of the expressroutecircuit {0} allowing to specify ServiceKey. + */ + interface WithServiceKey { + /** + * Specifies serviceKey. + */ + Update withServiceKey(String serviceKey); + } + + /** + * The stage of the expressroutecircuit {0} allowing to specify ServiceProviderNotes. + */ + interface WithServiceProviderNotes { + /** + * Specifies serviceProviderNotes. + */ + Update withServiceProviderNotes(String serviceProviderNotes); + } + + /** + * The stage of the expressroutecircuit {0} allowing to specify ServiceProviderProperties. + */ + interface WithServiceProviderProperties { + /** + * Specifies serviceProviderProperties. + */ + Update withServiceProviderProperties(ExpressRouteCircuitServiceProviderProperties serviceProviderProperties); + } + + /** + * The stage of the expressroutecircuit {0} allowing to specify ServiceProviderProvisioningState. + */ + interface WithServiceProviderProvisioningState { + /** + * Specifies serviceProviderProvisioningState. + */ + Update withServiceProviderProvisioningState(ServiceProviderProvisioningState serviceProviderProvisioningState); + } + + /** + * The stage of the expressroutecircuit {0} allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + */ + Update withSku(ExpressRouteCircuitSku sku); + } + + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitArpTable.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitArpTable.java new file mode 100644 index 000000000000..9f9eaccc89c1 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitArpTable.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.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ARP table associated with the ExpressRouteCircuit. + */ +public class ExpressRouteCircuitArpTable { + /** + * Entry age in minutes. + */ + @JsonProperty(value = "age") + private Integer age; + + /** + * Interface address. + */ + @JsonProperty(value = "interface") + private String interfaceProperty; + + /** + * The IP address. + */ + @JsonProperty(value = "ipAddress") + private String ipAddress; + + /** + * The MAC address. + */ + @JsonProperty(value = "macAddress") + private String macAddress; + + /** + * Get entry age in minutes. + * + * @return the age value + */ + public Integer age() { + return this.age; + } + + /** + * Set entry age in minutes. + * + * @param age the age value to set + * @return the ExpressRouteCircuitArpTable object itself. + */ + public ExpressRouteCircuitArpTable withAge(Integer age) { + this.age = age; + return this; + } + + /** + * Get interface address. + * + * @return the interfaceProperty value + */ + public String interfaceProperty() { + return this.interfaceProperty; + } + + /** + * Set interface address. + * + * @param interfaceProperty the interfaceProperty value to set + * @return the ExpressRouteCircuitArpTable object itself. + */ + public ExpressRouteCircuitArpTable withInterfaceProperty(String interfaceProperty) { + this.interfaceProperty = interfaceProperty; + return this; + } + + /** + * Get the IP address. + * + * @return the ipAddress value + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Set the IP address. + * + * @param ipAddress the ipAddress value to set + * @return the ExpressRouteCircuitArpTable object itself. + */ + public ExpressRouteCircuitArpTable withIpAddress(String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + * Get the MAC address. + * + * @return the macAddress value + */ + public String macAddress() { + return this.macAddress; + } + + /** + * Set the MAC address. + * + * @param macAddress the macAddress value to set + * @return the ExpressRouteCircuitArpTable object itself. + */ + public ExpressRouteCircuitArpTable withMacAddress(String macAddress) { + this.macAddress = macAddress; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitAuthorization.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitAuthorization.java new file mode 100644 index 000000000000..be663eeb4584 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitAuthorization.java @@ -0,0 +1,200 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_06_01.implementation.ExpressRouteCircuitAuthorizationInner; +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.network.v2018_06_01.implementation.NetworkManager; + +/** + * Type representing ExpressRouteCircuitAuthorization. + */ +public interface ExpressRouteCircuitAuthorization extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the authorizationKey value. + */ + String authorizationKey(); + + /** + * @return the authorizationUseStatus value. + */ + AuthorizationUseStatus authorizationUseStatus(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * The entirety of the ExpressRouteCircuitAuthorization definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithExpressRouteCircuit, DefinitionStages.WithCreate { + } + + /** + * Grouping of ExpressRouteCircuitAuthorization definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ExpressRouteCircuitAuthorization definition. + */ + interface Blank extends WithExpressRouteCircuit { + } + + /** + * The stage of the expressroutecircuitauthorization definition allowing to specify ExpressRouteCircuit. + */ + interface WithExpressRouteCircuit { + /** + * Specifies resourceGroupName, circuitName. + */ + WithCreate withExistingExpressRouteCircuit(String resourceGroupName, String circuitName); + } + + /** + * The stage of the expressroutecircuitauthorization definition allowing to specify AuthorizationKey. + */ + interface WithAuthorizationKey { + /** + * Specifies authorizationKey. + */ + WithCreate withAuthorizationKey(String authorizationKey); + } + + /** + * The stage of the expressroutecircuitauthorization definition allowing to specify AuthorizationUseStatus. + */ + interface WithAuthorizationUseStatus { + /** + * Specifies authorizationUseStatus. + */ + WithCreate withAuthorizationUseStatus(AuthorizationUseStatus authorizationUseStatus); + } + + /** + * The stage of the expressroutecircuitauthorization definition allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + */ + WithCreate withId(String id); + } + + /** + * The stage of the expressroutecircuitauthorization definition allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + */ + WithCreate withName(String name); + } + + /** + * The stage of the expressroutecircuitauthorization definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * 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.WithAuthorizationKey, DefinitionStages.WithAuthorizationUseStatus, DefinitionStages.WithId, DefinitionStages.WithName, DefinitionStages.WithProvisioningState { + } + } + /** + * The template for a ExpressRouteCircuitAuthorization update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAuthorizationKey, UpdateStages.WithAuthorizationUseStatus, UpdateStages.WithId, UpdateStages.WithName, UpdateStages.WithProvisioningState { + } + + /** + * Grouping of ExpressRouteCircuitAuthorization update stages. + */ + interface UpdateStages { + /** + * The stage of the expressroutecircuitauthorization update allowing to specify AuthorizationKey. + */ + interface WithAuthorizationKey { + /** + * Specifies authorizationKey. + */ + Update withAuthorizationKey(String authorizationKey); + } + + /** + * The stage of the expressroutecircuitauthorization update allowing to specify AuthorizationUseStatus. + */ + interface WithAuthorizationUseStatus { + /** + * Specifies authorizationUseStatus. + */ + Update withAuthorizationUseStatus(AuthorizationUseStatus authorizationUseStatus); + } + + /** + * The stage of the expressroutecircuitauthorization update allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + */ + Update withId(String id); + } + + /** + * The stage of the expressroutecircuitauthorization update allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + */ + Update withName(String name); + } + + /** + * The stage of the expressroutecircuitauthorization update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + */ + Update withProvisioningState(String provisioningState); + } + + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitAuthorizations.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitAuthorizations.java new file mode 100644 index 000000000000..91f8c60531a2 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitAuthorizations.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.network.v2018_06_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_06_01.implementation.ExpressRouteCircuitAuthorizationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ExpressRouteCircuitAuthorizations. + */ +public interface ExpressRouteCircuitAuthorizations extends SupportsCreating, HasInner { + /** + * Gets the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String circuitName, String authorizationName); + + /** + * Gets all authorizations in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String circuitName); + + /** + * Deletes the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String circuitName, String authorizationName); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitConnection.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitConnection.java new file mode 100644 index 000000000000..ca788fa5bc86 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitConnection.java @@ -0,0 +1,236 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_06_01.implementation.ExpressRouteCircuitConnectionInner; +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.network.v2018_06_01.implementation.NetworkManager; +import com.microsoft.azure.SubResource; + +/** + * Type representing ExpressRouteCircuitConnection. + */ +public interface ExpressRouteCircuitConnection extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the addressPrefix value. + */ + String addressPrefix(); + + /** + * @return the authorizationKey value. + */ + String authorizationKey(); + + /** + * @return the circuitConnectionStatus value. + */ + CircuitConnectionStatus circuitConnectionStatus(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the expressRouteCircuitPeering value. + */ + SubResource expressRouteCircuitPeering(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the peerExpressRouteCircuitPeering value. + */ + SubResource peerExpressRouteCircuitPeering(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * The entirety of the ExpressRouteCircuitConnection definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithPeering, DefinitionStages.WithCreate { + } + + /** + * Grouping of ExpressRouteCircuitConnection definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ExpressRouteCircuitConnection definition. + */ + interface Blank extends WithPeering { + } + + /** + * The stage of the expressroutecircuitconnection definition allowing to specify Peering. + */ + interface WithPeering { + /** + * Specifies resourceGroupName, circuitName, peeringName. + */ + WithCreate withExistingPeering(String resourceGroupName, String circuitName, String peeringName); + } + + /** + * The stage of the expressroutecircuitconnection definition allowing to specify AddressPrefix. + */ + interface WithAddressPrefix { + /** + * Specifies addressPrefix. + */ + WithCreate withAddressPrefix(String addressPrefix); + } + + /** + * The stage of the expressroutecircuitconnection definition allowing to specify AuthorizationKey. + */ + interface WithAuthorizationKey { + /** + * Specifies authorizationKey. + */ + WithCreate withAuthorizationKey(String authorizationKey); + } + + /** + * The stage of the expressroutecircuitconnection definition allowing to specify ExpressRouteCircuitPeering. + */ + interface WithExpressRouteCircuitPeering { + /** + * Specifies expressRouteCircuitPeering. + */ + WithCreate withExpressRouteCircuitPeering(SubResource expressRouteCircuitPeering); + } + + /** + * The stage of the expressroutecircuitconnection definition allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + */ + WithCreate withId(String id); + } + + /** + * The stage of the expressroutecircuitconnection definition allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + */ + WithCreate withName(String name); + } + + /** + * The stage of the expressroutecircuitconnection definition allowing to specify PeerExpressRouteCircuitPeering. + */ + interface WithPeerExpressRouteCircuitPeering { + /** + * Specifies peerExpressRouteCircuitPeering. + */ + WithCreate withPeerExpressRouteCircuitPeering(SubResource peerExpressRouteCircuitPeering); + } + + /** + * 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.WithAddressPrefix, DefinitionStages.WithAuthorizationKey, DefinitionStages.WithExpressRouteCircuitPeering, DefinitionStages.WithId, DefinitionStages.WithName, DefinitionStages.WithPeerExpressRouteCircuitPeering { + } + } + /** + * The template for a ExpressRouteCircuitConnection update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAddressPrefix, UpdateStages.WithAuthorizationKey, UpdateStages.WithExpressRouteCircuitPeering, UpdateStages.WithId, UpdateStages.WithName, UpdateStages.WithPeerExpressRouteCircuitPeering { + } + + /** + * Grouping of ExpressRouteCircuitConnection update stages. + */ + interface UpdateStages { + /** + * The stage of the expressroutecircuitconnection update allowing to specify AddressPrefix. + */ + interface WithAddressPrefix { + /** + * Specifies addressPrefix. + */ + Update withAddressPrefix(String addressPrefix); + } + + /** + * The stage of the expressroutecircuitconnection update allowing to specify AuthorizationKey. + */ + interface WithAuthorizationKey { + /** + * Specifies authorizationKey. + */ + Update withAuthorizationKey(String authorizationKey); + } + + /** + * The stage of the expressroutecircuitconnection update allowing to specify ExpressRouteCircuitPeering. + */ + interface WithExpressRouteCircuitPeering { + /** + * Specifies expressRouteCircuitPeering. + */ + Update withExpressRouteCircuitPeering(SubResource expressRouteCircuitPeering); + } + + /** + * The stage of the expressroutecircuitconnection update allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + */ + Update withId(String id); + } + + /** + * The stage of the expressroutecircuitconnection update allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + */ + Update withName(String name); + } + + /** + * The stage of the expressroutecircuitconnection update allowing to specify PeerExpressRouteCircuitPeering. + */ + interface WithPeerExpressRouteCircuitPeering { + /** + * Specifies peerExpressRouteCircuitPeering. + */ + Update withPeerExpressRouteCircuitPeering(SubResource peerExpressRouteCircuitPeering); + } + + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitConnections.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitConnections.java new file mode 100644 index 000000000000..94c30ae2e589 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitConnections.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_06_01.implementation.ExpressRouteCircuitConnectionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ExpressRouteCircuitConnections. + */ +public interface ExpressRouteCircuitConnections extends SupportsCreating, HasInner { + /** + * Gets the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName); + + /** + * Deletes the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitPeering.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitPeering.java new file mode 100644 index 000000000000..1e405df9d44f --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitPeering.java @@ -0,0 +1,579 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_06_01.implementation.ExpressRouteCircuitPeeringInner; +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.network.v2018_06_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.implementation.ExpressRouteCircuitConnectionInner; +import com.microsoft.azure.management.network.v2018_06_01.implementation.RouteFilterInner; +import com.microsoft.azure.management.network.v2018_06_01.implementation.ExpressRouteCircuitStatsInner; + +/** + * Type representing ExpressRouteCircuitPeering. + */ +public interface ExpressRouteCircuitPeering extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the azureASN value. + */ + Integer azureASN(); + + /** + * @return the connections value. + */ + List connections(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the gatewayManagerEtag value. + */ + String gatewayManagerEtag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the ipv6PeeringConfig value. + */ + Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig(); + + /** + * @return the lastModifiedBy value. + */ + String lastModifiedBy(); + + /** + * @return the microsoftPeeringConfig value. + */ + ExpressRouteCircuitPeeringConfig microsoftPeeringConfig(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the peerASN value. + */ + Long peerASN(); + + /** + * @return the peeringType value. + */ + ExpressRoutePeeringType peeringType(); + + /** + * @return the primaryAzurePort value. + */ + String primaryAzurePort(); + + /** + * @return the primaryPeerAddressPrefix value. + */ + String primaryPeerAddressPrefix(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the routeFilter value. + */ + RouteFilter routeFilter(); + + /** + * @return the secondaryAzurePort value. + */ + String secondaryAzurePort(); + + /** + * @return the secondaryPeerAddressPrefix value. + */ + String secondaryPeerAddressPrefix(); + + /** + * @return the sharedKey value. + */ + String sharedKey(); + + /** + * @return the state value. + */ + ExpressRoutePeeringState state(); + + /** + * @return the stats value. + */ + ExpressRouteCircuitStats stats(); + + /** + * @return the vlanId value. + */ + Integer vlanId(); + + /** + * The entirety of the ExpressRouteCircuitPeering definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithExpressRouteCircuit, DefinitionStages.WithCreate { + } + + /** + * Grouping of ExpressRouteCircuitPeering definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ExpressRouteCircuitPeering definition. + */ + interface Blank extends WithExpressRouteCircuit { + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify ExpressRouteCircuit. + */ + interface WithExpressRouteCircuit { + /** + * Specifies resourceGroupName, circuitName. + */ + WithCreate withExistingExpressRouteCircuit(String resourceGroupName, String circuitName); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify AzureASN. + */ + interface WithAzureASN { + /** + * Specifies azureASN. + */ + WithCreate withAzureASN(Integer azureASN); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify Connections. + */ + interface WithConnections { + /** + * Specifies connections. + */ + WithCreate withConnections(List connections); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify GatewayManagerEtag. + */ + interface WithGatewayManagerEtag { + /** + * Specifies gatewayManagerEtag. + */ + WithCreate withGatewayManagerEtag(String gatewayManagerEtag); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + */ + WithCreate withId(String id); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify Ipv6PeeringConfig. + */ + interface WithIpv6PeeringConfig { + /** + * Specifies ipv6PeeringConfig. + */ + WithCreate withIpv6PeeringConfig(Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify LastModifiedBy. + */ + interface WithLastModifiedBy { + /** + * Specifies lastModifiedBy. + */ + WithCreate withLastModifiedBy(String lastModifiedBy); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify MicrosoftPeeringConfig. + */ + interface WithMicrosoftPeeringConfig { + /** + * Specifies microsoftPeeringConfig. + */ + WithCreate withMicrosoftPeeringConfig(ExpressRouteCircuitPeeringConfig microsoftPeeringConfig); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + */ + WithCreate withName(String name); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify PeerASN. + */ + interface WithPeerASN { + /** + * Specifies peerASN. + */ + WithCreate withPeerASN(Long peerASN); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify PeeringType. + */ + interface WithPeeringType { + /** + * Specifies peeringType. + */ + WithCreate withPeeringType(ExpressRoutePeeringType peeringType); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify PrimaryAzurePort. + */ + interface WithPrimaryAzurePort { + /** + * Specifies primaryAzurePort. + */ + WithCreate withPrimaryAzurePort(String primaryAzurePort); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify PrimaryPeerAddressPrefix. + */ + interface WithPrimaryPeerAddressPrefix { + /** + * Specifies primaryPeerAddressPrefix. + */ + WithCreate withPrimaryPeerAddressPrefix(String primaryPeerAddressPrefix); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify RouteFilter. + */ + interface WithRouteFilter { + /** + * Specifies routeFilter. + */ + WithCreate withRouteFilter(RouteFilterInner routeFilter); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify SecondaryAzurePort. + */ + interface WithSecondaryAzurePort { + /** + * Specifies secondaryAzurePort. + */ + WithCreate withSecondaryAzurePort(String secondaryAzurePort); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify SecondaryPeerAddressPrefix. + */ + interface WithSecondaryPeerAddressPrefix { + /** + * Specifies secondaryPeerAddressPrefix. + */ + WithCreate withSecondaryPeerAddressPrefix(String secondaryPeerAddressPrefix); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify SharedKey. + */ + interface WithSharedKey { + /** + * Specifies sharedKey. + */ + WithCreate withSharedKey(String sharedKey); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify State. + */ + interface WithState { + /** + * Specifies state. + */ + WithCreate withState(ExpressRoutePeeringState state); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify Stats. + */ + interface WithStats { + /** + * Specifies stats. + */ + WithCreate withStats(ExpressRouteCircuitStatsInner stats); + } + + /** + * The stage of the expressroutecircuitpeering definition allowing to specify VlanId. + */ + interface WithVlanId { + /** + * Specifies vlanId. + */ + WithCreate withVlanId(Integer vlanId); + } + + /** + * 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.WithAzureASN, DefinitionStages.WithConnections, DefinitionStages.WithGatewayManagerEtag, DefinitionStages.WithId, DefinitionStages.WithIpv6PeeringConfig, DefinitionStages.WithLastModifiedBy, DefinitionStages.WithMicrosoftPeeringConfig, DefinitionStages.WithName, DefinitionStages.WithPeerASN, DefinitionStages.WithPeeringType, DefinitionStages.WithPrimaryAzurePort, DefinitionStages.WithPrimaryPeerAddressPrefix, DefinitionStages.WithProvisioningState, DefinitionStages.WithRouteFilter, DefinitionStages.WithSecondaryAzurePort, DefinitionStages.WithSecondaryPeerAddressPrefix, DefinitionStages.WithSharedKey, DefinitionStages.WithState, DefinitionStages.WithStats, DefinitionStages.WithVlanId { + } + } + /** + * The template for a ExpressRouteCircuitPeering update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAzureASN, UpdateStages.WithConnections, UpdateStages.WithGatewayManagerEtag, UpdateStages.WithId, UpdateStages.WithIpv6PeeringConfig, UpdateStages.WithLastModifiedBy, UpdateStages.WithMicrosoftPeeringConfig, UpdateStages.WithName, UpdateStages.WithPeerASN, UpdateStages.WithPeeringType, UpdateStages.WithPrimaryAzurePort, UpdateStages.WithPrimaryPeerAddressPrefix, UpdateStages.WithProvisioningState, UpdateStages.WithRouteFilter, UpdateStages.WithSecondaryAzurePort, UpdateStages.WithSecondaryPeerAddressPrefix, UpdateStages.WithSharedKey, UpdateStages.WithState, UpdateStages.WithStats, UpdateStages.WithVlanId { + } + + /** + * Grouping of ExpressRouteCircuitPeering update stages. + */ + interface UpdateStages { + /** + * The stage of the expressroutecircuitpeering update allowing to specify AzureASN. + */ + interface WithAzureASN { + /** + * Specifies azureASN. + */ + Update withAzureASN(Integer azureASN); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify Connections. + */ + interface WithConnections { + /** + * Specifies connections. + */ + Update withConnections(List connections); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify GatewayManagerEtag. + */ + interface WithGatewayManagerEtag { + /** + * Specifies gatewayManagerEtag. + */ + Update withGatewayManagerEtag(String gatewayManagerEtag); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + */ + Update withId(String id); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify Ipv6PeeringConfig. + */ + interface WithIpv6PeeringConfig { + /** + * Specifies ipv6PeeringConfig. + */ + Update withIpv6PeeringConfig(Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify LastModifiedBy. + */ + interface WithLastModifiedBy { + /** + * Specifies lastModifiedBy. + */ + Update withLastModifiedBy(String lastModifiedBy); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify MicrosoftPeeringConfig. + */ + interface WithMicrosoftPeeringConfig { + /** + * Specifies microsoftPeeringConfig. + */ + Update withMicrosoftPeeringConfig(ExpressRouteCircuitPeeringConfig microsoftPeeringConfig); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + */ + Update withName(String name); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify PeerASN. + */ + interface WithPeerASN { + /** + * Specifies peerASN. + */ + Update withPeerASN(Long peerASN); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify PeeringType. + */ + interface WithPeeringType { + /** + * Specifies peeringType. + */ + Update withPeeringType(ExpressRoutePeeringType peeringType); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify PrimaryAzurePort. + */ + interface WithPrimaryAzurePort { + /** + * Specifies primaryAzurePort. + */ + Update withPrimaryAzurePort(String primaryAzurePort); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify PrimaryPeerAddressPrefix. + */ + interface WithPrimaryPeerAddressPrefix { + /** + * Specifies primaryPeerAddressPrefix. + */ + Update withPrimaryPeerAddressPrefix(String primaryPeerAddressPrefix); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + */ + Update withProvisioningState(String provisioningState); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify RouteFilter. + */ + interface WithRouteFilter { + /** + * Specifies routeFilter. + */ + Update withRouteFilter(RouteFilterInner routeFilter); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify SecondaryAzurePort. + */ + interface WithSecondaryAzurePort { + /** + * Specifies secondaryAzurePort. + */ + Update withSecondaryAzurePort(String secondaryAzurePort); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify SecondaryPeerAddressPrefix. + */ + interface WithSecondaryPeerAddressPrefix { + /** + * Specifies secondaryPeerAddressPrefix. + */ + Update withSecondaryPeerAddressPrefix(String secondaryPeerAddressPrefix); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify SharedKey. + */ + interface WithSharedKey { + /** + * Specifies sharedKey. + */ + Update withSharedKey(String sharedKey); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify State. + */ + interface WithState { + /** + * Specifies state. + */ + Update withState(ExpressRoutePeeringState state); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify Stats. + */ + interface WithStats { + /** + * Specifies stats. + */ + Update withStats(ExpressRouteCircuitStatsInner stats); + } + + /** + * The stage of the expressroutecircuitpeering update allowing to specify VlanId. + */ + interface WithVlanId { + /** + * Specifies vlanId. + */ + Update withVlanId(Integer vlanId); + } + + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.java new file mode 100644 index 000000000000..53e1a43e8bbf --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ExpressRouteCircuitPeeringAdvertisedPublicPrefixState. + */ +public final class ExpressRouteCircuitPeeringAdvertisedPublicPrefixState extends ExpandableStringEnum { + /** Static value NotConfigured for ExpressRouteCircuitPeeringAdvertisedPublicPrefixState. */ + public static final ExpressRouteCircuitPeeringAdvertisedPublicPrefixState NOT_CONFIGURED = fromString("NotConfigured"); + + /** Static value Configuring for ExpressRouteCircuitPeeringAdvertisedPublicPrefixState. */ + public static final ExpressRouteCircuitPeeringAdvertisedPublicPrefixState CONFIGURING = fromString("Configuring"); + + /** Static value Configured for ExpressRouteCircuitPeeringAdvertisedPublicPrefixState. */ + public static final ExpressRouteCircuitPeeringAdvertisedPublicPrefixState CONFIGURED = fromString("Configured"); + + /** Static value ValidationNeeded for ExpressRouteCircuitPeeringAdvertisedPublicPrefixState. */ + public static final ExpressRouteCircuitPeeringAdvertisedPublicPrefixState VALIDATION_NEEDED = fromString("ValidationNeeded"); + + /** + * Creates or finds a ExpressRouteCircuitPeeringAdvertisedPublicPrefixState from its string representation. + * @param name a name to look for + * @return the corresponding ExpressRouteCircuitPeeringAdvertisedPublicPrefixState + */ + @JsonCreator + public static ExpressRouteCircuitPeeringAdvertisedPublicPrefixState fromString(String name) { + return fromString(name, ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.class); + } + + /** + * @return known ExpressRouteCircuitPeeringAdvertisedPublicPrefixState values + */ + public static Collection values() { + return values(ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitPeeringConfig.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitPeeringConfig.java new file mode 100644 index 000000000000..26a9a4d01615 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitPeeringConfig.java @@ -0,0 +1,177 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies the peering configuration. + */ +public class ExpressRouteCircuitPeeringConfig { + /** + * The reference of AdvertisedPublicPrefixes. + */ + @JsonProperty(value = "advertisedPublicPrefixes") + private List advertisedPublicPrefixes; + + /** + * The communities of bgp peering. Spepcified for microsoft peering. + */ + @JsonProperty(value = "advertisedCommunities") + private List advertisedCommunities; + + /** + * AdvertisedPublicPrefixState of the Peering resource. Possible values are + * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. + * Possible values include: 'NotConfigured', 'Configuring', 'Configured', + * 'ValidationNeeded'. + */ + @JsonProperty(value = "advertisedPublicPrefixesState") + private ExpressRouteCircuitPeeringAdvertisedPublicPrefixState advertisedPublicPrefixesState; + + /** + * The legacy mode of the peering. + */ + @JsonProperty(value = "legacyMode") + private Integer legacyMode; + + /** + * The CustomerASN of the peering. + */ + @JsonProperty(value = "customerASN") + private Integer customerASN; + + /** + * The RoutingRegistryName of the configuration. + */ + @JsonProperty(value = "routingRegistryName") + private String routingRegistryName; + + /** + * Get the reference of AdvertisedPublicPrefixes. + * + * @return the advertisedPublicPrefixes value + */ + public List advertisedPublicPrefixes() { + return this.advertisedPublicPrefixes; + } + + /** + * Set the reference of AdvertisedPublicPrefixes. + * + * @param advertisedPublicPrefixes the advertisedPublicPrefixes value to set + * @return the ExpressRouteCircuitPeeringConfig object itself. + */ + public ExpressRouteCircuitPeeringConfig withAdvertisedPublicPrefixes(List advertisedPublicPrefixes) { + this.advertisedPublicPrefixes = advertisedPublicPrefixes; + return this; + } + + /** + * Get the communities of bgp peering. Spepcified for microsoft peering. + * + * @return the advertisedCommunities value + */ + public List advertisedCommunities() { + return this.advertisedCommunities; + } + + /** + * Set the communities of bgp peering. Spepcified for microsoft peering. + * + * @param advertisedCommunities the advertisedCommunities value to set + * @return the ExpressRouteCircuitPeeringConfig object itself. + */ + public ExpressRouteCircuitPeeringConfig withAdvertisedCommunities(List advertisedCommunities) { + this.advertisedCommunities = advertisedCommunities; + return this; + } + + /** + * Get advertisedPublicPrefixState of the Peering resource. Possible values are 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. Possible values include: 'NotConfigured', 'Configuring', 'Configured', 'ValidationNeeded'. + * + * @return the advertisedPublicPrefixesState value + */ + public ExpressRouteCircuitPeeringAdvertisedPublicPrefixState advertisedPublicPrefixesState() { + return this.advertisedPublicPrefixesState; + } + + /** + * Set advertisedPublicPrefixState of the Peering resource. Possible values are 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. Possible values include: 'NotConfigured', 'Configuring', 'Configured', 'ValidationNeeded'. + * + * @param advertisedPublicPrefixesState the advertisedPublicPrefixesState value to set + * @return the ExpressRouteCircuitPeeringConfig object itself. + */ + public ExpressRouteCircuitPeeringConfig withAdvertisedPublicPrefixesState(ExpressRouteCircuitPeeringAdvertisedPublicPrefixState advertisedPublicPrefixesState) { + this.advertisedPublicPrefixesState = advertisedPublicPrefixesState; + return this; + } + + /** + * Get the legacy mode of the peering. + * + * @return the legacyMode value + */ + public Integer legacyMode() { + return this.legacyMode; + } + + /** + * Set the legacy mode of the peering. + * + * @param legacyMode the legacyMode value to set + * @return the ExpressRouteCircuitPeeringConfig object itself. + */ + public ExpressRouteCircuitPeeringConfig withLegacyMode(Integer legacyMode) { + this.legacyMode = legacyMode; + return this; + } + + /** + * Get the CustomerASN of the peering. + * + * @return the customerASN value + */ + public Integer customerASN() { + return this.customerASN; + } + + /** + * Set the CustomerASN of the peering. + * + * @param customerASN the customerASN value to set + * @return the ExpressRouteCircuitPeeringConfig object itself. + */ + public ExpressRouteCircuitPeeringConfig withCustomerASN(Integer customerASN) { + this.customerASN = customerASN; + return this; + } + + /** + * Get the RoutingRegistryName of the configuration. + * + * @return the routingRegistryName value + */ + public String routingRegistryName() { + return this.routingRegistryName; + } + + /** + * Set the RoutingRegistryName of the configuration. + * + * @param routingRegistryName the routingRegistryName value to set + * @return the ExpressRouteCircuitPeeringConfig object itself. + */ + public ExpressRouteCircuitPeeringConfig withRoutingRegistryName(String routingRegistryName) { + this.routingRegistryName = routingRegistryName; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitPeeringState.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitPeeringState.java new file mode 100644 index 000000000000..7638bec7cf5f --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitPeeringState.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ExpressRouteCircuitPeeringState. + */ +public final class ExpressRouteCircuitPeeringState extends ExpandableStringEnum { + /** Static value Disabled for ExpressRouteCircuitPeeringState. */ + public static final ExpressRouteCircuitPeeringState DISABLED = fromString("Disabled"); + + /** Static value Enabled for ExpressRouteCircuitPeeringState. */ + public static final ExpressRouteCircuitPeeringState ENABLED = fromString("Enabled"); + + /** + * Creates or finds a ExpressRouteCircuitPeeringState from its string representation. + * @param name a name to look for + * @return the corresponding ExpressRouteCircuitPeeringState + */ + @JsonCreator + public static ExpressRouteCircuitPeeringState fromString(String name) { + return fromString(name, ExpressRouteCircuitPeeringState.class); + } + + /** + * @return known ExpressRouteCircuitPeeringState values + */ + public static Collection values() { + return values(ExpressRouteCircuitPeeringState.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitPeerings.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitPeerings.java new file mode 100644 index 000000000000..2d1960caf6dd --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitPeerings.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.network.v2018_06_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_06_01.implementation.ExpressRouteCircuitPeeringsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ExpressRouteCircuitPeerings. + */ +public interface ExpressRouteCircuitPeerings extends SupportsCreating, HasInner { + /** + * Gets the specified peering for the express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String circuitName, String peeringName); + + /** + * Gets all peerings in a specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String circuitName); + + /** + * Deletes the specified peering from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String circuitName, String peeringName); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitReference.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitReference.java new file mode 100644 index 000000000000..fa06d0a6201d --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitReference.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.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ExpressRouteCircuitReference model. + */ +public class ExpressRouteCircuitReference { + /** + * Corresponding Express Route Circuit Id. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get corresponding Express Route Circuit Id. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set corresponding Express Route Circuit Id. + * + * @param id the id value to set + * @return the ExpressRouteCircuitReference object itself. + */ + public ExpressRouteCircuitReference withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitRoutesTable.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitRoutesTable.java new file mode 100644 index 000000000000..2fc87cf503e5 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitRoutesTable.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The routes table associated with the ExpressRouteCircuit. + */ +public class ExpressRouteCircuitRoutesTable { + /** + * IP address of a network entity. + */ + @JsonProperty(value = "network") + private String network; + + /** + * NextHop address. + */ + @JsonProperty(value = "nextHop") + private String nextHop; + + /** + * Local preference value as set with the set local-preference route-map + * configuration command. + */ + @JsonProperty(value = "locPrf") + private String locPrf; + + /** + * Route Weight. + */ + @JsonProperty(value = "weight") + private Integer weight; + + /** + * Autonomous system paths to the destination network. + */ + @JsonProperty(value = "path") + private String path; + + /** + * Get iP address of a network entity. + * + * @return the network value + */ + public String network() { + return this.network; + } + + /** + * Set iP address of a network entity. + * + * @param network the network value to set + * @return the ExpressRouteCircuitRoutesTable object itself. + */ + public ExpressRouteCircuitRoutesTable withNetwork(String network) { + this.network = network; + return this; + } + + /** + * Get nextHop address. + * + * @return the nextHop value + */ + public String nextHop() { + return this.nextHop; + } + + /** + * Set nextHop address. + * + * @param nextHop the nextHop value to set + * @return the ExpressRouteCircuitRoutesTable object itself. + */ + public ExpressRouteCircuitRoutesTable withNextHop(String nextHop) { + this.nextHop = nextHop; + return this; + } + + /** + * Get local preference value as set with the set local-preference route-map configuration command. + * + * @return the locPrf value + */ + public String locPrf() { + return this.locPrf; + } + + /** + * Set local preference value as set with the set local-preference route-map configuration command. + * + * @param locPrf the locPrf value to set + * @return the ExpressRouteCircuitRoutesTable object itself. + */ + public ExpressRouteCircuitRoutesTable withLocPrf(String locPrf) { + this.locPrf = locPrf; + return this; + } + + /** + * Get route Weight. + * + * @return the weight value + */ + public Integer weight() { + return this.weight; + } + + /** + * Set route Weight. + * + * @param weight the weight value to set + * @return the ExpressRouteCircuitRoutesTable object itself. + */ + public ExpressRouteCircuitRoutesTable withWeight(Integer weight) { + this.weight = weight; + return this; + } + + /** + * Get autonomous system paths to the destination network. + * + * @return the path value + */ + public String path() { + return this.path; + } + + /** + * Set autonomous system paths to the destination network. + * + * @param path the path value to set + * @return the ExpressRouteCircuitRoutesTable object itself. + */ + public ExpressRouteCircuitRoutesTable withPath(String path) { + this.path = path; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitRoutesTableSummary.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitRoutesTableSummary.java new file mode 100644 index 000000000000..03fdef498046 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitRoutesTableSummary.java @@ -0,0 +1,149 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The routes table associated with the ExpressRouteCircuit. + */ +public class ExpressRouteCircuitRoutesTableSummary { + /** + * IP address of the neighbor. + */ + @JsonProperty(value = "neighbor") + private String neighbor; + + /** + * BGP version number spoken to the neighbor. + */ + @JsonProperty(value = "v") + private Integer v; + + /** + * Autonomous system number. + */ + @JsonProperty(value = "as") + private Integer as; + + /** + * The length of time that the BGP session has been in the Established + * state, or the current status if not in the Established state. + */ + @JsonProperty(value = "upDown") + private String upDown; + + /** + * Current state of the BGP session, and the number of prefixes that have + * been received from a neighbor or peer group. + */ + @JsonProperty(value = "statePfxRcd") + private String statePfxRcd; + + /** + * Get iP address of the neighbor. + * + * @return the neighbor value + */ + public String neighbor() { + return this.neighbor; + } + + /** + * Set iP address of the neighbor. + * + * @param neighbor the neighbor value to set + * @return the ExpressRouteCircuitRoutesTableSummary object itself. + */ + public ExpressRouteCircuitRoutesTableSummary withNeighbor(String neighbor) { + this.neighbor = neighbor; + return this; + } + + /** + * Get bGP version number spoken to the neighbor. + * + * @return the v value + */ + public Integer v() { + return this.v; + } + + /** + * Set bGP version number spoken to the neighbor. + * + * @param v the v value to set + * @return the ExpressRouteCircuitRoutesTableSummary object itself. + */ + public ExpressRouteCircuitRoutesTableSummary withV(Integer v) { + this.v = v; + return this; + } + + /** + * Get autonomous system number. + * + * @return the as value + */ + public Integer as() { + return this.as; + } + + /** + * Set autonomous system number. + * + * @param as the as value to set + * @return the ExpressRouteCircuitRoutesTableSummary object itself. + */ + public ExpressRouteCircuitRoutesTableSummary withAs(Integer as) { + this.as = as; + return this; + } + + /** + * Get the length of time that the BGP session has been in the Established state, or the current status if not in the Established state. + * + * @return the upDown value + */ + public String upDown() { + return this.upDown; + } + + /** + * Set the length of time that the BGP session has been in the Established state, or the current status if not in the Established state. + * + * @param upDown the upDown value to set + * @return the ExpressRouteCircuitRoutesTableSummary object itself. + */ + public ExpressRouteCircuitRoutesTableSummary withUpDown(String upDown) { + this.upDown = upDown; + return this; + } + + /** + * Get current state of the BGP session, and the number of prefixes that have been received from a neighbor or peer group. + * + * @return the statePfxRcd value + */ + public String statePfxRcd() { + return this.statePfxRcd; + } + + /** + * Set current state of the BGP session, and the number of prefixes that have been received from a neighbor or peer group. + * + * @param statePfxRcd the statePfxRcd value to set + * @return the ExpressRouteCircuitRoutesTableSummary object itself. + */ + public ExpressRouteCircuitRoutesTableSummary withStatePfxRcd(String statePfxRcd) { + this.statePfxRcd = statePfxRcd; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitServiceProviderProperties.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitServiceProviderProperties.java new file mode 100644 index 000000000000..8f677cabe50e --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitServiceProviderProperties.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains ServiceProviderProperties in an ExpressRouteCircuit. + */ +public class ExpressRouteCircuitServiceProviderProperties { + /** + * The serviceProviderName. + */ + @JsonProperty(value = "serviceProviderName") + private String serviceProviderName; + + /** + * The peering location. + */ + @JsonProperty(value = "peeringLocation") + private String peeringLocation; + + /** + * The BandwidthInMbps. + */ + @JsonProperty(value = "bandwidthInMbps") + private Integer bandwidthInMbps; + + /** + * Get the serviceProviderName. + * + * @return the serviceProviderName value + */ + public String serviceProviderName() { + return this.serviceProviderName; + } + + /** + * Set the serviceProviderName. + * + * @param serviceProviderName the serviceProviderName value to set + * @return the ExpressRouteCircuitServiceProviderProperties object itself. + */ + public ExpressRouteCircuitServiceProviderProperties withServiceProviderName(String serviceProviderName) { + this.serviceProviderName = serviceProviderName; + return this; + } + + /** + * Get the peering location. + * + * @return the peeringLocation value + */ + public String peeringLocation() { + return this.peeringLocation; + } + + /** + * Set the peering location. + * + * @param peeringLocation the peeringLocation value to set + * @return the ExpressRouteCircuitServiceProviderProperties object itself. + */ + public ExpressRouteCircuitServiceProviderProperties withPeeringLocation(String peeringLocation) { + this.peeringLocation = peeringLocation; + return this; + } + + /** + * Get the BandwidthInMbps. + * + * @return the bandwidthInMbps value + */ + public Integer bandwidthInMbps() { + return this.bandwidthInMbps; + } + + /** + * Set the BandwidthInMbps. + * + * @param bandwidthInMbps the bandwidthInMbps value to set + * @return the ExpressRouteCircuitServiceProviderProperties object itself. + */ + public ExpressRouteCircuitServiceProviderProperties withBandwidthInMbps(Integer bandwidthInMbps) { + this.bandwidthInMbps = bandwidthInMbps; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitSku.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitSku.java new file mode 100644 index 000000000000..85ce86ad461b --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitSku.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains SKU in an ExpressRouteCircuit. + */ +public class ExpressRouteCircuitSku { + /** + * The name of the SKU. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The tier of the SKU. Possible values are 'Standard' and 'Premium'. + * Possible values include: 'Standard', 'Premium'. + */ + @JsonProperty(value = "tier") + private ExpressRouteCircuitSkuTier tier; + + /** + * The family of the SKU. Possible values are: 'UnlimitedData' and + * 'MeteredData'. Possible values include: 'UnlimitedData', 'MeteredData'. + */ + @JsonProperty(value = "family") + private ExpressRouteCircuitSkuFamily family; + + /** + * Get the name of the SKU. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the SKU. + * + * @param name the name value to set + * @return the ExpressRouteCircuitSku object itself. + */ + public ExpressRouteCircuitSku withName(String name) { + this.name = name; + return this; + } + + /** + * Get the tier of the SKU. Possible values are 'Standard' and 'Premium'. Possible values include: 'Standard', 'Premium'. + * + * @return the tier value + */ + public ExpressRouteCircuitSkuTier tier() { + return this.tier; + } + + /** + * Set the tier of the SKU. Possible values are 'Standard' and 'Premium'. Possible values include: 'Standard', 'Premium'. + * + * @param tier the tier value to set + * @return the ExpressRouteCircuitSku object itself. + */ + public ExpressRouteCircuitSku withTier(ExpressRouteCircuitSkuTier tier) { + this.tier = tier; + return this; + } + + /** + * Get the family of the SKU. Possible values are: 'UnlimitedData' and 'MeteredData'. Possible values include: 'UnlimitedData', 'MeteredData'. + * + * @return the family value + */ + public ExpressRouteCircuitSkuFamily family() { + return this.family; + } + + /** + * Set the family of the SKU. Possible values are: 'UnlimitedData' and 'MeteredData'. Possible values include: 'UnlimitedData', 'MeteredData'. + * + * @param family the family value to set + * @return the ExpressRouteCircuitSku object itself. + */ + public ExpressRouteCircuitSku withFamily(ExpressRouteCircuitSkuFamily family) { + this.family = family; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitSkuFamily.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitSkuFamily.java new file mode 100644 index 000000000000..83beaf084330 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitSkuFamily.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ExpressRouteCircuitSkuFamily. + */ +public final class ExpressRouteCircuitSkuFamily extends ExpandableStringEnum { + /** Static value UnlimitedData for ExpressRouteCircuitSkuFamily. */ + public static final ExpressRouteCircuitSkuFamily UNLIMITED_DATA = fromString("UnlimitedData"); + + /** Static value MeteredData for ExpressRouteCircuitSkuFamily. */ + public static final ExpressRouteCircuitSkuFamily METERED_DATA = fromString("MeteredData"); + + /** + * Creates or finds a ExpressRouteCircuitSkuFamily from its string representation. + * @param name a name to look for + * @return the corresponding ExpressRouteCircuitSkuFamily + */ + @JsonCreator + public static ExpressRouteCircuitSkuFamily fromString(String name) { + return fromString(name, ExpressRouteCircuitSkuFamily.class); + } + + /** + * @return known ExpressRouteCircuitSkuFamily values + */ + public static Collection values() { + return values(ExpressRouteCircuitSkuFamily.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitSkuTier.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitSkuTier.java new file mode 100644 index 000000000000..ddbbbd5cb636 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitSkuTier.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ExpressRouteCircuitSkuTier. + */ +public final class ExpressRouteCircuitSkuTier extends ExpandableStringEnum { + /** Static value Standard for ExpressRouteCircuitSkuTier. */ + public static final ExpressRouteCircuitSkuTier STANDARD = fromString("Standard"); + + /** Static value Premium for ExpressRouteCircuitSkuTier. */ + public static final ExpressRouteCircuitSkuTier PREMIUM = fromString("Premium"); + + /** + * Creates or finds a ExpressRouteCircuitSkuTier from its string representation. + * @param name a name to look for + * @return the corresponding ExpressRouteCircuitSkuTier + */ + @JsonCreator + public static ExpressRouteCircuitSkuTier fromString(String name) { + return fromString(name, ExpressRouteCircuitSkuTier.class); + } + + /** + * @return known ExpressRouteCircuitSkuTier values + */ + public static Collection values() { + return values(ExpressRouteCircuitSkuTier.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitStats.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitStats.java new file mode 100644 index 000000000000..a76dc30c4e4e --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitStats.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.ExpressRouteCircuitStatsInner; + +/** + * Type representing ExpressRouteCircuitStats. + */ +public interface ExpressRouteCircuitStats extends HasInner, HasManager { + /** + * @return the primarybytesIn value. + */ + Long primarybytesIn(); + + /** + * @return the primarybytesOut value. + */ + Long primarybytesOut(); + + /** + * @return the secondarybytesIn value. + */ + Long secondarybytesIn(); + + /** + * @return the secondarybytesOut value. + */ + Long secondarybytesOut(); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuits.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuits.java new file mode 100644 index 000000000000..961066022698 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuits.java @@ -0,0 +1,82 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_06_01.implementation.ExpressRouteCircuitsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ExpressRouteCircuits. + */ +public interface ExpressRouteCircuits extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Gets the currently advertised ARP table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listArpTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath); + + /** + * Gets the currently advertised routes table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listRoutesTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath); + + /** + * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listRoutesTableSummaryAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath); + + /** + * Gets all the stats from an express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getStatsAsync(String resourceGroupName, String circuitName); + + /** + * Gets all stats from an express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getPeeringStatsAsync(String resourceGroupName, String circuitName, String peeringName); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitsArpTableListResult.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitsArpTableListResult.java new file mode 100644 index 000000000000..65bae3853337 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitsArpTableListResult.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.ExpressRouteCircuitsArpTableListResultInner; +import java.util.List; + +/** + * Type representing ExpressRouteCircuitsArpTableListResult. + */ +public interface ExpressRouteCircuitsArpTableListResult extends HasInner, HasManager { + /** + * @return the nextLink value. + */ + String nextLink(); + + /** + * @return the value value. + */ + List value(); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitsRoutesTableListResult.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitsRoutesTableListResult.java new file mode 100644 index 000000000000..05ca878f5954 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitsRoutesTableListResult.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.ExpressRouteCircuitsRoutesTableListResultInner; +import java.util.List; + +/** + * Type representing ExpressRouteCircuitsRoutesTableListResult. + */ +public interface ExpressRouteCircuitsRoutesTableListResult extends HasInner, HasManager { + /** + * @return the nextLink value. + */ + String nextLink(); + + /** + * @return the value value. + */ + List value(); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitsRoutesTableSummaryListResult.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitsRoutesTableSummaryListResult.java new file mode 100644 index 000000000000..e2f7cfa4bc83 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCircuitsRoutesTableSummaryListResult.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.ExpressRouteCircuitsRoutesTableSummaryListResultInner; +import java.util.List; + +/** + * Type representing ExpressRouteCircuitsRoutesTableSummaryListResult. + */ +public interface ExpressRouteCircuitsRoutesTableSummaryListResult extends HasInner, HasManager { + /** + * @return the nextLink value. + */ + String nextLink(); + + /** + * @return the value value. + */ + List value(); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCrossConnection.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCrossConnection.java new file mode 100644 index 000000000000..edfe7db7a6ef --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCrossConnection.java @@ -0,0 +1,245 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.implementation.ExpressRouteCrossConnectionPeeringInner; +import com.microsoft.azure.management.network.v2018_06_01.implementation.ExpressRouteCrossConnectionInner; + +/** + * Type representing ExpressRouteCrossConnection. + */ +public interface ExpressRouteCrossConnection extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the bandwidthInMbps value. + */ + Integer bandwidthInMbps(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the expressRouteCircuit value. + */ + ExpressRouteCircuitReference expressRouteCircuit(); + + /** + * @return the peeringLocation value. + */ + String peeringLocation(); + + /** + * @return the peerings value. + */ + List peerings(); + + /** + * @return the primaryAzurePort value. + */ + String primaryAzurePort(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the secondaryAzurePort value. + */ + String secondaryAzurePort(); + + /** + * @return the serviceProviderNotes value. + */ + String serviceProviderNotes(); + + /** + * @return the serviceProviderProvisioningState value. + */ + ServiceProviderProvisioningState serviceProviderProvisioningState(); + + /** + * @return the sTag value. + */ + Integer sTag(); + + /** + * The entirety of the ExpressRouteCrossConnection definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of ExpressRouteCrossConnection definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ExpressRouteCrossConnection definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the ExpressRouteCrossConnection definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the expressroutecrossconnection update allowing to specify BandwidthInMbps. + */ + interface WithBandwidthInMbps { + /** + * Specifies bandwidthInMbps. + */ + WithCreate withBandwidthInMbps(Integer bandwidthInMbps); + } + + /** + * The stage of the expressroutecrossconnection update allowing to specify ExpressRouteCircuit. + */ + interface WithExpressRouteCircuit { + /** + * Specifies expressRouteCircuit. + */ + WithCreate withExpressRouteCircuit(ExpressRouteCircuitReference expressRouteCircuit); + } + + /** + * The stage of the expressroutecrossconnection update allowing to specify PeeringLocation. + */ + interface WithPeeringLocation { + /** + * Specifies peeringLocation. + */ + WithCreate withPeeringLocation(String peeringLocation); + } + + /** + * The stage of the expressroutecrossconnection update allowing to specify Peerings. + */ + interface WithPeerings { + /** + * Specifies peerings. + */ + WithCreate withPeerings(List peerings); + } + + /** + * The stage of the expressroutecrossconnection update allowing to specify ServiceProviderNotes. + */ + interface WithServiceProviderNotes { + /** + * Specifies serviceProviderNotes. + */ + WithCreate withServiceProviderNotes(String serviceProviderNotes); + } + + /** + * The stage of the expressroutecrossconnection update allowing to specify ServiceProviderProvisioningState. + */ + interface WithServiceProviderProvisioningState { + /** + * Specifies serviceProviderProvisioningState. + */ + WithCreate withServiceProviderProvisioningState(ServiceProviderProvisioningState serviceProviderProvisioningState); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithBandwidthInMbps, DefinitionStages.WithExpressRouteCircuit, DefinitionStages.WithPeeringLocation, DefinitionStages.WithPeerings, DefinitionStages.WithServiceProviderNotes, DefinitionStages.WithServiceProviderProvisioningState { + } + } + /** + * The template for a ExpressRouteCrossConnection update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithBandwidthInMbps, UpdateStages.WithExpressRouteCircuit, UpdateStages.WithPeeringLocation, UpdateStages.WithPeerings, UpdateStages.WithServiceProviderNotes, UpdateStages.WithServiceProviderProvisioningState { + } + + /** + * Grouping of ExpressRouteCrossConnection update stages. + */ + interface UpdateStages { + /** + * The stage of the expressroutecrossconnection {0} allowing to specify BandwidthInMbps. + */ + interface WithBandwidthInMbps { + /** + * Specifies bandwidthInMbps. + */ + Update withBandwidthInMbps(Integer bandwidthInMbps); + } + + /** + * The stage of the expressroutecrossconnection {0} allowing to specify ExpressRouteCircuit. + */ + interface WithExpressRouteCircuit { + /** + * Specifies expressRouteCircuit. + */ + Update withExpressRouteCircuit(ExpressRouteCircuitReference expressRouteCircuit); + } + + /** + * The stage of the expressroutecrossconnection {0} allowing to specify PeeringLocation. + */ + interface WithPeeringLocation { + /** + * Specifies peeringLocation. + */ + Update withPeeringLocation(String peeringLocation); + } + + /** + * The stage of the expressroutecrossconnection {0} allowing to specify Peerings. + */ + interface WithPeerings { + /** + * Specifies peerings. + */ + Update withPeerings(List peerings); + } + + /** + * The stage of the expressroutecrossconnection {0} allowing to specify ServiceProviderNotes. + */ + interface WithServiceProviderNotes { + /** + * Specifies serviceProviderNotes. + */ + Update withServiceProviderNotes(String serviceProviderNotes); + } + + /** + * The stage of the expressroutecrossconnection {0} allowing to specify ServiceProviderProvisioningState. + */ + interface WithServiceProviderProvisioningState { + /** + * Specifies serviceProviderProvisioningState. + */ + Update withServiceProviderProvisioningState(ServiceProviderProvisioningState serviceProviderProvisioningState); + } + + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCrossConnectionPeering.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCrossConnectionPeering.java new file mode 100644 index 000000000000..47cb0d2f6166 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCrossConnectionPeering.java @@ -0,0 +1,420 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_06_01.implementation.ExpressRouteCrossConnectionPeeringInner; +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.network.v2018_06_01.implementation.NetworkManager; + +/** + * Type representing ExpressRouteCrossConnectionPeering. + */ +public interface ExpressRouteCrossConnectionPeering extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the azureASN value. + */ + Integer azureASN(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the gatewayManagerEtag value. + */ + String gatewayManagerEtag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the ipv6PeeringConfig value. + */ + Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig(); + + /** + * @return the lastModifiedBy value. + */ + String lastModifiedBy(); + + /** + * @return the microsoftPeeringConfig value. + */ + ExpressRouteCircuitPeeringConfig microsoftPeeringConfig(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the peerASN value. + */ + Long peerASN(); + + /** + * @return the peeringType value. + */ + ExpressRoutePeeringType peeringType(); + + /** + * @return the primaryAzurePort value. + */ + String primaryAzurePort(); + + /** + * @return the primaryPeerAddressPrefix value. + */ + String primaryPeerAddressPrefix(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the secondaryAzurePort value. + */ + String secondaryAzurePort(); + + /** + * @return the secondaryPeerAddressPrefix value. + */ + String secondaryPeerAddressPrefix(); + + /** + * @return the sharedKey value. + */ + String sharedKey(); + + /** + * @return the state value. + */ + ExpressRoutePeeringState state(); + + /** + * @return the vlanId value. + */ + Integer vlanId(); + + /** + * The entirety of the ExpressRouteCrossConnectionPeering definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithExpressRouteCrossConnection, DefinitionStages.WithCreate { + } + + /** + * Grouping of ExpressRouteCrossConnectionPeering definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ExpressRouteCrossConnectionPeering definition. + */ + interface Blank extends WithExpressRouteCrossConnection { + } + + /** + * The stage of the expressroutecrossconnectionpeering definition allowing to specify ExpressRouteCrossConnection. + */ + interface WithExpressRouteCrossConnection { + /** + * Specifies resourceGroupName, crossConnectionName. + */ + WithCreate withExistingExpressRouteCrossConnection(String resourceGroupName, String crossConnectionName); + } + + /** + * The stage of the expressroutecrossconnectionpeering definition allowing to specify GatewayManagerEtag. + */ + interface WithGatewayManagerEtag { + /** + * Specifies gatewayManagerEtag. + */ + WithCreate withGatewayManagerEtag(String gatewayManagerEtag); + } + + /** + * The stage of the expressroutecrossconnectionpeering definition allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + */ + WithCreate withId(String id); + } + + /** + * The stage of the expressroutecrossconnectionpeering definition allowing to specify Ipv6PeeringConfig. + */ + interface WithIpv6PeeringConfig { + /** + * Specifies ipv6PeeringConfig. + */ + WithCreate withIpv6PeeringConfig(Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig); + } + + /** + * The stage of the expressroutecrossconnectionpeering definition allowing to specify LastModifiedBy. + */ + interface WithLastModifiedBy { + /** + * Specifies lastModifiedBy. + */ + WithCreate withLastModifiedBy(String lastModifiedBy); + } + + /** + * The stage of the expressroutecrossconnectionpeering definition allowing to specify MicrosoftPeeringConfig. + */ + interface WithMicrosoftPeeringConfig { + /** + * Specifies microsoftPeeringConfig. + */ + WithCreate withMicrosoftPeeringConfig(ExpressRouteCircuitPeeringConfig microsoftPeeringConfig); + } + + /** + * The stage of the expressroutecrossconnectionpeering definition allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + */ + WithCreate withName(String name); + } + + /** + * The stage of the expressroutecrossconnectionpeering definition allowing to specify PeerASN. + */ + interface WithPeerASN { + /** + * Specifies peerASN. + */ + WithCreate withPeerASN(Long peerASN); + } + + /** + * The stage of the expressroutecrossconnectionpeering definition allowing to specify PeeringType. + */ + interface WithPeeringType { + /** + * Specifies peeringType. + */ + WithCreate withPeeringType(ExpressRoutePeeringType peeringType); + } + + /** + * The stage of the expressroutecrossconnectionpeering definition allowing to specify PrimaryPeerAddressPrefix. + */ + interface WithPrimaryPeerAddressPrefix { + /** + * Specifies primaryPeerAddressPrefix. + */ + WithCreate withPrimaryPeerAddressPrefix(String primaryPeerAddressPrefix); + } + + /** + * The stage of the expressroutecrossconnectionpeering definition allowing to specify SecondaryPeerAddressPrefix. + */ + interface WithSecondaryPeerAddressPrefix { + /** + * Specifies secondaryPeerAddressPrefix. + */ + WithCreate withSecondaryPeerAddressPrefix(String secondaryPeerAddressPrefix); + } + + /** + * The stage of the expressroutecrossconnectionpeering definition allowing to specify SharedKey. + */ + interface WithSharedKey { + /** + * Specifies sharedKey. + */ + WithCreate withSharedKey(String sharedKey); + } + + /** + * The stage of the expressroutecrossconnectionpeering definition allowing to specify State. + */ + interface WithState { + /** + * Specifies state. + */ + WithCreate withState(ExpressRoutePeeringState state); + } + + /** + * The stage of the expressroutecrossconnectionpeering definition allowing to specify VlanId. + */ + interface WithVlanId { + /** + * Specifies vlanId. + */ + WithCreate withVlanId(Integer vlanId); + } + + /** + * 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.WithGatewayManagerEtag, DefinitionStages.WithId, DefinitionStages.WithIpv6PeeringConfig, DefinitionStages.WithLastModifiedBy, DefinitionStages.WithMicrosoftPeeringConfig, DefinitionStages.WithName, DefinitionStages.WithPeerASN, DefinitionStages.WithPeeringType, DefinitionStages.WithPrimaryPeerAddressPrefix, DefinitionStages.WithSecondaryPeerAddressPrefix, DefinitionStages.WithSharedKey, DefinitionStages.WithState, DefinitionStages.WithVlanId { + } + } + /** + * The template for a ExpressRouteCrossConnectionPeering update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithGatewayManagerEtag, UpdateStages.WithId, UpdateStages.WithIpv6PeeringConfig, UpdateStages.WithLastModifiedBy, UpdateStages.WithMicrosoftPeeringConfig, UpdateStages.WithName, UpdateStages.WithPeerASN, UpdateStages.WithPeeringType, UpdateStages.WithPrimaryPeerAddressPrefix, UpdateStages.WithSecondaryPeerAddressPrefix, UpdateStages.WithSharedKey, UpdateStages.WithState, UpdateStages.WithVlanId { + } + + /** + * Grouping of ExpressRouteCrossConnectionPeering update stages. + */ + interface UpdateStages { + /** + * The stage of the expressroutecrossconnectionpeering update allowing to specify GatewayManagerEtag. + */ + interface WithGatewayManagerEtag { + /** + * Specifies gatewayManagerEtag. + */ + Update withGatewayManagerEtag(String gatewayManagerEtag); + } + + /** + * The stage of the expressroutecrossconnectionpeering update allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + */ + Update withId(String id); + } + + /** + * The stage of the expressroutecrossconnectionpeering update allowing to specify Ipv6PeeringConfig. + */ + interface WithIpv6PeeringConfig { + /** + * Specifies ipv6PeeringConfig. + */ + Update withIpv6PeeringConfig(Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig); + } + + /** + * The stage of the expressroutecrossconnectionpeering update allowing to specify LastModifiedBy. + */ + interface WithLastModifiedBy { + /** + * Specifies lastModifiedBy. + */ + Update withLastModifiedBy(String lastModifiedBy); + } + + /** + * The stage of the expressroutecrossconnectionpeering update allowing to specify MicrosoftPeeringConfig. + */ + interface WithMicrosoftPeeringConfig { + /** + * Specifies microsoftPeeringConfig. + */ + Update withMicrosoftPeeringConfig(ExpressRouteCircuitPeeringConfig microsoftPeeringConfig); + } + + /** + * The stage of the expressroutecrossconnectionpeering update allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + */ + Update withName(String name); + } + + /** + * The stage of the expressroutecrossconnectionpeering update allowing to specify PeerASN. + */ + interface WithPeerASN { + /** + * Specifies peerASN. + */ + Update withPeerASN(Long peerASN); + } + + /** + * The stage of the expressroutecrossconnectionpeering update allowing to specify PeeringType. + */ + interface WithPeeringType { + /** + * Specifies peeringType. + */ + Update withPeeringType(ExpressRoutePeeringType peeringType); + } + + /** + * The stage of the expressroutecrossconnectionpeering update allowing to specify PrimaryPeerAddressPrefix. + */ + interface WithPrimaryPeerAddressPrefix { + /** + * Specifies primaryPeerAddressPrefix. + */ + Update withPrimaryPeerAddressPrefix(String primaryPeerAddressPrefix); + } + + /** + * The stage of the expressroutecrossconnectionpeering update allowing to specify SecondaryPeerAddressPrefix. + */ + interface WithSecondaryPeerAddressPrefix { + /** + * Specifies secondaryPeerAddressPrefix. + */ + Update withSecondaryPeerAddressPrefix(String secondaryPeerAddressPrefix); + } + + /** + * The stage of the expressroutecrossconnectionpeering update allowing to specify SharedKey. + */ + interface WithSharedKey { + /** + * Specifies sharedKey. + */ + Update withSharedKey(String sharedKey); + } + + /** + * The stage of the expressroutecrossconnectionpeering update allowing to specify State. + */ + interface WithState { + /** + * Specifies state. + */ + Update withState(ExpressRoutePeeringState state); + } + + /** + * The stage of the expressroutecrossconnectionpeering update allowing to specify VlanId. + */ + interface WithVlanId { + /** + * Specifies vlanId. + */ + Update withVlanId(Integer vlanId); + } + + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCrossConnectionPeerings.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCrossConnectionPeerings.java new file mode 100644 index 000000000000..3e739de6f5bb --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCrossConnectionPeerings.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.network.v2018_06_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_06_01.implementation.ExpressRouteCrossConnectionPeeringsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ExpressRouteCrossConnectionPeerings. + */ +public interface ExpressRouteCrossConnectionPeerings extends SupportsCreating, HasInner { + /** + * Gets the specified peering for the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String crossConnectionName, String peeringName); + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String crossConnectionName); + + /** + * Deletes the specified peering from the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String crossConnectionName, String peeringName); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCrossConnectionRoutesTableSummary.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCrossConnectionRoutesTableSummary.java new file mode 100644 index 000000000000..471a0400b168 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCrossConnectionRoutesTableSummary.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The routes table associated with the ExpressRouteCircuit. + */ +public class ExpressRouteCrossConnectionRoutesTableSummary { + /** + * IP address of Neighbor router. + */ + @JsonProperty(value = "neighbor") + private String neighbor; + + /** + * Autonomous system number. + */ + @JsonProperty(value = "asn") + private Integer asn; + + /** + * The length of time that the BGP session has been in the Established + * state, or the current status if not in the Established state. + */ + @JsonProperty(value = "upDown") + private String upDown; + + /** + * Current state of the BGP session, and the number of prefixes that have + * been received from a neighbor or peer group. + */ + @JsonProperty(value = "stateOrPrefixesReceived") + private String stateOrPrefixesReceived; + + /** + * Get iP address of Neighbor router. + * + * @return the neighbor value + */ + public String neighbor() { + return this.neighbor; + } + + /** + * Set iP address of Neighbor router. + * + * @param neighbor the neighbor value to set + * @return the ExpressRouteCrossConnectionRoutesTableSummary object itself. + */ + public ExpressRouteCrossConnectionRoutesTableSummary withNeighbor(String neighbor) { + this.neighbor = neighbor; + return this; + } + + /** + * Get autonomous system number. + * + * @return the asn value + */ + public Integer asn() { + return this.asn; + } + + /** + * Set autonomous system number. + * + * @param asn the asn value to set + * @return the ExpressRouteCrossConnectionRoutesTableSummary object itself. + */ + public ExpressRouteCrossConnectionRoutesTableSummary withAsn(Integer asn) { + this.asn = asn; + return this; + } + + /** + * Get the length of time that the BGP session has been in the Established state, or the current status if not in the Established state. + * + * @return the upDown value + */ + public String upDown() { + return this.upDown; + } + + /** + * Set the length of time that the BGP session has been in the Established state, or the current status if not in the Established state. + * + * @param upDown the upDown value to set + * @return the ExpressRouteCrossConnectionRoutesTableSummary object itself. + */ + public ExpressRouteCrossConnectionRoutesTableSummary withUpDown(String upDown) { + this.upDown = upDown; + return this; + } + + /** + * Get current state of the BGP session, and the number of prefixes that have been received from a neighbor or peer group. + * + * @return the stateOrPrefixesReceived value + */ + public String stateOrPrefixesReceived() { + return this.stateOrPrefixesReceived; + } + + /** + * Set current state of the BGP session, and the number of prefixes that have been received from a neighbor or peer group. + * + * @param stateOrPrefixesReceived the stateOrPrefixesReceived value to set + * @return the ExpressRouteCrossConnectionRoutesTableSummary object itself. + */ + public ExpressRouteCrossConnectionRoutesTableSummary withStateOrPrefixesReceived(String stateOrPrefixesReceived) { + this.stateOrPrefixesReceived = stateOrPrefixesReceived; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCrossConnections.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCrossConnections.java new file mode 100644 index 000000000000..3a457ba791ea --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCrossConnections.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_06_01.implementation.ExpressRouteCrossConnectionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ExpressRouteCrossConnections. + */ +public interface ExpressRouteCrossConnections extends SupportsCreating, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listArpTableAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath); + + /** + * Gets the route table summary associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listRoutesTableSummaryAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath); + + /** + * Gets the currently advertised routes table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listRoutesTableAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCrossConnectionsRoutesTableSummaryListResult.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCrossConnectionsRoutesTableSummaryListResult.java new file mode 100644 index 000000000000..2c87c34fd39d --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteCrossConnectionsRoutesTableSummaryListResult.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner; +import java.util.List; + +/** + * Type representing ExpressRouteCrossConnectionsRoutesTableSummaryListResult. + */ +public interface ExpressRouteCrossConnectionsRoutesTableSummaryListResult extends HasInner, HasManager { + /** + * @return the nextLink value. + */ + String nextLink(); + + /** + * @return the value value. + */ + List value(); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRoutePeeringState.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRoutePeeringState.java new file mode 100644 index 000000000000..b82f033d4489 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRoutePeeringState.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ExpressRoutePeeringState. + */ +public final class ExpressRoutePeeringState extends ExpandableStringEnum { + /** Static value Disabled for ExpressRoutePeeringState. */ + public static final ExpressRoutePeeringState DISABLED = fromString("Disabled"); + + /** Static value Enabled for ExpressRoutePeeringState. */ + public static final ExpressRoutePeeringState ENABLED = fromString("Enabled"); + + /** + * Creates or finds a ExpressRoutePeeringState from its string representation. + * @param name a name to look for + * @return the corresponding ExpressRoutePeeringState + */ + @JsonCreator + public static ExpressRoutePeeringState fromString(String name) { + return fromString(name, ExpressRoutePeeringState.class); + } + + /** + * @return known ExpressRoutePeeringState values + */ + public static Collection values() { + return values(ExpressRoutePeeringState.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRoutePeeringType.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRoutePeeringType.java new file mode 100644 index 000000000000..eb43fa183b11 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRoutePeeringType.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ExpressRoutePeeringType. + */ +public final class ExpressRoutePeeringType extends ExpandableStringEnum { + /** Static value AzurePublicPeering for ExpressRoutePeeringType. */ + public static final ExpressRoutePeeringType AZURE_PUBLIC_PEERING = fromString("AzurePublicPeering"); + + /** Static value AzurePrivatePeering for ExpressRoutePeeringType. */ + public static final ExpressRoutePeeringType AZURE_PRIVATE_PEERING = fromString("AzurePrivatePeering"); + + /** Static value MicrosoftPeering for ExpressRoutePeeringType. */ + public static final ExpressRoutePeeringType MICROSOFT_PEERING = fromString("MicrosoftPeering"); + + /** + * Creates or finds a ExpressRoutePeeringType from its string representation. + * @param name a name to look for + * @return the corresponding ExpressRoutePeeringType + */ + @JsonCreator + public static ExpressRoutePeeringType fromString(String name) { + return fromString(name, ExpressRoutePeeringType.class); + } + + /** + * @return known ExpressRoutePeeringType values + */ + public static Collection values() { + return values(ExpressRoutePeeringType.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteServiceProvider.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteServiceProvider.java new file mode 100644 index 000000000000..a9a62b8fa215 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteServiceProvider.java @@ -0,0 +1,39 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.implementation.ExpressRouteServiceProviderInner; + +/** + * Type representing ExpressRouteServiceProvider. + */ +public interface ExpressRouteServiceProvider extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, HasManager { + /** + * @return the bandwidthsOffered value. + */ + List bandwidthsOffered(); + + /** + * @return the peeringLocations value. + */ + List peeringLocations(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteServiceProviderBandwidthsOffered.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteServiceProviderBandwidthsOffered.java new file mode 100644 index 000000000000..ea450b6ad2a0 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteServiceProviderBandwidthsOffered.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.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains bandwidths offered in ExpressRouteServiceProvider resources. + */ +public class ExpressRouteServiceProviderBandwidthsOffered { + /** + * The OfferName. + */ + @JsonProperty(value = "offerName") + private String offerName; + + /** + * The ValueInMbps. + */ + @JsonProperty(value = "valueInMbps") + private Integer valueInMbps; + + /** + * Get the OfferName. + * + * @return the offerName value + */ + public String offerName() { + return this.offerName; + } + + /** + * Set the OfferName. + * + * @param offerName the offerName value to set + * @return the ExpressRouteServiceProviderBandwidthsOffered object itself. + */ + public ExpressRouteServiceProviderBandwidthsOffered withOfferName(String offerName) { + this.offerName = offerName; + return this; + } + + /** + * Get the ValueInMbps. + * + * @return the valueInMbps value + */ + public Integer valueInMbps() { + return this.valueInMbps; + } + + /** + * Set the ValueInMbps. + * + * @param valueInMbps the valueInMbps value to set + * @return the ExpressRouteServiceProviderBandwidthsOffered object itself. + */ + public ExpressRouteServiceProviderBandwidthsOffered withValueInMbps(Integer valueInMbps) { + this.valueInMbps = valueInMbps; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteServiceProviders.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteServiceProviders.java new file mode 100644 index 000000000000..5fc4ec88ae25 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ExpressRouteServiceProviders.java @@ -0,0 +1,19 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_06_01.implementation.ExpressRouteServiceProvidersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ExpressRouteServiceProviders. + */ +public interface ExpressRouteServiceProviders extends SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/FlowLogInformation.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/FlowLogInformation.java new file mode 100644 index 000000000000..1b96a8ed011e --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/FlowLogInformation.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.FlowLogInformationInner; + +/** + * Type representing FlowLogInformation. + */ +public interface FlowLogInformation extends HasInner, HasManager { + /** + * @return the enabled value. + */ + boolean enabled(); + + /** + * @return the flowAnalyticsConfiguration value. + */ + TrafficAnalyticsProperties flowAnalyticsConfiguration(); + + /** + * @return the retentionPolicy value. + */ + RetentionPolicyParameters retentionPolicy(); + + /** + * @return the storageId value. + */ + String storageId(); + + /** + * @return the targetResourceId value. + */ + String targetResourceId(); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/FlowLogStatusParameters.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/FlowLogStatusParameters.java new file mode 100644 index 000000000000..aa0aedf7e60f --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/FlowLogStatusParameters.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters that define a resource to query flow log and traffic analytics + * (optional) status. + */ +public class FlowLogStatusParameters { + /** + * The target resource where getting the flow log and traffic analytics + * (optional) status. + */ + @JsonProperty(value = "targetResourceId", required = true) + private String targetResourceId; + + /** + * Get the target resource where getting the flow log and traffic analytics (optional) status. + * + * @return the targetResourceId value + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Set the target resource where getting the flow log and traffic analytics (optional) status. + * + * @param targetResourceId the targetResourceId value to set + * @return the FlowLogStatusParameters object itself. + */ + public FlowLogStatusParameters withTargetResourceId(String targetResourceId) { + this.targetResourceId = targetResourceId; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/FrontendIPConfiguration.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/FrontendIPConfiguration.java new file mode 100644 index 000000000000..3f0a50e03fe5 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/FrontendIPConfiguration.java @@ -0,0 +1,89 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_06_01.implementation.FrontendIPConfigurationInner; +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.network.v2018_06_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.SubResource; + +/** + * Type representing FrontendIPConfiguration. + */ +public interface FrontendIPConfiguration extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the inboundNatPools value. + */ + List inboundNatPools(); + + /** + * @return the inboundNatRules value. + */ + List inboundNatRules(); + + /** + * @return the loadBalancingRules value. + */ + List loadBalancingRules(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the outboundNatRules value. + */ + List outboundNatRules(); + + /** + * @return the privateIPAddress value. + */ + String privateIPAddress(); + + /** + * @return the privateIPAllocationMethod value. + */ + IPAllocationMethod privateIPAllocationMethod(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the publicIPAddress value. + */ + PublicIPAddress publicIPAddress(); + + /** + * @return the subnet value. + */ + Subnet subnet(); + + /** + * @return the zones value. + */ + List zones(); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/GatewayRoute.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/GatewayRoute.java new file mode 100644 index 000000000000..38cbd9ec3605 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/GatewayRoute.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.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Gateway routing details. + */ +public class GatewayRoute { + /** + * The gateway's local address. + */ + @JsonProperty(value = "localAddress", access = JsonProperty.Access.WRITE_ONLY) + private String localAddress; + + /** + * The route's network prefix. + */ + @JsonProperty(value = "network", access = JsonProperty.Access.WRITE_ONLY) + private String network; + + /** + * The route's next hop. + */ + @JsonProperty(value = "nextHop", access = JsonProperty.Access.WRITE_ONLY) + private String nextHop; + + /** + * The peer this route was learned from. + */ + @JsonProperty(value = "sourcePeer", access = JsonProperty.Access.WRITE_ONLY) + private String sourcePeer; + + /** + * The source this route was learned from. + */ + @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) + private String origin; + + /** + * The route's AS path sequence. + */ + @JsonProperty(value = "asPath", access = JsonProperty.Access.WRITE_ONLY) + private String asPath; + + /** + * The route's weight. + */ + @JsonProperty(value = "weight", access = JsonProperty.Access.WRITE_ONLY) + private Integer weight; + + /** + * Get the gateway's local address. + * + * @return the localAddress value + */ + public String localAddress() { + return this.localAddress; + } + + /** + * Get the route's network prefix. + * + * @return the network value + */ + public String network() { + return this.network; + } + + /** + * Get the route's next hop. + * + * @return the nextHop value + */ + public String nextHop() { + return this.nextHop; + } + + /** + * Get the peer this route was learned from. + * + * @return the sourcePeer value + */ + public String sourcePeer() { + return this.sourcePeer; + } + + /** + * Get the source this route was learned from. + * + * @return the origin value + */ + public String origin() { + return this.origin; + } + + /** + * Get the route's AS path sequence. + * + * @return the asPath value + */ + public String asPath() { + return this.asPath; + } + + /** + * Get the route's weight. + * + * @return the weight value + */ + public Integer weight() { + return this.weight; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/GatewayRouteListResult.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/GatewayRouteListResult.java new file mode 100644 index 000000000000..e3e4b719dd2d --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/GatewayRouteListResult.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.GatewayRouteListResultInner; +import java.util.List; + +/** + * Type representing GatewayRouteListResult. + */ +public interface GatewayRouteListResult extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/GetVpnSitesConfigurationRequest.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/GetVpnSitesConfigurationRequest.java new file mode 100644 index 000000000000..da7efb035b6e --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/GetVpnSitesConfigurationRequest.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.network.v2018_06_01; + +import java.util.List; +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * List of Vpn-Sites. + */ +public class GetVpnSitesConfigurationRequest { + /** + * List of resource-ids of the vpn-sites for which config is to be + * downloaded. + */ + @JsonProperty(value = "vpnSites") + private List vpnSites; + + /** + * The sas-url to download the configurations for vpn-sites. + */ + @JsonProperty(value = "outputBlobSasUrl") + private String outputBlobSasUrl; + + /** + * Get list of resource-ids of the vpn-sites for which config is to be downloaded. + * + * @return the vpnSites value + */ + public List vpnSites() { + return this.vpnSites; + } + + /** + * Set list of resource-ids of the vpn-sites for which config is to be downloaded. + * + * @param vpnSites the vpnSites value to set + * @return the GetVpnSitesConfigurationRequest object itself. + */ + public GetVpnSitesConfigurationRequest withVpnSites(List vpnSites) { + this.vpnSites = vpnSites; + return this; + } + + /** + * Get the sas-url to download the configurations for vpn-sites. + * + * @return the outputBlobSasUrl value + */ + public String outputBlobSasUrl() { + return this.outputBlobSasUrl; + } + + /** + * Set the sas-url to download the configurations for vpn-sites. + * + * @param outputBlobSasUrl the outputBlobSasUrl value to set + * @return the GetVpnSitesConfigurationRequest object itself. + */ + public GetVpnSitesConfigurationRequest withOutputBlobSasUrl(String outputBlobSasUrl) { + this.outputBlobSasUrl = outputBlobSasUrl; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/HTTPConfiguration.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/HTTPConfiguration.java new file mode 100644 index 000000000000..4c0dadefa604 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/HTTPConfiguration.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.network.v2018_06_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * HTTP configuration of the connectivity check. + */ +public class HTTPConfiguration { + /** + * HTTP method. Possible values include: 'Get'. + */ + @JsonProperty(value = "method") + private HTTPMethod method; + + /** + * List of HTTP headers. + */ + @JsonProperty(value = "headers") + private List headers; + + /** + * Valid status codes. + */ + @JsonProperty(value = "validStatusCodes") + private List validStatusCodes; + + /** + * Get hTTP method. Possible values include: 'Get'. + * + * @return the method value + */ + public HTTPMethod method() { + return this.method; + } + + /** + * Set hTTP method. Possible values include: 'Get'. + * + * @param method the method value to set + * @return the HTTPConfiguration object itself. + */ + public HTTPConfiguration withMethod(HTTPMethod method) { + this.method = method; + return this; + } + + /** + * Get list of HTTP headers. + * + * @return the headers value + */ + public List headers() { + return this.headers; + } + + /** + * Set list of HTTP headers. + * + * @param headers the headers value to set + * @return the HTTPConfiguration object itself. + */ + public HTTPConfiguration withHeaders(List headers) { + this.headers = headers; + return this; + } + + /** + * Get valid status codes. + * + * @return the validStatusCodes value + */ + public List validStatusCodes() { + return this.validStatusCodes; + } + + /** + * Set valid status codes. + * + * @param validStatusCodes the validStatusCodes value to set + * @return the HTTPConfiguration object itself. + */ + public HTTPConfiguration withValidStatusCodes(List validStatusCodes) { + this.validStatusCodes = validStatusCodes; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/HTTPHeader.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/HTTPHeader.java new file mode 100644 index 000000000000..aea7ac67efdd --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/HTTPHeader.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.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the HTTP header. + */ +public class HTTPHeader { + /** + * The name in HTTP header. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The value in HTTP header. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get the name in HTTP header. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name in HTTP header. + * + * @param name the name value to set + * @return the HTTPHeader object itself. + */ + public HTTPHeader withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value in HTTP header. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the value in HTTP header. + * + * @param value the value value to set + * @return the HTTPHeader object itself. + */ + public HTTPHeader withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/HTTPMethod.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/HTTPMethod.java new file mode 100644 index 000000000000..33ad44db31c0 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/HTTPMethod.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for HTTPMethod. + */ +public final class HTTPMethod extends ExpandableStringEnum { + /** Static value Get for HTTPMethod. */ + public static final HTTPMethod GET = fromString("Get"); + + /** + * Creates or finds a HTTPMethod from its string representation. + * @param name a name to look for + * @return the corresponding HTTPMethod + */ + @JsonCreator + public static HTTPMethod fromString(String name) { + return fromString(name, HTTPMethod.class); + } + + /** + * @return known HTTPMethod values + */ + public static Collection values() { + return values(HTTPMethod.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/HubVirtualNetworkConnection.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/HubVirtualNetworkConnection.java new file mode 100644 index 000000000000..26db1c694c49 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/HubVirtualNetworkConnection.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.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_06_01.implementation.HubVirtualNetworkConnectionInner; +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.network.v2018_06_01.implementation.NetworkManager; +import com.microsoft.azure.SubResource; +import java.util.Map; + +/** + * Type representing HubVirtualNetworkConnection. + */ +public interface HubVirtualNetworkConnection extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the allowHubToRemoteVnetTransit value. + */ + Boolean allowHubToRemoteVnetTransit(); + + /** + * @return the allowRemoteVnetToUseHubVnetGateways value. + */ + Boolean allowRemoteVnetToUseHubVnetGateways(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the remoteVirtualNetwork value. + */ + SubResource remoteVirtualNetwork(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/HubVirtualNetworkConnectionStatus.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/HubVirtualNetworkConnectionStatus.java new file mode 100644 index 000000000000..2e87ef0f9932 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/HubVirtualNetworkConnectionStatus.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for HubVirtualNetworkConnectionStatus. + */ +public final class HubVirtualNetworkConnectionStatus extends ExpandableStringEnum { + /** Static value Unknown for HubVirtualNetworkConnectionStatus. */ + public static final HubVirtualNetworkConnectionStatus UNKNOWN = fromString("Unknown"); + + /** Static value Connecting for HubVirtualNetworkConnectionStatus. */ + public static final HubVirtualNetworkConnectionStatus CONNECTING = fromString("Connecting"); + + /** Static value Connected for HubVirtualNetworkConnectionStatus. */ + public static final HubVirtualNetworkConnectionStatus CONNECTED = fromString("Connected"); + + /** Static value NotConnected for HubVirtualNetworkConnectionStatus. */ + public static final HubVirtualNetworkConnectionStatus NOT_CONNECTED = fromString("NotConnected"); + + /** + * Creates or finds a HubVirtualNetworkConnectionStatus from its string representation. + * @param name a name to look for + * @return the corresponding HubVirtualNetworkConnectionStatus + */ + @JsonCreator + public static HubVirtualNetworkConnectionStatus fromString(String name) { + return fromString(name, HubVirtualNetworkConnectionStatus.class); + } + + /** + * @return known HubVirtualNetworkConnectionStatus values + */ + public static Collection values() { + return values(HubVirtualNetworkConnectionStatus.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/HubVirtualNetworkConnections.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/HubVirtualNetworkConnections.java new file mode 100644 index 000000000000..03360436a98b --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/HubVirtualNetworkConnections.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import rx.Observable; +import com.microsoft.azure.management.network.v2018_06_01.implementation.HubVirtualNetworkConnectionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing HubVirtualNetworkConnections. + */ +public interface HubVirtualNetworkConnections extends HasInner { + /** + * Retrieves the details of a HubVirtualNetworkConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String virtualHubName, String connectionName); + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String virtualHubName); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/IPAddressAvailabilityResult.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/IPAddressAvailabilityResult.java new file mode 100644 index 000000000000..bd6d67c66188 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/IPAddressAvailabilityResult.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.IPAddressAvailabilityResultInner; +import java.util.List; + +/** + * Type representing IPAddressAvailabilityResult. + */ +public interface IPAddressAvailabilityResult extends HasInner, HasManager { + /** + * @return the available value. + */ + Boolean available(); + + /** + * @return the availableIPAddresses value. + */ + List availableIPAddresses(); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/IPAllocationMethod.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/IPAllocationMethod.java new file mode 100644 index 000000000000..026f338411d3 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/IPAllocationMethod.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for IPAllocationMethod. + */ +public final class IPAllocationMethod extends ExpandableStringEnum { + /** Static value Static for IPAllocationMethod. */ + public static final IPAllocationMethod STATIC = fromString("Static"); + + /** Static value Dynamic for IPAllocationMethod. */ + public static final IPAllocationMethod DYNAMIC = fromString("Dynamic"); + + /** + * Creates or finds a IPAllocationMethod from its string representation. + * @param name a name to look for + * @return the corresponding IPAllocationMethod + */ + @JsonCreator + public static IPAllocationMethod fromString(String name) { + return fromString(name, IPAllocationMethod.class); + } + + /** + * @return known IPAllocationMethod values + */ + public static Collection values() { + return values(IPAllocationMethod.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/IPConfiguration.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/IPConfiguration.java new file mode 100644 index 000000000000..38b58f08293e --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/IPConfiguration.java @@ -0,0 +1,207 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.management.network.v2018_06_01.implementation.SubnetInner; +import com.microsoft.azure.management.network.v2018_06_01.implementation.PublicIPAddressInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * IP configuration. + */ +@JsonFlatten +public class IPConfiguration extends SubResource { + /** + * The private IP address of the IP configuration. + */ + @JsonProperty(value = "properties.privateIPAddress") + private String privateIPAddress; + + /** + * The private IP allocation method. Possible values are 'Static' and + * 'Dynamic'. Possible values include: 'Static', 'Dynamic'. + */ + @JsonProperty(value = "properties.privateIPAllocationMethod") + private IPAllocationMethod privateIPAllocationMethod; + + /** + * The reference of the subnet resource. + */ + @JsonProperty(value = "properties.subnet") + private SubnetInner subnet; + + /** + * The reference of the public IP resource. + */ + @JsonProperty(value = "properties.publicIPAddress") + private PublicIPAddressInner publicIPAddress; + + /** + * Gets the provisioning state of the public IP resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get the private IP address of the IP configuration. + * + * @return the privateIPAddress value + */ + public String privateIPAddress() { + return this.privateIPAddress; + } + + /** + * Set the private IP address of the IP configuration. + * + * @param privateIPAddress the privateIPAddress value to set + * @return the IPConfiguration object itself. + */ + public IPConfiguration withPrivateIPAddress(String privateIPAddress) { + this.privateIPAddress = privateIPAddress; + return this; + } + + /** + * Get the private IP allocation method. Possible values are 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic'. + * + * @return the privateIPAllocationMethod value + */ + public IPAllocationMethod privateIPAllocationMethod() { + return this.privateIPAllocationMethod; + } + + /** + * Set the private IP allocation method. Possible values are 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic'. + * + * @param privateIPAllocationMethod the privateIPAllocationMethod value to set + * @return the IPConfiguration object itself. + */ + public IPConfiguration withPrivateIPAllocationMethod(IPAllocationMethod privateIPAllocationMethod) { + this.privateIPAllocationMethod = privateIPAllocationMethod; + return this; + } + + /** + * Get the reference of the subnet resource. + * + * @return the subnet value + */ + public SubnetInner subnet() { + return this.subnet; + } + + /** + * Set the reference of the subnet resource. + * + * @param subnet the subnet value to set + * @return the IPConfiguration object itself. + */ + public IPConfiguration withSubnet(SubnetInner subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get the reference of the public IP resource. + * + * @return the publicIPAddress value + */ + public PublicIPAddressInner publicIPAddress() { + return this.publicIPAddress; + } + + /** + * Set the reference of the public IP resource. + * + * @param publicIPAddress the publicIPAddress value to set + * @return the IPConfiguration object itself. + */ + public IPConfiguration withPublicIPAddress(PublicIPAddressInner publicIPAddress) { + this.publicIPAddress = publicIPAddress; + return this; + } + + /** + * Get gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the IPConfiguration object itself. + */ + public IPConfiguration withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the IPConfiguration object itself. + */ + public IPConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the IPConfiguration object itself. + */ + public IPConfiguration withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/IPVersion.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/IPVersion.java new file mode 100644 index 000000000000..b679bd7fe4ec --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/IPVersion.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for IPVersion. + */ +public final class IPVersion extends ExpandableStringEnum { + /** Static value IPv4 for IPVersion. */ + public static final IPVersion IPV4 = fromString("IPv4"); + + /** Static value IPv6 for IPVersion. */ + public static final IPVersion IPV6 = fromString("IPv6"); + + /** + * Creates or finds a IPVersion from its string representation. + * @param name a name to look for + * @return the corresponding IPVersion + */ + @JsonCreator + public static IPVersion fromString(String name) { + return fromString(name, IPVersion.class); + } + + /** + * @return known IPVersion values + */ + public static Collection values() { + return values(IPVersion.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/IkeEncryption.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/IkeEncryption.java new file mode 100644 index 000000000000..a8a754dc859c --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/IkeEncryption.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for IkeEncryption. + */ +public final class IkeEncryption extends ExpandableStringEnum { + /** Static value DES for IkeEncryption. */ + public static final IkeEncryption DES = fromString("DES"); + + /** Static value DES3 for IkeEncryption. */ + public static final IkeEncryption DES3 = fromString("DES3"); + + /** Static value AES128 for IkeEncryption. */ + public static final IkeEncryption AES128 = fromString("AES128"); + + /** Static value AES192 for IkeEncryption. */ + public static final IkeEncryption AES192 = fromString("AES192"); + + /** Static value AES256 for IkeEncryption. */ + public static final IkeEncryption AES256 = fromString("AES256"); + + /** Static value GCMAES256 for IkeEncryption. */ + public static final IkeEncryption GCMAES256 = fromString("GCMAES256"); + + /** Static value GCMAES128 for IkeEncryption. */ + public static final IkeEncryption GCMAES128 = fromString("GCMAES128"); + + /** + * Creates or finds a IkeEncryption from its string representation. + * @param name a name to look for + * @return the corresponding IkeEncryption + */ + @JsonCreator + public static IkeEncryption fromString(String name) { + return fromString(name, IkeEncryption.class); + } + + /** + * @return known IkeEncryption values + */ + public static Collection values() { + return values(IkeEncryption.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/IkeIntegrity.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/IkeIntegrity.java new file mode 100644 index 000000000000..4d95d2ba5691 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/IkeIntegrity.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for IkeIntegrity. + */ +public final class IkeIntegrity extends ExpandableStringEnum { + /** Static value MD5 for IkeIntegrity. */ + public static final IkeIntegrity MD5 = fromString("MD5"); + + /** Static value SHA1 for IkeIntegrity. */ + public static final IkeIntegrity SHA1 = fromString("SHA1"); + + /** Static value SHA256 for IkeIntegrity. */ + public static final IkeIntegrity SHA256 = fromString("SHA256"); + + /** Static value SHA384 for IkeIntegrity. */ + public static final IkeIntegrity SHA384 = fromString("SHA384"); + + /** Static value GCMAES256 for IkeIntegrity. */ + public static final IkeIntegrity GCMAES256 = fromString("GCMAES256"); + + /** Static value GCMAES128 for IkeIntegrity. */ + public static final IkeIntegrity GCMAES128 = fromString("GCMAES128"); + + /** + * Creates or finds a IkeIntegrity from its string representation. + * @param name a name to look for + * @return the corresponding IkeIntegrity + */ + @JsonCreator + public static IkeIntegrity fromString(String name) { + return fromString(name, IkeIntegrity.class); + } + + /** + * @return known IkeIntegrity values + */ + public static Collection values() { + return values(IkeIntegrity.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/InboundNatPool.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/InboundNatPool.java new file mode 100644 index 000000000000..a0f1f3eb43cb --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/InboundNatPool.java @@ -0,0 +1,292 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Inbound NAT pool of the load balancer. + */ +@JsonFlatten +public class InboundNatPool extends SubResource { + /** + * A reference to frontend IP addresses. + */ + @JsonProperty(value = "properties.frontendIPConfiguration") + private SubResource frontendIPConfiguration; + + /** + * Possible values include: 'Udp', 'Tcp', 'All'. + */ + @JsonProperty(value = "properties.protocol", required = true) + private TransportProtocol protocol; + + /** + * The first port number in the range of external ports that will be used + * to provide Inbound Nat to NICs associated with a load balancer. + * Acceptable values range between 1 and 65534. + */ + @JsonProperty(value = "properties.frontendPortRangeStart", required = true) + private int frontendPortRangeStart; + + /** + * The last port number in the range of external ports that will be used to + * provide Inbound Nat to NICs associated with a load balancer. Acceptable + * values range between 1 and 65535. + */ + @JsonProperty(value = "properties.frontendPortRangeEnd", required = true) + private int frontendPortRangeEnd; + + /** + * The port used for internal connections on the endpoint. Acceptable + * values are between 1 and 65535. + */ + @JsonProperty(value = "properties.backendPort", required = true) + private int backendPort; + + /** + * The timeout for the TCP idle connection. The value can be set between 4 + * and 30 minutes. The default value is 4 minutes. This element is only + * used when the protocol is set to TCP. + */ + @JsonProperty(value = "properties.idleTimeoutInMinutes") + private Integer idleTimeoutInMinutes; + + /** + * Configures a virtual machine's endpoint for the floating IP capability + * required to configure a SQL AlwaysOn Availability Group. This setting is + * required when using the SQL AlwaysOn Availability Groups in SQL server. + * This setting can't be changed after you create the endpoint. + */ + @JsonProperty(value = "properties.enableFloatingIP") + private Boolean enableFloatingIP; + + /** + * Gets the provisioning state of the PublicIP resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get a reference to frontend IP addresses. + * + * @return the frontendIPConfiguration value + */ + public SubResource frontendIPConfiguration() { + return this.frontendIPConfiguration; + } + + /** + * Set a reference to frontend IP addresses. + * + * @param frontendIPConfiguration the frontendIPConfiguration value to set + * @return the InboundNatPool object itself. + */ + public InboundNatPool withFrontendIPConfiguration(SubResource frontendIPConfiguration) { + this.frontendIPConfiguration = frontendIPConfiguration; + return this; + } + + /** + * Get possible values include: 'Udp', 'Tcp', 'All'. + * + * @return the protocol value + */ + public TransportProtocol protocol() { + return this.protocol; + } + + /** + * Set possible values include: 'Udp', 'Tcp', 'All'. + * + * @param protocol the protocol value to set + * @return the InboundNatPool object itself. + */ + public InboundNatPool withProtocol(TransportProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the first port number in the range of external ports that will be used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65534. + * + * @return the frontendPortRangeStart value + */ + public int frontendPortRangeStart() { + return this.frontendPortRangeStart; + } + + /** + * Set the first port number in the range of external ports that will be used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65534. + * + * @param frontendPortRangeStart the frontendPortRangeStart value to set + * @return the InboundNatPool object itself. + */ + public InboundNatPool withFrontendPortRangeStart(int frontendPortRangeStart) { + this.frontendPortRangeStart = frontendPortRangeStart; + return this; + } + + /** + * Get the last port number in the range of external ports that will be used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65535. + * + * @return the frontendPortRangeEnd value + */ + public int frontendPortRangeEnd() { + return this.frontendPortRangeEnd; + } + + /** + * Set the last port number in the range of external ports that will be used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65535. + * + * @param frontendPortRangeEnd the frontendPortRangeEnd value to set + * @return the InboundNatPool object itself. + */ + public InboundNatPool withFrontendPortRangeEnd(int frontendPortRangeEnd) { + this.frontendPortRangeEnd = frontendPortRangeEnd; + return this; + } + + /** + * Get the port used for internal connections on the endpoint. Acceptable values are between 1 and 65535. + * + * @return the backendPort value + */ + public int backendPort() { + return this.backendPort; + } + + /** + * Set the port used for internal connections on the endpoint. Acceptable values are between 1 and 65535. + * + * @param backendPort the backendPort value to set + * @return the InboundNatPool object itself. + */ + public InboundNatPool withBackendPort(int backendPort) { + this.backendPort = backendPort; + return this; + } + + /** + * Get the timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. + * + * @return the idleTimeoutInMinutes value + */ + public Integer idleTimeoutInMinutes() { + return this.idleTimeoutInMinutes; + } + + /** + * Set the timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. + * + * @param idleTimeoutInMinutes the idleTimeoutInMinutes value to set + * @return the InboundNatPool object itself. + */ + public InboundNatPool withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { + this.idleTimeoutInMinutes = idleTimeoutInMinutes; + return this; + } + + /** + * Get configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint. + * + * @return the enableFloatingIP value + */ + public Boolean enableFloatingIP() { + return this.enableFloatingIP; + } + + /** + * Set configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint. + * + * @param enableFloatingIP the enableFloatingIP value to set + * @return the InboundNatPool object itself. + */ + public InboundNatPool withEnableFloatingIP(Boolean enableFloatingIP) { + this.enableFloatingIP = enableFloatingIP; + return this; + } + + /** + * Get gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the InboundNatPool object itself. + */ + public InboundNatPool withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the InboundNatPool object itself. + */ + public InboundNatPool withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the InboundNatPool object itself. + */ + public InboundNatPool withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/InboundNatRule.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/InboundNatRule.java new file mode 100644 index 000000000000..95295748a1b0 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/InboundNatRule.java @@ -0,0 +1,326 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_06_01.implementation.InboundNatRuleInner; +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.network.v2018_06_01.implementation.NetworkManager; +import com.microsoft.azure.SubResource; + +/** + * Type representing InboundNatRule. + */ +public interface InboundNatRule extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the backendIPConfiguration value. + */ + VirtualMachineScaleSetNetworkInterfaceIPConfiguration backendIPConfiguration(); + + /** + * @return the backendPort value. + */ + Integer backendPort(); + + /** + * @return the enableFloatingIP value. + */ + Boolean enableFloatingIP(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the frontendIPConfiguration value. + */ + SubResource frontendIPConfiguration(); + + /** + * @return the frontendPort value. + */ + Integer frontendPort(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the idleTimeoutInMinutes value. + */ + Integer idleTimeoutInMinutes(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the protocol value. + */ + TransportProtocol protocol(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * The entirety of the InboundNatRule definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLoadBalancer, DefinitionStages.WithCreate { + } + + /** + * Grouping of InboundNatRule definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a InboundNatRule definition. + */ + interface Blank extends WithLoadBalancer { + } + + /** + * The stage of the inboundnatrule definition allowing to specify LoadBalancer. + */ + interface WithLoadBalancer { + /** + * Specifies resourceGroupName, loadBalancerName. + */ + WithCreate withExistingLoadBalancer(String resourceGroupName, String loadBalancerName); + } + + /** + * The stage of the inboundnatrule definition allowing to specify BackendPort. + */ + interface WithBackendPort { + /** + * Specifies backendPort. + */ + WithCreate withBackendPort(Integer backendPort); + } + + /** + * The stage of the inboundnatrule definition allowing to specify EnableFloatingIP. + */ + interface WithEnableFloatingIP { + /** + * Specifies enableFloatingIP. + */ + WithCreate withEnableFloatingIP(Boolean enableFloatingIP); + } + + /** + * The stage of the inboundnatrule definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the inboundnatrule definition allowing to specify FrontendIPConfiguration. + */ + interface WithFrontendIPConfiguration { + /** + * Specifies frontendIPConfiguration. + */ + WithCreate withFrontendIPConfiguration(SubResource frontendIPConfiguration); + } + + /** + * The stage of the inboundnatrule definition allowing to specify FrontendPort. + */ + interface WithFrontendPort { + /** + * Specifies frontendPort. + */ + WithCreate withFrontendPort(Integer frontendPort); + } + + /** + * The stage of the inboundnatrule definition allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + */ + WithCreate withId(String id); + } + + /** + * The stage of the inboundnatrule definition allowing to specify IdleTimeoutInMinutes. + */ + interface WithIdleTimeoutInMinutes { + /** + * Specifies idleTimeoutInMinutes. + */ + WithCreate withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes); + } + + /** + * The stage of the inboundnatrule definition allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + */ + WithCreate withName(String name); + } + + /** + * The stage of the inboundnatrule definition allowing to specify Protocol. + */ + interface WithProtocol { + /** + * Specifies protocol. + */ + WithCreate withProtocol(TransportProtocol protocol); + } + + /** + * The stage of the inboundnatrule definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * 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.WithBackendPort, DefinitionStages.WithEnableFloatingIP, DefinitionStages.WithEtag, DefinitionStages.WithFrontendIPConfiguration, DefinitionStages.WithFrontendPort, DefinitionStages.WithId, DefinitionStages.WithIdleTimeoutInMinutes, DefinitionStages.WithName, DefinitionStages.WithProtocol, DefinitionStages.WithProvisioningState { + } + } + /** + * The template for a InboundNatRule update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithBackendPort, UpdateStages.WithEnableFloatingIP, UpdateStages.WithEtag, UpdateStages.WithFrontendIPConfiguration, UpdateStages.WithFrontendPort, UpdateStages.WithId, UpdateStages.WithIdleTimeoutInMinutes, UpdateStages.WithName, UpdateStages.WithProtocol, UpdateStages.WithProvisioningState { + } + + /** + * Grouping of InboundNatRule update stages. + */ + interface UpdateStages { + /** + * The stage of the inboundnatrule update allowing to specify BackendPort. + */ + interface WithBackendPort { + /** + * Specifies backendPort. + */ + Update withBackendPort(Integer backendPort); + } + + /** + * The stage of the inboundnatrule update allowing to specify EnableFloatingIP. + */ + interface WithEnableFloatingIP { + /** + * Specifies enableFloatingIP. + */ + Update withEnableFloatingIP(Boolean enableFloatingIP); + } + + /** + * The stage of the inboundnatrule update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + */ + Update withEtag(String etag); + } + + /** + * The stage of the inboundnatrule update allowing to specify FrontendIPConfiguration. + */ + interface WithFrontendIPConfiguration { + /** + * Specifies frontendIPConfiguration. + */ + Update withFrontendIPConfiguration(SubResource frontendIPConfiguration); + } + + /** + * The stage of the inboundnatrule update allowing to specify FrontendPort. + */ + interface WithFrontendPort { + /** + * Specifies frontendPort. + */ + Update withFrontendPort(Integer frontendPort); + } + + /** + * The stage of the inboundnatrule update allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + */ + Update withId(String id); + } + + /** + * The stage of the inboundnatrule update allowing to specify IdleTimeoutInMinutes. + */ + interface WithIdleTimeoutInMinutes { + /** + * Specifies idleTimeoutInMinutes. + */ + Update withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes); + } + + /** + * The stage of the inboundnatrule update allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + */ + Update withName(String name); + } + + /** + * The stage of the inboundnatrule update allowing to specify Protocol. + */ + interface WithProtocol { + /** + * Specifies protocol. + */ + Update withProtocol(TransportProtocol protocol); + } + + /** + * The stage of the inboundnatrule update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + */ + Update withProvisioningState(String provisioningState); + } + + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/InboundNatRules.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/InboundNatRules.java new file mode 100644 index 000000000000..a16982db67c0 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/InboundNatRules.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.network.v2018_06_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_06_01.implementation.InboundNatRulesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing InboundNatRules. + */ +public interface InboundNatRules extends SupportsCreating, HasInner { + /** + * Gets the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName); + + /** + * Gets all the inbound nat rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String loadBalancerName); + + /** + * Deletes the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/IpFlowProtocol.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/IpFlowProtocol.java new file mode 100644 index 000000000000..0d62a4e5885a --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/IpFlowProtocol.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for IpFlowProtocol. + */ +public final class IpFlowProtocol extends ExpandableStringEnum { + /** Static value TCP for IpFlowProtocol. */ + public static final IpFlowProtocol TCP = fromString("TCP"); + + /** Static value UDP for IpFlowProtocol. */ + public static final IpFlowProtocol UDP = fromString("UDP"); + + /** + * Creates or finds a IpFlowProtocol from its string representation. + * @param name a name to look for + * @return the corresponding IpFlowProtocol + */ + @JsonCreator + public static IpFlowProtocol fromString(String name) { + return fromString(name, IpFlowProtocol.class); + } + + /** + * @return known IpFlowProtocol values + */ + public static Collection values() { + return values(IpFlowProtocol.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/IpTag.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/IpTag.java new file mode 100644 index 000000000000..773abfc39132 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/IpTag.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.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains the IpTag associated with the public IP address. + */ +public class IpTag { + /** + * Gets or sets the ipTag type: Example FirstPartyUsage. + */ + @JsonProperty(value = "ipTagType") + private String ipTagType; + + /** + * Gets or sets value of the IpTag associated with the public IP. Example + * SQL, Storage etc. + */ + @JsonProperty(value = "tag") + private String tag; + + /** + * Get gets or sets the ipTag type: Example FirstPartyUsage. + * + * @return the ipTagType value + */ + public String ipTagType() { + return this.ipTagType; + } + + /** + * Set gets or sets the ipTag type: Example FirstPartyUsage. + * + * @param ipTagType the ipTagType value to set + * @return the IpTag object itself. + */ + public IpTag withIpTagType(String ipTagType) { + this.ipTagType = ipTagType; + return this; + } + + /** + * Get gets or sets value of the IpTag associated with the public IP. Example SQL, Storage etc. + * + * @return the tag value + */ + public String tag() { + return this.tag; + } + + /** + * Set gets or sets value of the IpTag associated with the public IP. Example SQL, Storage etc. + * + * @param tag the tag value to set + * @return the IpTag object itself. + */ + public IpTag withTag(String tag) { + this.tag = tag; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/IpsecEncryption.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/IpsecEncryption.java new file mode 100644 index 000000000000..f953c9f148df --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/IpsecEncryption.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for IpsecEncryption. + */ +public final class IpsecEncryption extends ExpandableStringEnum { + /** Static value None for IpsecEncryption. */ + public static final IpsecEncryption NONE = fromString("None"); + + /** Static value DES for IpsecEncryption. */ + public static final IpsecEncryption DES = fromString("DES"); + + /** Static value DES3 for IpsecEncryption. */ + public static final IpsecEncryption DES3 = fromString("DES3"); + + /** Static value AES128 for IpsecEncryption. */ + public static final IpsecEncryption AES128 = fromString("AES128"); + + /** Static value AES192 for IpsecEncryption. */ + public static final IpsecEncryption AES192 = fromString("AES192"); + + /** Static value AES256 for IpsecEncryption. */ + public static final IpsecEncryption AES256 = fromString("AES256"); + + /** Static value GCMAES128 for IpsecEncryption. */ + public static final IpsecEncryption GCMAES128 = fromString("GCMAES128"); + + /** Static value GCMAES192 for IpsecEncryption. */ + public static final IpsecEncryption GCMAES192 = fromString("GCMAES192"); + + /** Static value GCMAES256 for IpsecEncryption. */ + public static final IpsecEncryption GCMAES256 = fromString("GCMAES256"); + + /** + * Creates or finds a IpsecEncryption from its string representation. + * @param name a name to look for + * @return the corresponding IpsecEncryption + */ + @JsonCreator + public static IpsecEncryption fromString(String name) { + return fromString(name, IpsecEncryption.class); + } + + /** + * @return known IpsecEncryption values + */ + public static Collection values() { + return values(IpsecEncryption.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/IpsecIntegrity.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/IpsecIntegrity.java new file mode 100644 index 000000000000..867709e55683 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/IpsecIntegrity.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for IpsecIntegrity. + */ +public final class IpsecIntegrity extends ExpandableStringEnum { + /** Static value MD5 for IpsecIntegrity. */ + public static final IpsecIntegrity MD5 = fromString("MD5"); + + /** Static value SHA1 for IpsecIntegrity. */ + public static final IpsecIntegrity SHA1 = fromString("SHA1"); + + /** Static value SHA256 for IpsecIntegrity. */ + public static final IpsecIntegrity SHA256 = fromString("SHA256"); + + /** Static value GCMAES128 for IpsecIntegrity. */ + public static final IpsecIntegrity GCMAES128 = fromString("GCMAES128"); + + /** Static value GCMAES192 for IpsecIntegrity. */ + public static final IpsecIntegrity GCMAES192 = fromString("GCMAES192"); + + /** Static value GCMAES256 for IpsecIntegrity. */ + public static final IpsecIntegrity GCMAES256 = fromString("GCMAES256"); + + /** + * Creates or finds a IpsecIntegrity from its string representation. + * @param name a name to look for + * @return the corresponding IpsecIntegrity + */ + @JsonCreator + public static IpsecIntegrity fromString(String name) { + return fromString(name, IpsecIntegrity.class); + } + + /** + * @return known IpsecIntegrity values + */ + public static Collection values() { + return values(IpsecIntegrity.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/IpsecPolicy.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/IpsecPolicy.java new file mode 100644 index 000000000000..a2aa9fe6549b --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/IpsecPolicy.java @@ -0,0 +1,236 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An IPSec Policy configuration for a virtual network gateway connection. + */ +public class IpsecPolicy { + /** + * The IPSec Security Association (also called Quick Mode or Phase 2 SA) + * lifetime in seconds for a site to site VPN tunnel. + */ + @JsonProperty(value = "saLifeTimeSeconds", required = true) + private int saLifeTimeSeconds; + + /** + * The IPSec Security Association (also called Quick Mode or Phase 2 SA) + * payload size in KB for a site to site VPN tunnel. + */ + @JsonProperty(value = "saDataSizeKilobytes", required = true) + private int saDataSizeKilobytes; + + /** + * The IPSec encryption algorithm (IKE phase 1). Possible values include: + * 'None', 'DES', 'DES3', 'AES128', 'AES192', 'AES256', 'GCMAES128', + * 'GCMAES192', 'GCMAES256'. + */ + @JsonProperty(value = "ipsecEncryption", required = true) + private IpsecEncryption ipsecEncryption; + + /** + * The IPSec integrity algorithm (IKE phase 1). Possible values include: + * 'MD5', 'SHA1', 'SHA256', 'GCMAES128', 'GCMAES192', 'GCMAES256'. + */ + @JsonProperty(value = "ipsecIntegrity", required = true) + private IpsecIntegrity ipsecIntegrity; + + /** + * The IKE encryption algorithm (IKE phase 2). Possible values include: + * 'DES', 'DES3', 'AES128', 'AES192', 'AES256', 'GCMAES256', 'GCMAES128'. + */ + @JsonProperty(value = "ikeEncryption", required = true) + private IkeEncryption ikeEncryption; + + /** + * The IKE integrity algorithm (IKE phase 2). Possible values include: + * 'MD5', 'SHA1', 'SHA256', 'SHA384', 'GCMAES256', 'GCMAES128'. + */ + @JsonProperty(value = "ikeIntegrity", required = true) + private IkeIntegrity ikeIntegrity; + + /** + * The DH Groups used in IKE Phase 1 for initial SA. Possible values + * include: 'None', 'DHGroup1', 'DHGroup2', 'DHGroup14', 'DHGroup2048', + * 'ECP256', 'ECP384', 'DHGroup24'. + */ + @JsonProperty(value = "dhGroup", required = true) + private DhGroup dhGroup; + + /** + * The Pfs Groups used in IKE Phase 2 for new child SA. Possible values + * include: 'None', 'PFS1', 'PFS2', 'PFS2048', 'ECP256', 'ECP384', 'PFS24', + * 'PFS14', 'PFSMM'. + */ + @JsonProperty(value = "pfsGroup", required = true) + private PfsGroup pfsGroup; + + /** + * Get the IPSec Security Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for a site to site VPN tunnel. + * + * @return the saLifeTimeSeconds value + */ + public int saLifeTimeSeconds() { + return this.saLifeTimeSeconds; + } + + /** + * Set the IPSec Security Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for a site to site VPN tunnel. + * + * @param saLifeTimeSeconds the saLifeTimeSeconds value to set + * @return the IpsecPolicy object itself. + */ + public IpsecPolicy withSaLifeTimeSeconds(int saLifeTimeSeconds) { + this.saLifeTimeSeconds = saLifeTimeSeconds; + return this; + } + + /** + * Get the IPSec Security Association (also called Quick Mode or Phase 2 SA) payload size in KB for a site to site VPN tunnel. + * + * @return the saDataSizeKilobytes value + */ + public int saDataSizeKilobytes() { + return this.saDataSizeKilobytes; + } + + /** + * Set the IPSec Security Association (also called Quick Mode or Phase 2 SA) payload size in KB for a site to site VPN tunnel. + * + * @param saDataSizeKilobytes the saDataSizeKilobytes value to set + * @return the IpsecPolicy object itself. + */ + public IpsecPolicy withSaDataSizeKilobytes(int saDataSizeKilobytes) { + this.saDataSizeKilobytes = saDataSizeKilobytes; + return this; + } + + /** + * Get the IPSec encryption algorithm (IKE phase 1). Possible values include: 'None', 'DES', 'DES3', 'AES128', 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256'. + * + * @return the ipsecEncryption value + */ + public IpsecEncryption ipsecEncryption() { + return this.ipsecEncryption; + } + + /** + * Set the IPSec encryption algorithm (IKE phase 1). Possible values include: 'None', 'DES', 'DES3', 'AES128', 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256'. + * + * @param ipsecEncryption the ipsecEncryption value to set + * @return the IpsecPolicy object itself. + */ + public IpsecPolicy withIpsecEncryption(IpsecEncryption ipsecEncryption) { + this.ipsecEncryption = ipsecEncryption; + return this; + } + + /** + * Get the IPSec integrity algorithm (IKE phase 1). Possible values include: 'MD5', 'SHA1', 'SHA256', 'GCMAES128', 'GCMAES192', 'GCMAES256'. + * + * @return the ipsecIntegrity value + */ + public IpsecIntegrity ipsecIntegrity() { + return this.ipsecIntegrity; + } + + /** + * Set the IPSec integrity algorithm (IKE phase 1). Possible values include: 'MD5', 'SHA1', 'SHA256', 'GCMAES128', 'GCMAES192', 'GCMAES256'. + * + * @param ipsecIntegrity the ipsecIntegrity value to set + * @return the IpsecPolicy object itself. + */ + public IpsecPolicy withIpsecIntegrity(IpsecIntegrity ipsecIntegrity) { + this.ipsecIntegrity = ipsecIntegrity; + return this; + } + + /** + * Get the IKE encryption algorithm (IKE phase 2). Possible values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256', 'GCMAES256', 'GCMAES128'. + * + * @return the ikeEncryption value + */ + public IkeEncryption ikeEncryption() { + return this.ikeEncryption; + } + + /** + * Set the IKE encryption algorithm (IKE phase 2). Possible values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256', 'GCMAES256', 'GCMAES128'. + * + * @param ikeEncryption the ikeEncryption value to set + * @return the IpsecPolicy object itself. + */ + public IpsecPolicy withIkeEncryption(IkeEncryption ikeEncryption) { + this.ikeEncryption = ikeEncryption; + return this; + } + + /** + * Get the IKE integrity algorithm (IKE phase 2). Possible values include: 'MD5', 'SHA1', 'SHA256', 'SHA384', 'GCMAES256', 'GCMAES128'. + * + * @return the ikeIntegrity value + */ + public IkeIntegrity ikeIntegrity() { + return this.ikeIntegrity; + } + + /** + * Set the IKE integrity algorithm (IKE phase 2). Possible values include: 'MD5', 'SHA1', 'SHA256', 'SHA384', 'GCMAES256', 'GCMAES128'. + * + * @param ikeIntegrity the ikeIntegrity value to set + * @return the IpsecPolicy object itself. + */ + public IpsecPolicy withIkeIntegrity(IkeIntegrity ikeIntegrity) { + this.ikeIntegrity = ikeIntegrity; + return this; + } + + /** + * Get the DH Groups used in IKE Phase 1 for initial SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24'. + * + * @return the dhGroup value + */ + public DhGroup dhGroup() { + return this.dhGroup; + } + + /** + * Set the DH Groups used in IKE Phase 1 for initial SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24'. + * + * @param dhGroup the dhGroup value to set + * @return the IpsecPolicy object itself. + */ + public IpsecPolicy withDhGroup(DhGroup dhGroup) { + this.dhGroup = dhGroup; + return this; + } + + /** + * Get the Pfs Groups used in IKE Phase 2 for new child SA. Possible values include: 'None', 'PFS1', 'PFS2', 'PFS2048', 'ECP256', 'ECP384', 'PFS24', 'PFS14', 'PFSMM'. + * + * @return the pfsGroup value + */ + public PfsGroup pfsGroup() { + return this.pfsGroup; + } + + /** + * Set the Pfs Groups used in IKE Phase 2 for new child SA. Possible values include: 'None', 'PFS1', 'PFS2', 'PFS2048', 'ECP256', 'ECP384', 'PFS24', 'PFS14', 'PFSMM'. + * + * @param pfsGroup the pfsGroup value to set + * @return the IpsecPolicy object itself. + */ + public IpsecPolicy withPfsGroup(PfsGroup pfsGroup) { + this.pfsGroup = pfsGroup; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/Ipv6ExpressRouteCircuitPeeringConfig.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/Ipv6ExpressRouteCircuitPeeringConfig.java new file mode 100644 index 000000000000..8e34a3a07c4b --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/Ipv6ExpressRouteCircuitPeeringConfig.java @@ -0,0 +1,149 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.management.network.v2018_06_01.implementation.RouteFilterInner; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains IPv6 peering config. + */ +public class Ipv6ExpressRouteCircuitPeeringConfig { + /** + * The primary address prefix. + */ + @JsonProperty(value = "primaryPeerAddressPrefix") + private String primaryPeerAddressPrefix; + + /** + * The secondary address prefix. + */ + @JsonProperty(value = "secondaryPeerAddressPrefix") + private String secondaryPeerAddressPrefix; + + /** + * The Microsoft peering configuration. + */ + @JsonProperty(value = "microsoftPeeringConfig") + private ExpressRouteCircuitPeeringConfig microsoftPeeringConfig; + + /** + * The reference of the RouteFilter resource. + */ + @JsonProperty(value = "routeFilter") + private RouteFilterInner routeFilter; + + /** + * The state of peering. Possible values are: 'Disabled' and 'Enabled'. + * Possible values include: 'Disabled', 'Enabled'. + */ + @JsonProperty(value = "state") + private ExpressRouteCircuitPeeringState state; + + /** + * Get the primary address prefix. + * + * @return the primaryPeerAddressPrefix value + */ + public String primaryPeerAddressPrefix() { + return this.primaryPeerAddressPrefix; + } + + /** + * Set the primary address prefix. + * + * @param primaryPeerAddressPrefix the primaryPeerAddressPrefix value to set + * @return the Ipv6ExpressRouteCircuitPeeringConfig object itself. + */ + public Ipv6ExpressRouteCircuitPeeringConfig withPrimaryPeerAddressPrefix(String primaryPeerAddressPrefix) { + this.primaryPeerAddressPrefix = primaryPeerAddressPrefix; + return this; + } + + /** + * Get the secondary address prefix. + * + * @return the secondaryPeerAddressPrefix value + */ + public String secondaryPeerAddressPrefix() { + return this.secondaryPeerAddressPrefix; + } + + /** + * Set the secondary address prefix. + * + * @param secondaryPeerAddressPrefix the secondaryPeerAddressPrefix value to set + * @return the Ipv6ExpressRouteCircuitPeeringConfig object itself. + */ + public Ipv6ExpressRouteCircuitPeeringConfig withSecondaryPeerAddressPrefix(String secondaryPeerAddressPrefix) { + this.secondaryPeerAddressPrefix = secondaryPeerAddressPrefix; + return this; + } + + /** + * Get the Microsoft peering configuration. + * + * @return the microsoftPeeringConfig value + */ + public ExpressRouteCircuitPeeringConfig microsoftPeeringConfig() { + return this.microsoftPeeringConfig; + } + + /** + * Set the Microsoft peering configuration. + * + * @param microsoftPeeringConfig the microsoftPeeringConfig value to set + * @return the Ipv6ExpressRouteCircuitPeeringConfig object itself. + */ + public Ipv6ExpressRouteCircuitPeeringConfig withMicrosoftPeeringConfig(ExpressRouteCircuitPeeringConfig microsoftPeeringConfig) { + this.microsoftPeeringConfig = microsoftPeeringConfig; + return this; + } + + /** + * Get the reference of the RouteFilter resource. + * + * @return the routeFilter value + */ + public RouteFilterInner routeFilter() { + return this.routeFilter; + } + + /** + * Set the reference of the RouteFilter resource. + * + * @param routeFilter the routeFilter value to set + * @return the Ipv6ExpressRouteCircuitPeeringConfig object itself. + */ + public Ipv6ExpressRouteCircuitPeeringConfig withRouteFilter(RouteFilterInner routeFilter) { + this.routeFilter = routeFilter; + return this; + } + + /** + * Get the state of peering. Possible values are: 'Disabled' and 'Enabled'. Possible values include: 'Disabled', 'Enabled'. + * + * @return the state value + */ + public ExpressRouteCircuitPeeringState state() { + return this.state; + } + + /** + * Set the state of peering. Possible values are: 'Disabled' and 'Enabled'. Possible values include: 'Disabled', 'Enabled'. + * + * @param state the state value to set + * @return the Ipv6ExpressRouteCircuitPeeringConfig object itself. + */ + public Ipv6ExpressRouteCircuitPeeringConfig withState(ExpressRouteCircuitPeeringState state) { + this.state = state; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/IssueType.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/IssueType.java new file mode 100644 index 000000000000..b8e445fdc1f5 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/IssueType.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for IssueType. + */ +public final class IssueType extends ExpandableStringEnum { + /** Static value Unknown for IssueType. */ + public static final IssueType UNKNOWN = fromString("Unknown"); + + /** Static value AgentStopped for IssueType. */ + public static final IssueType AGENT_STOPPED = fromString("AgentStopped"); + + /** Static value GuestFirewall for IssueType. */ + public static final IssueType GUEST_FIREWALL = fromString("GuestFirewall"); + + /** Static value DnsResolution for IssueType. */ + public static final IssueType DNS_RESOLUTION = fromString("DnsResolution"); + + /** Static value SocketBind for IssueType. */ + public static final IssueType SOCKET_BIND = fromString("SocketBind"); + + /** Static value NetworkSecurityRule for IssueType. */ + public static final IssueType NETWORK_SECURITY_RULE = fromString("NetworkSecurityRule"); + + /** Static value UserDefinedRoute for IssueType. */ + public static final IssueType USER_DEFINED_ROUTE = fromString("UserDefinedRoute"); + + /** Static value PortThrottled for IssueType. */ + public static final IssueType PORT_THROTTLED = fromString("PortThrottled"); + + /** Static value Platform for IssueType. */ + public static final IssueType PLATFORM = fromString("Platform"); + + /** + * Creates or finds a IssueType from its string representation. + * @param name a name to look for + * @return the corresponding IssueType + */ + @JsonCreator + public static IssueType fromString(String name) { + return fromString(name, IssueType.class); + } + + /** + * @return known IssueType values + */ + public static Collection values() { + return values(IssueType.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/LoadBalancer.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/LoadBalancer.java new file mode 100644 index 000000000000..7047c12b9d2d --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/LoadBalancer.java @@ -0,0 +1,349 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.implementation.BackendAddressPoolInner; +import com.microsoft.azure.management.network.v2018_06_01.implementation.FrontendIPConfigurationInner; +import com.microsoft.azure.management.network.v2018_06_01.implementation.InboundNatRuleInner; +import com.microsoft.azure.management.network.v2018_06_01.implementation.LoadBalancingRuleInner; +import com.microsoft.azure.management.network.v2018_06_01.implementation.ProbeInner; +import com.microsoft.azure.management.network.v2018_06_01.implementation.LoadBalancerInner; + +/** + * Type representing LoadBalancer. + */ +public interface LoadBalancer extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the backendAddressPools value. + */ + List backendAddressPools(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the frontendIPConfigurations value. + */ + List frontendIPConfigurations(); + + /** + * @return the inboundNatPools value. + */ + List inboundNatPools(); + + /** + * @return the inboundNatRules value. + */ + List inboundNatRules(); + + /** + * @return the loadBalancingRules value. + */ + List loadBalancingRules(); + + /** + * @return the outboundNatRules value. + */ + List outboundNatRules(); + + /** + * @return the probes value. + */ + List probes(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * @return the sku value. + */ + LoadBalancerSku sku(); + + /** + * The entirety of the LoadBalancer definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of LoadBalancer definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a LoadBalancer definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the LoadBalancer definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the loadbalancer update allowing to specify BackendAddressPools. + */ + interface WithBackendAddressPools { + /** + * Specifies backendAddressPools. + */ + WithCreate withBackendAddressPools(List backendAddressPools); + } + + /** + * The stage of the loadbalancer update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the loadbalancer update allowing to specify FrontendIPConfigurations. + */ + interface WithFrontendIPConfigurations { + /** + * Specifies frontendIPConfigurations. + */ + WithCreate withFrontendIPConfigurations(List frontendIPConfigurations); + } + + /** + * The stage of the loadbalancer update allowing to specify InboundNatPools. + */ + interface WithInboundNatPools { + /** + * Specifies inboundNatPools. + */ + WithCreate withInboundNatPools(List inboundNatPools); + } + + /** + * The stage of the loadbalancer update allowing to specify InboundNatRules. + */ + interface WithInboundNatRules { + /** + * Specifies inboundNatRules. + */ + WithCreate withInboundNatRules(List inboundNatRules); + } + + /** + * The stage of the loadbalancer update allowing to specify LoadBalancingRules. + */ + interface WithLoadBalancingRules { + /** + * Specifies loadBalancingRules. + */ + WithCreate withLoadBalancingRules(List loadBalancingRules); + } + + /** + * The stage of the loadbalancer update allowing to specify OutboundNatRules. + */ + interface WithOutboundNatRules { + /** + * Specifies outboundNatRules. + */ + WithCreate withOutboundNatRules(List outboundNatRules); + } + + /** + * The stage of the loadbalancer update allowing to specify Probes. + */ + interface WithProbes { + /** + * Specifies probes. + */ + WithCreate withProbes(List probes); + } + + /** + * The stage of the loadbalancer update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the loadbalancer update allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + */ + WithCreate withResourceGuid(String resourceGuid); + } + + /** + * The stage of the loadbalancer update allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + */ + WithCreate withSku(LoadBalancerSku sku); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithBackendAddressPools, DefinitionStages.WithEtag, DefinitionStages.WithFrontendIPConfigurations, DefinitionStages.WithInboundNatPools, DefinitionStages.WithInboundNatRules, DefinitionStages.WithLoadBalancingRules, DefinitionStages.WithOutboundNatRules, DefinitionStages.WithProbes, DefinitionStages.WithProvisioningState, DefinitionStages.WithResourceGuid, DefinitionStages.WithSku { + } + } + /** + * The template for a LoadBalancer update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithBackendAddressPools, UpdateStages.WithEtag, UpdateStages.WithFrontendIPConfigurations, UpdateStages.WithInboundNatPools, UpdateStages.WithInboundNatRules, UpdateStages.WithLoadBalancingRules, UpdateStages.WithOutboundNatRules, UpdateStages.WithProbes, UpdateStages.WithProvisioningState, UpdateStages.WithResourceGuid, UpdateStages.WithSku { + } + + /** + * Grouping of LoadBalancer update stages. + */ + interface UpdateStages { + /** + * The stage of the loadbalancer {0} allowing to specify BackendAddressPools. + */ + interface WithBackendAddressPools { + /** + * Specifies backendAddressPools. + */ + Update withBackendAddressPools(List backendAddressPools); + } + + /** + * The stage of the loadbalancer {0} allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + */ + Update withEtag(String etag); + } + + /** + * The stage of the loadbalancer {0} allowing to specify FrontendIPConfigurations. + */ + interface WithFrontendIPConfigurations { + /** + * Specifies frontendIPConfigurations. + */ + Update withFrontendIPConfigurations(List frontendIPConfigurations); + } + + /** + * The stage of the loadbalancer {0} allowing to specify InboundNatPools. + */ + interface WithInboundNatPools { + /** + * Specifies inboundNatPools. + */ + Update withInboundNatPools(List inboundNatPools); + } + + /** + * The stage of the loadbalancer {0} allowing to specify InboundNatRules. + */ + interface WithInboundNatRules { + /** + * Specifies inboundNatRules. + */ + Update withInboundNatRules(List inboundNatRules); + } + + /** + * The stage of the loadbalancer {0} allowing to specify LoadBalancingRules. + */ + interface WithLoadBalancingRules { + /** + * Specifies loadBalancingRules. + */ + Update withLoadBalancingRules(List loadBalancingRules); + } + + /** + * The stage of the loadbalancer {0} allowing to specify OutboundNatRules. + */ + interface WithOutboundNatRules { + /** + * Specifies outboundNatRules. + */ + Update withOutboundNatRules(List outboundNatRules); + } + + /** + * The stage of the loadbalancer {0} allowing to specify Probes. + */ + interface WithProbes { + /** + * Specifies probes. + */ + Update withProbes(List probes); + } + + /** + * The stage of the loadbalancer {0} allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + */ + Update withProvisioningState(String provisioningState); + } + + /** + * The stage of the loadbalancer {0} allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + */ + Update withResourceGuid(String resourceGuid); + } + + /** + * The stage of the loadbalancer {0} allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + */ + Update withSku(LoadBalancerSku sku); + } + + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/LoadBalancerBackendAddressPools.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/LoadBalancerBackendAddressPools.java new file mode 100644 index 000000000000..2009ca9298cc --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/LoadBalancerBackendAddressPools.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import rx.Observable; +import com.microsoft.azure.management.network.v2018_06_01.implementation.LoadBalancerBackendAddressPoolsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing LoadBalancerBackendAddressPools. + */ +public interface LoadBalancerBackendAddressPools extends HasInner { + /** + * Gets load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String loadBalancerName, String backendAddressPoolName); + + /** + * Gets all the load balancer backed address pools. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String loadBalancerName); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/LoadBalancerFrontendIPConfigurations.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/LoadBalancerFrontendIPConfigurations.java new file mode 100644 index 000000000000..fa10c0473129 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/LoadBalancerFrontendIPConfigurations.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import rx.Observable; +import com.microsoft.azure.management.network.v2018_06_01.implementation.LoadBalancerFrontendIPConfigurationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing LoadBalancerFrontendIPConfigurations. + */ +public interface LoadBalancerFrontendIPConfigurations extends HasInner { + /** + * Gets load balancer frontend IP configuration. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param frontendIPConfigurationName The name of the frontend IP configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String loadBalancerName, String frontendIPConfigurationName); + + /** + * Gets all the load balancer frontend IP configurations. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String loadBalancerName); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/LoadBalancerLoadBalancingRules.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/LoadBalancerLoadBalancingRules.java new file mode 100644 index 000000000000..6377a0b5d8e1 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/LoadBalancerLoadBalancingRules.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import rx.Observable; +import com.microsoft.azure.management.network.v2018_06_01.implementation.LoadBalancerLoadBalancingRulesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing LoadBalancerLoadBalancingRules. + */ +public interface LoadBalancerLoadBalancingRules extends HasInner { + /** + * Gets the specified load balancer load balancing rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param loadBalancingRuleName The name of the load balancing rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String loadBalancerName, String loadBalancingRuleName); + + /** + * Gets all the load balancing rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String loadBalancerName); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/LoadBalancerNetworkInterface.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/LoadBalancerNetworkInterface.java new file mode 100644 index 000000000000..5d61589c5606 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/LoadBalancerNetworkInterface.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.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkInterfaceInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager; +import java.util.List; +import java.util.Map; +import com.microsoft.azure.SubResource; + +/** + * Type representing LoadBalancerNetworkInterface. + */ +public interface LoadBalancerNetworkInterface extends HasInner, HasManager { + /** + * @return the dnsSettings value. + */ + NetworkInterfaceDnsSettings dnsSettings(); + + /** + * @return the enableAcceleratedNetworking value. + */ + Boolean enableAcceleratedNetworking(); + + /** + * @return the enableIPForwarding value. + */ + Boolean enableIPForwarding(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the ipConfigurations value. + */ + List ipConfigurations(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the macAddress value. + */ + String macAddress(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the networkSecurityGroup value. + */ + NetworkSecurityGroup networkSecurityGroup(); + + /** + * @return the primary value. + */ + Boolean primary(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the virtualMachine value. + */ + SubResource virtualMachine(); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/LoadBalancerNetworkInterfaces.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/LoadBalancerNetworkInterfaces.java new file mode 100644 index 000000000000..d805ee16cd2e --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/LoadBalancerNetworkInterfaces.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import rx.Observable; +import com.microsoft.azure.management.network.v2018_06_01.implementation.LoadBalancerNetworkInterfacesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing LoadBalancerNetworkInterfaces. + */ +public interface LoadBalancerNetworkInterfaces extends HasInner { + /** + * Gets associated load balancer network interfaces. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String loadBalancerName); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/LoadBalancerProbes.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/LoadBalancerProbes.java new file mode 100644 index 000000000000..401208218512 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/LoadBalancerProbes.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import rx.Observable; +import com.microsoft.azure.management.network.v2018_06_01.implementation.LoadBalancerProbesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing LoadBalancerProbes. + */ +public interface LoadBalancerProbes extends HasInner { + /** + * Gets load balancer probe. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param probeName The name of the probe. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String loadBalancerName, String probeName); + + /** + * Gets all the load balancer probes. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String loadBalancerName); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/LoadBalancerSku.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/LoadBalancerSku.java new file mode 100644 index 000000000000..cfbdf994435b --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/LoadBalancerSku.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.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * SKU of a load balancer. + */ +public class LoadBalancerSku { + /** + * Name of a load balancer SKU. Possible values include: 'Basic', + * 'Standard'. + */ + @JsonProperty(value = "name") + private LoadBalancerSkuName name; + + /** + * Get name of a load balancer SKU. Possible values include: 'Basic', 'Standard'. + * + * @return the name value + */ + public LoadBalancerSkuName name() { + return this.name; + } + + /** + * Set name of a load balancer SKU. Possible values include: 'Basic', 'Standard'. + * + * @param name the name value to set + * @return the LoadBalancerSku object itself. + */ + public LoadBalancerSku withName(LoadBalancerSkuName name) { + this.name = name; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/LoadBalancerSkuName.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/LoadBalancerSkuName.java new file mode 100644 index 000000000000..0583bfcb145b --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/LoadBalancerSkuName.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for LoadBalancerSkuName. + */ +public final class LoadBalancerSkuName extends ExpandableStringEnum { + /** Static value Basic for LoadBalancerSkuName. */ + public static final LoadBalancerSkuName BASIC = fromString("Basic"); + + /** Static value Standard for LoadBalancerSkuName. */ + public static final LoadBalancerSkuName STANDARD = fromString("Standard"); + + /** + * Creates or finds a LoadBalancerSkuName from its string representation. + * @param name a name to look for + * @return the corresponding LoadBalancerSkuName + */ + @JsonCreator + public static LoadBalancerSkuName fromString(String name) { + return fromString(name, LoadBalancerSkuName.class); + } + + /** + * @return known LoadBalancerSkuName values + */ + public static Collection values() { + return values(LoadBalancerSkuName.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/LoadBalancers.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/LoadBalancers.java new file mode 100644 index 000000000000..6b47718283ec --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/LoadBalancers.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_06_01.implementation.LoadBalancersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing LoadBalancers. + */ +public interface LoadBalancers extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/LoadBalancingRule.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/LoadBalancingRule.java new file mode 100644 index 000000000000..4e00c7b4d6e8 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/LoadBalancingRule.java @@ -0,0 +1,93 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_06_01.implementation.LoadBalancingRuleInner; +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.network.v2018_06_01.implementation.NetworkManager; +import com.microsoft.azure.SubResource; + +/** + * Type representing LoadBalancingRule. + */ +public interface LoadBalancingRule extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the backendAddressPool value. + */ + SubResource backendAddressPool(); + + /** + * @return the backendPort value. + */ + Integer backendPort(); + + /** + * @return the disableOutboundSnat value. + */ + Boolean disableOutboundSnat(); + + /** + * @return the enableFloatingIP value. + */ + Boolean enableFloatingIP(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the frontendIPConfiguration value. + */ + SubResource frontendIPConfiguration(); + + /** + * @return the frontendPort value. + */ + int frontendPort(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the idleTimeoutInMinutes value. + */ + Integer idleTimeoutInMinutes(); + + /** + * @return the loadDistribution value. + */ + LoadDistribution loadDistribution(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the probe value. + */ + SubResource probe(); + + /** + * @return the protocol value. + */ + TransportProtocol protocol(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/LoadDistribution.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/LoadDistribution.java new file mode 100644 index 000000000000..815f458562f2 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/LoadDistribution.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for LoadDistribution. + */ +public final class LoadDistribution extends ExpandableStringEnum { + /** Static value Default for LoadDistribution. */ + public static final LoadDistribution DEFAULT = fromString("Default"); + + /** Static value SourceIP for LoadDistribution. */ + public static final LoadDistribution SOURCE_IP = fromString("SourceIP"); + + /** Static value SourceIPProtocol for LoadDistribution. */ + public static final LoadDistribution SOURCE_IPPROTOCOL = fromString("SourceIPProtocol"); + + /** + * Creates or finds a LoadDistribution from its string representation. + * @param name a name to look for + * @return the corresponding LoadDistribution + */ + @JsonCreator + public static LoadDistribution fromString(String name) { + return fromString(name, LoadDistribution.class); + } + + /** + * @return known LoadDistribution values + */ + public static Collection values() { + return values(LoadDistribution.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/LocalNetworkGateway.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/LocalNetworkGateway.java new file mode 100644 index 000000000000..69df51b86f82 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/LocalNetworkGateway.java @@ -0,0 +1,198 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.LocalNetworkGatewayInner; + +/** + * Type representing LocalNetworkGateway. + */ +public interface LocalNetworkGateway extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the bgpSettings value. + */ + BgpSettings bgpSettings(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the gatewayIpAddress value. + */ + String gatewayIpAddress(); + + /** + * @return the localNetworkAddressSpace value. + */ + AddressSpace localNetworkAddressSpace(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * The entirety of the LocalNetworkGateway definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of LocalNetworkGateway definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a LocalNetworkGateway definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the LocalNetworkGateway definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the localnetworkgateway update allowing to specify BgpSettings. + */ + interface WithBgpSettings { + /** + * Specifies bgpSettings. + */ + WithCreate withBgpSettings(BgpSettings bgpSettings); + } + + /** + * The stage of the localnetworkgateway update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the localnetworkgateway update allowing to specify GatewayIpAddress. + */ + interface WithGatewayIpAddress { + /** + * Specifies gatewayIpAddress. + */ + WithCreate withGatewayIpAddress(String gatewayIpAddress); + } + + /** + * The stage of the localnetworkgateway update allowing to specify LocalNetworkAddressSpace. + */ + interface WithLocalNetworkAddressSpace { + /** + * Specifies localNetworkAddressSpace. + */ + WithCreate withLocalNetworkAddressSpace(AddressSpace localNetworkAddressSpace); + } + + /** + * The stage of the localnetworkgateway update allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + */ + WithCreate withResourceGuid(String resourceGuid); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithBgpSettings, DefinitionStages.WithEtag, DefinitionStages.WithGatewayIpAddress, DefinitionStages.WithLocalNetworkAddressSpace, DefinitionStages.WithResourceGuid { + } + } + /** + * The template for a LocalNetworkGateway update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithBgpSettings, UpdateStages.WithEtag, UpdateStages.WithGatewayIpAddress, UpdateStages.WithLocalNetworkAddressSpace, UpdateStages.WithResourceGuid { + } + + /** + * Grouping of LocalNetworkGateway update stages. + */ + interface UpdateStages { + /** + * The stage of the localnetworkgateway {0} allowing to specify BgpSettings. + */ + interface WithBgpSettings { + /** + * Specifies bgpSettings. + */ + Update withBgpSettings(BgpSettings bgpSettings); + } + + /** + * The stage of the localnetworkgateway {0} allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + */ + Update withEtag(String etag); + } + + /** + * The stage of the localnetworkgateway {0} allowing to specify GatewayIpAddress. + */ + interface WithGatewayIpAddress { + /** + * Specifies gatewayIpAddress. + */ + Update withGatewayIpAddress(String gatewayIpAddress); + } + + /** + * The stage of the localnetworkgateway {0} allowing to specify LocalNetworkAddressSpace. + */ + interface WithLocalNetworkAddressSpace { + /** + * Specifies localNetworkAddressSpace. + */ + Update withLocalNetworkAddressSpace(AddressSpace localNetworkAddressSpace); + } + + /** + * The stage of the localnetworkgateway {0} allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + */ + Update withResourceGuid(String resourceGuid); + } + + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/LocalNetworkGateways.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/LocalNetworkGateways.java new file mode 100644 index 000000000000..5274c5737fc0 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/LocalNetworkGateways.java @@ -0,0 +1,24 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.management.network.v2018_06_01.implementation.LocalNetworkGatewaysInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing LocalNetworkGateways. + */ +public interface LocalNetworkGateways extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, HasInner { +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/LogSpecification.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/LogSpecification.java new file mode 100644 index 000000000000..e598d0cf0102 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/LogSpecification.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Description of logging specification. + */ +public class LogSpecification { + /** + * The name of the specification. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The display name of the specification. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * Duration of the blob. + */ + @JsonProperty(value = "blobDuration") + private String blobDuration; + + /** + * Get the name of the specification. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the specification. + * + * @param name the name value to set + * @return the LogSpecification object itself. + */ + public LogSpecification withName(String name) { + this.name = name; + return this; + } + + /** + * Get the display name of the specification. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the display name of the specification. + * + * @param displayName the displayName value to set + * @return the LogSpecification object itself. + */ + public LogSpecification withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get duration of the blob. + * + * @return the blobDuration value + */ + public String blobDuration() { + return this.blobDuration; + } + + /** + * Set duration of the blob. + * + * @param blobDuration the blobDuration value to set + * @return the LogSpecification object itself. + */ + public LogSpecification withBlobDuration(String blobDuration) { + this.blobDuration = blobDuration; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/MetricSpecification.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/MetricSpecification.java new file mode 100644 index 000000000000..3f9e8d933412 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/MetricSpecification.java @@ -0,0 +1,382 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Description of metrics specification. + */ +public class MetricSpecification { + /** + * The name of the metric. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The display name of the metric. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * The description of the metric. + */ + @JsonProperty(value = "displayDescription") + private String displayDescription; + + /** + * Units the metric to be displayed in. + */ + @JsonProperty(value = "unit") + private String unit; + + /** + * The aggregation type. + */ + @JsonProperty(value = "aggregationType") + private String aggregationType; + + /** + * List of availability. + */ + @JsonProperty(value = "availabilities") + private List availabilities; + + /** + * Whether regional MDM account enabled. + */ + @JsonProperty(value = "enableRegionalMdmAccount") + private Boolean enableRegionalMdmAccount; + + /** + * Whether gaps would be filled with zeros. + */ + @JsonProperty(value = "fillGapWithZero") + private Boolean fillGapWithZero; + + /** + * Pattern for the filter of the metric. + */ + @JsonProperty(value = "metricFilterPattern") + private String metricFilterPattern; + + /** + * List of dimensions. + */ + @JsonProperty(value = "dimensions") + private List dimensions; + + /** + * Whether the metric is internal. + */ + @JsonProperty(value = "isInternal") + private Boolean isInternal; + + /** + * The source MDM account. + */ + @JsonProperty(value = "sourceMdmAccount") + private String sourceMdmAccount; + + /** + * The source MDM namespace. + */ + @JsonProperty(value = "sourceMdmNamespace") + private String sourceMdmNamespace; + + /** + * The resource Id dimension name override. + */ + @JsonProperty(value = "resourceIdDimensionNameOverride") + private String resourceIdDimensionNameOverride; + + /** + * Get the name of the metric. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the metric. + * + * @param name the name value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withName(String name) { + this.name = name; + return this; + } + + /** + * Get the display name of the metric. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the display name of the metric. + * + * @param displayName the displayName value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the description of the metric. + * + * @return the displayDescription value + */ + public String displayDescription() { + return this.displayDescription; + } + + /** + * Set the description of the metric. + * + * @param displayDescription the displayDescription value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDisplayDescription(String displayDescription) { + this.displayDescription = displayDescription; + return this; + } + + /** + * Get units the metric to be displayed in. + * + * @return the unit value + */ + public String unit() { + return this.unit; + } + + /** + * Set units the metric to be displayed in. + * + * @param unit the unit value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withUnit(String unit) { + this.unit = unit; + return this; + } + + /** + * Get the aggregation type. + * + * @return the aggregationType value + */ + public String aggregationType() { + return this.aggregationType; + } + + /** + * Set the aggregation type. + * + * @param aggregationType the aggregationType value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withAggregationType(String aggregationType) { + this.aggregationType = aggregationType; + return this; + } + + /** + * Get list of availability. + * + * @return the availabilities value + */ + public List availabilities() { + return this.availabilities; + } + + /** + * Set list of availability. + * + * @param availabilities the availabilities value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withAvailabilities(List availabilities) { + this.availabilities = availabilities; + return this; + } + + /** + * Get whether regional MDM account enabled. + * + * @return the enableRegionalMdmAccount value + */ + public Boolean enableRegionalMdmAccount() { + return this.enableRegionalMdmAccount; + } + + /** + * Set whether regional MDM account enabled. + * + * @param enableRegionalMdmAccount the enableRegionalMdmAccount value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withEnableRegionalMdmAccount(Boolean enableRegionalMdmAccount) { + this.enableRegionalMdmAccount = enableRegionalMdmAccount; + return this; + } + + /** + * Get whether gaps would be filled with zeros. + * + * @return the fillGapWithZero value + */ + public Boolean fillGapWithZero() { + return this.fillGapWithZero; + } + + /** + * Set whether gaps would be filled with zeros. + * + * @param fillGapWithZero the fillGapWithZero value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withFillGapWithZero(Boolean fillGapWithZero) { + this.fillGapWithZero = fillGapWithZero; + return this; + } + + /** + * Get pattern for the filter of the metric. + * + * @return the metricFilterPattern value + */ + public String metricFilterPattern() { + return this.metricFilterPattern; + } + + /** + * Set pattern for the filter of the metric. + * + * @param metricFilterPattern the metricFilterPattern value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withMetricFilterPattern(String metricFilterPattern) { + this.metricFilterPattern = metricFilterPattern; + return this; + } + + /** + * Get list of dimensions. + * + * @return the dimensions value + */ + public List dimensions() { + return this.dimensions; + } + + /** + * Set list of dimensions. + * + * @param dimensions the dimensions value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDimensions(List dimensions) { + this.dimensions = dimensions; + return this; + } + + /** + * Get whether the metric is internal. + * + * @return the isInternal value + */ + public Boolean isInternal() { + return this.isInternal; + } + + /** + * Set whether the metric is internal. + * + * @param isInternal the isInternal value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withIsInternal(Boolean isInternal) { + this.isInternal = isInternal; + return this; + } + + /** + * Get the source MDM account. + * + * @return the sourceMdmAccount value + */ + public String sourceMdmAccount() { + return this.sourceMdmAccount; + } + + /** + * Set the source MDM account. + * + * @param sourceMdmAccount the sourceMdmAccount value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withSourceMdmAccount(String sourceMdmAccount) { + this.sourceMdmAccount = sourceMdmAccount; + return this; + } + + /** + * Get the source MDM namespace. + * + * @return the sourceMdmNamespace value + */ + public String sourceMdmNamespace() { + return this.sourceMdmNamespace; + } + + /** + * Set the source MDM namespace. + * + * @param sourceMdmNamespace the sourceMdmNamespace value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withSourceMdmNamespace(String sourceMdmNamespace) { + this.sourceMdmNamespace = sourceMdmNamespace; + return this; + } + + /** + * Get the resource Id dimension name override. + * + * @return the resourceIdDimensionNameOverride value + */ + public String resourceIdDimensionNameOverride() { + return this.resourceIdDimensionNameOverride; + } + + /** + * Set the resource Id dimension name override. + * + * @param resourceIdDimensionNameOverride the resourceIdDimensionNameOverride value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withResourceIdDimensionNameOverride(String resourceIdDimensionNameOverride) { + this.resourceIdDimensionNameOverride = resourceIdDimensionNameOverride; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkInterface.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkInterface.java new file mode 100644 index 000000000000..dcc3e8e1ede1 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkInterface.java @@ -0,0 +1,347 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager; +import com.microsoft.azure.SubResource; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkInterfaceIPConfigurationInner; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkSecurityGroupInner; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkInterfaceInner; + +/** + * Type representing NetworkInterface. + */ +public interface NetworkInterface extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the dnsSettings value. + */ + NetworkInterfaceDnsSettings dnsSettings(); + + /** + * @return the enableAcceleratedNetworking value. + */ + Boolean enableAcceleratedNetworking(); + + /** + * @return the enableIPForwarding value. + */ + Boolean enableIPForwarding(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the ipConfigurations value. + */ + List ipConfigurations(); + + /** + * @return the macAddress value. + */ + String macAddress(); + + /** + * @return the networkSecurityGroup value. + */ + NetworkSecurityGroup networkSecurityGroup(); + + /** + * @return the primary value. + */ + Boolean primary(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * @return the virtualMachine value. + */ + SubResource virtualMachine(); + + /** + * The entirety of the NetworkInterface definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of NetworkInterface definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a NetworkInterface definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the NetworkInterface definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the networkinterface update allowing to specify DnsSettings. + */ + interface WithDnsSettings { + /** + * Specifies dnsSettings. + */ + WithCreate withDnsSettings(NetworkInterfaceDnsSettings dnsSettings); + } + + /** + * The stage of the networkinterface update allowing to specify EnableAcceleratedNetworking. + */ + interface WithEnableAcceleratedNetworking { + /** + * Specifies enableAcceleratedNetworking. + */ + WithCreate withEnableAcceleratedNetworking(Boolean enableAcceleratedNetworking); + } + + /** + * The stage of the networkinterface update allowing to specify EnableIPForwarding. + */ + interface WithEnableIPForwarding { + /** + * Specifies enableIPForwarding. + */ + WithCreate withEnableIPForwarding(Boolean enableIPForwarding); + } + + /** + * The stage of the networkinterface update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the networkinterface update allowing to specify IpConfigurations. + */ + interface WithIpConfigurations { + /** + * Specifies ipConfigurations. + */ + WithCreate withIpConfigurations(List ipConfigurations); + } + + /** + * The stage of the networkinterface update allowing to specify MacAddress. + */ + interface WithMacAddress { + /** + * Specifies macAddress. + */ + WithCreate withMacAddress(String macAddress); + } + + /** + * The stage of the networkinterface update allowing to specify NetworkSecurityGroup. + */ + interface WithNetworkSecurityGroup { + /** + * Specifies networkSecurityGroup. + */ + WithCreate withNetworkSecurityGroup(NetworkSecurityGroupInner networkSecurityGroup); + } + + /** + * The stage of the networkinterface update allowing to specify Primary. + */ + interface WithPrimary { + /** + * Specifies primary. + */ + WithCreate withPrimary(Boolean primary); + } + + /** + * The stage of the networkinterface update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the networkinterface update allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + */ + WithCreate withResourceGuid(String resourceGuid); + } + + /** + * The stage of the networkinterface update allowing to specify VirtualMachine. + */ + interface WithVirtualMachine { + /** + * Specifies virtualMachine. + */ + WithCreate withVirtualMachine(SubResource virtualMachine); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithDnsSettings, DefinitionStages.WithEnableAcceleratedNetworking, DefinitionStages.WithEnableIPForwarding, DefinitionStages.WithEtag, DefinitionStages.WithIpConfigurations, DefinitionStages.WithMacAddress, DefinitionStages.WithNetworkSecurityGroup, DefinitionStages.WithPrimary, DefinitionStages.WithProvisioningState, DefinitionStages.WithResourceGuid, DefinitionStages.WithVirtualMachine { + } + } + /** + * The template for a NetworkInterface update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithDnsSettings, UpdateStages.WithEnableAcceleratedNetworking, UpdateStages.WithEnableIPForwarding, UpdateStages.WithEtag, UpdateStages.WithIpConfigurations, UpdateStages.WithMacAddress, UpdateStages.WithNetworkSecurityGroup, UpdateStages.WithPrimary, UpdateStages.WithProvisioningState, UpdateStages.WithResourceGuid, UpdateStages.WithVirtualMachine { + } + + /** + * Grouping of NetworkInterface update stages. + */ + interface UpdateStages { + /** + * The stage of the networkinterface {0} allowing to specify DnsSettings. + */ + interface WithDnsSettings { + /** + * Specifies dnsSettings. + */ + Update withDnsSettings(NetworkInterfaceDnsSettings dnsSettings); + } + + /** + * The stage of the networkinterface {0} allowing to specify EnableAcceleratedNetworking. + */ + interface WithEnableAcceleratedNetworking { + /** + * Specifies enableAcceleratedNetworking. + */ + Update withEnableAcceleratedNetworking(Boolean enableAcceleratedNetworking); + } + + /** + * The stage of the networkinterface {0} allowing to specify EnableIPForwarding. + */ + interface WithEnableIPForwarding { + /** + * Specifies enableIPForwarding. + */ + Update withEnableIPForwarding(Boolean enableIPForwarding); + } + + /** + * The stage of the networkinterface {0} allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + */ + Update withEtag(String etag); + } + + /** + * The stage of the networkinterface {0} allowing to specify IpConfigurations. + */ + interface WithIpConfigurations { + /** + * Specifies ipConfigurations. + */ + Update withIpConfigurations(List ipConfigurations); + } + + /** + * The stage of the networkinterface {0} allowing to specify MacAddress. + */ + interface WithMacAddress { + /** + * Specifies macAddress. + */ + Update withMacAddress(String macAddress); + } + + /** + * The stage of the networkinterface {0} allowing to specify NetworkSecurityGroup. + */ + interface WithNetworkSecurityGroup { + /** + * Specifies networkSecurityGroup. + */ + Update withNetworkSecurityGroup(NetworkSecurityGroupInner networkSecurityGroup); + } + + /** + * The stage of the networkinterface {0} allowing to specify Primary. + */ + interface WithPrimary { + /** + * Specifies primary. + */ + Update withPrimary(Boolean primary); + } + + /** + * The stage of the networkinterface {0} allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + */ + Update withProvisioningState(String provisioningState); + } + + /** + * The stage of the networkinterface {0} allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + */ + Update withResourceGuid(String resourceGuid); + } + + /** + * The stage of the networkinterface {0} allowing to specify VirtualMachine. + */ + interface WithVirtualMachine { + /** + * Specifies virtualMachine. + */ + Update withVirtualMachine(SubResource virtualMachine); + } + + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkInterfaceAssociation.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkInterfaceAssociation.java new file mode 100644 index 000000000000..4cbf279c2063 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkInterfaceAssociation.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.network.v2018_06_01; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.implementation.SecurityRuleInner; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Network interface and its custom security rules. + */ +public class NetworkInterfaceAssociation { + /** + * Network interface ID. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Collection of custom security rules. + */ + @JsonProperty(value = "securityRules") + private List securityRules; + + /** + * Get network interface ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get collection of custom security rules. + * + * @return the securityRules value + */ + public List securityRules() { + return this.securityRules; + } + + /** + * Set collection of custom security rules. + * + * @param securityRules the securityRules value to set + * @return the NetworkInterfaceAssociation object itself. + */ + public NetworkInterfaceAssociation withSecurityRules(List securityRules) { + this.securityRules = securityRules; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkInterfaceDnsSettings.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkInterfaceDnsSettings.java new file mode 100644 index 000000000000..ad3a1ed6e263 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkInterfaceDnsSettings.java @@ -0,0 +1,158 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * DNS settings of a network interface. + */ +public class NetworkInterfaceDnsSettings { + /** + * List of DNS servers IP addresses. Use 'AzureProvidedDNS' to switch to + * azure provided DNS resolution. 'AzureProvidedDNS' value cannot be + * combined with other IPs, it must be the only value in dnsServers + * collection. + */ + @JsonProperty(value = "dnsServers") + private List dnsServers; + + /** + * If the VM that uses this NIC is part of an Availability Set, then this + * list will have the union of all DNS servers from all NICs that are part + * of the Availability Set. This property is what is configured on each of + * those VMs. + */ + @JsonProperty(value = "appliedDnsServers") + private List appliedDnsServers; + + /** + * Relative DNS name for this NIC used for internal communications between + * VMs in the same virtual network. + */ + @JsonProperty(value = "internalDnsNameLabel") + private String internalDnsNameLabel; + + /** + * Fully qualified DNS name supporting internal communications between VMs + * in the same virtual network. + */ + @JsonProperty(value = "internalFqdn") + private String internalFqdn; + + /** + * Even if internalDnsNameLabel is not specified, a DNS entry is created + * for the primary NIC of the VM. This DNS name can be constructed by + * concatenating the VM name with the value of internalDomainNameSuffix. + */ + @JsonProperty(value = "internalDomainNameSuffix") + private String internalDomainNameSuffix; + + /** + * Get list of DNS servers IP addresses. Use 'AzureProvidedDNS' to switch to azure provided DNS resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it must be the only value in dnsServers collection. + * + * @return the dnsServers value + */ + public List dnsServers() { + return this.dnsServers; + } + + /** + * Set list of DNS servers IP addresses. Use 'AzureProvidedDNS' to switch to azure provided DNS resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it must be the only value in dnsServers collection. + * + * @param dnsServers the dnsServers value to set + * @return the NetworkInterfaceDnsSettings object itself. + */ + public NetworkInterfaceDnsSettings withDnsServers(List dnsServers) { + this.dnsServers = dnsServers; + return this; + } + + /** + * Get if the VM that uses this NIC is part of an Availability Set, then this list will have the union of all DNS servers from all NICs that are part of the Availability Set. This property is what is configured on each of those VMs. + * + * @return the appliedDnsServers value + */ + public List appliedDnsServers() { + return this.appliedDnsServers; + } + + /** + * Set if the VM that uses this NIC is part of an Availability Set, then this list will have the union of all DNS servers from all NICs that are part of the Availability Set. This property is what is configured on each of those VMs. + * + * @param appliedDnsServers the appliedDnsServers value to set + * @return the NetworkInterfaceDnsSettings object itself. + */ + public NetworkInterfaceDnsSettings withAppliedDnsServers(List appliedDnsServers) { + this.appliedDnsServers = appliedDnsServers; + return this; + } + + /** + * Get relative DNS name for this NIC used for internal communications between VMs in the same virtual network. + * + * @return the internalDnsNameLabel value + */ + public String internalDnsNameLabel() { + return this.internalDnsNameLabel; + } + + /** + * Set relative DNS name for this NIC used for internal communications between VMs in the same virtual network. + * + * @param internalDnsNameLabel the internalDnsNameLabel value to set + * @return the NetworkInterfaceDnsSettings object itself. + */ + public NetworkInterfaceDnsSettings withInternalDnsNameLabel(String internalDnsNameLabel) { + this.internalDnsNameLabel = internalDnsNameLabel; + return this; + } + + /** + * Get fully qualified DNS name supporting internal communications between VMs in the same virtual network. + * + * @return the internalFqdn value + */ + public String internalFqdn() { + return this.internalFqdn; + } + + /** + * Set fully qualified DNS name supporting internal communications between VMs in the same virtual network. + * + * @param internalFqdn the internalFqdn value to set + * @return the NetworkInterfaceDnsSettings object itself. + */ + public NetworkInterfaceDnsSettings withInternalFqdn(String internalFqdn) { + this.internalFqdn = internalFqdn; + return this; + } + + /** + * Get even if internalDnsNameLabel is not specified, a DNS entry is created for the primary NIC of the VM. This DNS name can be constructed by concatenating the VM name with the value of internalDomainNameSuffix. + * + * @return the internalDomainNameSuffix value + */ + public String internalDomainNameSuffix() { + return this.internalDomainNameSuffix; + } + + /** + * Set even if internalDnsNameLabel is not specified, a DNS entry is created for the primary NIC of the VM. This DNS name can be constructed by concatenating the VM name with the value of internalDomainNameSuffix. + * + * @param internalDomainNameSuffix the internalDomainNameSuffix value to set + * @return the NetworkInterfaceDnsSettings object itself. + */ + public NetworkInterfaceDnsSettings withInternalDomainNameSuffix(String internalDomainNameSuffix) { + this.internalDomainNameSuffix = internalDomainNameSuffix; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkInterfaceIPConfigurations.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkInterfaceIPConfigurations.java new file mode 100644 index 000000000000..aedb5f671eab --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkInterfaceIPConfigurations.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import rx.Observable; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkInterfaceIPConfigurationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing NetworkInterfaceIPConfigurations. + */ +public interface NetworkInterfaceIPConfigurations extends HasInner { + /** + * Gets the specified network interface ip configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String networkInterfaceName, String ipConfigurationName); + + /** + * Get all ip configurations in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String networkInterfaceName); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkInterfaceLoadBalancer.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkInterfaceLoadBalancer.java new file mode 100644 index 000000000000..82191a54c580 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkInterfaceLoadBalancer.java @@ -0,0 +1,102 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_06_01.implementation.LoadBalancerInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager; +import java.util.List; +import java.util.Map; + +/** + * Type representing NetworkInterfaceLoadBalancer. + */ +public interface NetworkInterfaceLoadBalancer extends HasInner, HasManager { + /** + * @return the backendAddressPools value. + */ + List backendAddressPools(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the frontendIPConfigurations value. + */ + List frontendIPConfigurations(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the inboundNatPools value. + */ + List inboundNatPools(); + + /** + * @return the inboundNatRules value. + */ + List inboundNatRules(); + + /** + * @return the loadBalancingRules value. + */ + List loadBalancingRules(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the outboundNatRules value. + */ + List outboundNatRules(); + + /** + * @return the probes value. + */ + List probes(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * @return the sku value. + */ + LoadBalancerSku sku(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkInterfaceLoadBalancers.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkInterfaceLoadBalancers.java new file mode 100644 index 000000000000..a28a37b9bb5c --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkInterfaceLoadBalancers.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import rx.Observable; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkInterfaceLoadBalancersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing NetworkInterfaceLoadBalancers. + */ +public interface NetworkInterfaceLoadBalancers extends HasInner { + /** + * List all load balancers in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String networkInterfaceName); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkInterfaceNetworkInterfaceIPConfiguration.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkInterfaceNetworkInterfaceIPConfiguration.java new file mode 100644 index 000000000000..4c8820db3944 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkInterfaceNetworkInterfaceIPConfiguration.java @@ -0,0 +1,93 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkInterfaceIPConfigurationInner; +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.network.v2018_06_01.implementation.NetworkManager; +import java.util.List; + +/** + * Type representing NetworkInterfaceNetworkInterfaceIPConfiguration. + */ +public interface NetworkInterfaceNetworkInterfaceIPConfiguration extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the applicationGatewayBackendAddressPools value. + */ + List applicationGatewayBackendAddressPools(); + + /** + * @return the applicationSecurityGroups value. + */ + List applicationSecurityGroups(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the loadBalancerBackendAddressPools value. + */ + List loadBalancerBackendAddressPools(); + + /** + * @return the loadBalancerInboundNatRules value. + */ + List loadBalancerInboundNatRules(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the primary value. + */ + Boolean primary(); + + /** + * @return the privateIPAddress value. + */ + String privateIPAddress(); + + /** + * @return the privateIPAddressVersion value. + */ + IPVersion privateIPAddressVersion(); + + /** + * @return the privateIPAllocationMethod value. + */ + IPAllocationMethod privateIPAllocationMethod(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the publicIPAddress value. + */ + PublicIPAddress publicIPAddress(); + + /** + * @return the subnet value. + */ + Subnet subnet(); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkInterfaces.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkInterfaces.java new file mode 100644 index 000000000000..db3b089888b6 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkInterfaces.java @@ -0,0 +1,142 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import rx.Observable; +import com.microsoft.azure.management.network.v2018_06_01.NetworkInterface; +import rx.Completable; +import com.microsoft.azure.management.network.v2018_06_01.VirtualMachineScaleSetNetworkInterfaceIPConfiguration; + +/** + * Type representing NetworkInterfaces. + */ +public interface NetworkInterfaces { + /** + * Begins definition for a new NetworkInterface resource. + * @param name resource name. + * @return the first stage of the new NetworkInterface definition. + */ + NetworkInterface.DefinitionStages.Blank defineNetworkInterface(String name); + + /** + * Gets information about the specified network interface. + * + * @param resourceGroupName resource group name + * @param name resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getByResourceGroupAsync(String resourceGroupName, String name); + + /** + * Gets all network interfaces in a resource group. + * + * @param resourceGroupName resource group name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByResourceGroupAsync(String resourceGroupName); + + /** + * Gets all network interfaces in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + + /** + * Deletes the specified network interface. + * + * @param resourceGroupName resource group name + * @param name resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String name); + + /** + * Gets all route tables applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getEffectiveRouteTableAsync(String resourceGroupName, String networkInterfaceName); + + /** + * Gets all network security groups applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listEffectiveNetworkSecurityGroupsAsync(String resourceGroupName, String networkInterfaceName); + + /** + * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listVirtualMachineScaleSetVMNetworkInterfacesAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex); + + /** + * Gets all network interfaces in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listVirtualMachineScaleSetNetworkInterfacesAsync(final String resourceGroupName, final String virtualMachineScaleSetName); + + /** + * Get the specified network interface in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getVirtualMachineScaleSetNetworkInterfaceAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName); + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getVirtualMachineScaleSetIpConfigurationAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName); + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listVirtualMachineScaleSetIpConfigurationsAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkOperationStatus.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkOperationStatus.java new file mode 100644 index 000000000000..b30997fb4904 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkOperationStatus.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for NetworkOperationStatus. + */ +public final class NetworkOperationStatus extends ExpandableStringEnum { + /** Static value InProgress for NetworkOperationStatus. */ + public static final NetworkOperationStatus IN_PROGRESS = fromString("InProgress"); + + /** Static value Succeeded for NetworkOperationStatus. */ + public static final NetworkOperationStatus SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for NetworkOperationStatus. */ + public static final NetworkOperationStatus FAILED = fromString("Failed"); + + /** + * Creates or finds a NetworkOperationStatus from its string representation. + * @param name a name to look for + * @return the corresponding NetworkOperationStatus + */ + @JsonCreator + public static NetworkOperationStatus fromString(String name) { + return fromString(name, NetworkOperationStatus.class); + } + + /** + * @return known NetworkOperationStatus values + */ + public static Collection values() { + return values(NetworkOperationStatus.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkSecurityGroup.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkSecurityGroup.java new file mode 100644 index 000000000000..45eacb27d1de --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkSecurityGroup.java @@ -0,0 +1,205 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.implementation.SecurityRuleInner; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkSecurityGroupInner; + +/** + * Type representing NetworkSecurityGroup. + */ +public interface NetworkSecurityGroup extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the defaultSecurityRules value. + */ + List defaultSecurityRules(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the networkInterfaces value. + */ + List networkInterfaces(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * @return the securityRules value. + */ + List securityRules(); + + /** + * @return the subnets value. + */ + List subnets(); + + /** + * The entirety of the NetworkSecurityGroup definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of NetworkSecurityGroup definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a NetworkSecurityGroup definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the NetworkSecurityGroup definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the networksecuritygroup update allowing to specify DefaultSecurityRules. + */ + interface WithDefaultSecurityRules { + /** + * Specifies defaultSecurityRules. + */ + WithCreate withDefaultSecurityRules(List defaultSecurityRules); + } + + /** + * The stage of the networksecuritygroup update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the networksecuritygroup update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the networksecuritygroup update allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + */ + WithCreate withResourceGuid(String resourceGuid); + } + + /** + * The stage of the networksecuritygroup update allowing to specify SecurityRules. + */ + interface WithSecurityRules { + /** + * Specifies securityRules. + */ + WithCreate withSecurityRules(List securityRules); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithDefaultSecurityRules, DefinitionStages.WithEtag, DefinitionStages.WithProvisioningState, DefinitionStages.WithResourceGuid, DefinitionStages.WithSecurityRules { + } + } + /** + * The template for a NetworkSecurityGroup update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithDefaultSecurityRules, UpdateStages.WithEtag, UpdateStages.WithProvisioningState, UpdateStages.WithResourceGuid, UpdateStages.WithSecurityRules { + } + + /** + * Grouping of NetworkSecurityGroup update stages. + */ + interface UpdateStages { + /** + * The stage of the networksecuritygroup {0} allowing to specify DefaultSecurityRules. + */ + interface WithDefaultSecurityRules { + /** + * Specifies defaultSecurityRules. + */ + Update withDefaultSecurityRules(List defaultSecurityRules); + } + + /** + * The stage of the networksecuritygroup {0} allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + */ + Update withEtag(String etag); + } + + /** + * The stage of the networksecuritygroup {0} allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + */ + Update withProvisioningState(String provisioningState); + } + + /** + * The stage of the networksecuritygroup {0} allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + */ + Update withResourceGuid(String resourceGuid); + } + + /** + * The stage of the networksecuritygroup {0} allowing to specify SecurityRules. + */ + interface WithSecurityRules { + /** + * Specifies securityRules. + */ + Update withSecurityRules(List securityRules); + } + + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkSecurityGroupSecurityRule.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkSecurityGroupSecurityRule.java new file mode 100644 index 000000000000..b0b19ec08b99 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkSecurityGroupSecurityRule.java @@ -0,0 +1,517 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_06_01.implementation.SecurityRuleInner; +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.network.v2018_06_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.implementation.ApplicationSecurityGroupInner; + +/** + * Type representing NetworkSecurityGroupSecurityRule. + */ +public interface NetworkSecurityGroupSecurityRule extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the access value. + */ + SecurityRuleAccess access(); + + /** + * @return the description value. + */ + String description(); + + /** + * @return the destinationAddressPrefix value. + */ + String destinationAddressPrefix(); + + /** + * @return the destinationAddressPrefixes value. + */ + List destinationAddressPrefixes(); + + /** + * @return the destinationApplicationSecurityGroups value. + */ + List destinationApplicationSecurityGroups(); + + /** + * @return the destinationPortRange value. + */ + String destinationPortRange(); + + /** + * @return the destinationPortRanges value. + */ + List destinationPortRanges(); + + /** + * @return the direction value. + */ + SecurityRuleDirection direction(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the priority value. + */ + Integer priority(); + + /** + * @return the protocol value. + */ + SecurityRuleProtocol protocol(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the sourceAddressPrefix value. + */ + String sourceAddressPrefix(); + + /** + * @return the sourceAddressPrefixes value. + */ + List sourceAddressPrefixes(); + + /** + * @return the sourceApplicationSecurityGroups value. + */ + List sourceApplicationSecurityGroups(); + + /** + * @return the sourcePortRange value. + */ + String sourcePortRange(); + + /** + * @return the sourcePortRanges value. + */ + List sourcePortRanges(); + + /** + * The entirety of the NetworkSecurityGroupSecurityRule definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithNetworkSecurityGroup, DefinitionStages.WithAccess, DefinitionStages.WithDirection, DefinitionStages.WithProtocol, DefinitionStages.WithCreate { + } + + /** + * Grouping of NetworkSecurityGroupSecurityRule definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a NetworkSecurityGroupSecurityRule definition. + */ + interface Blank extends WithNetworkSecurityGroup { + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify NetworkSecurityGroup. + */ + interface WithNetworkSecurityGroup { + /** + * Specifies resourceGroupName, networkSecurityGroupName. + */ + WithAccess withExistingNetworkSecurityGroup(String resourceGroupName, String networkSecurityGroupName); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify Access. + */ + interface WithAccess { + /** + * Specifies access. + */ + WithDirection withAccess(SecurityRuleAccess access); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify Direction. + */ + interface WithDirection { + /** + * Specifies direction. + */ + WithProtocol withDirection(SecurityRuleDirection direction); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify Protocol. + */ + interface WithProtocol { + /** + * Specifies protocol. + */ + WithCreate withProtocol(SecurityRuleProtocol protocol); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + */ + WithCreate withDescription(String description); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify DestinationAddressPrefix. + */ + interface WithDestinationAddressPrefix { + /** + * Specifies destinationAddressPrefix. + */ + WithCreate withDestinationAddressPrefix(String destinationAddressPrefix); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify DestinationAddressPrefixes. + */ + interface WithDestinationAddressPrefixes { + /** + * Specifies destinationAddressPrefixes. + */ + WithCreate withDestinationAddressPrefixes(List destinationAddressPrefixes); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify DestinationApplicationSecurityGroups. + */ + interface WithDestinationApplicationSecurityGroups { + /** + * Specifies destinationApplicationSecurityGroups. + */ + WithCreate withDestinationApplicationSecurityGroups(List destinationApplicationSecurityGroups); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify DestinationPortRange. + */ + interface WithDestinationPortRange { + /** + * Specifies destinationPortRange. + */ + WithCreate withDestinationPortRange(String destinationPortRange); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify DestinationPortRanges. + */ + interface WithDestinationPortRanges { + /** + * Specifies destinationPortRanges. + */ + WithCreate withDestinationPortRanges(List destinationPortRanges); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + */ + WithCreate withId(String id); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + */ + WithCreate withName(String name); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify Priority. + */ + interface WithPriority { + /** + * Specifies priority. + */ + WithCreate withPriority(Integer priority); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify SourceAddressPrefix. + */ + interface WithSourceAddressPrefix { + /** + * Specifies sourceAddressPrefix. + */ + WithCreate withSourceAddressPrefix(String sourceAddressPrefix); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify SourceAddressPrefixes. + */ + interface WithSourceAddressPrefixes { + /** + * Specifies sourceAddressPrefixes. + */ + WithCreate withSourceAddressPrefixes(List sourceAddressPrefixes); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify SourceApplicationSecurityGroups. + */ + interface WithSourceApplicationSecurityGroups { + /** + * Specifies sourceApplicationSecurityGroups. + */ + WithCreate withSourceApplicationSecurityGroups(List sourceApplicationSecurityGroups); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify SourcePortRange. + */ + interface WithSourcePortRange { + /** + * Specifies sourcePortRange. + */ + WithCreate withSourcePortRange(String sourcePortRange); + } + + /** + * The stage of the networksecuritygroupsecurityrule definition allowing to specify SourcePortRanges. + */ + interface WithSourcePortRanges { + /** + * Specifies sourcePortRanges. + */ + WithCreate withSourcePortRanges(List sourcePortRanges); + } + + /** + * 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.WithDescription, DefinitionStages.WithDestinationAddressPrefix, DefinitionStages.WithDestinationAddressPrefixes, DefinitionStages.WithDestinationApplicationSecurityGroups, DefinitionStages.WithDestinationPortRange, DefinitionStages.WithDestinationPortRanges, DefinitionStages.WithEtag, DefinitionStages.WithId, DefinitionStages.WithName, DefinitionStages.WithPriority, DefinitionStages.WithProvisioningState, DefinitionStages.WithSourceAddressPrefix, DefinitionStages.WithSourceAddressPrefixes, DefinitionStages.WithSourceApplicationSecurityGroups, DefinitionStages.WithSourcePortRange, DefinitionStages.WithSourcePortRanges { + } + } + /** + * The template for a NetworkSecurityGroupSecurityRule update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithDescription, UpdateStages.WithDestinationAddressPrefix, UpdateStages.WithDestinationAddressPrefixes, UpdateStages.WithDestinationApplicationSecurityGroups, UpdateStages.WithDestinationPortRange, UpdateStages.WithDestinationPortRanges, UpdateStages.WithEtag, UpdateStages.WithId, UpdateStages.WithName, UpdateStages.WithPriority, UpdateStages.WithProvisioningState, UpdateStages.WithSourceAddressPrefix, UpdateStages.WithSourceAddressPrefixes, UpdateStages.WithSourceApplicationSecurityGroups, UpdateStages.WithSourcePortRange, UpdateStages.WithSourcePortRanges { + } + + /** + * Grouping of NetworkSecurityGroupSecurityRule update stages. + */ + interface UpdateStages { + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + */ + Update withDescription(String description); + } + + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify DestinationAddressPrefix. + */ + interface WithDestinationAddressPrefix { + /** + * Specifies destinationAddressPrefix. + */ + Update withDestinationAddressPrefix(String destinationAddressPrefix); + } + + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify DestinationAddressPrefixes. + */ + interface WithDestinationAddressPrefixes { + /** + * Specifies destinationAddressPrefixes. + */ + Update withDestinationAddressPrefixes(List destinationAddressPrefixes); + } + + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify DestinationApplicationSecurityGroups. + */ + interface WithDestinationApplicationSecurityGroups { + /** + * Specifies destinationApplicationSecurityGroups. + */ + Update withDestinationApplicationSecurityGroups(List destinationApplicationSecurityGroups); + } + + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify DestinationPortRange. + */ + interface WithDestinationPortRange { + /** + * Specifies destinationPortRange. + */ + Update withDestinationPortRange(String destinationPortRange); + } + + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify DestinationPortRanges. + */ + interface WithDestinationPortRanges { + /** + * Specifies destinationPortRanges. + */ + Update withDestinationPortRanges(List destinationPortRanges); + } + + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + */ + Update withEtag(String etag); + } + + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + */ + Update withId(String id); + } + + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + */ + Update withName(String name); + } + + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify Priority. + */ + interface WithPriority { + /** + * Specifies priority. + */ + Update withPriority(Integer priority); + } + + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + */ + Update withProvisioningState(String provisioningState); + } + + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify SourceAddressPrefix. + */ + interface WithSourceAddressPrefix { + /** + * Specifies sourceAddressPrefix. + */ + Update withSourceAddressPrefix(String sourceAddressPrefix); + } + + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify SourceAddressPrefixes. + */ + interface WithSourceAddressPrefixes { + /** + * Specifies sourceAddressPrefixes. + */ + Update withSourceAddressPrefixes(List sourceAddressPrefixes); + } + + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify SourceApplicationSecurityGroups. + */ + interface WithSourceApplicationSecurityGroups { + /** + * Specifies sourceApplicationSecurityGroups. + */ + Update withSourceApplicationSecurityGroups(List sourceApplicationSecurityGroups); + } + + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify SourcePortRange. + */ + interface WithSourcePortRange { + /** + * Specifies sourcePortRange. + */ + Update withSourcePortRange(String sourcePortRange); + } + + /** + * The stage of the networksecuritygroupsecurityrule update allowing to specify SourcePortRanges. + */ + interface WithSourcePortRanges { + /** + * Specifies sourcePortRanges. + */ + Update withSourcePortRanges(List sourcePortRanges); + } + + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkSecurityGroupSecurityRuleModel.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkSecurityGroupSecurityRuleModel.java new file mode 100644 index 000000000000..05029eb41ce7 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkSecurityGroupSecurityRuleModel.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.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_06_01.implementation.SecurityRuleInner; +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.network.v2018_06_01.implementation.NetworkManager; +import java.util.List; + +/** + * Type representing NetworkSecurityGroupSecurityRuleModel. + */ +public interface NetworkSecurityGroupSecurityRuleModel extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the access value. + */ + SecurityRuleAccess access(); + + /** + * @return the description value. + */ + String description(); + + /** + * @return the destinationAddressPrefix value. + */ + String destinationAddressPrefix(); + + /** + * @return the destinationAddressPrefixes value. + */ + List destinationAddressPrefixes(); + + /** + * @return the destinationApplicationSecurityGroups value. + */ + List destinationApplicationSecurityGroups(); + + /** + * @return the destinationPortRange value. + */ + String destinationPortRange(); + + /** + * @return the destinationPortRanges value. + */ + List destinationPortRanges(); + + /** + * @return the direction value. + */ + SecurityRuleDirection direction(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the priority value. + */ + Integer priority(); + + /** + * @return the protocol value. + */ + SecurityRuleProtocol protocol(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the sourceAddressPrefix value. + */ + String sourceAddressPrefix(); + + /** + * @return the sourceAddressPrefixes value. + */ + List sourceAddressPrefixes(); + + /** + * @return the sourceApplicationSecurityGroups value. + */ + List sourceApplicationSecurityGroups(); + + /** + * @return the sourcePortRange value. + */ + String sourcePortRange(); + + /** + * @return the sourcePortRanges value. + */ + List sourcePortRanges(); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkSecurityGroups.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkSecurityGroups.java new file mode 100644 index 000000000000..82bbe9d775db --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkSecurityGroups.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkSecurityGroupsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing NetworkSecurityGroups. + */ +public interface NetworkSecurityGroups extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkWatcher.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkWatcher.java new file mode 100644 index 000000000000..b82ef4791059 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkWatcher.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkWatcherInner; + +/** + * Type representing NetworkWatcher. + */ +public interface NetworkWatcher extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * The entirety of the NetworkWatcher definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of NetworkWatcher definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a NetworkWatcher definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the NetworkWatcher definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the networkwatcher update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithEtag { + } + } + /** + * The template for a NetworkWatcher update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithEtag { + } + + /** + * Grouping of NetworkWatcher update stages. + */ + interface UpdateStages { + /** + * The stage of the networkwatcher {0} allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + */ + Update withEtag(String etag); + } + + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkWatchers.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkWatchers.java new file mode 100644 index 000000000000..a462c56dd7af --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkWatchers.java @@ -0,0 +1,147 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_06_01.implementation.FlowLogInformationInner; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkWatchersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing NetworkWatchers. + */ +public interface NetworkWatchers extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Gets the current network topology by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the representation of topology. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getTopologyAsync(String resourceGroupName, String networkWatcherName, TopologyParameters parameters); + + /** + * Verify IP flow from the specified VM to a location given the currently configured NSG rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the IP flow to be verified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable verifyIPFlowAsync(String resourceGroupName, String networkWatcherName, VerificationIPFlowParameters parameters); + + /** + * Gets the next hop from the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the source and destination endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getNextHopAsync(String resourceGroupName, String networkWatcherName, NextHopParameters parameters); + + /** + * Gets the configured and effective security group rules on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param targetResourceId ID of the target VM. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getVMSecurityRulesAsync(String resourceGroupName, String networkWatcherName, String targetResourceId); + + /** + * Initiate troubleshooting on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to troubleshoot. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getTroubleshootingAsync(String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters); + + /** + * Get the last completed troubleshooting result on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param targetResourceId The target resource ID to query the troubleshooting result. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getTroubleshootingResultAsync(String resourceGroupName, String networkWatcherName, String targetResourceId); + + /** + * Configures flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the configuration of flow log. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable setFlowLogConfigurationAsync(String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters); + + /** + * Queries status of flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param targetResourceId The target resource where getting the flow log and traffic analytics (optional) status. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getFlowLogStatusAsync(String resourceGroupName, String networkWatcherName, String targetResourceId); + + /** + * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine how the connectivity check will be performed. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkConnectivityAsync(String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters); + + /** + * Gets the relative latency score for internet service providers from a specified location to Azure regions. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine Azure reachability report configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAzureReachabilityReportAsync(String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters); + + /** + * Lists all available internet service providers for a specified Azure region. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that scope the list of available providers. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAvailableProvidersAsync(String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NextHopParameters.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NextHopParameters.java new file mode 100644 index 000000000000..a26e55538a09 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NextHopParameters.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters that define the source and destination endpoint. + */ +public class NextHopParameters { + /** + * The resource identifier of the target resource against which the action + * is to be performed. + */ + @JsonProperty(value = "targetResourceId", required = true) + private String targetResourceId; + + /** + * The source IP address. + */ + @JsonProperty(value = "sourceIPAddress", required = true) + private String sourceIPAddress; + + /** + * The destination IP address. + */ + @JsonProperty(value = "destinationIPAddress", required = true) + private String destinationIPAddress; + + /** + * The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any + * of the nics, then this parameter must be specified. Otherwise optional). + */ + @JsonProperty(value = "targetNicResourceId") + private String targetNicResourceId; + + /** + * Get the resource identifier of the target resource against which the action is to be performed. + * + * @return the targetResourceId value + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Set the resource identifier of the target resource against which the action is to be performed. + * + * @param targetResourceId the targetResourceId value to set + * @return the NextHopParameters object itself. + */ + public NextHopParameters withTargetResourceId(String targetResourceId) { + this.targetResourceId = targetResourceId; + return this; + } + + /** + * Get the source IP address. + * + * @return the sourceIPAddress value + */ + public String sourceIPAddress() { + return this.sourceIPAddress; + } + + /** + * Set the source IP address. + * + * @param sourceIPAddress the sourceIPAddress value to set + * @return the NextHopParameters object itself. + */ + public NextHopParameters withSourceIPAddress(String sourceIPAddress) { + this.sourceIPAddress = sourceIPAddress; + return this; + } + + /** + * Get the destination IP address. + * + * @return the destinationIPAddress value + */ + public String destinationIPAddress() { + return this.destinationIPAddress; + } + + /** + * Set the destination IP address. + * + * @param destinationIPAddress the destinationIPAddress value to set + * @return the NextHopParameters object itself. + */ + public NextHopParameters withDestinationIPAddress(String destinationIPAddress) { + this.destinationIPAddress = destinationIPAddress; + return this; + } + + /** + * Get the NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of the nics, then this parameter must be specified. Otherwise optional). + * + * @return the targetNicResourceId value + */ + public String targetNicResourceId() { + return this.targetNicResourceId; + } + + /** + * Set the NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of the nics, then this parameter must be specified. Otherwise optional). + * + * @param targetNicResourceId the targetNicResourceId value to set + * @return the NextHopParameters object itself. + */ + public NextHopParameters withTargetNicResourceId(String targetNicResourceId) { + this.targetNicResourceId = targetNicResourceId; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NextHopResult.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NextHopResult.java new file mode 100644 index 000000000000..f20f13626605 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NextHopResult.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.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NextHopResultInner; + +/** + * Type representing NextHopResult. + */ +public interface NextHopResult extends HasInner, HasManager { + /** + * @return the nextHopIpAddress value. + */ + String nextHopIpAddress(); + + /** + * @return the nextHopType value. + */ + NextHopType nextHopType(); + + /** + * @return the routeTableId value. + */ + String routeTableId(); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NextHopType.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NextHopType.java new file mode 100644 index 000000000000..dfed71281a0d --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NextHopType.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for NextHopType. + */ +public final class NextHopType extends ExpandableStringEnum { + /** Static value Internet for NextHopType. */ + public static final NextHopType INTERNET = fromString("Internet"); + + /** Static value VirtualAppliance for NextHopType. */ + public static final NextHopType VIRTUAL_APPLIANCE = fromString("VirtualAppliance"); + + /** Static value VirtualNetworkGateway for NextHopType. */ + public static final NextHopType VIRTUAL_NETWORK_GATEWAY = fromString("VirtualNetworkGateway"); + + /** Static value VnetLocal for NextHopType. */ + public static final NextHopType VNET_LOCAL = fromString("VnetLocal"); + + /** Static value HyperNetGateway for NextHopType. */ + public static final NextHopType HYPER_NET_GATEWAY = fromString("HyperNetGateway"); + + /** Static value None for NextHopType. */ + public static final NextHopType NONE = fromString("None"); + + /** + * Creates or finds a NextHopType from its string representation. + * @param name a name to look for + * @return the corresponding NextHopType + */ + @JsonCreator + public static NextHopType fromString(String name) { + return fromString(name, NextHopType.class); + } + + /** + * @return known NextHopType values + */ + public static Collection values() { + return values(NextHopType.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/Operation.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/Operation.java new file mode 100644 index 000000000000..e223e6e4496f --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/Operation.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.OperationInner; + +/** + * Type representing Operation. + */ +public interface Operation extends HasInner, HasManager { + /** + * @return the display value. + */ + OperationDisplay display(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the origin value. + */ + String origin(); + + /** + * @return the serviceSpecification value. + */ + OperationPropertiesFormatServiceSpecification serviceSpecification(); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/OperationDisplay.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/OperationDisplay.java new file mode 100644 index 000000000000..aca1b9a4990d --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/OperationDisplay.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.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Display metadata associated with the operation. + */ +public class OperationDisplay { + /** + * Service provider: Microsoft Network. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * Resource on which the operation is performed. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * Type of the operation: get, read, delete, etc. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * Description of the operation. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get service provider: Microsoft Network. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set service provider: Microsoft Network. + * + * @param provider the provider value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get resource on which the operation is performed. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set resource on which the operation is performed. + * + * @param resource the resource value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get type of the operation: get, read, delete, etc. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set type of the operation: get, read, delete, etc. + * + * @param operation the operation value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get description of the operation. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of the operation. + * + * @param description the description value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/OperationPropertiesFormatServiceSpecification.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/OperationPropertiesFormatServiceSpecification.java new file mode 100644 index 000000000000..b8f94f1f9649 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/OperationPropertiesFormatServiceSpecification.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.network.v2018_06_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specification of the service. + */ +public class OperationPropertiesFormatServiceSpecification { + /** + * Operation service specification. + */ + @JsonProperty(value = "metricSpecifications") + private List metricSpecifications; + + /** + * Operation log specification. + */ + @JsonProperty(value = "logSpecifications") + private List logSpecifications; + + /** + * Get operation service specification. + * + * @return the metricSpecifications value + */ + public List metricSpecifications() { + return this.metricSpecifications; + } + + /** + * Set operation service specification. + * + * @param metricSpecifications the metricSpecifications value to set + * @return the OperationPropertiesFormatServiceSpecification object itself. + */ + public OperationPropertiesFormatServiceSpecification withMetricSpecifications(List metricSpecifications) { + this.metricSpecifications = metricSpecifications; + return this; + } + + /** + * Get operation log specification. + * + * @return the logSpecifications value + */ + public List logSpecifications() { + return this.logSpecifications; + } + + /** + * Set operation log specification. + * + * @param logSpecifications the logSpecifications value to set + * @return the OperationPropertiesFormatServiceSpecification object itself. + */ + public OperationPropertiesFormatServiceSpecification withLogSpecifications(List logSpecifications) { + this.logSpecifications = logSpecifications; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/Operations.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/Operations.java new file mode 100644 index 000000000000..6c909aea4d9c --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/Operations.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import rx.Observable; +import com.microsoft.azure.management.network.v2018_06_01.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Lists all of the available Network Rest API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/Origin.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/Origin.java new file mode 100644 index 000000000000..4e293156f1b5 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/Origin.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for Origin. + */ +public final class Origin extends ExpandableStringEnum { + /** Static value Local for Origin. */ + public static final Origin LOCAL = fromString("Local"); + + /** Static value Inbound for Origin. */ + public static final Origin INBOUND = fromString("Inbound"); + + /** Static value Outbound for Origin. */ + public static final Origin OUTBOUND = fromString("Outbound"); + + /** + * Creates or finds a Origin from its string representation. + * @param name a name to look for + * @return the corresponding Origin + */ + @JsonCreator + public static Origin fromString(String name) { + return fromString(name, Origin.class); + } + + /** + * @return known Origin values + */ + public static Collection values() { + return values(Origin.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/OutboundNatRule.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/OutboundNatRule.java new file mode 100644 index 000000000000..b5ef5fbbe110 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/OutboundNatRule.java @@ -0,0 +1,180 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import java.util.List; +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Outbound NAT pool of the load balancer. + */ +@JsonFlatten +public class OutboundNatRule extends SubResource { + /** + * The number of outbound ports to be used for NAT. + */ + @JsonProperty(value = "properties.allocatedOutboundPorts") + private Integer allocatedOutboundPorts; + + /** + * The Frontend IP addresses of the load balancer. + */ + @JsonProperty(value = "properties.frontendIPConfigurations") + private List frontendIPConfigurations; + + /** + * A reference to a pool of DIPs. Outbound traffic is randomly load + * balanced across IPs in the backend IPs. + */ + @JsonProperty(value = "properties.backendAddressPool", required = true) + private SubResource backendAddressPool; + + /** + * Gets the provisioning state of the PublicIP resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get the number of outbound ports to be used for NAT. + * + * @return the allocatedOutboundPorts value + */ + public Integer allocatedOutboundPorts() { + return this.allocatedOutboundPorts; + } + + /** + * Set the number of outbound ports to be used for NAT. + * + * @param allocatedOutboundPorts the allocatedOutboundPorts value to set + * @return the OutboundNatRule object itself. + */ + public OutboundNatRule withAllocatedOutboundPorts(Integer allocatedOutboundPorts) { + this.allocatedOutboundPorts = allocatedOutboundPorts; + return this; + } + + /** + * Get the Frontend IP addresses of the load balancer. + * + * @return the frontendIPConfigurations value + */ + public List frontendIPConfigurations() { + return this.frontendIPConfigurations; + } + + /** + * Set the Frontend IP addresses of the load balancer. + * + * @param frontendIPConfigurations the frontendIPConfigurations value to set + * @return the OutboundNatRule object itself. + */ + public OutboundNatRule withFrontendIPConfigurations(List frontendIPConfigurations) { + this.frontendIPConfigurations = frontendIPConfigurations; + return this; + } + + /** + * Get a reference to a pool of DIPs. Outbound traffic is randomly load balanced across IPs in the backend IPs. + * + * @return the backendAddressPool value + */ + public SubResource backendAddressPool() { + return this.backendAddressPool; + } + + /** + * Set a reference to a pool of DIPs. Outbound traffic is randomly load balanced across IPs in the backend IPs. + * + * @param backendAddressPool the backendAddressPool value to set + * @return the OutboundNatRule object itself. + */ + public OutboundNatRule withBackendAddressPool(SubResource backendAddressPool) { + this.backendAddressPool = backendAddressPool; + return this; + } + + /** + * Get gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the OutboundNatRule object itself. + */ + public OutboundNatRule withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the OutboundNatRule object itself. + */ + public OutboundNatRule withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the OutboundNatRule object itself. + */ + public OutboundNatRule withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/PacketCaptureFilter.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/PacketCaptureFilter.java new file mode 100644 index 000000000000..ed5a49ca73b0 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/PacketCaptureFilter.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.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Filter that is applied to packet capture request. Multiple filters can be + * applied. + */ +public class PacketCaptureFilter { + /** + * Protocol to be filtered on. Possible values include: 'TCP', 'UDP', + * 'Any'. + */ + @JsonProperty(value = "protocol") + private PcProtocol protocol; + + /** + * Local IP Address to be filtered on. Notation: "127.0.0.1" for single + * address entry. "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5"? + * for multiple entries. Multiple ranges not currently supported. Mixing + * ranges with multiple entries not currently supported. Default = null. + */ + @JsonProperty(value = "localIPAddress") + private String localIPAddress; + + /** + * Local IP Address to be filtered on. Notation: "127.0.0.1" for single + * address entry. "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5;" + * for multiple entries. Multiple ranges not currently supported. Mixing + * ranges with multiple entries not currently supported. Default = null. + */ + @JsonProperty(value = "remoteIPAddress") + private String remoteIPAddress; + + /** + * Local port to be filtered on. Notation: "80" for single port + * entry."80-85" for range. "80;443;" for multiple entries. Multiple ranges + * not currently supported. Mixing ranges with multiple entries not + * currently supported. Default = null. + */ + @JsonProperty(value = "localPort") + private String localPort; + + /** + * Remote port to be filtered on. Notation: "80" for single port + * entry."80-85" for range. "80;443;" for multiple entries. Multiple ranges + * not currently supported. Mixing ranges with multiple entries not + * currently supported. Default = null. + */ + @JsonProperty(value = "remotePort") + private String remotePort; + + /** + * Get protocol to be filtered on. Possible values include: 'TCP', 'UDP', 'Any'. + * + * @return the protocol value + */ + public PcProtocol protocol() { + return this.protocol; + } + + /** + * Set protocol to be filtered on. Possible values include: 'TCP', 'UDP', 'Any'. + * + * @param protocol the protocol value to set + * @return the PacketCaptureFilter object itself. + */ + public PacketCaptureFilter withProtocol(PcProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get local IP Address to be filtered on. Notation: "127.0.0.1" for single address entry. "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5"? for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not currently supported. Default = null. + * + * @return the localIPAddress value + */ + public String localIPAddress() { + return this.localIPAddress; + } + + /** + * Set local IP Address to be filtered on. Notation: "127.0.0.1" for single address entry. "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5"? for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not currently supported. Default = null. + * + * @param localIPAddress the localIPAddress value to set + * @return the PacketCaptureFilter object itself. + */ + public PacketCaptureFilter withLocalIPAddress(String localIPAddress) { + this.localIPAddress = localIPAddress; + return this; + } + + /** + * Get local IP Address to be filtered on. Notation: "127.0.0.1" for single address entry. "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5;" for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not currently supported. Default = null. + * + * @return the remoteIPAddress value + */ + public String remoteIPAddress() { + return this.remoteIPAddress; + } + + /** + * Set local IP Address to be filtered on. Notation: "127.0.0.1" for single address entry. "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5;" for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not currently supported. Default = null. + * + * @param remoteIPAddress the remoteIPAddress value to set + * @return the PacketCaptureFilter object itself. + */ + public PacketCaptureFilter withRemoteIPAddress(String remoteIPAddress) { + this.remoteIPAddress = remoteIPAddress; + return this; + } + + /** + * Get local port to be filtered on. Notation: "80" for single port entry."80-85" for range. "80;443;" for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not currently supported. Default = null. + * + * @return the localPort value + */ + public String localPort() { + return this.localPort; + } + + /** + * Set local port to be filtered on. Notation: "80" for single port entry."80-85" for range. "80;443;" for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not currently supported. Default = null. + * + * @param localPort the localPort value to set + * @return the PacketCaptureFilter object itself. + */ + public PacketCaptureFilter withLocalPort(String localPort) { + this.localPort = localPort; + return this; + } + + /** + * Get remote port to be filtered on. Notation: "80" for single port entry."80-85" for range. "80;443;" for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not currently supported. Default = null. + * + * @return the remotePort value + */ + public String remotePort() { + return this.remotePort; + } + + /** + * Set remote port to be filtered on. Notation: "80" for single port entry."80-85" for range. "80;443;" for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not currently supported. Default = null. + * + * @param remotePort the remotePort value to set + * @return the PacketCaptureFilter object itself. + */ + public PacketCaptureFilter withRemotePort(String remotePort) { + this.remotePort = remotePort; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/PacketCaptureParameters.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/PacketCaptureParameters.java new file mode 100644 index 000000000000..52569d138dde --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/PacketCaptureParameters.java @@ -0,0 +1,174 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters that define the create packet capture operation. + */ +public class PacketCaptureParameters { + /** + * The ID of the targeted resource, only VM is currently supported. + */ + @JsonProperty(value = "target", required = true) + private String target; + + /** + * Number of bytes captured per packet, the remaining bytes are truncated. + */ + @JsonProperty(value = "bytesToCapturePerPacket") + private Integer bytesToCapturePerPacket; + + /** + * Maximum size of the capture output. + */ + @JsonProperty(value = "totalBytesPerSession") + private Integer totalBytesPerSession; + + /** + * Maximum duration of the capture session in seconds. + */ + @JsonProperty(value = "timeLimitInSeconds") + private Integer timeLimitInSeconds; + + /** + * The storageLocation property. + */ + @JsonProperty(value = "storageLocation", required = true) + private PacketCaptureStorageLocation storageLocation; + + /** + * The filters property. + */ + @JsonProperty(value = "filters") + private List filters; + + /** + * Get the ID of the targeted resource, only VM is currently supported. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Set the ID of the targeted resource, only VM is currently supported. + * + * @param target the target value to set + * @return the PacketCaptureParameters object itself. + */ + public PacketCaptureParameters withTarget(String target) { + this.target = target; + return this; + } + + /** + * Get number of bytes captured per packet, the remaining bytes are truncated. + * + * @return the bytesToCapturePerPacket value + */ + public Integer bytesToCapturePerPacket() { + return this.bytesToCapturePerPacket; + } + + /** + * Set number of bytes captured per packet, the remaining bytes are truncated. + * + * @param bytesToCapturePerPacket the bytesToCapturePerPacket value to set + * @return the PacketCaptureParameters object itself. + */ + public PacketCaptureParameters withBytesToCapturePerPacket(Integer bytesToCapturePerPacket) { + this.bytesToCapturePerPacket = bytesToCapturePerPacket; + return this; + } + + /** + * Get maximum size of the capture output. + * + * @return the totalBytesPerSession value + */ + public Integer totalBytesPerSession() { + return this.totalBytesPerSession; + } + + /** + * Set maximum size of the capture output. + * + * @param totalBytesPerSession the totalBytesPerSession value to set + * @return the PacketCaptureParameters object itself. + */ + public PacketCaptureParameters withTotalBytesPerSession(Integer totalBytesPerSession) { + this.totalBytesPerSession = totalBytesPerSession; + return this; + } + + /** + * Get maximum duration of the capture session in seconds. + * + * @return the timeLimitInSeconds value + */ + public Integer timeLimitInSeconds() { + return this.timeLimitInSeconds; + } + + /** + * Set maximum duration of the capture session in seconds. + * + * @param timeLimitInSeconds the timeLimitInSeconds value to set + * @return the PacketCaptureParameters object itself. + */ + public PacketCaptureParameters withTimeLimitInSeconds(Integer timeLimitInSeconds) { + this.timeLimitInSeconds = timeLimitInSeconds; + return this; + } + + /** + * Get the storageLocation value. + * + * @return the storageLocation value + */ + public PacketCaptureStorageLocation storageLocation() { + return this.storageLocation; + } + + /** + * Set the storageLocation value. + * + * @param storageLocation the storageLocation value to set + * @return the PacketCaptureParameters object itself. + */ + public PacketCaptureParameters withStorageLocation(PacketCaptureStorageLocation storageLocation) { + this.storageLocation = storageLocation; + return this; + } + + /** + * Get the filters value. + * + * @return the filters value + */ + public List filters() { + return this.filters; + } + + /** + * Set the filters value. + * + * @param filters the filters value to set + * @return the PacketCaptureParameters object itself. + */ + public PacketCaptureParameters withFilters(List filters) { + this.filters = filters; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/PacketCaptureQueryStatusResult.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/PacketCaptureQueryStatusResult.java new file mode 100644 index 000000000000..c892e99eccf0 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/PacketCaptureQueryStatusResult.java @@ -0,0 +1,52 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.PacketCaptureQueryStatusResultInner; +import org.joda.time.DateTime; +import java.util.List; + +/** + * Type representing PacketCaptureQueryStatusResult. + */ +public interface PacketCaptureQueryStatusResult extends HasInner, HasManager { + /** + * @return the captureStartTime value. + */ + DateTime captureStartTime(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the packetCaptureError value. + */ + List packetCaptureError(); + + /** + * @return the packetCaptureStatus value. + */ + PcStatus packetCaptureStatus(); + + /** + * @return the stopReason value. + */ + String stopReason(); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/PacketCaptureResult.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/PacketCaptureResult.java new file mode 100644 index 000000000000..d13f55095caa --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/PacketCaptureResult.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.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_06_01.implementation.PacketCaptureResultInner; +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.network.v2018_06_01.implementation.NetworkManager; +import java.util.List; + +/** + * Type representing PacketCaptureResult. + */ +public interface PacketCaptureResult extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the bytesToCapturePerPacket value. + */ + Integer bytesToCapturePerPacket(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the filters value. + */ + List filters(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the storageLocation value. + */ + PacketCaptureStorageLocation storageLocation(); + + /** + * @return the target value. + */ + String target(); + + /** + * @return the timeLimitInSeconds value. + */ + Integer timeLimitInSeconds(); + + /** + * @return the totalBytesPerSession value. + */ + Integer totalBytesPerSession(); + + /** + * The entirety of the PacketCaptureResult definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithNetworkWatcher, DefinitionStages.WithStorageLocation, DefinitionStages.WithTarget, DefinitionStages.WithCreate { + } + + /** + * Grouping of PacketCaptureResult definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a PacketCaptureResult definition. + */ + interface Blank extends WithNetworkWatcher { + } + + /** + * The stage of the packetcaptureresult definition allowing to specify NetworkWatcher. + */ + interface WithNetworkWatcher { + /** + * Specifies resourceGroupName, networkWatcherName. + */ + WithStorageLocation withExistingNetworkWatcher(String resourceGroupName, String networkWatcherName); + } + + /** + * The stage of the packetcaptureresult definition allowing to specify StorageLocation. + */ + interface WithStorageLocation { + /** + * Specifies storageLocation. + */ + WithTarget withStorageLocation(PacketCaptureStorageLocation storageLocation); + } + + /** + * The stage of the packetcaptureresult definition allowing to specify Target. + */ + interface WithTarget { + /** + * Specifies target. + */ + WithCreate withTarget(String target); + } + + /** + * The stage of the packetcaptureresult definition allowing to specify BytesToCapturePerPacket. + */ + interface WithBytesToCapturePerPacket { + /** + * Specifies bytesToCapturePerPacket. + */ + WithCreate withBytesToCapturePerPacket(Integer bytesToCapturePerPacket); + } + + /** + * The stage of the packetcaptureresult definition allowing to specify Filters. + */ + interface WithFilters { + /** + * Specifies filters. + */ + WithCreate withFilters(List filters); + } + + /** + * The stage of the packetcaptureresult definition allowing to specify TimeLimitInSeconds. + */ + interface WithTimeLimitInSeconds { + /** + * Specifies timeLimitInSeconds. + */ + WithCreate withTimeLimitInSeconds(Integer timeLimitInSeconds); + } + + /** + * The stage of the packetcaptureresult definition allowing to specify TotalBytesPerSession. + */ + interface WithTotalBytesPerSession { + /** + * Specifies totalBytesPerSession. + */ + WithCreate withTotalBytesPerSession(Integer totalBytesPerSession); + } + + /** + * 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.WithBytesToCapturePerPacket, DefinitionStages.WithFilters, DefinitionStages.WithTimeLimitInSeconds, DefinitionStages.WithTotalBytesPerSession { + } + } + /** + * The template for a PacketCaptureResult update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithBytesToCapturePerPacket, UpdateStages.WithFilters, UpdateStages.WithTimeLimitInSeconds, UpdateStages.WithTotalBytesPerSession { + } + + /** + * Grouping of PacketCaptureResult update stages. + */ + interface UpdateStages { + /** + * The stage of the packetcaptureresult update allowing to specify BytesToCapturePerPacket. + */ + interface WithBytesToCapturePerPacket { + /** + * Specifies bytesToCapturePerPacket. + */ + Update withBytesToCapturePerPacket(Integer bytesToCapturePerPacket); + } + + /** + * The stage of the packetcaptureresult update allowing to specify Filters. + */ + interface WithFilters { + /** + * Specifies filters. + */ + Update withFilters(List filters); + } + + /** + * The stage of the packetcaptureresult update allowing to specify TimeLimitInSeconds. + */ + interface WithTimeLimitInSeconds { + /** + * Specifies timeLimitInSeconds. + */ + Update withTimeLimitInSeconds(Integer timeLimitInSeconds); + } + + /** + * The stage of the packetcaptureresult update allowing to specify TotalBytesPerSession. + */ + interface WithTotalBytesPerSession { + /** + * Specifies totalBytesPerSession. + */ + Update withTotalBytesPerSession(Integer totalBytesPerSession); + } + + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/PacketCaptureStorageLocation.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/PacketCaptureStorageLocation.java new file mode 100644 index 000000000000..302d2244959c --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/PacketCaptureStorageLocation.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the storage location for a packet capture session. + */ +public class PacketCaptureStorageLocation { + /** + * The ID of the storage account to save the packet capture session. + * Required if no local file path is provided. + */ + @JsonProperty(value = "storageId") + private String storageId; + + /** + * The URI of the storage path to save the packet capture. Must be a + * well-formed URI describing the location to save the packet capture. + */ + @JsonProperty(value = "storagePath") + private String storagePath; + + /** + * A valid local path on the targeting VM. Must include the name of the + * capture file (*.cap). For linux virtual machine it must start with + * /var/captures. Required if no storage ID is provided, otherwise + * optional. + */ + @JsonProperty(value = "filePath") + private String filePath; + + /** + * Get the ID of the storage account to save the packet capture session. Required if no local file path is provided. + * + * @return the storageId value + */ + public String storageId() { + return this.storageId; + } + + /** + * Set the ID of the storage account to save the packet capture session. Required if no local file path is provided. + * + * @param storageId the storageId value to set + * @return the PacketCaptureStorageLocation object itself. + */ + public PacketCaptureStorageLocation withStorageId(String storageId) { + this.storageId = storageId; + return this; + } + + /** + * Get the URI of the storage path to save the packet capture. Must be a well-formed URI describing the location to save the packet capture. + * + * @return the storagePath value + */ + public String storagePath() { + return this.storagePath; + } + + /** + * Set the URI of the storage path to save the packet capture. Must be a well-formed URI describing the location to save the packet capture. + * + * @param storagePath the storagePath value to set + * @return the PacketCaptureStorageLocation object itself. + */ + public PacketCaptureStorageLocation withStoragePath(String storagePath) { + this.storagePath = storagePath; + return this; + } + + /** + * Get a valid local path on the targeting VM. Must include the name of the capture file (*.cap). For linux virtual machine it must start with /var/captures. Required if no storage ID is provided, otherwise optional. + * + * @return the filePath value + */ + public String filePath() { + return this.filePath; + } + + /** + * Set a valid local path on the targeting VM. Must include the name of the capture file (*.cap). For linux virtual machine it must start with /var/captures. Required if no storage ID is provided, otherwise optional. + * + * @param filePath the filePath value to set + * @return the PacketCaptureStorageLocation object itself. + */ + public PacketCaptureStorageLocation withFilePath(String filePath) { + this.filePath = filePath; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/PacketCaptures.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/PacketCaptures.java new file mode 100644 index 000000000000..ee70572fcb79 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/PacketCaptures.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_06_01.implementation.PacketCapturesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing PacketCaptures. + */ +public interface PacketCaptures extends SupportsCreating, HasInner { + /** + * Stops a specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable stopAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName); + + /** + * Query the status of a running packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @param packetCaptureName The name given to the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getStatusAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName); + + /** + * Gets a packet capture session by name. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName); + + /** + * Lists all packet capture sessions within the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String networkWatcherName); + + /** + * Deletes the specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/PatchRouteFilter.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/PatchRouteFilter.java new file mode 100644 index 000000000000..b92f7e2e1291 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/PatchRouteFilter.java @@ -0,0 +1,164 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.implementation.RouteFilterRuleInner; +import com.microsoft.azure.management.network.v2018_06_01.implementation.ExpressRouteCircuitPeeringInner; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Route Filter Resource. + */ +@JsonFlatten +public class PatchRouteFilter extends SubResource { + /** + * Collection of RouteFilterRules contained within a route filter. + */ + @JsonProperty(value = "properties.rules") + private List rules; + + /** + * A collection of references to express route circuit peerings. + */ + @JsonProperty(value = "properties.peerings") + private List peerings; + + /** + * The provisioning state of the resource. Possible values are: 'Updating', + * 'Deleting', 'Succeeded' and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get collection of RouteFilterRules contained within a route filter. + * + * @return the rules value + */ + public List rules() { + return this.rules; + } + + /** + * Set collection of RouteFilterRules contained within a route filter. + * + * @param rules the rules value to set + * @return the PatchRouteFilter object itself. + */ + public PatchRouteFilter withRules(List rules) { + this.rules = rules; + return this; + } + + /** + * Get a collection of references to express route circuit peerings. + * + * @return the peerings value + */ + public List peerings() { + return this.peerings; + } + + /** + * Set a collection of references to express route circuit peerings. + * + * @param peerings the peerings value to set + * @return the PatchRouteFilter object itself. + */ + public PatchRouteFilter withPeerings(List peerings) { + this.peerings = peerings; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get resource type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Get resource tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set resource tags. + * + * @param tags the tags value to set + * @return the PatchRouteFilter object itself. + */ + public PatchRouteFilter withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/PatchRouteFilterRule.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/PatchRouteFilterRule.java new file mode 100644 index 000000000000..d56e23988dde --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/PatchRouteFilterRule.java @@ -0,0 +1,157 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Route Filter Rule Resource. + */ +@JsonFlatten +public class PatchRouteFilterRule extends SubResource { + /** + * The access type of the rule. Valid values are: 'Allow', 'Deny'. Possible + * values include: 'Allow', 'Deny'. + */ + @JsonProperty(value = "properties.access", required = true) + private Access access; + + /** + * The rule type of the rule. Valid value is: 'Community'. + */ + @JsonProperty(value = "properties.routeFilterRuleType", required = true) + private String routeFilterRuleType; + + /** + * The collection for bgp community values to filter on. e.g. + * ['12076:5010','12076:5020']. + */ + @JsonProperty(value = "properties.communities", required = true) + private List communities; + + /** + * The provisioning state of the resource. Possible values are: 'Updating', + * 'Deleting', 'Succeeded' and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Creates an instance of PatchRouteFilterRule class. + * @param access the access type of the rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny'. + * @param communities the collection for bgp community values to filter on. e.g. ['12076:5010','12076:5020']. + */ + public PatchRouteFilterRule() { + routeFilterRuleType = "Community"; + } + + /** + * Get the access type of the rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny'. + * + * @return the access value + */ + public Access access() { + return this.access; + } + + /** + * Set the access type of the rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny'. + * + * @param access the access value to set + * @return the PatchRouteFilterRule object itself. + */ + public PatchRouteFilterRule withAccess(Access access) { + this.access = access; + return this; + } + + /** + * Get the rule type of the rule. Valid value is: 'Community'. + * + * @return the routeFilterRuleType value + */ + public String routeFilterRuleType() { + return this.routeFilterRuleType; + } + + /** + * Set the rule type of the rule. Valid value is: 'Community'. + * + * @param routeFilterRuleType the routeFilterRuleType value to set + * @return the PatchRouteFilterRule object itself. + */ + public PatchRouteFilterRule withRouteFilterRuleType(String routeFilterRuleType) { + this.routeFilterRuleType = routeFilterRuleType; + return this; + } + + /** + * Get the collection for bgp community values to filter on. e.g. ['12076:5010','12076:5020']. + * + * @return the communities value + */ + public List communities() { + return this.communities; + } + + /** + * Set the collection for bgp community values to filter on. e.g. ['12076:5010','12076:5020']. + * + * @param communities the communities value to set + * @return the PatchRouteFilterRule object itself. + */ + public PatchRouteFilterRule withCommunities(List communities) { + this.communities = communities; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/PcError.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/PcError.java new file mode 100644 index 000000000000..0dbfdcc7f414 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/PcError.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for PcError. + */ +public final class PcError extends ExpandableStringEnum { + /** Static value InternalError for PcError. */ + public static final PcError INTERNAL_ERROR = fromString("InternalError"); + + /** Static value AgentStopped for PcError. */ + public static final PcError AGENT_STOPPED = fromString("AgentStopped"); + + /** Static value CaptureFailed for PcError. */ + public static final PcError CAPTURE_FAILED = fromString("CaptureFailed"); + + /** Static value LocalFileFailed for PcError. */ + public static final PcError LOCAL_FILE_FAILED = fromString("LocalFileFailed"); + + /** Static value StorageFailed for PcError. */ + public static final PcError STORAGE_FAILED = fromString("StorageFailed"); + + /** + * Creates or finds a PcError from its string representation. + * @param name a name to look for + * @return the corresponding PcError + */ + @JsonCreator + public static PcError fromString(String name) { + return fromString(name, PcError.class); + } + + /** + * @return known PcError values + */ + public static Collection values() { + return values(PcError.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/PcProtocol.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/PcProtocol.java new file mode 100644 index 000000000000..defea46c7939 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/PcProtocol.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for PcProtocol. + */ +public final class PcProtocol extends ExpandableStringEnum { + /** Static value TCP for PcProtocol. */ + public static final PcProtocol TCP = fromString("TCP"); + + /** Static value UDP for PcProtocol. */ + public static final PcProtocol UDP = fromString("UDP"); + + /** Static value Any for PcProtocol. */ + public static final PcProtocol ANY = fromString("Any"); + + /** + * Creates or finds a PcProtocol from its string representation. + * @param name a name to look for + * @return the corresponding PcProtocol + */ + @JsonCreator + public static PcProtocol fromString(String name) { + return fromString(name, PcProtocol.class); + } + + /** + * @return known PcProtocol values + */ + public static Collection values() { + return values(PcProtocol.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/PcStatus.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/PcStatus.java new file mode 100644 index 000000000000..78aff7a3588f --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/PcStatus.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for PcStatus. + */ +public final class PcStatus extends ExpandableStringEnum { + /** Static value NotStarted for PcStatus. */ + public static final PcStatus NOT_STARTED = fromString("NotStarted"); + + /** Static value Running for PcStatus. */ + public static final PcStatus RUNNING = fromString("Running"); + + /** Static value Stopped for PcStatus. */ + public static final PcStatus STOPPED = fromString("Stopped"); + + /** Static value Error for PcStatus. */ + public static final PcStatus ERROR = fromString("Error"); + + /** Static value Unknown for PcStatus. */ + public static final PcStatus UNKNOWN = fromString("Unknown"); + + /** + * Creates or finds a PcStatus from its string representation. + * @param name a name to look for + * @return the corresponding PcStatus + */ + @JsonCreator + public static PcStatus fromString(String name) { + return fromString(name, PcStatus.class); + } + + /** + * @return known PcStatus values + */ + public static Collection values() { + return values(PcStatus.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/PfsGroup.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/PfsGroup.java new file mode 100644 index 000000000000..385efe0ef5d4 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/PfsGroup.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for PfsGroup. + */ +public final class PfsGroup extends ExpandableStringEnum { + /** Static value None for PfsGroup. */ + public static final PfsGroup NONE = fromString("None"); + + /** Static value PFS1 for PfsGroup. */ + public static final PfsGroup PFS1 = fromString("PFS1"); + + /** Static value PFS2 for PfsGroup. */ + public static final PfsGroup PFS2 = fromString("PFS2"); + + /** Static value PFS2048 for PfsGroup. */ + public static final PfsGroup PFS2048 = fromString("PFS2048"); + + /** Static value ECP256 for PfsGroup. */ + public static final PfsGroup ECP256 = fromString("ECP256"); + + /** Static value ECP384 for PfsGroup. */ + public static final PfsGroup ECP384 = fromString("ECP384"); + + /** Static value PFS24 for PfsGroup. */ + public static final PfsGroup PFS24 = fromString("PFS24"); + + /** Static value PFS14 for PfsGroup. */ + public static final PfsGroup PFS14 = fromString("PFS14"); + + /** Static value PFSMM for PfsGroup. */ + public static final PfsGroup PFSMM = fromString("PFSMM"); + + /** + * Creates or finds a PfsGroup from its string representation. + * @param name a name to look for + * @return the corresponding PfsGroup + */ + @JsonCreator + public static PfsGroup fromString(String name) { + return fromString(name, PfsGroup.class); + } + + /** + * @return known PfsGroup values + */ + public static Collection values() { + return values(PfsGroup.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/Policies.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/Policies.java new file mode 100644 index 000000000000..bb2566cf1feb --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/Policies.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.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Policies for vpn gateway. + */ +public class Policies { + /** + * True if branch to branch traffic is allowed. + */ + @JsonProperty(value = "allowBranchToBranchTraffic") + private Boolean allowBranchToBranchTraffic; + + /** + * True if Vnet to Vnet traffic is allowed. + */ + @JsonProperty(value = "allowVnetToVnetTraffic") + private Boolean allowVnetToVnetTraffic; + + /** + * Get true if branch to branch traffic is allowed. + * + * @return the allowBranchToBranchTraffic value + */ + public Boolean allowBranchToBranchTraffic() { + return this.allowBranchToBranchTraffic; + } + + /** + * Set true if branch to branch traffic is allowed. + * + * @param allowBranchToBranchTraffic the allowBranchToBranchTraffic value to set + * @return the Policies object itself. + */ + public Policies withAllowBranchToBranchTraffic(Boolean allowBranchToBranchTraffic) { + this.allowBranchToBranchTraffic = allowBranchToBranchTraffic; + return this; + } + + /** + * Get true if Vnet to Vnet traffic is allowed. + * + * @return the allowVnetToVnetTraffic value + */ + public Boolean allowVnetToVnetTraffic() { + return this.allowVnetToVnetTraffic; + } + + /** + * Set true if Vnet to Vnet traffic is allowed. + * + * @param allowVnetToVnetTraffic the allowVnetToVnetTraffic value to set + * @return the Policies object itself. + */ + public Policies withAllowVnetToVnetTraffic(Boolean allowVnetToVnetTraffic) { + this.allowVnetToVnetTraffic = allowVnetToVnetTraffic; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/Probe.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/Probe.java new file mode 100644 index 000000000000..8a338a3cb3db --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/Probe.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.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_06_01.implementation.ProbeInner; +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.network.v2018_06_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.SubResource; + +/** + * Type representing Probe. + */ +public interface Probe extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the intervalInSeconds value. + */ + Integer intervalInSeconds(); + + /** + * @return the loadBalancingRules value. + */ + List loadBalancingRules(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the numberOfProbes value. + */ + Integer numberOfProbes(); + + /** + * @return the port value. + */ + int port(); + + /** + * @return the protocol value. + */ + ProbeProtocol protocol(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the requestPath value. + */ + String requestPath(); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ProbeProtocol.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ProbeProtocol.java new file mode 100644 index 000000000000..cafb109feef0 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ProbeProtocol.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ProbeProtocol. + */ +public final class ProbeProtocol extends ExpandableStringEnum { + /** Static value Http for ProbeProtocol. */ + public static final ProbeProtocol HTTP = fromString("Http"); + + /** Static value Tcp for ProbeProtocol. */ + public static final ProbeProtocol TCP = fromString("Tcp"); + + /** Static value Https for ProbeProtocol. */ + public static final ProbeProtocol HTTPS = fromString("Https"); + + /** + * Creates or finds a ProbeProtocol from its string representation. + * @param name a name to look for + * @return the corresponding ProbeProtocol + */ + @JsonCreator + public static ProbeProtocol fromString(String name) { + return fromString(name, ProbeProtocol.class); + } + + /** + * @return known ProbeProtocol values + */ + public static Collection values() { + return values(ProbeProtocol.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ProcessorArchitecture.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ProcessorArchitecture.java new file mode 100644 index 000000000000..da8488991e78 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ProcessorArchitecture.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ProcessorArchitecture. + */ +public final class ProcessorArchitecture extends ExpandableStringEnum { + /** Static value Amd64 for ProcessorArchitecture. */ + public static final ProcessorArchitecture AMD64 = fromString("Amd64"); + + /** Static value X86 for ProcessorArchitecture. */ + public static final ProcessorArchitecture X86 = fromString("X86"); + + /** + * Creates or finds a ProcessorArchitecture from its string representation. + * @param name a name to look for + * @return the corresponding ProcessorArchitecture + */ + @JsonCreator + public static ProcessorArchitecture fromString(String name) { + return fromString(name, ProcessorArchitecture.class); + } + + /** + * @return known ProcessorArchitecture values + */ + public static Collection values() { + return values(ProcessorArchitecture.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/Protocol.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/Protocol.java new file mode 100644 index 000000000000..5ada6762fa6b --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/Protocol.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for Protocol. + */ +public final class Protocol extends ExpandableStringEnum { + /** Static value Tcp for Protocol. */ + public static final Protocol TCP = fromString("Tcp"); + + /** Static value Http for Protocol. */ + public static final Protocol HTTP = fromString("Http"); + + /** Static value Https for Protocol. */ + public static final Protocol HTTPS = fromString("Https"); + + /** Static value Icmp for Protocol. */ + public static final Protocol ICMP = fromString("Icmp"); + + /** + * Creates or finds a Protocol from its string representation. + * @param name a name to look for + * @return the corresponding Protocol + */ + @JsonCreator + public static Protocol fromString(String name) { + return fromString(name, Protocol.class); + } + + /** + * @return known Protocol values + */ + public static Collection values() { + return values(Protocol.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ProtocolConfiguration.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ProtocolConfiguration.java new file mode 100644 index 000000000000..f0e9bb453f72 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ProtocolConfiguration.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.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Configuration of the protocol. + */ +public class ProtocolConfiguration { + /** + * The hTTPConfiguration property. + */ + @JsonProperty(value = "HTTPConfiguration") + private HTTPConfiguration hTTPConfiguration; + + /** + * Get the hTTPConfiguration value. + * + * @return the hTTPConfiguration value + */ + public HTTPConfiguration hTTPConfiguration() { + return this.hTTPConfiguration; + } + + /** + * Set the hTTPConfiguration value. + * + * @param hTTPConfiguration the hTTPConfiguration value to set + * @return the ProtocolConfiguration object itself. + */ + public ProtocolConfiguration withHTTPConfiguration(HTTPConfiguration hTTPConfiguration) { + this.hTTPConfiguration = hTTPConfiguration; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ProvisioningState.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ProvisioningState.java new file mode 100644 index 000000000000..528e5ca4efda --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ProvisioningState.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ProvisioningState. + */ +public final class ProvisioningState extends ExpandableStringEnum { + /** Static value Succeeded for ProvisioningState. */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Updating for ProvisioningState. */ + public static final ProvisioningState UPDATING = fromString("Updating"); + + /** Static value Deleting for ProvisioningState. */ + public static final ProvisioningState DELETING = fromString("Deleting"); + + /** Static value Failed for ProvisioningState. */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** + * Creates or finds a ProvisioningState from its string representation. + * @param name a name to look for + * @return the corresponding ProvisioningState + */ + @JsonCreator + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** + * @return known ProvisioningState values + */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/PublicIPAddress.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/PublicIPAddress.java new file mode 100644 index 000000000000..98de5e27cfb6 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/PublicIPAddress.java @@ -0,0 +1,349 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.implementation.PublicIPAddressInner; + +/** + * Type representing PublicIPAddress. + */ +public interface PublicIPAddress extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the dnsSettings value. + */ + PublicIPAddressDnsSettings dnsSettings(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the idleTimeoutInMinutes value. + */ + Integer idleTimeoutInMinutes(); + + /** + * @return the ipAddress value. + */ + String ipAddress(); + + /** + * @return the ipConfiguration value. + */ + IPConfiguration ipConfiguration(); + + /** + * @return the ipTags value. + */ + List ipTags(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the publicIPAddressVersion value. + */ + IPVersion publicIPAddressVersion(); + + /** + * @return the publicIPAllocationMethod value. + */ + IPAllocationMethod publicIPAllocationMethod(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * @return the sku value. + */ + PublicIPAddressSku sku(); + + /** + * @return the zones value. + */ + List zones(); + + /** + * The entirety of the PublicIPAddress definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of PublicIPAddress definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a PublicIPAddress definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the PublicIPAddress definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the publicipaddress update allowing to specify DnsSettings. + */ + interface WithDnsSettings { + /** + * Specifies dnsSettings. + */ + WithCreate withDnsSettings(PublicIPAddressDnsSettings dnsSettings); + } + + /** + * The stage of the publicipaddress update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the publicipaddress update allowing to specify IdleTimeoutInMinutes. + */ + interface WithIdleTimeoutInMinutes { + /** + * Specifies idleTimeoutInMinutes. + */ + WithCreate withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes); + } + + /** + * The stage of the publicipaddress update allowing to specify IpAddress. + */ + interface WithIpAddress { + /** + * Specifies ipAddress. + */ + WithCreate withIpAddress(String ipAddress); + } + + /** + * The stage of the publicipaddress update allowing to specify IpTags. + */ + interface WithIpTags { + /** + * Specifies ipTags. + */ + WithCreate withIpTags(List ipTags); + } + + /** + * The stage of the publicipaddress update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the publicipaddress update allowing to specify PublicIPAddressVersion. + */ + interface WithPublicIPAddressVersion { + /** + * Specifies publicIPAddressVersion. + */ + WithCreate withPublicIPAddressVersion(IPVersion publicIPAddressVersion); + } + + /** + * The stage of the publicipaddress update allowing to specify PublicIPAllocationMethod. + */ + interface WithPublicIPAllocationMethod { + /** + * Specifies publicIPAllocationMethod. + */ + WithCreate withPublicIPAllocationMethod(IPAllocationMethod publicIPAllocationMethod); + } + + /** + * The stage of the publicipaddress update allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + */ + WithCreate withResourceGuid(String resourceGuid); + } + + /** + * The stage of the publicipaddress update allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + */ + WithCreate withSku(PublicIPAddressSku sku); + } + + /** + * The stage of the publicipaddress update allowing to specify Zones. + */ + interface WithZones { + /** + * Specifies zones. + */ + WithCreate withZones(List zones); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithDnsSettings, DefinitionStages.WithEtag, DefinitionStages.WithIdleTimeoutInMinutes, DefinitionStages.WithIpAddress, DefinitionStages.WithIpTags, DefinitionStages.WithProvisioningState, DefinitionStages.WithPublicIPAddressVersion, DefinitionStages.WithPublicIPAllocationMethod, DefinitionStages.WithResourceGuid, DefinitionStages.WithSku, DefinitionStages.WithZones { + } + } + /** + * The template for a PublicIPAddress update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithDnsSettings, UpdateStages.WithEtag, UpdateStages.WithIdleTimeoutInMinutes, UpdateStages.WithIpAddress, UpdateStages.WithIpTags, UpdateStages.WithProvisioningState, UpdateStages.WithPublicIPAddressVersion, UpdateStages.WithPublicIPAllocationMethod, UpdateStages.WithResourceGuid, UpdateStages.WithSku, UpdateStages.WithZones { + } + + /** + * Grouping of PublicIPAddress update stages. + */ + interface UpdateStages { + /** + * The stage of the publicipaddress {0} allowing to specify DnsSettings. + */ + interface WithDnsSettings { + /** + * Specifies dnsSettings. + */ + Update withDnsSettings(PublicIPAddressDnsSettings dnsSettings); + } + + /** + * The stage of the publicipaddress {0} allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + */ + Update withEtag(String etag); + } + + /** + * The stage of the publicipaddress {0} allowing to specify IdleTimeoutInMinutes. + */ + interface WithIdleTimeoutInMinutes { + /** + * Specifies idleTimeoutInMinutes. + */ + Update withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes); + } + + /** + * The stage of the publicipaddress {0} allowing to specify IpAddress. + */ + interface WithIpAddress { + /** + * Specifies ipAddress. + */ + Update withIpAddress(String ipAddress); + } + + /** + * The stage of the publicipaddress {0} allowing to specify IpTags. + */ + interface WithIpTags { + /** + * Specifies ipTags. + */ + Update withIpTags(List ipTags); + } + + /** + * The stage of the publicipaddress {0} allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + */ + Update withProvisioningState(String provisioningState); + } + + /** + * The stage of the publicipaddress {0} allowing to specify PublicIPAddressVersion. + */ + interface WithPublicIPAddressVersion { + /** + * Specifies publicIPAddressVersion. + */ + Update withPublicIPAddressVersion(IPVersion publicIPAddressVersion); + } + + /** + * The stage of the publicipaddress {0} allowing to specify PublicIPAllocationMethod. + */ + interface WithPublicIPAllocationMethod { + /** + * Specifies publicIPAllocationMethod. + */ + Update withPublicIPAllocationMethod(IPAllocationMethod publicIPAllocationMethod); + } + + /** + * The stage of the publicipaddress {0} allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + */ + Update withResourceGuid(String resourceGuid); + } + + /** + * The stage of the publicipaddress {0} allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + */ + Update withSku(PublicIPAddressSku sku); + } + + /** + * The stage of the publicipaddress {0} allowing to specify Zones. + */ + interface WithZones { + /** + * Specifies zones. + */ + Update withZones(List zones); + } + + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/PublicIPAddressDnsSettings.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/PublicIPAddressDnsSettings.java new file mode 100644 index 000000000000..2d05d1e91bbf --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/PublicIPAddressDnsSettings.java @@ -0,0 +1,104 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains FQDN of the DNS record associated with the public IP address. + */ +public class PublicIPAddressDnsSettings { + /** + * Gets or sets the Domain name label.The concatenation of the domain name + * label and the regionalized DNS zone make up the fully qualified domain + * name associated with the public IP address. If a domain name label is + * specified, an A DNS record is created for the public IP in the Microsoft + * Azure DNS system. + */ + @JsonProperty(value = "domainNameLabel") + private String domainNameLabel; + + /** + * Gets the FQDN, Fully qualified domain name of the A DNS record + * associated with the public IP. This is the concatenation of the + * domainNameLabel and the regionalized DNS zone. + */ + @JsonProperty(value = "fqdn") + private String fqdn; + + /** + * Gets or Sets the Reverse FQDN. A user-visible, fully qualified domain + * name that resolves to this public IP address. If the reverseFqdn is + * specified, then a PTR DNS record is created pointing from the IP address + * in the in-addr.arpa domain to the reverse FQDN. + */ + @JsonProperty(value = "reverseFqdn") + private String reverseFqdn; + + /** + * Get gets or sets the Domain name label.The concatenation of the domain name label and the regionalized DNS zone make up the fully qualified domain name associated with the public IP address. If a domain name label is specified, an A DNS record is created for the public IP in the Microsoft Azure DNS system. + * + * @return the domainNameLabel value + */ + public String domainNameLabel() { + return this.domainNameLabel; + } + + /** + * Set gets or sets the Domain name label.The concatenation of the domain name label and the regionalized DNS zone make up the fully qualified domain name associated with the public IP address. If a domain name label is specified, an A DNS record is created for the public IP in the Microsoft Azure DNS system. + * + * @param domainNameLabel the domainNameLabel value to set + * @return the PublicIPAddressDnsSettings object itself. + */ + public PublicIPAddressDnsSettings withDomainNameLabel(String domainNameLabel) { + this.domainNameLabel = domainNameLabel; + return this; + } + + /** + * Get gets the FQDN, Fully qualified domain name of the A DNS record associated with the public IP. This is the concatenation of the domainNameLabel and the regionalized DNS zone. + * + * @return the fqdn value + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Set gets the FQDN, Fully qualified domain name of the A DNS record associated with the public IP. This is the concatenation of the domainNameLabel and the regionalized DNS zone. + * + * @param fqdn the fqdn value to set + * @return the PublicIPAddressDnsSettings object itself. + */ + public PublicIPAddressDnsSettings withFqdn(String fqdn) { + this.fqdn = fqdn; + return this; + } + + /** + * Get gets or Sets the Reverse FQDN. A user-visible, fully qualified domain name that resolves to this public IP address. If the reverseFqdn is specified, then a PTR DNS record is created pointing from the IP address in the in-addr.arpa domain to the reverse FQDN. + * + * @return the reverseFqdn value + */ + public String reverseFqdn() { + return this.reverseFqdn; + } + + /** + * Set gets or Sets the Reverse FQDN. A user-visible, fully qualified domain name that resolves to this public IP address. If the reverseFqdn is specified, then a PTR DNS record is created pointing from the IP address in the in-addr.arpa domain to the reverse FQDN. + * + * @param reverseFqdn the reverseFqdn value to set + * @return the PublicIPAddressDnsSettings object itself. + */ + public PublicIPAddressDnsSettings withReverseFqdn(String reverseFqdn) { + this.reverseFqdn = reverseFqdn; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/PublicIPAddressSku.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/PublicIPAddressSku.java new file mode 100644 index 000000000000..a93894d5cdb1 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/PublicIPAddressSku.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.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * SKU of a public IP address. + */ +public class PublicIPAddressSku { + /** + * Name of a public IP address SKU. Possible values include: 'Basic', + * 'Standard'. + */ + @JsonProperty(value = "name") + private PublicIPAddressSkuName name; + + /** + * Get name of a public IP address SKU. Possible values include: 'Basic', 'Standard'. + * + * @return the name value + */ + public PublicIPAddressSkuName name() { + return this.name; + } + + /** + * Set name of a public IP address SKU. Possible values include: 'Basic', 'Standard'. + * + * @param name the name value to set + * @return the PublicIPAddressSku object itself. + */ + public PublicIPAddressSku withName(PublicIPAddressSkuName name) { + this.name = name; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/PublicIPAddressSkuName.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/PublicIPAddressSkuName.java new file mode 100644 index 000000000000..60fdaac9939d --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/PublicIPAddressSkuName.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for PublicIPAddressSkuName. + */ +public final class PublicIPAddressSkuName extends ExpandableStringEnum { + /** Static value Basic for PublicIPAddressSkuName. */ + public static final PublicIPAddressSkuName BASIC = fromString("Basic"); + + /** Static value Standard for PublicIPAddressSkuName. */ + public static final PublicIPAddressSkuName STANDARD = fromString("Standard"); + + /** + * Creates or finds a PublicIPAddressSkuName from its string representation. + * @param name a name to look for + * @return the corresponding PublicIPAddressSkuName + */ + @JsonCreator + public static PublicIPAddressSkuName fromString(String name) { + return fromString(name, PublicIPAddressSkuName.class); + } + + /** + * @return known PublicIPAddressSkuName values + */ + public static Collection values() { + return values(PublicIPAddressSkuName.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/PublicIPAddresses.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/PublicIPAddresses.java new file mode 100644 index 000000000000..9c7b94c33e08 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/PublicIPAddresses.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_06_01.implementation.PublicIPAddressesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing PublicIPAddresses. + */ +public interface PublicIPAddresses extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Gets information about all public IP addresses on a virtual machine scale set level. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listVirtualMachineScaleSetPublicIPAddressesAsync(final String resourceGroupName, final String virtualMachineScaleSetName); + + /** + * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The network interface name. + * @param ipConfigurationName The IP configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listVirtualMachineScaleSetVMPublicIPAddressesAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName, final String ipConfigurationName); + + /** + * Get the specified public IP address in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getVirtualMachineScaleSetPublicIPAddressAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, String publicIpAddressName); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/QueryTroubleshootingParameters.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/QueryTroubleshootingParameters.java new file mode 100644 index 000000000000..832b7be66f25 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/QueryTroubleshootingParameters.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.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters that define the resource to query the troubleshooting result. + */ +public class QueryTroubleshootingParameters { + /** + * The target resource ID to query the troubleshooting result. + */ + @JsonProperty(value = "targetResourceId", required = true) + private String targetResourceId; + + /** + * Get the target resource ID to query the troubleshooting result. + * + * @return the targetResourceId value + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Set the target resource ID to query the troubleshooting result. + * + * @param targetResourceId the targetResourceId value to set + * @return the QueryTroubleshootingParameters object itself. + */ + public QueryTroubleshootingParameters withTargetResourceId(String targetResourceId) { + this.targetResourceId = targetResourceId; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ResourceNavigationLink.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ResourceNavigationLink.java new file mode 100644 index 000000000000..ca6aaf11249d --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ResourceNavigationLink.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.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * ResourceNavigationLink resource. + */ +@JsonFlatten +public class ResourceNavigationLink extends SubResource { + /** + * Resource type of the linked resource. + */ + @JsonProperty(value = "properties.linkedResourceType") + private String linkedResourceType; + + /** + * Link to the external resource. + */ + @JsonProperty(value = "properties.link") + private String link; + + /** + * Provisioning state of the ResourceNavigationLink resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Name of the resource that is unique within a resource group. This name + * can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get resource type of the linked resource. + * + * @return the linkedResourceType value + */ + public String linkedResourceType() { + return this.linkedResourceType; + } + + /** + * Set resource type of the linked resource. + * + * @param linkedResourceType the linkedResourceType value to set + * @return the ResourceNavigationLink object itself. + */ + public ResourceNavigationLink withLinkedResourceType(String linkedResourceType) { + this.linkedResourceType = linkedResourceType; + return this; + } + + /** + * Get link to the external resource. + * + * @return the link value + */ + public String link() { + return this.link; + } + + /** + * Set link to the external resource. + * + * @param link the link value to set + * @return the ResourceNavigationLink object itself. + */ + public ResourceNavigationLink withLink(String link) { + this.link = link; + return this; + } + + /** + * Get provisioning state of the ResourceNavigationLink resource. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the ResourceNavigationLink object itself. + */ + public ResourceNavigationLink withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/RetentionPolicyParameters.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/RetentionPolicyParameters.java new file mode 100644 index 000000000000..778243c24875 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/RetentionPolicyParameters.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.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters that define the retention policy for flow log. + */ +public class RetentionPolicyParameters { + /** + * Number of days to retain flow log records. + */ + @JsonProperty(value = "days") + private Integer days; + + /** + * Flag to enable/disable retention. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /** + * Get number of days to retain flow log records. + * + * @return the days value + */ + public Integer days() { + return this.days; + } + + /** + * Set number of days to retain flow log records. + * + * @param days the days value to set + * @return the RetentionPolicyParameters object itself. + */ + public RetentionPolicyParameters withDays(Integer days) { + this.days = days; + return this; + } + + /** + * Get flag to enable/disable retention. + * + * @return the enabled value + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set flag to enable/disable retention. + * + * @param enabled the enabled value to set + * @return the RetentionPolicyParameters object itself. + */ + public RetentionPolicyParameters withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/Route.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/Route.java new file mode 100644 index 000000000000..9bae7c4a8565 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/Route.java @@ -0,0 +1,235 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_06_01.implementation.RouteInner; +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.network.v2018_06_01.implementation.NetworkManager; + +/** + * Type representing Route. + */ +public interface Route extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the addressPrefix value. + */ + String addressPrefix(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the nextHopIpAddress value. + */ + String nextHopIpAddress(); + + /** + * @return the nextHopType value. + */ + RouteNextHopType nextHopType(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * The entirety of the Route definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithRouteTable, DefinitionStages.WithNextHopType, DefinitionStages.WithCreate { + } + + /** + * Grouping of Route definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Route definition. + */ + interface Blank extends WithRouteTable { + } + + /** + * The stage of the route definition allowing to specify RouteTable. + */ + interface WithRouteTable { + /** + * Specifies resourceGroupName, routeTableName. + */ + WithNextHopType withExistingRouteTable(String resourceGroupName, String routeTableName); + } + + /** + * The stage of the route definition allowing to specify NextHopType. + */ + interface WithNextHopType { + /** + * Specifies nextHopType. + */ + WithCreate withNextHopType(RouteNextHopType nextHopType); + } + + /** + * The stage of the route definition allowing to specify AddressPrefix. + */ + interface WithAddressPrefix { + /** + * Specifies addressPrefix. + */ + WithCreate withAddressPrefix(String addressPrefix); + } + + /** + * The stage of the route definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the route definition allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + */ + WithCreate withId(String id); + } + + /** + * The stage of the route definition allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + */ + WithCreate withName(String name); + } + + /** + * The stage of the route definition allowing to specify NextHopIpAddress. + */ + interface WithNextHopIpAddress { + /** + * Specifies nextHopIpAddress. + */ + WithCreate withNextHopIpAddress(String nextHopIpAddress); + } + + /** + * The stage of the route definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * 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.WithAddressPrefix, DefinitionStages.WithEtag, DefinitionStages.WithId, DefinitionStages.WithName, DefinitionStages.WithNextHopIpAddress, DefinitionStages.WithProvisioningState { + } + } + /** + * The template for a Route update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAddressPrefix, UpdateStages.WithEtag, UpdateStages.WithId, UpdateStages.WithName, UpdateStages.WithNextHopIpAddress, UpdateStages.WithProvisioningState { + } + + /** + * Grouping of Route update stages. + */ + interface UpdateStages { + /** + * The stage of the route update allowing to specify AddressPrefix. + */ + interface WithAddressPrefix { + /** + * Specifies addressPrefix. + */ + Update withAddressPrefix(String addressPrefix); + } + + /** + * The stage of the route update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + */ + Update withEtag(String etag); + } + + /** + * The stage of the route update allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + */ + Update withId(String id); + } + + /** + * The stage of the route update allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + */ + Update withName(String name); + } + + /** + * The stage of the route update allowing to specify NextHopIpAddress. + */ + interface WithNextHopIpAddress { + /** + * Specifies nextHopIpAddress. + */ + Update withNextHopIpAddress(String nextHopIpAddress); + } + + /** + * The stage of the route update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + */ + Update withProvisioningState(String provisioningState); + } + + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/RouteFilter.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/RouteFilter.java new file mode 100644 index 000000000000..f072953da24a --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/RouteFilter.java @@ -0,0 +1,131 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.implementation.RouteFilterRuleInner; +import com.microsoft.azure.management.network.v2018_06_01.implementation.ExpressRouteCircuitPeeringInner; +import com.microsoft.azure.management.network.v2018_06_01.implementation.RouteFilterInner; + +/** + * Type representing RouteFilter. + */ +public interface RouteFilter extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the peerings value. + */ + List peerings(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the rules value. + */ + List rules(); + + /** + * The entirety of the RouteFilter definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of RouteFilter definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a RouteFilter definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the RouteFilter definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the routefilter update allowing to specify Peerings. + */ + interface WithPeerings { + /** + * Specifies peerings. + */ + WithCreate withPeerings(List peerings); + } + + /** + * The stage of the routefilter update allowing to specify Rules. + */ + interface WithRules { + /** + * Specifies rules. + */ + WithCreate withRules(List rules); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithPeerings, DefinitionStages.WithRules { + } + } + /** + * The template for a RouteFilter update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithPeerings, UpdateStages.WithRules { + } + + /** + * Grouping of RouteFilter update stages. + */ + interface UpdateStages { + /** + * The stage of the routefilter {0} allowing to specify Peerings. + */ + interface WithPeerings { + /** + * Specifies peerings. + */ + Update withPeerings(List peerings); + } + + /** + * The stage of the routefilter {0} allowing to specify Rules. + */ + interface WithRules { + /** + * Specifies rules. + */ + Update withRules(List rules); + } + + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/RouteFilterRule.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/RouteFilterRule.java new file mode 100644 index 000000000000..629526606aee --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/RouteFilterRule.java @@ -0,0 +1,181 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_06_01.implementation.RouteFilterRuleInner; +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.network.v2018_06_01.implementation.NetworkManager; +import java.util.List; + +/** + * Type representing RouteFilterRule. + */ +public interface RouteFilterRule extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the access value. + */ + Access access(); + + /** + * @return the communities value. + */ + List communities(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the routeFilterRuleType value. + */ + String routeFilterRuleType(); + + /** + * The entirety of the RouteFilterRule definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithRouteFilter, DefinitionStages.WithAccess, DefinitionStages.WithCommunities, DefinitionStages.WithRouteFilterRuleType, DefinitionStages.WithCreate { + } + + /** + * Grouping of RouteFilterRule definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a RouteFilterRule definition. + */ + interface Blank extends WithRouteFilter { + } + + /** + * The stage of the routefilterrule definition allowing to specify RouteFilter. + */ + interface WithRouteFilter { + /** + * Specifies resourceGroupName, routeFilterName. + */ + WithAccess withExistingRouteFilter(String resourceGroupName, String routeFilterName); + } + + /** + * The stage of the routefilterrule definition allowing to specify Access. + */ + interface WithAccess { + /** + * Specifies access. + */ + WithCommunities withAccess(Access access); + } + + /** + * The stage of the routefilterrule definition allowing to specify Communities. + */ + interface WithCommunities { + /** + * Specifies communities. + */ + WithRouteFilterRuleType withCommunities(List communities); + } + + /** + * The stage of the routefilterrule definition allowing to specify RouteFilterRuleType. + */ + interface WithRouteFilterRuleType { + /** + * Specifies routeFilterRuleType. + */ + WithCreate withRouteFilterRuleType(String routeFilterRuleType); + } + + /** + * The stage of the routefilterrule definition allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + */ + WithCreate withId(String id); + } + + /** + * The stage of the routefilterrule definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + */ + WithCreate withLocation(String location); + } + + /** + * The stage of the routefilterrule definition allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + */ + WithCreate withName(String name); + } + + /** + * 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.WithId, DefinitionStages.WithLocation, DefinitionStages.WithName { + } + } + /** + * The template for a RouteFilterRule update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithId { + } + + /** + * Grouping of RouteFilterRule update stages. + */ + interface UpdateStages { + /** + * The stage of the routefilterrule update allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + */ + Update withId(String id); + } + + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/RouteFilterRules.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/RouteFilterRules.java new file mode 100644 index 000000000000..ee2eb3db8e6d --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/RouteFilterRules.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.network.v2018_06_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_06_01.implementation.RouteFilterRulesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing RouteFilterRules. + */ +public interface RouteFilterRules extends SupportsCreating, HasInner { + /** + * Gets the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String routeFilterName, String ruleName); + + /** + * Gets all RouteFilterRules in a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByRouteFilterAsync(final String resourceGroupName, final String routeFilterName); + + /** + * Deletes the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String routeFilterName, String ruleName); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/RouteFilters.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/RouteFilters.java new file mode 100644 index 000000000000..08777e50371f --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/RouteFilters.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_06_01.implementation.RouteFiltersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing RouteFilters. + */ +public interface RouteFilters extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/RouteNextHopType.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/RouteNextHopType.java new file mode 100644 index 000000000000..59a3ad4ffb46 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/RouteNextHopType.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for RouteNextHopType. + */ +public final class RouteNextHopType extends ExpandableStringEnum { + /** Static value VirtualNetworkGateway for RouteNextHopType. */ + public static final RouteNextHopType VIRTUAL_NETWORK_GATEWAY = fromString("VirtualNetworkGateway"); + + /** Static value VnetLocal for RouteNextHopType. */ + public static final RouteNextHopType VNET_LOCAL = fromString("VnetLocal"); + + /** Static value Internet for RouteNextHopType. */ + public static final RouteNextHopType INTERNET = fromString("Internet"); + + /** Static value VirtualAppliance for RouteNextHopType. */ + public static final RouteNextHopType VIRTUAL_APPLIANCE = fromString("VirtualAppliance"); + + /** Static value None for RouteNextHopType. */ + public static final RouteNextHopType NONE = fromString("None"); + + /** + * Creates or finds a RouteNextHopType from its string representation. + * @param name a name to look for + * @return the corresponding RouteNextHopType + */ + @JsonCreator + public static RouteNextHopType fromString(String name) { + return fromString(name, RouteNextHopType.class); + } + + /** + * @return known RouteNextHopType values + */ + public static Collection values() { + return values(RouteNextHopType.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/RouteTable.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/RouteTable.java new file mode 100644 index 000000000000..e512da456159 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/RouteTable.java @@ -0,0 +1,175 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.implementation.RouteInner; +import com.microsoft.azure.management.network.v2018_06_01.implementation.RouteTableInner; + +/** + * Type representing RouteTable. + */ +public interface RouteTable extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the disableBgpRoutePropagation value. + */ + Boolean disableBgpRoutePropagation(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the routes value. + */ + List routes(); + + /** + * @return the subnets value. + */ + List subnets(); + + /** + * The entirety of the RouteTable definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of RouteTable definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a RouteTable definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the RouteTable definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the routetable update allowing to specify DisableBgpRoutePropagation. + */ + interface WithDisableBgpRoutePropagation { + /** + * Specifies disableBgpRoutePropagation. + */ + WithCreate withDisableBgpRoutePropagation(Boolean disableBgpRoutePropagation); + } + + /** + * The stage of the routetable update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the routetable update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the routetable update allowing to specify Routes. + */ + interface WithRoutes { + /** + * Specifies routes. + */ + WithCreate withRoutes(List routes); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithDisableBgpRoutePropagation, DefinitionStages.WithEtag, DefinitionStages.WithProvisioningState, DefinitionStages.WithRoutes { + } + } + /** + * The template for a RouteTable update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithDisableBgpRoutePropagation, UpdateStages.WithEtag, UpdateStages.WithProvisioningState, UpdateStages.WithRoutes { + } + + /** + * Grouping of RouteTable update stages. + */ + interface UpdateStages { + /** + * The stage of the routetable {0} allowing to specify DisableBgpRoutePropagation. + */ + interface WithDisableBgpRoutePropagation { + /** + * Specifies disableBgpRoutePropagation. + */ + Update withDisableBgpRoutePropagation(Boolean disableBgpRoutePropagation); + } + + /** + * The stage of the routetable {0} allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + */ + Update withEtag(String etag); + } + + /** + * The stage of the routetable {0} allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + */ + Update withProvisioningState(String provisioningState); + } + + /** + * The stage of the routetable {0} allowing to specify Routes. + */ + interface WithRoutes { + /** + * Specifies routes. + */ + Update withRoutes(List routes); + } + + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/RouteTables.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/RouteTables.java new file mode 100644 index 000000000000..ad25a58223e1 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/RouteTables.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_06_01.implementation.RouteTablesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing RouteTables. + */ +public interface RouteTables extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/Routes.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/Routes.java new file mode 100644 index 000000000000..f7be748d90a3 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/Routes.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.network.v2018_06_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_06_01.implementation.RoutesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Routes. + */ +public interface Routes extends SupportsCreating, HasInner { + /** + * Gets the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String routeTableName, String routeName); + + /** + * Gets all routes in a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String routeTableName); + + /** + * Deletes the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String routeTableName, String routeName); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/SecurityGroupNetworkInterface.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/SecurityGroupNetworkInterface.java new file mode 100644 index 000000000000..a5d072629178 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/SecurityGroupNetworkInterface.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.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Network interface and all its associated security rules. + */ +public class SecurityGroupNetworkInterface { + /** + * ID of the network interface. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The securityRuleAssociations property. + */ + @JsonProperty(value = "securityRuleAssociations") + private SecurityRuleAssociations securityRuleAssociations; + + /** + * Get iD of the network interface. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set iD of the network interface. + * + * @param id the id value to set + * @return the SecurityGroupNetworkInterface object itself. + */ + public SecurityGroupNetworkInterface withId(String id) { + this.id = id; + return this; + } + + /** + * Get the securityRuleAssociations value. + * + * @return the securityRuleAssociations value + */ + public SecurityRuleAssociations securityRuleAssociations() { + return this.securityRuleAssociations; + } + + /** + * Set the securityRuleAssociations value. + * + * @param securityRuleAssociations the securityRuleAssociations value to set + * @return the SecurityGroupNetworkInterface object itself. + */ + public SecurityGroupNetworkInterface withSecurityRuleAssociations(SecurityRuleAssociations securityRuleAssociations) { + this.securityRuleAssociations = securityRuleAssociations; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/SecurityGroupViewParameters.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/SecurityGroupViewParameters.java new file mode 100644 index 000000000000..af26310e1f71 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/SecurityGroupViewParameters.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.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters that define the VM to check security groups for. + */ +public class SecurityGroupViewParameters { + /** + * ID of the target VM. + */ + @JsonProperty(value = "targetResourceId", required = true) + private String targetResourceId; + + /** + * Get iD of the target VM. + * + * @return the targetResourceId value + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Set iD of the target VM. + * + * @param targetResourceId the targetResourceId value to set + * @return the SecurityGroupViewParameters object itself. + */ + public SecurityGroupViewParameters withTargetResourceId(String targetResourceId) { + this.targetResourceId = targetResourceId; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/SecurityGroupViewResult.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/SecurityGroupViewResult.java new file mode 100644 index 000000000000..f64d7efe1896 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/SecurityGroupViewResult.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.SecurityGroupViewResultInner; +import java.util.List; + +/** + * Type representing SecurityGroupViewResult. + */ +public interface SecurityGroupViewResult extends HasInner, HasManager { + /** + * @return the networkInterfaces value. + */ + List networkInterfaces(); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/SecurityRuleAccess.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/SecurityRuleAccess.java new file mode 100644 index 000000000000..ccde5de43017 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/SecurityRuleAccess.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SecurityRuleAccess. + */ +public final class SecurityRuleAccess extends ExpandableStringEnum { + /** Static value Allow for SecurityRuleAccess. */ + public static final SecurityRuleAccess ALLOW = fromString("Allow"); + + /** Static value Deny for SecurityRuleAccess. */ + public static final SecurityRuleAccess DENY = fromString("Deny"); + + /** + * Creates or finds a SecurityRuleAccess from its string representation. + * @param name a name to look for + * @return the corresponding SecurityRuleAccess + */ + @JsonCreator + public static SecurityRuleAccess fromString(String name) { + return fromString(name, SecurityRuleAccess.class); + } + + /** + * @return known SecurityRuleAccess values + */ + public static Collection values() { + return values(SecurityRuleAccess.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/SecurityRuleAssociations.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/SecurityRuleAssociations.java new file mode 100644 index 000000000000..6ee92c0f9f94 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/SecurityRuleAssociations.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.implementation.SecurityRuleInner; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * All security rules associated with the network interface. + */ +public class SecurityRuleAssociations { + /** + * The networkInterfaceAssociation property. + */ + @JsonProperty(value = "networkInterfaceAssociation") + private NetworkInterfaceAssociation networkInterfaceAssociation; + + /** + * The subnetAssociation property. + */ + @JsonProperty(value = "subnetAssociation") + private SubnetAssociation subnetAssociation; + + /** + * Collection of default security rules of the network security group. + */ + @JsonProperty(value = "defaultSecurityRules") + private List defaultSecurityRules; + + /** + * Collection of effective security rules. + */ + @JsonProperty(value = "effectiveSecurityRules") + private List effectiveSecurityRules; + + /** + * Get the networkInterfaceAssociation value. + * + * @return the networkInterfaceAssociation value + */ + public NetworkInterfaceAssociation networkInterfaceAssociation() { + return this.networkInterfaceAssociation; + } + + /** + * Set the networkInterfaceAssociation value. + * + * @param networkInterfaceAssociation the networkInterfaceAssociation value to set + * @return the SecurityRuleAssociations object itself. + */ + public SecurityRuleAssociations withNetworkInterfaceAssociation(NetworkInterfaceAssociation networkInterfaceAssociation) { + this.networkInterfaceAssociation = networkInterfaceAssociation; + return this; + } + + /** + * Get the subnetAssociation value. + * + * @return the subnetAssociation value + */ + public SubnetAssociation subnetAssociation() { + return this.subnetAssociation; + } + + /** + * Set the subnetAssociation value. + * + * @param subnetAssociation the subnetAssociation value to set + * @return the SecurityRuleAssociations object itself. + */ + public SecurityRuleAssociations withSubnetAssociation(SubnetAssociation subnetAssociation) { + this.subnetAssociation = subnetAssociation; + return this; + } + + /** + * Get collection of default security rules of the network security group. + * + * @return the defaultSecurityRules value + */ + public List defaultSecurityRules() { + return this.defaultSecurityRules; + } + + /** + * Set collection of default security rules of the network security group. + * + * @param defaultSecurityRules the defaultSecurityRules value to set + * @return the SecurityRuleAssociations object itself. + */ + public SecurityRuleAssociations withDefaultSecurityRules(List defaultSecurityRules) { + this.defaultSecurityRules = defaultSecurityRules; + return this; + } + + /** + * Get collection of effective security rules. + * + * @return the effectiveSecurityRules value + */ + public List effectiveSecurityRules() { + return this.effectiveSecurityRules; + } + + /** + * Set collection of effective security rules. + * + * @param effectiveSecurityRules the effectiveSecurityRules value to set + * @return the SecurityRuleAssociations object itself. + */ + public SecurityRuleAssociations withEffectiveSecurityRules(List effectiveSecurityRules) { + this.effectiveSecurityRules = effectiveSecurityRules; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/SecurityRuleDirection.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/SecurityRuleDirection.java new file mode 100644 index 000000000000..de035a21015c --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/SecurityRuleDirection.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SecurityRuleDirection. + */ +public final class SecurityRuleDirection extends ExpandableStringEnum { + /** Static value Inbound for SecurityRuleDirection. */ + public static final SecurityRuleDirection INBOUND = fromString("Inbound"); + + /** Static value Outbound for SecurityRuleDirection. */ + public static final SecurityRuleDirection OUTBOUND = fromString("Outbound"); + + /** + * Creates or finds a SecurityRuleDirection from its string representation. + * @param name a name to look for + * @return the corresponding SecurityRuleDirection + */ + @JsonCreator + public static SecurityRuleDirection fromString(String name) { + return fromString(name, SecurityRuleDirection.class); + } + + /** + * @return known SecurityRuleDirection values + */ + public static Collection values() { + return values(SecurityRuleDirection.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/SecurityRuleProtocol.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/SecurityRuleProtocol.java new file mode 100644 index 000000000000..7fb53cddd2bf --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/SecurityRuleProtocol.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SecurityRuleProtocol. + */ +public final class SecurityRuleProtocol extends ExpandableStringEnum { + /** Static value Tcp for SecurityRuleProtocol. */ + public static final SecurityRuleProtocol TCP = fromString("Tcp"); + + /** Static value Udp for SecurityRuleProtocol. */ + public static final SecurityRuleProtocol UDP = fromString("Udp"); + + /** Static value * for SecurityRuleProtocol. */ + public static final SecurityRuleProtocol ASTERISK = fromString("*"); + + /** + * Creates or finds a SecurityRuleProtocol from its string representation. + * @param name a name to look for + * @return the corresponding SecurityRuleProtocol + */ + @JsonCreator + public static SecurityRuleProtocol fromString(String name) { + return fromString(name, SecurityRuleProtocol.class); + } + + /** + * @return known SecurityRuleProtocol values + */ + public static Collection values() { + return values(SecurityRuleProtocol.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/SecurityRules.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/SecurityRules.java new file mode 100644 index 000000000000..17ed6f16044e --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/SecurityRules.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.network.v2018_06_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_06_01.implementation.SecurityRulesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing SecurityRules. + */ +public interface SecurityRules extends SupportsCreating, HasInner { + /** + * Get the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName); + + /** + * Gets all security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String networkSecurityGroupName); + + /** + * Deletes the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ServiceEndpointPropertiesFormat.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ServiceEndpointPropertiesFormat.java new file mode 100644 index 000000000000..4115199fff14 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ServiceEndpointPropertiesFormat.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.network.v2018_06_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The service endpoint properties. + */ +public class ServiceEndpointPropertiesFormat { + /** + * The type of the endpoint service. + */ + @JsonProperty(value = "service") + private String service; + + /** + * A list of locations. + */ + @JsonProperty(value = "locations") + private List locations; + + /** + * The provisioning state of the resource. + */ + @JsonProperty(value = "provisioningState") + private String provisioningState; + + /** + * Get the type of the endpoint service. + * + * @return the service value + */ + public String service() { + return this.service; + } + + /** + * Set the type of the endpoint service. + * + * @param service the service value to set + * @return the ServiceEndpointPropertiesFormat object itself. + */ + public ServiceEndpointPropertiesFormat withService(String service) { + this.service = service; + return this; + } + + /** + * Get a list of locations. + * + * @return the locations value + */ + public List locations() { + return this.locations; + } + + /** + * Set a list of locations. + * + * @param locations the locations value to set + * @return the ServiceEndpointPropertiesFormat object itself. + */ + public ServiceEndpointPropertiesFormat withLocations(List locations) { + this.locations = locations; + return this; + } + + /** + * Get the provisioning state of the resource. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. + * + * @param provisioningState the provisioningState value to set + * @return the ServiceEndpointPropertiesFormat object itself. + */ + public ServiceEndpointPropertiesFormat withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ServiceProviderProvisioningState.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ServiceProviderProvisioningState.java new file mode 100644 index 000000000000..9ab9bca91f66 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/ServiceProviderProvisioningState.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ServiceProviderProvisioningState. + */ +public final class ServiceProviderProvisioningState extends ExpandableStringEnum { + /** Static value NotProvisioned for ServiceProviderProvisioningState. */ + public static final ServiceProviderProvisioningState NOT_PROVISIONED = fromString("NotProvisioned"); + + /** Static value Provisioning for ServiceProviderProvisioningState. */ + public static final ServiceProviderProvisioningState PROVISIONING = fromString("Provisioning"); + + /** Static value Provisioned for ServiceProviderProvisioningState. */ + public static final ServiceProviderProvisioningState PROVISIONED = fromString("Provisioned"); + + /** Static value Deprovisioning for ServiceProviderProvisioningState. */ + public static final ServiceProviderProvisioningState DEPROVISIONING = fromString("Deprovisioning"); + + /** + * Creates or finds a ServiceProviderProvisioningState from its string representation. + * @param name a name to look for + * @return the corresponding ServiceProviderProvisioningState + */ + @JsonCreator + public static ServiceProviderProvisioningState fromString(String name) { + return fromString(name, ServiceProviderProvisioningState.class); + } + + /** + * @return known ServiceProviderProvisioningState values + */ + public static Collection values() { + return values(ServiceProviderProvisioningState.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/Severity.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/Severity.java new file mode 100644 index 000000000000..3d06e860620c --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/Severity.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for Severity. + */ +public final class Severity extends ExpandableStringEnum { + /** Static value Error for Severity. */ + public static final Severity ERROR = fromString("Error"); + + /** Static value Warning for Severity. */ + public static final Severity WARNING = fromString("Warning"); + + /** + * Creates or finds a Severity from its string representation. + * @param name a name to look for + * @return the corresponding Severity + */ + @JsonCreator + public static Severity fromString(String name) { + return fromString(name, Severity.class); + } + + /** + * @return known Severity values + */ + public static Collection values() { + return values(Severity.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/Subnet.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/Subnet.java new file mode 100644 index 000000000000..dd7dae71d517 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/Subnet.java @@ -0,0 +1,303 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_06_01.implementation.SubnetInner; +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.network.v2018_06_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkSecurityGroupInner; +import com.microsoft.azure.management.network.v2018_06_01.implementation.RouteTableInner; + +/** + * Type representing Subnet. + */ +public interface Subnet extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the addressPrefix value. + */ + String addressPrefix(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the ipConfigurations value. + */ + List ipConfigurations(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the networkSecurityGroup value. + */ + NetworkSecurityGroup networkSecurityGroup(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceNavigationLinks value. + */ + List resourceNavigationLinks(); + + /** + * @return the routeTable value. + */ + RouteTable routeTable(); + + /** + * @return the serviceEndpoints value. + */ + List serviceEndpoints(); + + /** + * The entirety of the Subnet definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithVirtualNetwork, DefinitionStages.WithCreate { + } + + /** + * Grouping of Subnet definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Subnet definition. + */ + interface Blank extends WithVirtualNetwork { + } + + /** + * The stage of the subnet definition allowing to specify VirtualNetwork. + */ + interface WithVirtualNetwork { + /** + * Specifies resourceGroupName, virtualNetworkName. + */ + WithCreate withExistingVirtualNetwork(String resourceGroupName, String virtualNetworkName); + } + + /** + * The stage of the subnet definition allowing to specify AddressPrefix. + */ + interface WithAddressPrefix { + /** + * Specifies addressPrefix. + */ + WithCreate withAddressPrefix(String addressPrefix); + } + + /** + * The stage of the subnet definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the subnet definition allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + */ + WithCreate withId(String id); + } + + /** + * The stage of the subnet definition allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + */ + WithCreate withName(String name); + } + + /** + * The stage of the subnet definition allowing to specify NetworkSecurityGroup. + */ + interface WithNetworkSecurityGroup { + /** + * Specifies networkSecurityGroup. + */ + WithCreate withNetworkSecurityGroup(NetworkSecurityGroupInner networkSecurityGroup); + } + + /** + * The stage of the subnet definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the subnet definition allowing to specify ResourceNavigationLinks. + */ + interface WithResourceNavigationLinks { + /** + * Specifies resourceNavigationLinks. + */ + WithCreate withResourceNavigationLinks(List resourceNavigationLinks); + } + + /** + * The stage of the subnet definition allowing to specify RouteTable. + */ + interface WithRouteTable { + /** + * Specifies routeTable. + */ + WithCreate withRouteTable(RouteTableInner routeTable); + } + + /** + * The stage of the subnet definition allowing to specify ServiceEndpoints. + */ + interface WithServiceEndpoints { + /** + * Specifies serviceEndpoints. + */ + WithCreate withServiceEndpoints(List serviceEndpoints); + } + + /** + * 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.WithAddressPrefix, DefinitionStages.WithEtag, DefinitionStages.WithId, DefinitionStages.WithName, DefinitionStages.WithNetworkSecurityGroup, DefinitionStages.WithProvisioningState, DefinitionStages.WithResourceNavigationLinks, DefinitionStages.WithRouteTable, DefinitionStages.WithServiceEndpoints { + } + } + /** + * The template for a Subnet update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAddressPrefix, UpdateStages.WithEtag, UpdateStages.WithId, UpdateStages.WithName, UpdateStages.WithNetworkSecurityGroup, UpdateStages.WithProvisioningState, UpdateStages.WithResourceNavigationLinks, UpdateStages.WithRouteTable, UpdateStages.WithServiceEndpoints { + } + + /** + * Grouping of Subnet update stages. + */ + interface UpdateStages { + /** + * The stage of the subnet update allowing to specify AddressPrefix. + */ + interface WithAddressPrefix { + /** + * Specifies addressPrefix. + */ + Update withAddressPrefix(String addressPrefix); + } + + /** + * The stage of the subnet update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + */ + Update withEtag(String etag); + } + + /** + * The stage of the subnet update allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + */ + Update withId(String id); + } + + /** + * The stage of the subnet update allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + */ + Update withName(String name); + } + + /** + * The stage of the subnet update allowing to specify NetworkSecurityGroup. + */ + interface WithNetworkSecurityGroup { + /** + * Specifies networkSecurityGroup. + */ + Update withNetworkSecurityGroup(NetworkSecurityGroupInner networkSecurityGroup); + } + + /** + * The stage of the subnet update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + */ + Update withProvisioningState(String provisioningState); + } + + /** + * The stage of the subnet update allowing to specify ResourceNavigationLinks. + */ + interface WithResourceNavigationLinks { + /** + * Specifies resourceNavigationLinks. + */ + Update withResourceNavigationLinks(List resourceNavigationLinks); + } + + /** + * The stage of the subnet update allowing to specify RouteTable. + */ + interface WithRouteTable { + /** + * Specifies routeTable. + */ + Update withRouteTable(RouteTableInner routeTable); + } + + /** + * The stage of the subnet update allowing to specify ServiceEndpoints. + */ + interface WithServiceEndpoints { + /** + * Specifies serviceEndpoints. + */ + Update withServiceEndpoints(List serviceEndpoints); + } + + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/SubnetAssociation.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/SubnetAssociation.java new file mode 100644 index 000000000000..bcddf896ffb9 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/SubnetAssociation.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.network.v2018_06_01; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.implementation.SecurityRuleInner; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Network interface and its custom security rules. + */ +public class SubnetAssociation { + /** + * Subnet ID. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Collection of custom security rules. + */ + @JsonProperty(value = "securityRules") + private List securityRules; + + /** + * Get subnet ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get collection of custom security rules. + * + * @return the securityRules value + */ + public List securityRules() { + return this.securityRules; + } + + /** + * Set collection of custom security rules. + * + * @param securityRules the securityRules value to set + * @return the SubnetAssociation object itself. + */ + public SubnetAssociation withSecurityRules(List securityRules) { + this.securityRules = securityRules; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/Subnets.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/Subnets.java new file mode 100644 index 000000000000..30c7d3f5308c --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/Subnets.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.network.v2018_06_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_06_01.implementation.SubnetsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Subnets. + */ +public interface Subnets extends SupportsCreating, HasInner { + /** + * Gets the specified subnet by virtual network and resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String virtualNetworkName, String subnetName); + + /** + * Gets all subnets in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String virtualNetworkName); + + /** + * Deletes the specified subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String virtualNetworkName, String subnetName); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/TagsObject.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/TagsObject.java new file mode 100644 index 000000000000..054c6ff8c185 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/TagsObject.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.network.v2018_06_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Tags object for patch operations. + */ +public class TagsObject { + /** + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get resource tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set resource tags. + * + * @param tags the tags value to set + * @return the TagsObject object itself. + */ + public TagsObject withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/Topology.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/Topology.java new file mode 100644 index 000000000000..c457c9840588 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/Topology.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.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.TopologyInner; +import org.joda.time.DateTime; +import java.util.List; + +/** + * Type representing Topology. + */ +public interface Topology extends HasInner, HasManager { + /** + * @return the createdDateTime value. + */ + DateTime createdDateTime(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the lastModified value. + */ + DateTime lastModified(); + + /** + * @return the resources value. + */ + List resources(); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/TopologyAssociation.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/TopologyAssociation.java new file mode 100644 index 000000000000..5a023ff40523 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/TopologyAssociation.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.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Resources that have an association with the parent resource. + */ +public class TopologyAssociation { + /** + * The name of the resource that is associated with the parent resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The ID of the resource that is associated with the parent resource. + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /** + * The association type of the child resource to the parent resource. + * Possible values include: 'Associated', 'Contains'. + */ + @JsonProperty(value = "associationType") + private AssociationType associationType; + + /** + * Get the name of the resource that is associated with the parent resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource that is associated with the parent resource. + * + * @param name the name value to set + * @return the TopologyAssociation object itself. + */ + public TopologyAssociation withName(String name) { + this.name = name; + return this; + } + + /** + * Get the ID of the resource that is associated with the parent resource. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the ID of the resource that is associated with the parent resource. + * + * @param resourceId the resourceId value to set + * @return the TopologyAssociation object itself. + */ + public TopologyAssociation withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the association type of the child resource to the parent resource. Possible values include: 'Associated', 'Contains'. + * + * @return the associationType value + */ + public AssociationType associationType() { + return this.associationType; + } + + /** + * Set the association type of the child resource to the parent resource. Possible values include: 'Associated', 'Contains'. + * + * @param associationType the associationType value to set + * @return the TopologyAssociation object itself. + */ + public TopologyAssociation withAssociationType(AssociationType associationType) { + this.associationType = associationType; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/TopologyParameters.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/TopologyParameters.java new file mode 100644 index 000000000000..a49d523eb5b4 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/TopologyParameters.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.network.v2018_06_01; + +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters that define the representation of topology. + */ +public class TopologyParameters { + /** + * The name of the target resource group to perform topology on. + */ + @JsonProperty(value = "targetResourceGroupName") + private String targetResourceGroupName; + + /** + * The reference of the Virtual Network resource. + */ + @JsonProperty(value = "targetVirtualNetwork") + private SubResource targetVirtualNetwork; + + /** + * The reference of the Subnet resource. + */ + @JsonProperty(value = "targetSubnet") + private SubResource targetSubnet; + + /** + * Get the name of the target resource group to perform topology on. + * + * @return the targetResourceGroupName value + */ + public String targetResourceGroupName() { + return this.targetResourceGroupName; + } + + /** + * Set the name of the target resource group to perform topology on. + * + * @param targetResourceGroupName the targetResourceGroupName value to set + * @return the TopologyParameters object itself. + */ + public TopologyParameters withTargetResourceGroupName(String targetResourceGroupName) { + this.targetResourceGroupName = targetResourceGroupName; + return this; + } + + /** + * Get the reference of the Virtual Network resource. + * + * @return the targetVirtualNetwork value + */ + public SubResource targetVirtualNetwork() { + return this.targetVirtualNetwork; + } + + /** + * Set the reference of the Virtual Network resource. + * + * @param targetVirtualNetwork the targetVirtualNetwork value to set + * @return the TopologyParameters object itself. + */ + public TopologyParameters withTargetVirtualNetwork(SubResource targetVirtualNetwork) { + this.targetVirtualNetwork = targetVirtualNetwork; + return this; + } + + /** + * Get the reference of the Subnet resource. + * + * @return the targetSubnet value + */ + public SubResource targetSubnet() { + return this.targetSubnet; + } + + /** + * Set the reference of the Subnet resource. + * + * @param targetSubnet the targetSubnet value to set + * @return the TopologyParameters object itself. + */ + public TopologyParameters withTargetSubnet(SubResource targetSubnet) { + this.targetSubnet = targetSubnet; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/TopologyResource.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/TopologyResource.java new file mode 100644 index 000000000000..f10725ace438 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/TopologyResource.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The network resource topology information for the given resource group. + */ +public class TopologyResource { + /** + * Name of the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * ID of the resource. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Resource location. + */ + @JsonProperty(value = "location") + private String location; + + /** + * Holds the associations the resource has with other resources in the + * resource group. + */ + @JsonProperty(value = "associations") + private List associations; + + /** + * Get name of the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the resource. + * + * @param name the name value to set + * @return the TopologyResource object itself. + */ + public TopologyResource withName(String name) { + this.name = name; + return this; + } + + /** + * Get iD of the resource. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set iD of the resource. + * + * @param id the id value to set + * @return the TopologyResource object itself. + */ + public TopologyResource withId(String id) { + this.id = id; + return this; + } + + /** + * Get resource location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set resource location. + * + * @param location the location value to set + * @return the TopologyResource object itself. + */ + public TopologyResource withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get holds the associations the resource has with other resources in the resource group. + * + * @return the associations value + */ + public List associations() { + return this.associations; + } + + /** + * Set holds the associations the resource has with other resources in the resource group. + * + * @param associations the associations value to set + * @return the TopologyResource object itself. + */ + public TopologyResource withAssociations(List associations) { + this.associations = associations; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/TrafficAnalyticsConfigurationProperties.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/TrafficAnalyticsConfigurationProperties.java new file mode 100644 index 000000000000..fa2a9ece7ab4 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/TrafficAnalyticsConfigurationProperties.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.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters that define the configuration of traffic analytics. + */ +public class TrafficAnalyticsConfigurationProperties { + /** + * Flag to enable/disable traffic analytics. + */ + @JsonProperty(value = "enabled", required = true) + private boolean enabled; + + /** + * The resource guid of the attached workspace. + */ + @JsonProperty(value = "workspaceId", required = true) + private String workspaceId; + + /** + * The location of the attached workspace. + */ + @JsonProperty(value = "workspaceRegion", required = true) + private String workspaceRegion; + + /** + * Resource Id of the attached workspace. + */ + @JsonProperty(value = "workspaceResourceId", required = true) + private String workspaceResourceId; + + /** + * Get flag to enable/disable traffic analytics. + * + * @return the enabled value + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set flag to enable/disable traffic analytics. + * + * @param enabled the enabled value to set + * @return the TrafficAnalyticsConfigurationProperties object itself. + */ + public TrafficAnalyticsConfigurationProperties withEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the resource guid of the attached workspace. + * + * @return the workspaceId value + */ + public String workspaceId() { + return this.workspaceId; + } + + /** + * Set the resource guid of the attached workspace. + * + * @param workspaceId the workspaceId value to set + * @return the TrafficAnalyticsConfigurationProperties object itself. + */ + public TrafficAnalyticsConfigurationProperties withWorkspaceId(String workspaceId) { + this.workspaceId = workspaceId; + return this; + } + + /** + * Get the location of the attached workspace. + * + * @return the workspaceRegion value + */ + public String workspaceRegion() { + return this.workspaceRegion; + } + + /** + * Set the location of the attached workspace. + * + * @param workspaceRegion the workspaceRegion value to set + * @return the TrafficAnalyticsConfigurationProperties object itself. + */ + public TrafficAnalyticsConfigurationProperties withWorkspaceRegion(String workspaceRegion) { + this.workspaceRegion = workspaceRegion; + return this; + } + + /** + * Get resource Id of the attached workspace. + * + * @return the workspaceResourceId value + */ + public String workspaceResourceId() { + return this.workspaceResourceId; + } + + /** + * Set resource Id of the attached workspace. + * + * @param workspaceResourceId the workspaceResourceId value to set + * @return the TrafficAnalyticsConfigurationProperties object itself. + */ + public TrafficAnalyticsConfigurationProperties withWorkspaceResourceId(String workspaceResourceId) { + this.workspaceResourceId = workspaceResourceId; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/TrafficAnalyticsProperties.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/TrafficAnalyticsProperties.java new file mode 100644 index 000000000000..4f66033540e6 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/TrafficAnalyticsProperties.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.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters that define the configuration of traffic analytics. + */ +public class TrafficAnalyticsProperties { + /** + * The networkWatcherFlowAnalyticsConfiguration property. + */ + @JsonProperty(value = "networkWatcherFlowAnalyticsConfiguration", required = true) + private TrafficAnalyticsConfigurationProperties networkWatcherFlowAnalyticsConfiguration; + + /** + * Get the networkWatcherFlowAnalyticsConfiguration value. + * + * @return the networkWatcherFlowAnalyticsConfiguration value + */ + public TrafficAnalyticsConfigurationProperties networkWatcherFlowAnalyticsConfiguration() { + return this.networkWatcherFlowAnalyticsConfiguration; + } + + /** + * Set the networkWatcherFlowAnalyticsConfiguration value. + * + * @param networkWatcherFlowAnalyticsConfiguration the networkWatcherFlowAnalyticsConfiguration value to set + * @return the TrafficAnalyticsProperties object itself. + */ + public TrafficAnalyticsProperties withNetworkWatcherFlowAnalyticsConfiguration(TrafficAnalyticsConfigurationProperties networkWatcherFlowAnalyticsConfiguration) { + this.networkWatcherFlowAnalyticsConfiguration = networkWatcherFlowAnalyticsConfiguration; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/TransportProtocol.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/TransportProtocol.java new file mode 100644 index 000000000000..af63d1abe049 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/TransportProtocol.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for TransportProtocol. + */ +public final class TransportProtocol extends ExpandableStringEnum { + /** Static value Udp for TransportProtocol. */ + public static final TransportProtocol UDP = fromString("Udp"); + + /** Static value Tcp for TransportProtocol. */ + public static final TransportProtocol TCP = fromString("Tcp"); + + /** Static value All for TransportProtocol. */ + public static final TransportProtocol ALL = fromString("All"); + + /** + * Creates or finds a TransportProtocol from its string representation. + * @param name a name to look for + * @return the corresponding TransportProtocol + */ + @JsonCreator + public static TransportProtocol fromString(String name) { + return fromString(name, TransportProtocol.class); + } + + /** + * @return known TransportProtocol values + */ + public static Collection values() { + return values(TransportProtocol.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/TroubleshootingDetails.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/TroubleshootingDetails.java new file mode 100644 index 000000000000..461e8782f4ca --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/TroubleshootingDetails.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information gained from troubleshooting of specified resource. + */ +public class TroubleshootingDetails { + /** + * The id of the get troubleshoot operation. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Reason type of failure. + */ + @JsonProperty(value = "reasonType") + private String reasonType; + + /** + * A summary of troubleshooting. + */ + @JsonProperty(value = "summary") + private String summary; + + /** + * Details on troubleshooting results. + */ + @JsonProperty(value = "detail") + private String detail; + + /** + * List of recommended actions. + */ + @JsonProperty(value = "recommendedActions") + private List recommendedActions; + + /** + * Get the id of the get troubleshoot operation. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the id of the get troubleshoot operation. + * + * @param id the id value to set + * @return the TroubleshootingDetails object itself. + */ + public TroubleshootingDetails withId(String id) { + this.id = id; + return this; + } + + /** + * Get reason type of failure. + * + * @return the reasonType value + */ + public String reasonType() { + return this.reasonType; + } + + /** + * Set reason type of failure. + * + * @param reasonType the reasonType value to set + * @return the TroubleshootingDetails object itself. + */ + public TroubleshootingDetails withReasonType(String reasonType) { + this.reasonType = reasonType; + return this; + } + + /** + * Get a summary of troubleshooting. + * + * @return the summary value + */ + public String summary() { + return this.summary; + } + + /** + * Set a summary of troubleshooting. + * + * @param summary the summary value to set + * @return the TroubleshootingDetails object itself. + */ + public TroubleshootingDetails withSummary(String summary) { + this.summary = summary; + return this; + } + + /** + * Get details on troubleshooting results. + * + * @return the detail value + */ + public String detail() { + return this.detail; + } + + /** + * Set details on troubleshooting results. + * + * @param detail the detail value to set + * @return the TroubleshootingDetails object itself. + */ + public TroubleshootingDetails withDetail(String detail) { + this.detail = detail; + return this; + } + + /** + * Get list of recommended actions. + * + * @return the recommendedActions value + */ + public List recommendedActions() { + return this.recommendedActions; + } + + /** + * Set list of recommended actions. + * + * @param recommendedActions the recommendedActions value to set + * @return the TroubleshootingDetails object itself. + */ + public TroubleshootingDetails withRecommendedActions(List recommendedActions) { + this.recommendedActions = recommendedActions; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/TroubleshootingParameters.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/TroubleshootingParameters.java new file mode 100644 index 000000000000..4df448b2598c --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/TroubleshootingParameters.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Parameters that define the resource to troubleshoot. + */ +@JsonFlatten +public class TroubleshootingParameters { + /** + * The target resource to troubleshoot. + */ + @JsonProperty(value = "targetResourceId", required = true) + private String targetResourceId; + + /** + * The ID for the storage account to save the troubleshoot result. + */ + @JsonProperty(value = "properties.storageId", required = true) + private String storageId; + + /** + * The path to the blob to save the troubleshoot result in. + */ + @JsonProperty(value = "properties.storagePath", required = true) + private String storagePath; + + /** + * Get the target resource to troubleshoot. + * + * @return the targetResourceId value + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Set the target resource to troubleshoot. + * + * @param targetResourceId the targetResourceId value to set + * @return the TroubleshootingParameters object itself. + */ + public TroubleshootingParameters withTargetResourceId(String targetResourceId) { + this.targetResourceId = targetResourceId; + return this; + } + + /** + * Get the ID for the storage account to save the troubleshoot result. + * + * @return the storageId value + */ + public String storageId() { + return this.storageId; + } + + /** + * Set the ID for the storage account to save the troubleshoot result. + * + * @param storageId the storageId value to set + * @return the TroubleshootingParameters object itself. + */ + public TroubleshootingParameters withStorageId(String storageId) { + this.storageId = storageId; + return this; + } + + /** + * Get the path to the blob to save the troubleshoot result in. + * + * @return the storagePath value + */ + public String storagePath() { + return this.storagePath; + } + + /** + * Set the path to the blob to save the troubleshoot result in. + * + * @param storagePath the storagePath value to set + * @return the TroubleshootingParameters object itself. + */ + public TroubleshootingParameters withStoragePath(String storagePath) { + this.storagePath = storagePath; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/TroubleshootingRecommendedActions.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/TroubleshootingRecommendedActions.java new file mode 100644 index 000000000000..058bc8a0c1f7 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/TroubleshootingRecommendedActions.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Recommended actions based on discovered issues. + */ +public class TroubleshootingRecommendedActions { + /** + * ID of the recommended action. + */ + @JsonProperty(value = "actionId") + private String actionId; + + /** + * Description of recommended actions. + */ + @JsonProperty(value = "actionText") + private String actionText; + + /** + * The uri linking to a documentation for the recommended troubleshooting + * actions. + */ + @JsonProperty(value = "actionUri") + private String actionUri; + + /** + * The information from the URI for the recommended troubleshooting + * actions. + */ + @JsonProperty(value = "actionUriText") + private String actionUriText; + + /** + * Get iD of the recommended action. + * + * @return the actionId value + */ + public String actionId() { + return this.actionId; + } + + /** + * Set iD of the recommended action. + * + * @param actionId the actionId value to set + * @return the TroubleshootingRecommendedActions object itself. + */ + public TroubleshootingRecommendedActions withActionId(String actionId) { + this.actionId = actionId; + return this; + } + + /** + * Get description of recommended actions. + * + * @return the actionText value + */ + public String actionText() { + return this.actionText; + } + + /** + * Set description of recommended actions. + * + * @param actionText the actionText value to set + * @return the TroubleshootingRecommendedActions object itself. + */ + public TroubleshootingRecommendedActions withActionText(String actionText) { + this.actionText = actionText; + return this; + } + + /** + * Get the uri linking to a documentation for the recommended troubleshooting actions. + * + * @return the actionUri value + */ + public String actionUri() { + return this.actionUri; + } + + /** + * Set the uri linking to a documentation for the recommended troubleshooting actions. + * + * @param actionUri the actionUri value to set + * @return the TroubleshootingRecommendedActions object itself. + */ + public TroubleshootingRecommendedActions withActionUri(String actionUri) { + this.actionUri = actionUri; + return this; + } + + /** + * Get the information from the URI for the recommended troubleshooting actions. + * + * @return the actionUriText value + */ + public String actionUriText() { + return this.actionUriText; + } + + /** + * Set the information from the URI for the recommended troubleshooting actions. + * + * @param actionUriText the actionUriText value to set + * @return the TroubleshootingRecommendedActions object itself. + */ + public TroubleshootingRecommendedActions withActionUriText(String actionUriText) { + this.actionUriText = actionUriText; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/TroubleshootingResult.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/TroubleshootingResult.java new file mode 100644 index 000000000000..a3cfb97e8739 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/TroubleshootingResult.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.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.TroubleshootingResultInner; +import org.joda.time.DateTime; +import java.util.List; + +/** + * Type representing TroubleshootingResult. + */ +public interface TroubleshootingResult extends HasInner, HasManager { + /** + * @return the code value. + */ + String code(); + + /** + * @return the endTime value. + */ + DateTime endTime(); + + /** + * @return the results value. + */ + List results(); + + /** + * @return the startTime value. + */ + DateTime startTime(); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/TunnelConnectionHealth.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/TunnelConnectionHealth.java new file mode 100644 index 000000000000..6f3f890026d5 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/TunnelConnectionHealth.java @@ -0,0 +1,93 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * VirtualNetworkGatewayConnection properties. + */ +public class TunnelConnectionHealth { + /** + * Tunnel name. + */ + @JsonProperty(value = "tunnel", access = JsonProperty.Access.WRITE_ONLY) + private String tunnel; + + /** + * Virtual network Gateway connection status. Possible values include: + * 'Unknown', 'Connecting', 'Connected', 'NotConnected'. + */ + @JsonProperty(value = "connectionStatus", access = JsonProperty.Access.WRITE_ONLY) + private VirtualNetworkGatewayConnectionStatus connectionStatus; + + /** + * The Ingress Bytes Transferred in this connection. + */ + @JsonProperty(value = "ingressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long ingressBytesTransferred; + + /** + * The Egress Bytes Transferred in this connection. + */ + @JsonProperty(value = "egressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long egressBytesTransferred; + + /** + * The time at which connection was established in Utc format. + */ + @JsonProperty(value = "lastConnectionEstablishedUtcTime", access = JsonProperty.Access.WRITE_ONLY) + private String lastConnectionEstablishedUtcTime; + + /** + * Get tunnel name. + * + * @return the tunnel value + */ + public String tunnel() { + return this.tunnel; + } + + /** + * Get virtual network Gateway connection status. Possible values include: 'Unknown', 'Connecting', 'Connected', 'NotConnected'. + * + * @return the connectionStatus value + */ + public VirtualNetworkGatewayConnectionStatus connectionStatus() { + return this.connectionStatus; + } + + /** + * Get the Ingress Bytes Transferred in this connection. + * + * @return the ingressBytesTransferred value + */ + public Long ingressBytesTransferred() { + return this.ingressBytesTransferred; + } + + /** + * Get the Egress Bytes Transferred in this connection. + * + * @return the egressBytesTransferred value + */ + public Long egressBytesTransferred() { + return this.egressBytesTransferred; + } + + /** + * Get the time at which connection was established in Utc format. + * + * @return the lastConnectionEstablishedUtcTime value + */ + public String lastConnectionEstablishedUtcTime() { + return this.lastConnectionEstablishedUtcTime; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/TunnelConnectionStatus.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/TunnelConnectionStatus.java new file mode 100644 index 000000000000..bb8cfbb578c8 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/TunnelConnectionStatus.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for TunnelConnectionStatus. + */ +public final class TunnelConnectionStatus extends ExpandableStringEnum { + /** Static value Unknown for TunnelConnectionStatus. */ + public static final TunnelConnectionStatus UNKNOWN = fromString("Unknown"); + + /** Static value Connecting for TunnelConnectionStatus. */ + public static final TunnelConnectionStatus CONNECTING = fromString("Connecting"); + + /** Static value Connected for TunnelConnectionStatus. */ + public static final TunnelConnectionStatus CONNECTED = fromString("Connected"); + + /** Static value NotConnected for TunnelConnectionStatus. */ + public static final TunnelConnectionStatus NOT_CONNECTED = fromString("NotConnected"); + + /** + * Creates or finds a TunnelConnectionStatus from its string representation. + * @param name a name to look for + * @return the corresponding TunnelConnectionStatus + */ + @JsonCreator + public static TunnelConnectionStatus fromString(String name) { + return fromString(name, TunnelConnectionStatus.class); + } + + /** + * @return known TunnelConnectionStatus values + */ + public static Collection values() { + return values(TunnelConnectionStatus.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/Usage.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/Usage.java new file mode 100644 index 000000000000..1fe78ce1da3d --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/Usage.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_06_01.implementation.UsageInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager; + +/** + * Type representing Usage. + */ +public interface Usage extends HasInner, HasManager { + /** + * @return the currentValue value. + */ + long currentValue(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the limit value. + */ + long limit(); + + /** + * @return the name value. + */ + UsageName name(); + + /** + * @return the unit value. + */ + String unit(); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/UsageName.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/UsageName.java new file mode 100644 index 000000000000..94a36c7e793f --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/UsageName.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.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The usage names. + */ +public class UsageName { + /** + * A string describing the resource name. + */ + @JsonProperty(value = "value") + private String value; + + /** + * A localized string describing the resource name. + */ + @JsonProperty(value = "localizedValue") + private String localizedValue; + + /** + * Get a string describing the resource name. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set a string describing the resource name. + * + * @param value the value value to set + * @return the UsageName object itself. + */ + public UsageName withValue(String value) { + this.value = value; + return this; + } + + /** + * Get a localized string describing the resource name. + * + * @return the localizedValue value + */ + public String localizedValue() { + return this.localizedValue; + } + + /** + * Set a localized string describing the resource name. + * + * @param localizedValue the localizedValue value to set + * @return the UsageName object itself. + */ + public UsageName withLocalizedValue(String localizedValue) { + this.localizedValue = localizedValue; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/Usages.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/Usages.java new file mode 100644 index 000000000000..ac4432b7c741 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/Usages.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.network.v2018_06_01; + +import rx.Observable; +import com.microsoft.azure.management.network.v2018_06_01.implementation.UsagesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Usages. + */ +public interface Usages extends HasInner { + /** + * List network usages for a subscription. + * + * @param location The location where resource usage is queried. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String location); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VerificationIPFlowParameters.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VerificationIPFlowParameters.java new file mode 100644 index 000000000000..da7e5d8fd173 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VerificationIPFlowParameters.java @@ -0,0 +1,231 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters that define the IP flow to be verified. + */ +public class VerificationIPFlowParameters { + /** + * The ID of the target resource to perform next-hop on. + */ + @JsonProperty(value = "targetResourceId", required = true) + private String targetResourceId; + + /** + * The direction of the packet represented as a 5-tuple. Possible values + * include: 'Inbound', 'Outbound'. + */ + @JsonProperty(value = "direction", required = true) + private Direction direction; + + /** + * Protocol to be verified on. Possible values include: 'TCP', 'UDP'. + */ + @JsonProperty(value = "protocol", required = true) + private IpFlowProtocol protocol; + + /** + * The local port. Acceptable values are a single integer in the range + * (0-65535). Support for * for the source port, which depends on the + * direction. + */ + @JsonProperty(value = "localPort", required = true) + private String localPort; + + /** + * The remote port. Acceptable values are a single integer in the range + * (0-65535). Support for * for the source port, which depends on the + * direction. + */ + @JsonProperty(value = "remotePort", required = true) + private String remotePort; + + /** + * The local IP address. Acceptable values are valid IPv4 addresses. + */ + @JsonProperty(value = "localIPAddress", required = true) + private String localIPAddress; + + /** + * The remote IP address. Acceptable values are valid IPv4 addresses. + */ + @JsonProperty(value = "remoteIPAddress", required = true) + private String remoteIPAddress; + + /** + * The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any + * of them, then this parameter must be specified. Otherwise optional). + */ + @JsonProperty(value = "targetNicResourceId") + private String targetNicResourceId; + + /** + * Get the ID of the target resource to perform next-hop on. + * + * @return the targetResourceId value + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Set the ID of the target resource to perform next-hop on. + * + * @param targetResourceId the targetResourceId value to set + * @return the VerificationIPFlowParameters object itself. + */ + public VerificationIPFlowParameters withTargetResourceId(String targetResourceId) { + this.targetResourceId = targetResourceId; + return this; + } + + /** + * Get the direction of the packet represented as a 5-tuple. Possible values include: 'Inbound', 'Outbound'. + * + * @return the direction value + */ + public Direction direction() { + return this.direction; + } + + /** + * Set the direction of the packet represented as a 5-tuple. Possible values include: 'Inbound', 'Outbound'. + * + * @param direction the direction value to set + * @return the VerificationIPFlowParameters object itself. + */ + public VerificationIPFlowParameters withDirection(Direction direction) { + this.direction = direction; + return this; + } + + /** + * Get protocol to be verified on. Possible values include: 'TCP', 'UDP'. + * + * @return the protocol value + */ + public IpFlowProtocol protocol() { + return this.protocol; + } + + /** + * Set protocol to be verified on. Possible values include: 'TCP', 'UDP'. + * + * @param protocol the protocol value to set + * @return the VerificationIPFlowParameters object itself. + */ + public VerificationIPFlowParameters withProtocol(IpFlowProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the local port. Acceptable values are a single integer in the range (0-65535). Support for * for the source port, which depends on the direction. + * + * @return the localPort value + */ + public String localPort() { + return this.localPort; + } + + /** + * Set the local port. Acceptable values are a single integer in the range (0-65535). Support for * for the source port, which depends on the direction. + * + * @param localPort the localPort value to set + * @return the VerificationIPFlowParameters object itself. + */ + public VerificationIPFlowParameters withLocalPort(String localPort) { + this.localPort = localPort; + return this; + } + + /** + * Get the remote port. Acceptable values are a single integer in the range (0-65535). Support for * for the source port, which depends on the direction. + * + * @return the remotePort value + */ + public String remotePort() { + return this.remotePort; + } + + /** + * Set the remote port. Acceptable values are a single integer in the range (0-65535). Support for * for the source port, which depends on the direction. + * + * @param remotePort the remotePort value to set + * @return the VerificationIPFlowParameters object itself. + */ + public VerificationIPFlowParameters withRemotePort(String remotePort) { + this.remotePort = remotePort; + return this; + } + + /** + * Get the local IP address. Acceptable values are valid IPv4 addresses. + * + * @return the localIPAddress value + */ + public String localIPAddress() { + return this.localIPAddress; + } + + /** + * Set the local IP address. Acceptable values are valid IPv4 addresses. + * + * @param localIPAddress the localIPAddress value to set + * @return the VerificationIPFlowParameters object itself. + */ + public VerificationIPFlowParameters withLocalIPAddress(String localIPAddress) { + this.localIPAddress = localIPAddress; + return this; + } + + /** + * Get the remote IP address. Acceptable values are valid IPv4 addresses. + * + * @return the remoteIPAddress value + */ + public String remoteIPAddress() { + return this.remoteIPAddress; + } + + /** + * Set the remote IP address. Acceptable values are valid IPv4 addresses. + * + * @param remoteIPAddress the remoteIPAddress value to set + * @return the VerificationIPFlowParameters object itself. + */ + public VerificationIPFlowParameters withRemoteIPAddress(String remoteIPAddress) { + this.remoteIPAddress = remoteIPAddress; + return this; + } + + /** + * Get the NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of them, then this parameter must be specified. Otherwise optional). + * + * @return the targetNicResourceId value + */ + public String targetNicResourceId() { + return this.targetNicResourceId; + } + + /** + * Set the NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of them, then this parameter must be specified. Otherwise optional). + * + * @param targetNicResourceId the targetNicResourceId value to set + * @return the VerificationIPFlowParameters object itself. + */ + public VerificationIPFlowParameters withTargetNicResourceId(String targetNicResourceId) { + this.targetNicResourceId = targetNicResourceId; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VerificationIPFlowResult.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VerificationIPFlowResult.java new file mode 100644 index 000000000000..a0d07874a25d --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VerificationIPFlowResult.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.VerificationIPFlowResultInner; + +/** + * Type representing VerificationIPFlowResult. + */ +public interface VerificationIPFlowResult extends HasInner, HasManager { + /** + * @return the access value. + */ + Access access(); + + /** + * @return the ruleName value. + */ + String ruleName(); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualHub.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualHub.java new file mode 100644 index 000000000000..b07255ef8087 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualHub.java @@ -0,0 +1,176 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager; +import com.microsoft.azure.SubResource; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.implementation.HubVirtualNetworkConnectionInner; +import com.microsoft.azure.management.network.v2018_06_01.implementation.VirtualHubInner; + +/** + * Type representing VirtualHub. + */ +public interface VirtualHub extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the addressPrefix value. + */ + String addressPrefix(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the hubVirtualNetworkConnections value. + */ + List hubVirtualNetworkConnections(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the virtualWan value. + */ + SubResource virtualWan(); + + /** + * The entirety of the VirtualHub definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of VirtualHub definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a VirtualHub definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the VirtualHub definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the virtualhub update allowing to specify AddressPrefix. + */ + interface WithAddressPrefix { + /** + * Specifies addressPrefix. + */ + WithCreate withAddressPrefix(String addressPrefix); + } + + /** + * The stage of the virtualhub update allowing to specify HubVirtualNetworkConnections. + */ + interface WithHubVirtualNetworkConnections { + /** + * Specifies hubVirtualNetworkConnections. + */ + WithCreate withHubVirtualNetworkConnections(List hubVirtualNetworkConnections); + } + + /** + * The stage of the virtualhub update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + */ + WithCreate withProvisioningState(ProvisioningState provisioningState); + } + + /** + * The stage of the virtualhub update allowing to specify VirtualWan. + */ + interface WithVirtualWan { + /** + * Specifies virtualWan. + */ + WithCreate withVirtualWan(SubResource virtualWan); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithAddressPrefix, DefinitionStages.WithHubVirtualNetworkConnections, DefinitionStages.WithProvisioningState, DefinitionStages.WithVirtualWan { + } + } + /** + * The template for a VirtualHub update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithAddressPrefix, UpdateStages.WithHubVirtualNetworkConnections, UpdateStages.WithProvisioningState, UpdateStages.WithVirtualWan { + } + + /** + * Grouping of VirtualHub update stages. + */ + interface UpdateStages { + /** + * The stage of the virtualhub {0} allowing to specify AddressPrefix. + */ + interface WithAddressPrefix { + /** + * Specifies addressPrefix. + */ + Update withAddressPrefix(String addressPrefix); + } + + /** + * The stage of the virtualhub {0} allowing to specify HubVirtualNetworkConnections. + */ + interface WithHubVirtualNetworkConnections { + /** + * Specifies hubVirtualNetworkConnections. + */ + Update withHubVirtualNetworkConnections(List hubVirtualNetworkConnections); + } + + /** + * The stage of the virtualhub {0} allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + */ + Update withProvisioningState(ProvisioningState provisioningState); + } + + /** + * The stage of the virtualhub {0} allowing to specify VirtualWan. + */ + interface WithVirtualWan { + /** + * Specifies virtualWan. + */ + Update withVirtualWan(SubResource virtualWan); + } + + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualHubs.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualHubs.java new file mode 100644 index 000000000000..d4273bbf70cf --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualHubs.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_06_01.implementation.VirtualHubsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing VirtualHubs. + */ +public interface VirtualHubs extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualMachineScaleSetNetworkInterfaceIPConfiguration.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualMachineScaleSetNetworkInterfaceIPConfiguration.java new file mode 100644 index 000000000000..874a976947f4 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualMachineScaleSetNetworkInterfaceIPConfiguration.java @@ -0,0 +1,93 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkInterfaceIPConfigurationInner; +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.network.v2018_06_01.implementation.NetworkManager; +import java.util.List; + +/** + * Type representing VirtualMachineScaleSetNetworkInterfaceIPConfiguration. + */ +public interface VirtualMachineScaleSetNetworkInterfaceIPConfiguration extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the applicationGatewayBackendAddressPools value. + */ + List applicationGatewayBackendAddressPools(); + + /** + * @return the applicationSecurityGroups value. + */ + List applicationSecurityGroups(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the loadBalancerBackendAddressPools value. + */ + List loadBalancerBackendAddressPools(); + + /** + * @return the loadBalancerInboundNatRules value. + */ + List loadBalancerInboundNatRules(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the primary value. + */ + Boolean primary(); + + /** + * @return the privateIPAddress value. + */ + String privateIPAddress(); + + /** + * @return the privateIPAddressVersion value. + */ + IPVersion privateIPAddressVersion(); + + /** + * @return the privateIPAllocationMethod value. + */ + IPAllocationMethod privateIPAllocationMethod(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the publicIPAddress value. + */ + PublicIPAddress publicIPAddress(); + + /** + * @return the subnet value. + */ + Subnet subnet(); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetwork.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetwork.java new file mode 100644 index 000000000000..dce787a32391 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetwork.java @@ -0,0 +1,322 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_06_01.implementation.SubnetInner; +import com.microsoft.azure.management.network.v2018_06_01.implementation.VirtualNetworkPeeringInner; +import com.microsoft.azure.management.network.v2018_06_01.implementation.VirtualNetworkInner; + +/** + * Type representing VirtualNetwork. + */ +public interface VirtualNetwork extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the addressSpace value. + */ + AddressSpace addressSpace(); + + /** + * @return the ddosProtectionPlan value. + */ + SubResource ddosProtectionPlan(); + + /** + * @return the dhcpOptions value. + */ + DhcpOptions dhcpOptions(); + + /** + * @return the enableDdosProtection value. + */ + Boolean enableDdosProtection(); + + /** + * @return the enableVmProtection value. + */ + Boolean enableVmProtection(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * @return the subnets value. + */ + List subnets(); + + /** + * @return the virtualNetworkPeerings value. + */ + List virtualNetworkPeerings(); + + /** + * The entirety of the VirtualNetwork definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of VirtualNetwork definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a VirtualNetwork definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the VirtualNetwork definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the virtualnetwork update allowing to specify AddressSpace. + */ + interface WithAddressSpace { + /** + * Specifies addressSpace. + */ + WithCreate withAddressSpace(AddressSpace addressSpace); + } + + /** + * The stage of the virtualnetwork update allowing to specify DdosProtectionPlan. + */ + interface WithDdosProtectionPlan { + /** + * Specifies ddosProtectionPlan. + */ + WithCreate withDdosProtectionPlan(SubResource ddosProtectionPlan); + } + + /** + * The stage of the virtualnetwork update allowing to specify DhcpOptions. + */ + interface WithDhcpOptions { + /** + * Specifies dhcpOptions. + */ + WithCreate withDhcpOptions(DhcpOptions dhcpOptions); + } + + /** + * The stage of the virtualnetwork update allowing to specify EnableDdosProtection. + */ + interface WithEnableDdosProtection { + /** + * Specifies enableDdosProtection. + */ + WithCreate withEnableDdosProtection(Boolean enableDdosProtection); + } + + /** + * The stage of the virtualnetwork update allowing to specify EnableVmProtection. + */ + interface WithEnableVmProtection { + /** + * Specifies enableVmProtection. + */ + WithCreate withEnableVmProtection(Boolean enableVmProtection); + } + + /** + * The stage of the virtualnetwork update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the virtualnetwork update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the virtualnetwork update allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + */ + WithCreate withResourceGuid(String resourceGuid); + } + + /** + * The stage of the virtualnetwork update allowing to specify Subnets. + */ + interface WithSubnets { + /** + * Specifies subnets. + */ + WithCreate withSubnets(List subnets); + } + + /** + * The stage of the virtualnetwork update allowing to specify VirtualNetworkPeerings. + */ + interface WithVirtualNetworkPeerings { + /** + * Specifies virtualNetworkPeerings. + */ + WithCreate withVirtualNetworkPeerings(List virtualNetworkPeerings); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithAddressSpace, DefinitionStages.WithDdosProtectionPlan, DefinitionStages.WithDhcpOptions, DefinitionStages.WithEnableDdosProtection, DefinitionStages.WithEnableVmProtection, DefinitionStages.WithEtag, DefinitionStages.WithProvisioningState, DefinitionStages.WithResourceGuid, DefinitionStages.WithSubnets, DefinitionStages.WithVirtualNetworkPeerings { + } + } + /** + * The template for a VirtualNetwork update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithAddressSpace, UpdateStages.WithDdosProtectionPlan, UpdateStages.WithDhcpOptions, UpdateStages.WithEnableDdosProtection, UpdateStages.WithEnableVmProtection, UpdateStages.WithEtag, UpdateStages.WithProvisioningState, UpdateStages.WithResourceGuid, UpdateStages.WithSubnets, UpdateStages.WithVirtualNetworkPeerings { + } + + /** + * Grouping of VirtualNetwork update stages. + */ + interface UpdateStages { + /** + * The stage of the virtualnetwork {0} allowing to specify AddressSpace. + */ + interface WithAddressSpace { + /** + * Specifies addressSpace. + */ + Update withAddressSpace(AddressSpace addressSpace); + } + + /** + * The stage of the virtualnetwork {0} allowing to specify DdosProtectionPlan. + */ + interface WithDdosProtectionPlan { + /** + * Specifies ddosProtectionPlan. + */ + Update withDdosProtectionPlan(SubResource ddosProtectionPlan); + } + + /** + * The stage of the virtualnetwork {0} allowing to specify DhcpOptions. + */ + interface WithDhcpOptions { + /** + * Specifies dhcpOptions. + */ + Update withDhcpOptions(DhcpOptions dhcpOptions); + } + + /** + * The stage of the virtualnetwork {0} allowing to specify EnableDdosProtection. + */ + interface WithEnableDdosProtection { + /** + * Specifies enableDdosProtection. + */ + Update withEnableDdosProtection(Boolean enableDdosProtection); + } + + /** + * The stage of the virtualnetwork {0} allowing to specify EnableVmProtection. + */ + interface WithEnableVmProtection { + /** + * Specifies enableVmProtection. + */ + Update withEnableVmProtection(Boolean enableVmProtection); + } + + /** + * The stage of the virtualnetwork {0} allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + */ + Update withEtag(String etag); + } + + /** + * The stage of the virtualnetwork {0} allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + */ + Update withProvisioningState(String provisioningState); + } + + /** + * The stage of the virtualnetwork {0} allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + */ + Update withResourceGuid(String resourceGuid); + } + + /** + * The stage of the virtualnetwork {0} allowing to specify Subnets. + */ + interface WithSubnets { + /** + * Specifies subnets. + */ + Update withSubnets(List subnets); + } + + /** + * The stage of the virtualnetwork {0} allowing to specify VirtualNetworkPeerings. + */ + interface WithVirtualNetworkPeerings { + /** + * Specifies virtualNetworkPeerings. + */ + Update withVirtualNetworkPeerings(List virtualNetworkPeerings); + } + + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworkConnectionGatewayReference.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworkConnectionGatewayReference.java new file mode 100644 index 000000000000..3664f9327b2e --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworkConnectionGatewayReference.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.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A reference to VirtualNetworkGateway or LocalNetworkGateway resource. + */ +public class VirtualNetworkConnectionGatewayReference { + /** + * The ID of VirtualNetworkGateway or LocalNetworkGateway resource. + */ + @JsonProperty(value = "id", required = true) + private String id; + + /** + * Get the ID of VirtualNetworkGateway or LocalNetworkGateway resource. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the ID of VirtualNetworkGateway or LocalNetworkGateway resource. + * + * @param id the id value to set + * @return the VirtualNetworkConnectionGatewayReference object itself. + */ + public VirtualNetworkConnectionGatewayReference withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworkGateway.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworkGateway.java new file mode 100644 index 000000000000..5e2119bc1296 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworkGateway.java @@ -0,0 +1,350 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_06_01.implementation.VirtualNetworkGatewayInner; + +/** + * Type representing VirtualNetworkGateway. + */ +public interface VirtualNetworkGateway extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the activeActive value. + */ + Boolean activeActive(); + + /** + * @return the bgpSettings value. + */ + BgpSettings bgpSettings(); + + /** + * @return the enableBgp value. + */ + Boolean enableBgp(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the gatewayDefaultSite value. + */ + SubResource gatewayDefaultSite(); + + /** + * @return the gatewayType value. + */ + VirtualNetworkGatewayType gatewayType(); + + /** + * @return the ipConfigurations value. + */ + List ipConfigurations(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * @return the sku value. + */ + VirtualNetworkGatewaySku sku(); + + /** + * @return the vpnClientConfiguration value. + */ + VpnClientConfiguration vpnClientConfiguration(); + + /** + * @return the vpnType value. + */ + VpnType vpnType(); + + /** + * The entirety of the VirtualNetworkGateway definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of VirtualNetworkGateway definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a VirtualNetworkGateway definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the VirtualNetworkGateway definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the virtualnetworkgateway update allowing to specify ActiveActive. + */ + interface WithActiveActive { + /** + * Specifies activeActive. + */ + WithCreate withActiveActive(Boolean activeActive); + } + + /** + * The stage of the virtualnetworkgateway update allowing to specify BgpSettings. + */ + interface WithBgpSettings { + /** + * Specifies bgpSettings. + */ + WithCreate withBgpSettings(BgpSettings bgpSettings); + } + + /** + * The stage of the virtualnetworkgateway update allowing to specify EnableBgp. + */ + interface WithEnableBgp { + /** + * Specifies enableBgp. + */ + WithCreate withEnableBgp(Boolean enableBgp); + } + + /** + * The stage of the virtualnetworkgateway update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the virtualnetworkgateway update allowing to specify GatewayDefaultSite. + */ + interface WithGatewayDefaultSite { + /** + * Specifies gatewayDefaultSite. + */ + WithCreate withGatewayDefaultSite(SubResource gatewayDefaultSite); + } + + /** + * The stage of the virtualnetworkgateway update allowing to specify GatewayType. + */ + interface WithGatewayType { + /** + * Specifies gatewayType. + */ + WithCreate withGatewayType(VirtualNetworkGatewayType gatewayType); + } + + /** + * The stage of the virtualnetworkgateway update allowing to specify IpConfigurations. + */ + interface WithIpConfigurations { + /** + * Specifies ipConfigurations. + */ + WithCreate withIpConfigurations(List ipConfigurations); + } + + /** + * The stage of the virtualnetworkgateway update allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + */ + WithCreate withResourceGuid(String resourceGuid); + } + + /** + * The stage of the virtualnetworkgateway update allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + */ + WithCreate withSku(VirtualNetworkGatewaySku sku); + } + + /** + * The stage of the virtualnetworkgateway update allowing to specify VpnClientConfiguration. + */ + interface WithVpnClientConfiguration { + /** + * Specifies vpnClientConfiguration. + */ + WithCreate withVpnClientConfiguration(VpnClientConfiguration vpnClientConfiguration); + } + + /** + * The stage of the virtualnetworkgateway update allowing to specify VpnType. + */ + interface WithVpnType { + /** + * Specifies vpnType. + */ + WithCreate withVpnType(VpnType vpnType); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithActiveActive, DefinitionStages.WithBgpSettings, DefinitionStages.WithEnableBgp, DefinitionStages.WithEtag, DefinitionStages.WithGatewayDefaultSite, DefinitionStages.WithGatewayType, DefinitionStages.WithIpConfigurations, DefinitionStages.WithResourceGuid, DefinitionStages.WithSku, DefinitionStages.WithVpnClientConfiguration, DefinitionStages.WithVpnType { + } + } + /** + * The template for a VirtualNetworkGateway update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithActiveActive, UpdateStages.WithBgpSettings, UpdateStages.WithEnableBgp, UpdateStages.WithEtag, UpdateStages.WithGatewayDefaultSite, UpdateStages.WithGatewayType, UpdateStages.WithIpConfigurations, UpdateStages.WithResourceGuid, UpdateStages.WithSku, UpdateStages.WithVpnClientConfiguration, UpdateStages.WithVpnType { + } + + /** + * Grouping of VirtualNetworkGateway update stages. + */ + interface UpdateStages { + /** + * The stage of the virtualnetworkgateway {0} allowing to specify ActiveActive. + */ + interface WithActiveActive { + /** + * Specifies activeActive. + */ + Update withActiveActive(Boolean activeActive); + } + + /** + * The stage of the virtualnetworkgateway {0} allowing to specify BgpSettings. + */ + interface WithBgpSettings { + /** + * Specifies bgpSettings. + */ + Update withBgpSettings(BgpSettings bgpSettings); + } + + /** + * The stage of the virtualnetworkgateway {0} allowing to specify EnableBgp. + */ + interface WithEnableBgp { + /** + * Specifies enableBgp. + */ + Update withEnableBgp(Boolean enableBgp); + } + + /** + * The stage of the virtualnetworkgateway {0} allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + */ + Update withEtag(String etag); + } + + /** + * The stage of the virtualnetworkgateway {0} allowing to specify GatewayDefaultSite. + */ + interface WithGatewayDefaultSite { + /** + * Specifies gatewayDefaultSite. + */ + Update withGatewayDefaultSite(SubResource gatewayDefaultSite); + } + + /** + * The stage of the virtualnetworkgateway {0} allowing to specify GatewayType. + */ + interface WithGatewayType { + /** + * Specifies gatewayType. + */ + Update withGatewayType(VirtualNetworkGatewayType gatewayType); + } + + /** + * The stage of the virtualnetworkgateway {0} allowing to specify IpConfigurations. + */ + interface WithIpConfigurations { + /** + * Specifies ipConfigurations. + */ + Update withIpConfigurations(List ipConfigurations); + } + + /** + * The stage of the virtualnetworkgateway {0} allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + */ + Update withResourceGuid(String resourceGuid); + } + + /** + * The stage of the virtualnetworkgateway {0} allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + */ + Update withSku(VirtualNetworkGatewaySku sku); + } + + /** + * The stage of the virtualnetworkgateway {0} allowing to specify VpnClientConfiguration. + */ + interface WithVpnClientConfiguration { + /** + * Specifies vpnClientConfiguration. + */ + Update withVpnClientConfiguration(VpnClientConfiguration vpnClientConfiguration); + } + + /** + * The stage of the virtualnetworkgateway {0} allowing to specify VpnType. + */ + interface WithVpnType { + /** + * Specifies vpnType. + */ + Update withVpnType(VpnType vpnType); + } + + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworkGatewayConnection.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworkGatewayConnection.java new file mode 100644 index 000000000000..1515c4551a3c --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworkGatewayConnection.java @@ -0,0 +1,402 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_06_01.implementation.LocalNetworkGatewayInner; +import com.microsoft.azure.management.network.v2018_06_01.implementation.VirtualNetworkGatewayInner; +import com.microsoft.azure.management.network.v2018_06_01.implementation.VirtualNetworkGatewayConnectionInner; + +/** + * Type representing VirtualNetworkGatewayConnection. + */ +public interface VirtualNetworkGatewayConnection extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the authorizationKey value. + */ + String authorizationKey(); + + /** + * @return the connectionStatus value. + */ + VirtualNetworkGatewayConnectionStatus connectionStatus(); + + /** + * @return the connectionType value. + */ + VirtualNetworkGatewayConnectionType connectionType(); + + /** + * @return the egressBytesTransferred value. + */ + Long egressBytesTransferred(); + + /** + * @return the enableBgp value. + */ + Boolean enableBgp(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the ingressBytesTransferred value. + */ + Long ingressBytesTransferred(); + + /** + * @return the ipsecPolicies value. + */ + List ipsecPolicies(); + + /** + * @return the localNetworkGateway2 value. + */ + LocalNetworkGateway localNetworkGateway2(); + + /** + * @return the peer value. + */ + SubResource peer(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * @return the routingWeight value. + */ + Integer routingWeight(); + + /** + * @return the sharedKey value. + */ + String sharedKey(); + + /** + * @return the tunnelConnectionStatus value. + */ + List tunnelConnectionStatus(); + + /** + * @return the usePolicyBasedTrafficSelectors value. + */ + Boolean usePolicyBasedTrafficSelectors(); + + /** + * @return the virtualNetworkGateway1 value. + */ + VirtualNetworkGateway virtualNetworkGateway1(); + + /** + * @return the virtualNetworkGateway2 value. + */ + VirtualNetworkGateway virtualNetworkGateway2(); + + /** + * The entirety of the VirtualNetworkGatewayConnection definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithConnectionType, DefinitionStages.WithVirtualNetworkGateway1, DefinitionStages.WithCreate { + } + + /** + * Grouping of VirtualNetworkGatewayConnection definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a VirtualNetworkGatewayConnection definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the VirtualNetworkGatewayConnection definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the virtualnetworkgatewayconnection definition allowing to specify ConnectionType. + */ + interface WithConnectionType { + /** + * Specifies connectionType. + */ + WithVirtualNetworkGateway1 withConnectionType(VirtualNetworkGatewayConnectionType connectionType); + } + + /** + * The stage of the virtualnetworkgatewayconnection definition allowing to specify VirtualNetworkGateway1. + */ + interface WithVirtualNetworkGateway1 { + /** + * Specifies virtualNetworkGateway1. + */ + WithCreate withVirtualNetworkGateway1(VirtualNetworkGatewayInner virtualNetworkGateway1); + } + + /** + * The stage of the virtualnetworkgatewayconnection update allowing to specify AuthorizationKey. + */ + interface WithAuthorizationKey { + /** + * Specifies authorizationKey. + */ + WithCreate withAuthorizationKey(String authorizationKey); + } + + /** + * The stage of the virtualnetworkgatewayconnection update allowing to specify EnableBgp. + */ + interface WithEnableBgp { + /** + * Specifies enableBgp. + */ + WithCreate withEnableBgp(Boolean enableBgp); + } + + /** + * The stage of the virtualnetworkgatewayconnection update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the virtualnetworkgatewayconnection update allowing to specify IpsecPolicies. + */ + interface WithIpsecPolicies { + /** + * Specifies ipsecPolicies. + */ + WithCreate withIpsecPolicies(List ipsecPolicies); + } + + /** + * The stage of the virtualnetworkgatewayconnection update allowing to specify LocalNetworkGateway2. + */ + interface WithLocalNetworkGateway2 { + /** + * Specifies localNetworkGateway2. + */ + WithCreate withLocalNetworkGateway2(LocalNetworkGatewayInner localNetworkGateway2); + } + + /** + * The stage of the virtualnetworkgatewayconnection update allowing to specify Peer. + */ + interface WithPeer { + /** + * Specifies peer. + */ + WithCreate withPeer(SubResource peer); + } + + /** + * The stage of the virtualnetworkgatewayconnection update allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + */ + WithCreate withResourceGuid(String resourceGuid); + } + + /** + * The stage of the virtualnetworkgatewayconnection update allowing to specify RoutingWeight. + */ + interface WithRoutingWeight { + /** + * Specifies routingWeight. + */ + WithCreate withRoutingWeight(Integer routingWeight); + } + + /** + * The stage of the virtualnetworkgatewayconnection update allowing to specify SharedKey. + */ + interface WithSharedKey { + /** + * Specifies sharedKey. + */ + WithCreate withSharedKey(String sharedKey); + } + + /** + * The stage of the virtualnetworkgatewayconnection update allowing to specify UsePolicyBasedTrafficSelectors. + */ + interface WithUsePolicyBasedTrafficSelectors { + /** + * Specifies usePolicyBasedTrafficSelectors. + */ + WithCreate withUsePolicyBasedTrafficSelectors(Boolean usePolicyBasedTrafficSelectors); + } + + /** + * The stage of the virtualnetworkgatewayconnection update allowing to specify VirtualNetworkGateway2. + */ + interface WithVirtualNetworkGateway2 { + /** + * Specifies virtualNetworkGateway2. + */ + WithCreate withVirtualNetworkGateway2(VirtualNetworkGatewayInner virtualNetworkGateway2); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithAuthorizationKey, DefinitionStages.WithEnableBgp, DefinitionStages.WithEtag, DefinitionStages.WithIpsecPolicies, DefinitionStages.WithLocalNetworkGateway2, DefinitionStages.WithPeer, DefinitionStages.WithResourceGuid, DefinitionStages.WithRoutingWeight, DefinitionStages.WithSharedKey, DefinitionStages.WithUsePolicyBasedTrafficSelectors, DefinitionStages.WithVirtualNetworkGateway2 { + } + } + /** + * The template for a VirtualNetworkGatewayConnection update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithAuthorizationKey, UpdateStages.WithEnableBgp, UpdateStages.WithEtag, UpdateStages.WithIpsecPolicies, UpdateStages.WithLocalNetworkGateway2, UpdateStages.WithPeer, UpdateStages.WithResourceGuid, UpdateStages.WithRoutingWeight, UpdateStages.WithSharedKey, UpdateStages.WithUsePolicyBasedTrafficSelectors, UpdateStages.WithVirtualNetworkGateway2 { + } + + /** + * Grouping of VirtualNetworkGatewayConnection update stages. + */ + interface UpdateStages { + /** + * The stage of the virtualnetworkgatewayconnection {0} allowing to specify AuthorizationKey. + */ + interface WithAuthorizationKey { + /** + * Specifies authorizationKey. + */ + Update withAuthorizationKey(String authorizationKey); + } + + /** + * The stage of the virtualnetworkgatewayconnection {0} allowing to specify EnableBgp. + */ + interface WithEnableBgp { + /** + * Specifies enableBgp. + */ + Update withEnableBgp(Boolean enableBgp); + } + + /** + * The stage of the virtualnetworkgatewayconnection {0} allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + */ + Update withEtag(String etag); + } + + /** + * The stage of the virtualnetworkgatewayconnection {0} allowing to specify IpsecPolicies. + */ + interface WithIpsecPolicies { + /** + * Specifies ipsecPolicies. + */ + Update withIpsecPolicies(List ipsecPolicies); + } + + /** + * The stage of the virtualnetworkgatewayconnection {0} allowing to specify LocalNetworkGateway2. + */ + interface WithLocalNetworkGateway2 { + /** + * Specifies localNetworkGateway2. + */ + Update withLocalNetworkGateway2(LocalNetworkGatewayInner localNetworkGateway2); + } + + /** + * The stage of the virtualnetworkgatewayconnection {0} allowing to specify Peer. + */ + interface WithPeer { + /** + * Specifies peer. + */ + Update withPeer(SubResource peer); + } + + /** + * The stage of the virtualnetworkgatewayconnection {0} allowing to specify ResourceGuid. + */ + interface WithResourceGuid { + /** + * Specifies resourceGuid. + */ + Update withResourceGuid(String resourceGuid); + } + + /** + * The stage of the virtualnetworkgatewayconnection {0} allowing to specify RoutingWeight. + */ + interface WithRoutingWeight { + /** + * Specifies routingWeight. + */ + Update withRoutingWeight(Integer routingWeight); + } + + /** + * The stage of the virtualnetworkgatewayconnection {0} allowing to specify SharedKey. + */ + interface WithSharedKey { + /** + * Specifies sharedKey. + */ + Update withSharedKey(String sharedKey); + } + + /** + * The stage of the virtualnetworkgatewayconnection {0} allowing to specify UsePolicyBasedTrafficSelectors. + */ + interface WithUsePolicyBasedTrafficSelectors { + /** + * Specifies usePolicyBasedTrafficSelectors. + */ + Update withUsePolicyBasedTrafficSelectors(Boolean usePolicyBasedTrafficSelectors); + } + + /** + * The stage of the virtualnetworkgatewayconnection {0} allowing to specify VirtualNetworkGateway2. + */ + interface WithVirtualNetworkGateway2 { + /** + * Specifies virtualNetworkGateway2. + */ + Update withVirtualNetworkGateway2(VirtualNetworkGatewayInner virtualNetworkGateway2); + } + + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworkGatewayConnectionListEntity.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworkGatewayConnectionListEntity.java new file mode 100644 index 000000000000..b04d6424b793 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworkGatewayConnectionListEntity.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_06_01.implementation.VirtualNetworkGatewayConnectionListEntityInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.SubResource; +import java.util.Map; + +/** + * Type representing VirtualNetworkGatewayConnectionListEntity. + */ +public interface VirtualNetworkGatewayConnectionListEntity extends HasInner, HasManager { + /** + * @return the authorizationKey value. + */ + String authorizationKey(); + + /** + * @return the connectionStatus value. + */ + VirtualNetworkGatewayConnectionStatus connectionStatus(); + + /** + * @return the connectionType value. + */ + VirtualNetworkGatewayConnectionType connectionType(); + + /** + * @return the egressBytesTransferred value. + */ + Long egressBytesTransferred(); + + /** + * @return the enableBgp value. + */ + Boolean enableBgp(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the ingressBytesTransferred value. + */ + Long ingressBytesTransferred(); + + /** + * @return the ipsecPolicies value. + */ + List ipsecPolicies(); + + /** + * @return the localNetworkGateway2 value. + */ + VirtualNetworkConnectionGatewayReference localNetworkGateway2(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the peer value. + */ + SubResource peer(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * @return the routingWeight value. + */ + Integer routingWeight(); + + /** + * @return the sharedKey value. + */ + String sharedKey(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the tunnelConnectionStatus value. + */ + List tunnelConnectionStatus(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the usePolicyBasedTrafficSelectors value. + */ + Boolean usePolicyBasedTrafficSelectors(); + + /** + * @return the virtualNetworkGateway1 value. + */ + VirtualNetworkConnectionGatewayReference virtualNetworkGateway1(); + + /** + * @return the virtualNetworkGateway2 value. + */ + VirtualNetworkConnectionGatewayReference virtualNetworkGateway2(); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworkGatewayConnectionStatus.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworkGatewayConnectionStatus.java new file mode 100644 index 000000000000..b6fb20f67f09 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworkGatewayConnectionStatus.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for VirtualNetworkGatewayConnectionStatus. + */ +public final class VirtualNetworkGatewayConnectionStatus extends ExpandableStringEnum { + /** Static value Unknown for VirtualNetworkGatewayConnectionStatus. */ + public static final VirtualNetworkGatewayConnectionStatus UNKNOWN = fromString("Unknown"); + + /** Static value Connecting for VirtualNetworkGatewayConnectionStatus. */ + public static final VirtualNetworkGatewayConnectionStatus CONNECTING = fromString("Connecting"); + + /** Static value Connected for VirtualNetworkGatewayConnectionStatus. */ + public static final VirtualNetworkGatewayConnectionStatus CONNECTED = fromString("Connected"); + + /** Static value NotConnected for VirtualNetworkGatewayConnectionStatus. */ + public static final VirtualNetworkGatewayConnectionStatus NOT_CONNECTED = fromString("NotConnected"); + + /** + * Creates or finds a VirtualNetworkGatewayConnectionStatus from its string representation. + * @param name a name to look for + * @return the corresponding VirtualNetworkGatewayConnectionStatus + */ + @JsonCreator + public static VirtualNetworkGatewayConnectionStatus fromString(String name) { + return fromString(name, VirtualNetworkGatewayConnectionStatus.class); + } + + /** + * @return known VirtualNetworkGatewayConnectionStatus values + */ + public static Collection values() { + return values(VirtualNetworkGatewayConnectionStatus.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworkGatewayConnectionType.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworkGatewayConnectionType.java new file mode 100644 index 000000000000..fc43f4939b16 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworkGatewayConnectionType.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for VirtualNetworkGatewayConnectionType. + */ +public final class VirtualNetworkGatewayConnectionType extends ExpandableStringEnum { + /** Static value IPsec for VirtualNetworkGatewayConnectionType. */ + public static final VirtualNetworkGatewayConnectionType IPSEC = fromString("IPsec"); + + /** Static value Vnet2Vnet for VirtualNetworkGatewayConnectionType. */ + public static final VirtualNetworkGatewayConnectionType VNET2VNET = fromString("Vnet2Vnet"); + + /** Static value ExpressRoute for VirtualNetworkGatewayConnectionType. */ + public static final VirtualNetworkGatewayConnectionType EXPRESS_ROUTE = fromString("ExpressRoute"); + + /** Static value VPNClient for VirtualNetworkGatewayConnectionType. */ + public static final VirtualNetworkGatewayConnectionType VPNCLIENT = fromString("VPNClient"); + + /** + * Creates or finds a VirtualNetworkGatewayConnectionType from its string representation. + * @param name a name to look for + * @return the corresponding VirtualNetworkGatewayConnectionType + */ + @JsonCreator + public static VirtualNetworkGatewayConnectionType fromString(String name) { + return fromString(name, VirtualNetworkGatewayConnectionType.class); + } + + /** + * @return known VirtualNetworkGatewayConnectionType values + */ + public static Collection values() { + return values(VirtualNetworkGatewayConnectionType.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworkGatewayConnections.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworkGatewayConnections.java new file mode 100644 index 000000000000..63710063fbeb --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworkGatewayConnections.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.management.network.v2018_06_01.implementation.ConnectionSharedKeyInner; +import com.microsoft.azure.management.network.v2018_06_01.implementation.VirtualNetworkGatewayConnectionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing VirtualNetworkGatewayConnections. + */ +public interface VirtualNetworkGatewayConnections extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, HasInner { + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. + * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation throughNetwork resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable setSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters); + + /** + * The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection shared key name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName); + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. + * @param keyLength The virtual network connection reset shared key length, should between 1 and 128. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable resetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, int keyLength); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworkGatewayIPConfiguration.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworkGatewayIPConfiguration.java new file mode 100644 index 000000000000..6deeeb8ce3c1 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworkGatewayIPConfiguration.java @@ -0,0 +1,168 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * IP configuration for virtual network gateway. + */ +@JsonFlatten +public class VirtualNetworkGatewayIPConfiguration extends SubResource { + /** + * The private IP allocation method. Possible values are: 'Static' and + * 'Dynamic'. Possible values include: 'Static', 'Dynamic'. + */ + @JsonProperty(value = "properties.privateIPAllocationMethod") + private IPAllocationMethod privateIPAllocationMethod; + + /** + * The reference of the subnet resource. + */ + @JsonProperty(value = "properties.subnet") + private SubResource subnet; + + /** + * The reference of the public IP resource. + */ + @JsonProperty(value = "properties.publicIPAddress") + private SubResource publicIPAddress; + + /** + * The provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get the private IP allocation method. Possible values are: 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic'. + * + * @return the privateIPAllocationMethod value + */ + public IPAllocationMethod privateIPAllocationMethod() { + return this.privateIPAllocationMethod; + } + + /** + * Set the private IP allocation method. Possible values are: 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic'. + * + * @param privateIPAllocationMethod the privateIPAllocationMethod value to set + * @return the VirtualNetworkGatewayIPConfiguration object itself. + */ + public VirtualNetworkGatewayIPConfiguration withPrivateIPAllocationMethod(IPAllocationMethod privateIPAllocationMethod) { + this.privateIPAllocationMethod = privateIPAllocationMethod; + return this; + } + + /** + * Get the reference of the subnet resource. + * + * @return the subnet value + */ + public SubResource subnet() { + return this.subnet; + } + + /** + * Set the reference of the subnet resource. + * + * @param subnet the subnet value to set + * @return the VirtualNetworkGatewayIPConfiguration object itself. + */ + public VirtualNetworkGatewayIPConfiguration withSubnet(SubResource subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get the reference of the public IP resource. + * + * @return the publicIPAddress value + */ + public SubResource publicIPAddress() { + return this.publicIPAddress; + } + + /** + * Set the reference of the public IP resource. + * + * @param publicIPAddress the publicIPAddress value to set + * @return the VirtualNetworkGatewayIPConfiguration object itself. + */ + public VirtualNetworkGatewayIPConfiguration withPublicIPAddress(SubResource publicIPAddress) { + this.publicIPAddress = publicIPAddress; + return this; + } + + /** + * Get the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the VirtualNetworkGatewayIPConfiguration object itself. + */ + public VirtualNetworkGatewayIPConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the VirtualNetworkGatewayIPConfiguration object itself. + */ + public VirtualNetworkGatewayIPConfiguration withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworkGatewaySku.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworkGatewaySku.java new file mode 100644 index 000000000000..8d630131a37f --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworkGatewaySku.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * VirtualNetworkGatewaySku details. + */ +public class VirtualNetworkGatewaySku { + /** + * Gateway SKU name. Possible values include: 'Basic', 'HighPerformance', + * 'Standard', 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', + * 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ'. + */ + @JsonProperty(value = "name") + private VirtualNetworkGatewaySkuName name; + + /** + * Gateway SKU tier. Possible values include: 'Basic', 'HighPerformance', + * 'Standard', 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', + * 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ'. + */ + @JsonProperty(value = "tier") + private VirtualNetworkGatewaySkuTier tier; + + /** + * The capacity. + */ + @JsonProperty(value = "capacity") + private Integer capacity; + + /** + * Get gateway SKU name. Possible values include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ'. + * + * @return the name value + */ + public VirtualNetworkGatewaySkuName name() { + return this.name; + } + + /** + * Set gateway SKU name. Possible values include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ'. + * + * @param name the name value to set + * @return the VirtualNetworkGatewaySku object itself. + */ + public VirtualNetworkGatewaySku withName(VirtualNetworkGatewaySkuName name) { + this.name = name; + return this; + } + + /** + * Get gateway SKU tier. Possible values include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ'. + * + * @return the tier value + */ + public VirtualNetworkGatewaySkuTier tier() { + return this.tier; + } + + /** + * Set gateway SKU tier. Possible values include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ'. + * + * @param tier the tier value to set + * @return the VirtualNetworkGatewaySku object itself. + */ + public VirtualNetworkGatewaySku withTier(VirtualNetworkGatewaySkuTier tier) { + this.tier = tier; + return this; + } + + /** + * Get the capacity. + * + * @return the capacity value + */ + public Integer capacity() { + return this.capacity; + } + + /** + * Set the capacity. + * + * @param capacity the capacity value to set + * @return the VirtualNetworkGatewaySku object itself. + */ + public VirtualNetworkGatewaySku withCapacity(Integer capacity) { + this.capacity = capacity; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworkGatewaySkuName.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworkGatewaySkuName.java new file mode 100644 index 000000000000..a110bae5856b --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworkGatewaySkuName.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for VirtualNetworkGatewaySkuName. + */ +public final class VirtualNetworkGatewaySkuName extends ExpandableStringEnum { + /** Static value Basic for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName BASIC = fromString("Basic"); + + /** Static value HighPerformance for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName HIGH_PERFORMANCE = fromString("HighPerformance"); + + /** Static value Standard for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName STANDARD = fromString("Standard"); + + /** Static value UltraPerformance for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName ULTRA_PERFORMANCE = fromString("UltraPerformance"); + + /** Static value VpnGw1 for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName VPN_GW1 = fromString("VpnGw1"); + + /** Static value VpnGw2 for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName VPN_GW2 = fromString("VpnGw2"); + + /** Static value VpnGw3 for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName VPN_GW3 = fromString("VpnGw3"); + + /** Static value VpnGw1AZ for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName VPN_GW1AZ = fromString("VpnGw1AZ"); + + /** Static value VpnGw2AZ for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName VPN_GW2AZ = fromString("VpnGw2AZ"); + + /** Static value VpnGw3AZ for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName VPN_GW3AZ = fromString("VpnGw3AZ"); + + /** Static value ErGw1AZ for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName ER_GW1AZ = fromString("ErGw1AZ"); + + /** Static value ErGw2AZ for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName ER_GW2AZ = fromString("ErGw2AZ"); + + /** Static value ErGw3AZ for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName ER_GW3AZ = fromString("ErGw3AZ"); + + /** + * Creates or finds a VirtualNetworkGatewaySkuName from its string representation. + * @param name a name to look for + * @return the corresponding VirtualNetworkGatewaySkuName + */ + @JsonCreator + public static VirtualNetworkGatewaySkuName fromString(String name) { + return fromString(name, VirtualNetworkGatewaySkuName.class); + } + + /** + * @return known VirtualNetworkGatewaySkuName values + */ + public static Collection values() { + return values(VirtualNetworkGatewaySkuName.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworkGatewaySkuTier.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworkGatewaySkuTier.java new file mode 100644 index 000000000000..582a2326bb83 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworkGatewaySkuTier.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for VirtualNetworkGatewaySkuTier. + */ +public final class VirtualNetworkGatewaySkuTier extends ExpandableStringEnum { + /** Static value Basic for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier BASIC = fromString("Basic"); + + /** Static value HighPerformance for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier HIGH_PERFORMANCE = fromString("HighPerformance"); + + /** Static value Standard for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier STANDARD = fromString("Standard"); + + /** Static value UltraPerformance for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier ULTRA_PERFORMANCE = fromString("UltraPerformance"); + + /** Static value VpnGw1 for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier VPN_GW1 = fromString("VpnGw1"); + + /** Static value VpnGw2 for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier VPN_GW2 = fromString("VpnGw2"); + + /** Static value VpnGw3 for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier VPN_GW3 = fromString("VpnGw3"); + + /** Static value VpnGw1AZ for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier VPN_GW1AZ = fromString("VpnGw1AZ"); + + /** Static value VpnGw2AZ for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier VPN_GW2AZ = fromString("VpnGw2AZ"); + + /** Static value VpnGw3AZ for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier VPN_GW3AZ = fromString("VpnGw3AZ"); + + /** Static value ErGw1AZ for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier ER_GW1AZ = fromString("ErGw1AZ"); + + /** Static value ErGw2AZ for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier ER_GW2AZ = fromString("ErGw2AZ"); + + /** Static value ErGw3AZ for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier ER_GW3AZ = fromString("ErGw3AZ"); + + /** + * Creates or finds a VirtualNetworkGatewaySkuTier from its string representation. + * @param name a name to look for + * @return the corresponding VirtualNetworkGatewaySkuTier + */ + @JsonCreator + public static VirtualNetworkGatewaySkuTier fromString(String name) { + return fromString(name, VirtualNetworkGatewaySkuTier.class); + } + + /** + * @return known VirtualNetworkGatewaySkuTier values + */ + public static Collection values() { + return values(VirtualNetworkGatewaySkuTier.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworkGatewayType.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworkGatewayType.java new file mode 100644 index 000000000000..b6943707d675 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworkGatewayType.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for VirtualNetworkGatewayType. + */ +public final class VirtualNetworkGatewayType extends ExpandableStringEnum { + /** Static value Vpn for VirtualNetworkGatewayType. */ + public static final VirtualNetworkGatewayType VPN = fromString("Vpn"); + + /** Static value ExpressRoute for VirtualNetworkGatewayType. */ + public static final VirtualNetworkGatewayType EXPRESS_ROUTE = fromString("ExpressRoute"); + + /** + * Creates or finds a VirtualNetworkGatewayType from its string representation. + * @param name a name to look for + * @return the corresponding VirtualNetworkGatewayType + */ + @JsonCreator + public static VirtualNetworkGatewayType fromString(String name) { + return fromString(name, VirtualNetworkGatewayType.class); + } + + /** + * @return known VirtualNetworkGatewayType values + */ + public static Collection values() { + return values(VirtualNetworkGatewayType.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworkGateways.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworkGateways.java new file mode 100644 index 000000000000..2d4cdfa896bb --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworkGateways.java @@ -0,0 +1,152 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import rx.Completable; +import com.microsoft.azure.management.network.v2018_06_01.implementation.VpnClientIPsecParametersInner; +import com.microsoft.azure.management.network.v2018_06_01.implementation.VirtualNetworkGatewaysInner; +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkGatewayConnectionListEntity; + +/** + * Type representing VirtualNetworkGateways. + */ +public interface VirtualNetworkGateways extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, HasInner { + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable resetAsync(String resourceGroupName, String virtualNetworkGatewayName); + + /** + * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable generatevpnclientpackageAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters); + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable generateVpnProfileAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters); + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The profile needs to be generated first using generateVpnProfile. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable getVpnProfilePackageUrlAsync(String resourceGroupName, String virtualNetworkGatewayName); + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getBgpPeerStatusAsync(String resourceGroupName, String virtualNetworkGatewayName); + + /** + * Gets a xml format representation for supported vpn devices. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable supportedVpnDevicesAsync(String resourceGroupName, String virtualNetworkGatewayName); + + /** + * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getLearnedRoutesAsync(String resourceGroupName, String virtualNetworkGatewayName); + + /** + * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAdvertisedRoutesAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer); + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network Gateway P2S client operation through Network resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable setVpnclientIpsecParametersAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientIPsecParametersInner vpnclientIpsecParams); + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The virtual network gateway name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getVpnclientIpsecParametersAsync(String resourceGroupName, String virtualNetworkGatewayName); + + /** + * Gets all the connections in a virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listConnectionsAsync(final String resourceGroupName, final String virtualNetworkGatewayName); + + /** + * Gets a xml format representation for vpn device configuration script. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection for which the configuration script is generated. + * @param parameters Parameters supplied to the generate vpn device script operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable vpnDeviceConfigurationScriptAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworkPeering.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworkPeering.java new file mode 100644 index 000000000000..57c8dcc251d4 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworkPeering.java @@ -0,0 +1,346 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_06_01.implementation.VirtualNetworkPeeringInner; +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.network.v2018_06_01.implementation.NetworkManager; +import com.microsoft.azure.SubResource; + +/** + * Type representing VirtualNetworkPeering. + */ +public interface VirtualNetworkPeering extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the allowForwardedTraffic value. + */ + Boolean allowForwardedTraffic(); + + /** + * @return the allowGatewayTransit value. + */ + Boolean allowGatewayTransit(); + + /** + * @return the allowVirtualNetworkAccess value. + */ + Boolean allowVirtualNetworkAccess(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the peeringState value. + */ + VirtualNetworkPeeringState peeringState(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the remoteAddressSpace value. + */ + AddressSpace remoteAddressSpace(); + + /** + * @return the remoteVirtualNetwork value. + */ + SubResource remoteVirtualNetwork(); + + /** + * @return the useRemoteGateways value. + */ + Boolean useRemoteGateways(); + + /** + * The entirety of the VirtualNetworkPeering definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithVirtualNetwork, DefinitionStages.WithCreate { + } + + /** + * Grouping of VirtualNetworkPeering definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a VirtualNetworkPeering definition. + */ + interface Blank extends WithVirtualNetwork { + } + + /** + * The stage of the virtualnetworkpeering definition allowing to specify VirtualNetwork. + */ + interface WithVirtualNetwork { + /** + * Specifies resourceGroupName, virtualNetworkName. + */ + WithCreate withExistingVirtualNetwork(String resourceGroupName, String virtualNetworkName); + } + + /** + * The stage of the virtualnetworkpeering definition allowing to specify AllowForwardedTraffic. + */ + interface WithAllowForwardedTraffic { + /** + * Specifies allowForwardedTraffic. + */ + WithCreate withAllowForwardedTraffic(Boolean allowForwardedTraffic); + } + + /** + * The stage of the virtualnetworkpeering definition allowing to specify AllowGatewayTransit. + */ + interface WithAllowGatewayTransit { + /** + * Specifies allowGatewayTransit. + */ + WithCreate withAllowGatewayTransit(Boolean allowGatewayTransit); + } + + /** + * The stage of the virtualnetworkpeering definition allowing to specify AllowVirtualNetworkAccess. + */ + interface WithAllowVirtualNetworkAccess { + /** + * Specifies allowVirtualNetworkAccess. + */ + WithCreate withAllowVirtualNetworkAccess(Boolean allowVirtualNetworkAccess); + } + + /** + * The stage of the virtualnetworkpeering definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the virtualnetworkpeering definition allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + */ + WithCreate withId(String id); + } + + /** + * The stage of the virtualnetworkpeering definition allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + */ + WithCreate withName(String name); + } + + /** + * The stage of the virtualnetworkpeering definition allowing to specify PeeringState. + */ + interface WithPeeringState { + /** + * Specifies peeringState. + */ + WithCreate withPeeringState(VirtualNetworkPeeringState peeringState); + } + + /** + * The stage of the virtualnetworkpeering definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the virtualnetworkpeering definition allowing to specify RemoteAddressSpace. + */ + interface WithRemoteAddressSpace { + /** + * Specifies remoteAddressSpace. + */ + WithCreate withRemoteAddressSpace(AddressSpace remoteAddressSpace); + } + + /** + * The stage of the virtualnetworkpeering definition allowing to specify RemoteVirtualNetwork. + */ + interface WithRemoteVirtualNetwork { + /** + * Specifies remoteVirtualNetwork. + */ + WithCreate withRemoteVirtualNetwork(SubResource remoteVirtualNetwork); + } + + /** + * The stage of the virtualnetworkpeering definition allowing to specify UseRemoteGateways. + */ + interface WithUseRemoteGateways { + /** + * Specifies useRemoteGateways. + */ + WithCreate withUseRemoteGateways(Boolean useRemoteGateways); + } + + /** + * 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.WithAllowForwardedTraffic, DefinitionStages.WithAllowGatewayTransit, DefinitionStages.WithAllowVirtualNetworkAccess, DefinitionStages.WithEtag, DefinitionStages.WithId, DefinitionStages.WithName, DefinitionStages.WithPeeringState, DefinitionStages.WithProvisioningState, DefinitionStages.WithRemoteAddressSpace, DefinitionStages.WithRemoteVirtualNetwork, DefinitionStages.WithUseRemoteGateways { + } + } + /** + * The template for a VirtualNetworkPeering update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAllowForwardedTraffic, UpdateStages.WithAllowGatewayTransit, UpdateStages.WithAllowVirtualNetworkAccess, UpdateStages.WithEtag, UpdateStages.WithId, UpdateStages.WithName, UpdateStages.WithPeeringState, UpdateStages.WithProvisioningState, UpdateStages.WithRemoteAddressSpace, UpdateStages.WithRemoteVirtualNetwork, UpdateStages.WithUseRemoteGateways { + } + + /** + * Grouping of VirtualNetworkPeering update stages. + */ + interface UpdateStages { + /** + * The stage of the virtualnetworkpeering update allowing to specify AllowForwardedTraffic. + */ + interface WithAllowForwardedTraffic { + /** + * Specifies allowForwardedTraffic. + */ + Update withAllowForwardedTraffic(Boolean allowForwardedTraffic); + } + + /** + * The stage of the virtualnetworkpeering update allowing to specify AllowGatewayTransit. + */ + interface WithAllowGatewayTransit { + /** + * Specifies allowGatewayTransit. + */ + Update withAllowGatewayTransit(Boolean allowGatewayTransit); + } + + /** + * The stage of the virtualnetworkpeering update allowing to specify AllowVirtualNetworkAccess. + */ + interface WithAllowVirtualNetworkAccess { + /** + * Specifies allowVirtualNetworkAccess. + */ + Update withAllowVirtualNetworkAccess(Boolean allowVirtualNetworkAccess); + } + + /** + * The stage of the virtualnetworkpeering update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + */ + Update withEtag(String etag); + } + + /** + * The stage of the virtualnetworkpeering update allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + */ + Update withId(String id); + } + + /** + * The stage of the virtualnetworkpeering update allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + */ + Update withName(String name); + } + + /** + * The stage of the virtualnetworkpeering update allowing to specify PeeringState. + */ + interface WithPeeringState { + /** + * Specifies peeringState. + */ + Update withPeeringState(VirtualNetworkPeeringState peeringState); + } + + /** + * The stage of the virtualnetworkpeering update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + */ + Update withProvisioningState(String provisioningState); + } + + /** + * The stage of the virtualnetworkpeering update allowing to specify RemoteAddressSpace. + */ + interface WithRemoteAddressSpace { + /** + * Specifies remoteAddressSpace. + */ + Update withRemoteAddressSpace(AddressSpace remoteAddressSpace); + } + + /** + * The stage of the virtualnetworkpeering update allowing to specify RemoteVirtualNetwork. + */ + interface WithRemoteVirtualNetwork { + /** + * Specifies remoteVirtualNetwork. + */ + Update withRemoteVirtualNetwork(SubResource remoteVirtualNetwork); + } + + /** + * The stage of the virtualnetworkpeering update allowing to specify UseRemoteGateways. + */ + interface WithUseRemoteGateways { + /** + * Specifies useRemoteGateways. + */ + Update withUseRemoteGateways(Boolean useRemoteGateways); + } + + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworkPeeringState.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworkPeeringState.java new file mode 100644 index 000000000000..b194e9e3987a --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworkPeeringState.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for VirtualNetworkPeeringState. + */ +public final class VirtualNetworkPeeringState extends ExpandableStringEnum { + /** Static value Initiated for VirtualNetworkPeeringState. */ + public static final VirtualNetworkPeeringState INITIATED = fromString("Initiated"); + + /** Static value Connected for VirtualNetworkPeeringState. */ + public static final VirtualNetworkPeeringState CONNECTED = fromString("Connected"); + + /** Static value Disconnected for VirtualNetworkPeeringState. */ + public static final VirtualNetworkPeeringState DISCONNECTED = fromString("Disconnected"); + + /** + * Creates or finds a VirtualNetworkPeeringState from its string representation. + * @param name a name to look for + * @return the corresponding VirtualNetworkPeeringState + */ + @JsonCreator + public static VirtualNetworkPeeringState fromString(String name) { + return fromString(name, VirtualNetworkPeeringState.class); + } + + /** + * @return known VirtualNetworkPeeringState values + */ + public static Collection values() { + return values(VirtualNetworkPeeringState.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworkPeerings.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworkPeerings.java new file mode 100644 index 000000000000..2ca6a53e8687 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworkPeerings.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.network.v2018_06_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_06_01.implementation.VirtualNetworkPeeringsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing VirtualNetworkPeerings. + */ +public interface VirtualNetworkPeerings extends SupportsCreating, HasInner { + /** + * Gets the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName); + + /** + * Gets all virtual network peerings in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String virtualNetworkName); + + /** + * Deletes the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworkUsage.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworkUsage.java new file mode 100644 index 000000000000..64d02a69def6 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworkUsage.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_06_01.implementation.VirtualNetworkUsageInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager; + +/** + * Type representing VirtualNetworkUsage. + */ +public interface VirtualNetworkUsage extends HasInner, HasManager { + /** + * @return the currentValue value. + */ + Double currentValue(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the limit value. + */ + Double limit(); + + /** + * @return the name value. + */ + VirtualNetworkUsageName name(); + + /** + * @return the unit value. + */ + String unit(); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworkUsageName.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworkUsageName.java new file mode 100644 index 000000000000..f3b02b230780 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworkUsageName.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.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Usage strings container. + */ +public class VirtualNetworkUsageName { + /** + * Localized subnet size and usage string. + */ + @JsonProperty(value = "localizedValue", access = JsonProperty.Access.WRITE_ONLY) + private String localizedValue; + + /** + * Subnet size and usage string. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private String value; + + /** + * Get localized subnet size and usage string. + * + * @return the localizedValue value + */ + public String localizedValue() { + return this.localizedValue; + } + + /** + * Get subnet size and usage string. + * + * @return the value value + */ + public String value() { + return this.value; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworks.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworks.java new file mode 100644 index 000000000000..cb765ea8901c --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualNetworks.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_06_01.implementation.VirtualNetworksInner; +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkUsage; + +/** + * Type representing VirtualNetworks. + */ +public interface VirtualNetworks extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Checks whether a private IP address is available for use. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkIPAddressAvailabilityAsync(String resourceGroupName, String virtualNetworkName); + + /** + * Lists usage stats. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listUsageAsync(final String resourceGroupName, final String virtualNetworkName); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualWAN.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualWAN.java new file mode 100644 index 000000000000..a1245122d2dc --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualWAN.java @@ -0,0 +1,135 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_06_01.implementation.VirtualWANInner; + +/** + * Type representing VirtualWAN. + */ +public interface VirtualWAN extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the disableVpnEncryption value. + */ + Boolean disableVpnEncryption(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the virtualHubs value. + */ + List virtualHubs(); + + /** + * @return the vpnSites value. + */ + List vpnSites(); + + /** + * The entirety of the VirtualWAN definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of VirtualWAN definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a VirtualWAN definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the VirtualWAN definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the virtualwan update allowing to specify DisableVpnEncryption. + */ + interface WithDisableVpnEncryption { + /** + * Specifies disableVpnEncryption. + */ + WithCreate withDisableVpnEncryption(Boolean disableVpnEncryption); + } + + /** + * The stage of the virtualwan update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + */ + WithCreate withProvisioningState(ProvisioningState provisioningState); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithDisableVpnEncryption, DefinitionStages.WithProvisioningState { + } + } + /** + * The template for a VirtualWAN update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithDisableVpnEncryption, UpdateStages.WithProvisioningState { + } + + /** + * Grouping of VirtualWAN update stages. + */ + interface UpdateStages { + /** + * The stage of the virtualwan {0} allowing to specify DisableVpnEncryption. + */ + interface WithDisableVpnEncryption { + /** + * Specifies disableVpnEncryption. + */ + Update withDisableVpnEncryption(Boolean disableVpnEncryption); + } + + /** + * The stage of the virtualwan {0} allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + */ + Update withProvisioningState(ProvisioningState provisioningState); + } + + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualWANs.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualWANs.java new file mode 100644 index 000000000000..f38cedb71cd9 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VirtualWANs.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_06_01.implementation.VirtualWANsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing VirtualWANs. + */ +public interface VirtualWANs extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VpnClientConfiguration.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VpnClientConfiguration.java new file mode 100644 index 000000000000..a8551d2c4cb5 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VpnClientConfiguration.java @@ -0,0 +1,203 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * VpnClientConfiguration for P2S client. + */ +public class VpnClientConfiguration { + /** + * The reference of the address space resource which represents Address + * space for P2S VpnClient. + */ + @JsonProperty(value = "vpnClientAddressPool") + private AddressSpace vpnClientAddressPool; + + /** + * VpnClientRootCertificate for virtual network gateway. + */ + @JsonProperty(value = "vpnClientRootCertificates") + private List vpnClientRootCertificates; + + /** + * VpnClientRevokedCertificate for Virtual network gateway. + */ + @JsonProperty(value = "vpnClientRevokedCertificates") + private List vpnClientRevokedCertificates; + + /** + * VpnClientProtocols for Virtual network gateway. + */ + @JsonProperty(value = "vpnClientProtocols") + private List vpnClientProtocols; + + /** + * VpnClientIpsecPolicies for virtual network gateway P2S client. + */ + @JsonProperty(value = "vpnClientIpsecPolicies") + private List vpnClientIpsecPolicies; + + /** + * The radius server address property of the VirtualNetworkGateway resource + * for vpn client connection. + */ + @JsonProperty(value = "radiusServerAddress") + private String radiusServerAddress; + + /** + * The radius secret property of the VirtualNetworkGateway resource for vpn + * client connection. + */ + @JsonProperty(value = "radiusServerSecret") + private String radiusServerSecret; + + /** + * Get the reference of the address space resource which represents Address space for P2S VpnClient. + * + * @return the vpnClientAddressPool value + */ + public AddressSpace vpnClientAddressPool() { + return this.vpnClientAddressPool; + } + + /** + * Set the reference of the address space resource which represents Address space for P2S VpnClient. + * + * @param vpnClientAddressPool the vpnClientAddressPool value to set + * @return the VpnClientConfiguration object itself. + */ + public VpnClientConfiguration withVpnClientAddressPool(AddressSpace vpnClientAddressPool) { + this.vpnClientAddressPool = vpnClientAddressPool; + return this; + } + + /** + * Get vpnClientRootCertificate for virtual network gateway. + * + * @return the vpnClientRootCertificates value + */ + public List vpnClientRootCertificates() { + return this.vpnClientRootCertificates; + } + + /** + * Set vpnClientRootCertificate for virtual network gateway. + * + * @param vpnClientRootCertificates the vpnClientRootCertificates value to set + * @return the VpnClientConfiguration object itself. + */ + public VpnClientConfiguration withVpnClientRootCertificates(List vpnClientRootCertificates) { + this.vpnClientRootCertificates = vpnClientRootCertificates; + return this; + } + + /** + * Get vpnClientRevokedCertificate for Virtual network gateway. + * + * @return the vpnClientRevokedCertificates value + */ + public List vpnClientRevokedCertificates() { + return this.vpnClientRevokedCertificates; + } + + /** + * Set vpnClientRevokedCertificate for Virtual network gateway. + * + * @param vpnClientRevokedCertificates the vpnClientRevokedCertificates value to set + * @return the VpnClientConfiguration object itself. + */ + public VpnClientConfiguration withVpnClientRevokedCertificates(List vpnClientRevokedCertificates) { + this.vpnClientRevokedCertificates = vpnClientRevokedCertificates; + return this; + } + + /** + * Get vpnClientProtocols for Virtual network gateway. + * + * @return the vpnClientProtocols value + */ + public List vpnClientProtocols() { + return this.vpnClientProtocols; + } + + /** + * Set vpnClientProtocols for Virtual network gateway. + * + * @param vpnClientProtocols the vpnClientProtocols value to set + * @return the VpnClientConfiguration object itself. + */ + public VpnClientConfiguration withVpnClientProtocols(List vpnClientProtocols) { + this.vpnClientProtocols = vpnClientProtocols; + return this; + } + + /** + * Get vpnClientIpsecPolicies for virtual network gateway P2S client. + * + * @return the vpnClientIpsecPolicies value + */ + public List vpnClientIpsecPolicies() { + return this.vpnClientIpsecPolicies; + } + + /** + * Set vpnClientIpsecPolicies for virtual network gateway P2S client. + * + * @param vpnClientIpsecPolicies the vpnClientIpsecPolicies value to set + * @return the VpnClientConfiguration object itself. + */ + public VpnClientConfiguration withVpnClientIpsecPolicies(List vpnClientIpsecPolicies) { + this.vpnClientIpsecPolicies = vpnClientIpsecPolicies; + return this; + } + + /** + * Get the radius server address property of the VirtualNetworkGateway resource for vpn client connection. + * + * @return the radiusServerAddress value + */ + public String radiusServerAddress() { + return this.radiusServerAddress; + } + + /** + * Set the radius server address property of the VirtualNetworkGateway resource for vpn client connection. + * + * @param radiusServerAddress the radiusServerAddress value to set + * @return the VpnClientConfiguration object itself. + */ + public VpnClientConfiguration withRadiusServerAddress(String radiusServerAddress) { + this.radiusServerAddress = radiusServerAddress; + return this; + } + + /** + * Get the radius secret property of the VirtualNetworkGateway resource for vpn client connection. + * + * @return the radiusServerSecret value + */ + public String radiusServerSecret() { + return this.radiusServerSecret; + } + + /** + * Set the radius secret property of the VirtualNetworkGateway resource for vpn client connection. + * + * @param radiusServerSecret the radiusServerSecret value to set + * @return the VpnClientConfiguration object itself. + */ + public VpnClientConfiguration withRadiusServerSecret(String radiusServerSecret) { + this.radiusServerSecret = radiusServerSecret; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VpnClientIPsecParameters.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VpnClientIPsecParameters.java new file mode 100644 index 000000000000..1fb0a8194d26 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VpnClientIPsecParameters.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.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.VpnClientIPsecParametersInner; + +/** + * Type representing VpnClientIPsecParameters. + */ +public interface VpnClientIPsecParameters extends HasInner, HasManager { + /** + * @return the dhGroup value. + */ + DhGroup dhGroup(); + + /** + * @return the ikeEncryption value. + */ + IkeEncryption ikeEncryption(); + + /** + * @return the ikeIntegrity value. + */ + IkeIntegrity ikeIntegrity(); + + /** + * @return the ipsecEncryption value. + */ + IpsecEncryption ipsecEncryption(); + + /** + * @return the ipsecIntegrity value. + */ + IpsecIntegrity ipsecIntegrity(); + + /** + * @return the pfsGroup value. + */ + PfsGroup pfsGroup(); + + /** + * @return the saDataSizeKilobytes value. + */ + int saDataSizeKilobytes(); + + /** + * @return the saLifeTimeSeconds value. + */ + int saLifeTimeSeconds(); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VpnClientParameters.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VpnClientParameters.java new file mode 100644 index 000000000000..9bd985250916 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VpnClientParameters.java @@ -0,0 +1,128 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Vpn Client Parameters for package generation. + */ +public class VpnClientParameters { + /** + * VPN client Processor Architecture. Possible values are: 'AMD64' and + * 'X86'. Possible values include: 'Amd64', 'X86'. + */ + @JsonProperty(value = "processorArchitecture") + private ProcessorArchitecture processorArchitecture; + + /** + * VPN client Authentication Method. Possible values are: 'EAPTLS' and + * 'EAPMSCHAPv2'. Possible values include: 'EAPTLS', 'EAPMSCHAPv2'. + */ + @JsonProperty(value = "authenticationMethod") + private AuthenticationMethod authenticationMethod; + + /** + * The public certificate data for the radius server authentication + * certificate as a Base-64 encoded string. Required only if external + * radius authentication has been configured with EAPTLS authentication. + */ + @JsonProperty(value = "radiusServerAuthCertificate") + private String radiusServerAuthCertificate; + + /** + * A list of client root certificates public certificate data encoded as + * Base-64 strings. Optional parameter for external radius based + * authentication with EAPTLS. + */ + @JsonProperty(value = "clientRootCertificates") + private List clientRootCertificates; + + /** + * Get vPN client Processor Architecture. Possible values are: 'AMD64' and 'X86'. Possible values include: 'Amd64', 'X86'. + * + * @return the processorArchitecture value + */ + public ProcessorArchitecture processorArchitecture() { + return this.processorArchitecture; + } + + /** + * Set vPN client Processor Architecture. Possible values are: 'AMD64' and 'X86'. Possible values include: 'Amd64', 'X86'. + * + * @param processorArchitecture the processorArchitecture value to set + * @return the VpnClientParameters object itself. + */ + public VpnClientParameters withProcessorArchitecture(ProcessorArchitecture processorArchitecture) { + this.processorArchitecture = processorArchitecture; + return this; + } + + /** + * Get vPN client Authentication Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values include: 'EAPTLS', 'EAPMSCHAPv2'. + * + * @return the authenticationMethod value + */ + public AuthenticationMethod authenticationMethod() { + return this.authenticationMethod; + } + + /** + * Set vPN client Authentication Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values include: 'EAPTLS', 'EAPMSCHAPv2'. + * + * @param authenticationMethod the authenticationMethod value to set + * @return the VpnClientParameters object itself. + */ + public VpnClientParameters withAuthenticationMethod(AuthenticationMethod authenticationMethod) { + this.authenticationMethod = authenticationMethod; + return this; + } + + /** + * Get the public certificate data for the radius server authentication certificate as a Base-64 encoded string. Required only if external radius authentication has been configured with EAPTLS authentication. + * + * @return the radiusServerAuthCertificate value + */ + public String radiusServerAuthCertificate() { + return this.radiusServerAuthCertificate; + } + + /** + * Set the public certificate data for the radius server authentication certificate as a Base-64 encoded string. Required only if external radius authentication has been configured with EAPTLS authentication. + * + * @param radiusServerAuthCertificate the radiusServerAuthCertificate value to set + * @return the VpnClientParameters object itself. + */ + public VpnClientParameters withRadiusServerAuthCertificate(String radiusServerAuthCertificate) { + this.radiusServerAuthCertificate = radiusServerAuthCertificate; + return this; + } + + /** + * Get a list of client root certificates public certificate data encoded as Base-64 strings. Optional parameter for external radius based authentication with EAPTLS. + * + * @return the clientRootCertificates value + */ + public List clientRootCertificates() { + return this.clientRootCertificates; + } + + /** + * Set a list of client root certificates public certificate data encoded as Base-64 strings. Optional parameter for external radius based authentication with EAPTLS. + * + * @param clientRootCertificates the clientRootCertificates value to set + * @return the VpnClientParameters object itself. + */ + public VpnClientParameters withClientRootCertificates(List clientRootCertificates) { + this.clientRootCertificates = clientRootCertificates; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VpnClientProtocol.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VpnClientProtocol.java new file mode 100644 index 000000000000..3f1c2fb15b20 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VpnClientProtocol.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for VpnClientProtocol. + */ +public final class VpnClientProtocol extends ExpandableStringEnum { + /** Static value IkeV2 for VpnClientProtocol. */ + public static final VpnClientProtocol IKE_V2 = fromString("IkeV2"); + + /** Static value SSTP for VpnClientProtocol. */ + public static final VpnClientProtocol SSTP = fromString("SSTP"); + + /** Static value OpenVPN for VpnClientProtocol. */ + public static final VpnClientProtocol OPEN_VPN = fromString("OpenVPN"); + + /** + * Creates or finds a VpnClientProtocol from its string representation. + * @param name a name to look for + * @return the corresponding VpnClientProtocol + */ + @JsonCreator + public static VpnClientProtocol fromString(String name) { + return fromString(name, VpnClientProtocol.class); + } + + /** + * @return known VpnClientProtocol values + */ + public static Collection values() { + return values(VpnClientProtocol.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VpnClientRevokedCertificate.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VpnClientRevokedCertificate.java new file mode 100644 index 000000000000..1dc66a07ebfe --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VpnClientRevokedCertificate.java @@ -0,0 +1,115 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * VPN client revoked certificate of virtual network gateway. + */ +@JsonFlatten +public class VpnClientRevokedCertificate extends SubResource { + /** + * The revoked VPN client certificate thumbprint. + */ + @JsonProperty(value = "properties.thumbprint") + private String thumbprint; + + /** + * The provisioning state of the VPN client revoked certificate resource. + * Possible values are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get the revoked VPN client certificate thumbprint. + * + * @return the thumbprint value + */ + public String thumbprint() { + return this.thumbprint; + } + + /** + * Set the revoked VPN client certificate thumbprint. + * + * @param thumbprint the thumbprint value to set + * @return the VpnClientRevokedCertificate object itself. + */ + public VpnClientRevokedCertificate withThumbprint(String thumbprint) { + this.thumbprint = thumbprint; + return this; + } + + /** + * Get the provisioning state of the VPN client revoked certificate resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the VpnClientRevokedCertificate object itself. + */ + public VpnClientRevokedCertificate withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the VpnClientRevokedCertificate object itself. + */ + public VpnClientRevokedCertificate withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VpnClientRootCertificate.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VpnClientRootCertificate.java new file mode 100644 index 000000000000..589aa58a636e --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VpnClientRootCertificate.java @@ -0,0 +1,115 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * VPN client root certificate of virtual network gateway. + */ +@JsonFlatten +public class VpnClientRootCertificate extends SubResource { + /** + * The certificate public data. + */ + @JsonProperty(value = "properties.publicCertData", required = true) + private String publicCertData; + + /** + * The provisioning state of the VPN client root certificate resource. + * Possible values are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get the certificate public data. + * + * @return the publicCertData value + */ + public String publicCertData() { + return this.publicCertData; + } + + /** + * Set the certificate public data. + * + * @param publicCertData the publicCertData value to set + * @return the VpnClientRootCertificate object itself. + */ + public VpnClientRootCertificate withPublicCertData(String publicCertData) { + this.publicCertData = publicCertData; + return this; + } + + /** + * Get the provisioning state of the VPN client root certificate resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the VpnClientRootCertificate object itself. + */ + public VpnClientRootCertificate withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the VpnClientRootCertificate object itself. + */ + public VpnClientRootCertificate withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VpnConnection.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VpnConnection.java new file mode 100644 index 000000000000..f65e935ee40f --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VpnConnection.java @@ -0,0 +1,353 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.network.v2018_06_01.implementation.VpnConnectionInner; +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.network.v2018_06_01.implementation.NetworkManager; +import java.util.Map; +import com.microsoft.azure.SubResource; +import java.util.List; + +/** + * Type representing VpnConnection. + */ +public interface VpnConnection extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the connectionBandwidthInMbps value. + */ + Integer connectionBandwidthInMbps(); + + /** + * @return the connectionStatus value. + */ + VpnConnectionStatus connectionStatus(); + + /** + * @return the egressBytesTransferred value. + */ + Long egressBytesTransferred(); + + /** + * @return the enableBgp value. + */ + Boolean enableBgp(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the ingressBytesTransferred value. + */ + Long ingressBytesTransferred(); + + /** + * @return the ipsecPolicies value. + */ + List ipsecPolicies(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the remoteVpnSite value. + */ + SubResource remoteVpnSite(); + + /** + * @return the routingWeight value. + */ + Integer routingWeight(); + + /** + * @return the sharedKey value. + */ + String sharedKey(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the VpnConnection definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithVpnGateway, DefinitionStages.WithCreate { + } + + /** + * Grouping of VpnConnection definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a VpnConnection definition. + */ + interface Blank extends WithVpnGateway { + } + + /** + * The stage of the vpnconnection definition allowing to specify VpnGateway. + */ + interface WithVpnGateway { + /** + * Specifies resourceGroupName, gatewayName. + */ + WithCreate withExistingVpnGateway(String resourceGroupName, String gatewayName); + } + + /** + * The stage of the vpnconnection definition allowing to specify ConnectionStatus. + */ + interface WithConnectionStatus { + /** + * Specifies connectionStatus. + */ + WithCreate withConnectionStatus(VpnConnectionStatus connectionStatus); + } + + /** + * The stage of the vpnconnection definition allowing to specify EnableBgp. + */ + interface WithEnableBgp { + /** + * Specifies enableBgp. + */ + WithCreate withEnableBgp(Boolean enableBgp); + } + + /** + * The stage of the vpnconnection definition allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + */ + WithCreate withId(String id); + } + + /** + * The stage of the vpnconnection definition allowing to specify IpsecPolicies. + */ + interface WithIpsecPolicies { + /** + * Specifies ipsecPolicies. + */ + WithCreate withIpsecPolicies(List ipsecPolicies); + } + + /** + * The stage of the vpnconnection definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + */ + WithCreate withLocation(String location); + } + + /** + * The stage of the vpnconnection definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + */ + WithCreate withProvisioningState(ProvisioningState provisioningState); + } + + /** + * The stage of the vpnconnection definition allowing to specify RemoteVpnSite. + */ + interface WithRemoteVpnSite { + /** + * Specifies remoteVpnSite. + */ + WithCreate withRemoteVpnSite(SubResource remoteVpnSite); + } + + /** + * The stage of the vpnconnection definition allowing to specify RoutingWeight. + */ + interface WithRoutingWeight { + /** + * Specifies routingWeight. + */ + WithCreate withRoutingWeight(Integer routingWeight); + } + + /** + * The stage of the vpnconnection definition allowing to specify SharedKey. + */ + interface WithSharedKey { + /** + * Specifies sharedKey. + */ + WithCreate withSharedKey(String sharedKey); + } + + /** + * The stage of the vpnconnection definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + */ + WithCreate withTags(Map tags); + } + + /** + * 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.WithConnectionStatus, DefinitionStages.WithEnableBgp, DefinitionStages.WithId, DefinitionStages.WithIpsecPolicies, DefinitionStages.WithLocation, DefinitionStages.WithProvisioningState, DefinitionStages.WithRemoteVpnSite, DefinitionStages.WithRoutingWeight, DefinitionStages.WithSharedKey, DefinitionStages.WithTags { + } + } + /** + * The template for a VpnConnection update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithConnectionStatus, UpdateStages.WithEnableBgp, UpdateStages.WithId, UpdateStages.WithIpsecPolicies, UpdateStages.WithLocation, UpdateStages.WithProvisioningState, UpdateStages.WithRemoteVpnSite, UpdateStages.WithRoutingWeight, UpdateStages.WithSharedKey, UpdateStages.WithTags { + } + + /** + * Grouping of VpnConnection update stages. + */ + interface UpdateStages { + /** + * The stage of the vpnconnection update allowing to specify ConnectionStatus. + */ + interface WithConnectionStatus { + /** + * Specifies connectionStatus. + */ + Update withConnectionStatus(VpnConnectionStatus connectionStatus); + } + + /** + * The stage of the vpnconnection update allowing to specify EnableBgp. + */ + interface WithEnableBgp { + /** + * Specifies enableBgp. + */ + Update withEnableBgp(Boolean enableBgp); + } + + /** + * The stage of the vpnconnection update allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + */ + Update withId(String id); + } + + /** + * The stage of the vpnconnection update allowing to specify IpsecPolicies. + */ + interface WithIpsecPolicies { + /** + * Specifies ipsecPolicies. + */ + Update withIpsecPolicies(List ipsecPolicies); + } + + /** + * The stage of the vpnconnection update allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + */ + Update withLocation(String location); + } + + /** + * The stage of the vpnconnection update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + */ + Update withProvisioningState(ProvisioningState provisioningState); + } + + /** + * The stage of the vpnconnection update allowing to specify RemoteVpnSite. + */ + interface WithRemoteVpnSite { + /** + * Specifies remoteVpnSite. + */ + Update withRemoteVpnSite(SubResource remoteVpnSite); + } + + /** + * The stage of the vpnconnection update allowing to specify RoutingWeight. + */ + interface WithRoutingWeight { + /** + * Specifies routingWeight. + */ + Update withRoutingWeight(Integer routingWeight); + } + + /** + * The stage of the vpnconnection update allowing to specify SharedKey. + */ + interface WithSharedKey { + /** + * Specifies sharedKey. + */ + Update withSharedKey(String sharedKey); + } + + /** + * The stage of the vpnconnection update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + */ + Update withTags(Map tags); + } + + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VpnConnectionStatus.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VpnConnectionStatus.java new file mode 100644 index 000000000000..d81680f01414 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VpnConnectionStatus.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for VpnConnectionStatus. + */ +public final class VpnConnectionStatus extends ExpandableStringEnum { + /** Static value Unknown for VpnConnectionStatus. */ + public static final VpnConnectionStatus UNKNOWN = fromString("Unknown"); + + /** Static value Connecting for VpnConnectionStatus. */ + public static final VpnConnectionStatus CONNECTING = fromString("Connecting"); + + /** Static value Connected for VpnConnectionStatus. */ + public static final VpnConnectionStatus CONNECTED = fromString("Connected"); + + /** Static value NotConnected for VpnConnectionStatus. */ + public static final VpnConnectionStatus NOT_CONNECTED = fromString("NotConnected"); + + /** + * Creates or finds a VpnConnectionStatus from its string representation. + * @param name a name to look for + * @return the corresponding VpnConnectionStatus + */ + @JsonCreator + public static VpnConnectionStatus fromString(String name) { + return fromString(name, VpnConnectionStatus.class); + } + + /** + * @return known VpnConnectionStatus values + */ + public static Collection values() { + return values(VpnConnectionStatus.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VpnConnections.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VpnConnections.java new file mode 100644 index 000000000000..89e9d8606b8c --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VpnConnections.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.network.v2018_06_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_06_01.implementation.VpnConnectionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing VpnConnections. + */ +public interface VpnConnections extends SupportsCreating, HasInner { + /** + * Retrieves the details of a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String gatewayName, String connectionName); + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByVpnGatewayAsync(final String resourceGroupName, final String gatewayName); + + /** + * Deletes a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String gatewayName, String connectionName); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VpnDeviceScriptParameters.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VpnDeviceScriptParameters.java new file mode 100644 index 000000000000..05b72ea627fd --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VpnDeviceScriptParameters.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Vpn device configuration script generation parameters. + */ +public class VpnDeviceScriptParameters { + /** + * The vendor for the vpn device. + */ + @JsonProperty(value = "vendor") + private String vendor; + + /** + * The device family for the vpn device. + */ + @JsonProperty(value = "deviceFamily") + private String deviceFamily; + + /** + * The firmware version for the vpn device. + */ + @JsonProperty(value = "firmwareVersion") + private String firmwareVersion; + + /** + * Get the vendor for the vpn device. + * + * @return the vendor value + */ + public String vendor() { + return this.vendor; + } + + /** + * Set the vendor for the vpn device. + * + * @param vendor the vendor value to set + * @return the VpnDeviceScriptParameters object itself. + */ + public VpnDeviceScriptParameters withVendor(String vendor) { + this.vendor = vendor; + return this; + } + + /** + * Get the device family for the vpn device. + * + * @return the deviceFamily value + */ + public String deviceFamily() { + return this.deviceFamily; + } + + /** + * Set the device family for the vpn device. + * + * @param deviceFamily the deviceFamily value to set + * @return the VpnDeviceScriptParameters object itself. + */ + public VpnDeviceScriptParameters withDeviceFamily(String deviceFamily) { + this.deviceFamily = deviceFamily; + return this; + } + + /** + * Get the firmware version for the vpn device. + * + * @return the firmwareVersion value + */ + public String firmwareVersion() { + return this.firmwareVersion; + } + + /** + * Set the firmware version for the vpn device. + * + * @param firmwareVersion the firmwareVersion value to set + * @return the VpnDeviceScriptParameters object itself. + */ + public VpnDeviceScriptParameters withFirmwareVersion(String firmwareVersion) { + this.firmwareVersion = firmwareVersion; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VpnGateway.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VpnGateway.java new file mode 100644 index 000000000000..f6b7f685d748 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VpnGateway.java @@ -0,0 +1,201 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager; +import com.microsoft.azure.SubResource; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.implementation.VpnConnectionInner; +import com.microsoft.azure.management.network.v2018_06_01.implementation.VpnGatewayInner; + +/** + * Type representing VpnGateway. + */ +public interface VpnGateway extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the bgpSettings value. + */ + BgpSettings bgpSettings(); + + /** + * @return the connections value. + */ + List connections(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the policies value. + */ + Policies policies(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the virtualHub value. + */ + SubResource virtualHub(); + + /** + * The entirety of the VpnGateway definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of VpnGateway definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a VpnGateway definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the VpnGateway definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the vpngateway update allowing to specify BgpSettings. + */ + interface WithBgpSettings { + /** + * Specifies bgpSettings. + */ + WithCreate withBgpSettings(BgpSettings bgpSettings); + } + + /** + * The stage of the vpngateway update allowing to specify Connections. + */ + interface WithConnections { + /** + * Specifies connections. + */ + WithCreate withConnections(List connections); + } + + /** + * The stage of the vpngateway update allowing to specify Policies. + */ + interface WithPolicies { + /** + * Specifies policies. + */ + WithCreate withPolicies(Policies policies); + } + + /** + * The stage of the vpngateway update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + */ + WithCreate withProvisioningState(ProvisioningState provisioningState); + } + + /** + * The stage of the vpngateway update allowing to specify VirtualHub. + */ + interface WithVirtualHub { + /** + * Specifies virtualHub. + */ + WithCreate withVirtualHub(SubResource virtualHub); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithBgpSettings, DefinitionStages.WithConnections, DefinitionStages.WithPolicies, DefinitionStages.WithProvisioningState, DefinitionStages.WithVirtualHub { + } + } + /** + * The template for a VpnGateway update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithBgpSettings, UpdateStages.WithConnections, UpdateStages.WithPolicies, UpdateStages.WithProvisioningState, UpdateStages.WithVirtualHub { + } + + /** + * Grouping of VpnGateway update stages. + */ + interface UpdateStages { + /** + * The stage of the vpngateway {0} allowing to specify BgpSettings. + */ + interface WithBgpSettings { + /** + * Specifies bgpSettings. + */ + Update withBgpSettings(BgpSettings bgpSettings); + } + + /** + * The stage of the vpngateway {0} allowing to specify Connections. + */ + interface WithConnections { + /** + * Specifies connections. + */ + Update withConnections(List connections); + } + + /** + * The stage of the vpngateway {0} allowing to specify Policies. + */ + interface WithPolicies { + /** + * Specifies policies. + */ + Update withPolicies(Policies policies); + } + + /** + * The stage of the vpngateway {0} allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + */ + Update withProvisioningState(ProvisioningState provisioningState); + } + + /** + * The stage of the vpngateway {0} allowing to specify VirtualHub. + */ + interface WithVirtualHub { + /** + * Specifies virtualHub. + */ + Update withVirtualHub(SubResource virtualHub); + } + + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VpnGateways.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VpnGateways.java new file mode 100644 index 000000000000..110388afdaa8 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VpnGateways.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_06_01.implementation.VpnGatewaysInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing VpnGateways. + */ +public interface VpnGateways extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VpnSite.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VpnSite.java new file mode 100644 index 000000000000..9d9221f14af6 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VpnSite.java @@ -0,0 +1,249 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_06_01.implementation.VpnSiteInner; + +/** + * Type representing VpnSite. + */ +public interface VpnSite extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the addressSpace value. + */ + AddressSpace addressSpace(); + + /** + * @return the bgpProperties value. + */ + BgpSettings bgpProperties(); + + /** + * @return the deviceProperties value. + */ + DeviceProperties deviceProperties(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the ipAddress value. + */ + String ipAddress(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the siteKey value. + */ + String siteKey(); + + /** + * @return the virtualWAN value. + */ + SubResource virtualWAN(); + + /** + * The entirety of the VpnSite definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of VpnSite definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a VpnSite definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the VpnSite definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the vpnsite update allowing to specify AddressSpace. + */ + interface WithAddressSpace { + /** + * Specifies addressSpace. + */ + WithCreate withAddressSpace(AddressSpace addressSpace); + } + + /** + * The stage of the vpnsite update allowing to specify BgpProperties. + */ + interface WithBgpProperties { + /** + * Specifies bgpProperties. + */ + WithCreate withBgpProperties(BgpSettings bgpProperties); + } + + /** + * The stage of the vpnsite update allowing to specify DeviceProperties. + */ + interface WithDeviceProperties { + /** + * Specifies deviceProperties. + */ + WithCreate withDeviceProperties(DeviceProperties deviceProperties); + } + + /** + * The stage of the vpnsite update allowing to specify IpAddress. + */ + interface WithIpAddress { + /** + * Specifies ipAddress. + */ + WithCreate withIpAddress(String ipAddress); + } + + /** + * The stage of the vpnsite update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + */ + WithCreate withProvisioningState(ProvisioningState provisioningState); + } + + /** + * The stage of the vpnsite update allowing to specify SiteKey. + */ + interface WithSiteKey { + /** + * Specifies siteKey. + */ + WithCreate withSiteKey(String siteKey); + } + + /** + * The stage of the vpnsite update allowing to specify VirtualWAN. + */ + interface WithVirtualWAN { + /** + * Specifies virtualWAN. + */ + WithCreate withVirtualWAN(SubResource virtualWAN); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithAddressSpace, DefinitionStages.WithBgpProperties, DefinitionStages.WithDeviceProperties, DefinitionStages.WithIpAddress, DefinitionStages.WithProvisioningState, DefinitionStages.WithSiteKey, DefinitionStages.WithVirtualWAN { + } + } + /** + * The template for a VpnSite update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithAddressSpace, UpdateStages.WithBgpProperties, UpdateStages.WithDeviceProperties, UpdateStages.WithIpAddress, UpdateStages.WithProvisioningState, UpdateStages.WithSiteKey, UpdateStages.WithVirtualWAN { + } + + /** + * Grouping of VpnSite update stages. + */ + interface UpdateStages { + /** + * The stage of the vpnsite {0} allowing to specify AddressSpace. + */ + interface WithAddressSpace { + /** + * Specifies addressSpace. + */ + Update withAddressSpace(AddressSpace addressSpace); + } + + /** + * The stage of the vpnsite {0} allowing to specify BgpProperties. + */ + interface WithBgpProperties { + /** + * Specifies bgpProperties. + */ + Update withBgpProperties(BgpSettings bgpProperties); + } + + /** + * The stage of the vpnsite {0} allowing to specify DeviceProperties. + */ + interface WithDeviceProperties { + /** + * Specifies deviceProperties. + */ + Update withDeviceProperties(DeviceProperties deviceProperties); + } + + /** + * The stage of the vpnsite {0} allowing to specify IpAddress. + */ + interface WithIpAddress { + /** + * Specifies ipAddress. + */ + Update withIpAddress(String ipAddress); + } + + /** + * The stage of the vpnsite {0} allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + */ + Update withProvisioningState(ProvisioningState provisioningState); + } + + /** + * The stage of the vpnsite {0} allowing to specify SiteKey. + */ + interface WithSiteKey { + /** + * Specifies siteKey. + */ + Update withSiteKey(String siteKey); + } + + /** + * The stage of the vpnsite {0} allowing to specify VirtualWAN. + */ + interface WithVirtualWAN { + /** + * Specifies virtualWAN. + */ + Update withVirtualWAN(SubResource virtualWAN); + } + + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VpnSiteId.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VpnSiteId.java new file mode 100644 index 000000000000..de0bba114799 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VpnSiteId.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * VpnSite Resource. + */ +public class VpnSiteId { + /** + * The resource-uri of the vpn-site for which config is to be fetched. + */ + @JsonProperty(value = "vpnSite", access = JsonProperty.Access.WRITE_ONLY) + private String vpnSite; + + /** + * Get the resource-uri of the vpn-site for which config is to be fetched. + * + * @return the vpnSite value + */ + public String vpnSite() { + return this.vpnSite; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VpnSites.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VpnSites.java new file mode 100644 index 000000000000..9c2f4e8329af --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VpnSites.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.network.v2018_06_01.implementation.VpnSitesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing VpnSites. + */ +public interface VpnSites extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VpnSitesConfigurations.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VpnSitesConfigurations.java new file mode 100644 index 000000000000..b1e96560f1e0 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VpnSitesConfigurations.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01; + +import rx.Completable; +import com.microsoft.azure.management.network.v2018_06_01.implementation.VpnSitesConfigurationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing VpnSitesConfigurations. + */ +public interface VpnSitesConfigurations extends HasInner { + /** + * Gives the sas-url to download the configurations for vpn-sites in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWANName The name of the VirtualWAN for which configuration of all vpn-sites is needed. + * @param request Parameters supplied to download vpn-sites configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable downloadAsync(String resourceGroupName, String virtualWANName, GetVpnSitesConfigurationRequest request); + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VpnType.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VpnType.java new file mode 100644 index 000000000000..1798252698f4 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/VpnType.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.network.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for VpnType. + */ +public final class VpnType extends ExpandableStringEnum { + /** Static value PolicyBased for VpnType. */ + public static final VpnType POLICY_BASED = fromString("PolicyBased"); + + /** Static value RouteBased for VpnType. */ + public static final VpnType ROUTE_BASED = fromString("RouteBased"); + + /** + * Creates or finds a VpnType from its string representation. + * @param name a name to look for + * @return the corresponding VpnType + */ + @JsonCreator + public static VpnType fromString(String name) { + return fromString(name, VpnType.class); + } + + /** + * @return known VpnType values + */ + public static Collection values() { + return values(VpnType.class); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ApplicationGatewayAvailableSslOptionsImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ApplicationGatewayAvailableSslOptionsImpl.java new file mode 100644 index 000000000000..3f2da5f2980c --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ApplicationGatewayAvailableSslOptionsImpl.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGatewayAvailableSslOptions; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGatewaySslCipherSuite; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGatewaySslProtocol; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGatewaySslPolicyName; +import com.microsoft.azure.SubResource; +import java.util.Map; + +class ApplicationGatewayAvailableSslOptionsImpl extends WrapperImpl implements ApplicationGatewayAvailableSslOptions { + private final NetworkManager manager; + ApplicationGatewayAvailableSslOptionsImpl(ApplicationGatewayAvailableSslOptionsInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public List availableCipherSuites() { + return this.inner().availableCipherSuites(); + } + + @Override + public List availableProtocols() { + return this.inner().availableProtocols(); + } + + @Override + public ApplicationGatewaySslPolicyName defaultPolicy() { + return this.inner().defaultPolicy(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List predefinedPolicies() { + return this.inner().predefinedPolicies(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ApplicationGatewayAvailableSslOptionsInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ApplicationGatewayAvailableSslOptionsInner.java new file mode 100644 index 000000000000..799defdb3ff9 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ApplicationGatewayAvailableSslOptionsInner.java @@ -0,0 +1,159 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGatewaySslPolicyName; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGatewaySslCipherSuite; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGatewaySslProtocol; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Response for ApplicationGatewayAvailableSslOptions API service call. + */ +@JsonFlatten +@SkipParentValidation +public class ApplicationGatewayAvailableSslOptionsInner extends Resource { + /** + * List of available Ssl predefined policy. + */ + @JsonProperty(value = "properties.predefinedPolicies") + private List predefinedPolicies; + + /** + * Name of the Ssl predefined policy applied by default to application + * gateway. Possible values include: 'AppGwSslPolicy20150501', + * 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S'. + */ + @JsonProperty(value = "properties.defaultPolicy") + private ApplicationGatewaySslPolicyName defaultPolicy; + + /** + * List of available Ssl cipher suites. + */ + @JsonProperty(value = "properties.availableCipherSuites") + private List availableCipherSuites; + + /** + * List of available Ssl protocols. + */ + @JsonProperty(value = "properties.availableProtocols") + private List availableProtocols; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get list of available Ssl predefined policy. + * + * @return the predefinedPolicies value + */ + public List predefinedPolicies() { + return this.predefinedPolicies; + } + + /** + * Set list of available Ssl predefined policy. + * + * @param predefinedPolicies the predefinedPolicies value to set + * @return the ApplicationGatewayAvailableSslOptionsInner object itself. + */ + public ApplicationGatewayAvailableSslOptionsInner withPredefinedPolicies(List predefinedPolicies) { + this.predefinedPolicies = predefinedPolicies; + return this; + } + + /** + * Get name of the Ssl predefined policy applied by default to application gateway. Possible values include: 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S'. + * + * @return the defaultPolicy value + */ + public ApplicationGatewaySslPolicyName defaultPolicy() { + return this.defaultPolicy; + } + + /** + * Set name of the Ssl predefined policy applied by default to application gateway. Possible values include: 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S'. + * + * @param defaultPolicy the defaultPolicy value to set + * @return the ApplicationGatewayAvailableSslOptionsInner object itself. + */ + public ApplicationGatewayAvailableSslOptionsInner withDefaultPolicy(ApplicationGatewaySslPolicyName defaultPolicy) { + this.defaultPolicy = defaultPolicy; + return this; + } + + /** + * Get list of available Ssl cipher suites. + * + * @return the availableCipherSuites value + */ + public List availableCipherSuites() { + return this.availableCipherSuites; + } + + /** + * Set list of available Ssl cipher suites. + * + * @param availableCipherSuites the availableCipherSuites value to set + * @return the ApplicationGatewayAvailableSslOptionsInner object itself. + */ + public ApplicationGatewayAvailableSslOptionsInner withAvailableCipherSuites(List availableCipherSuites) { + this.availableCipherSuites = availableCipherSuites; + return this; + } + + /** + * Get list of available Ssl protocols. + * + * @return the availableProtocols value + */ + public List availableProtocols() { + return this.availableProtocols; + } + + /** + * Set list of available Ssl protocols. + * + * @param availableProtocols the availableProtocols value to set + * @return the ApplicationGatewayAvailableSslOptionsInner object itself. + */ + public ApplicationGatewayAvailableSslOptionsInner withAvailableProtocols(List availableProtocols) { + this.availableProtocols = availableProtocols; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the ApplicationGatewayAvailableSslOptionsInner object itself. + */ + public ApplicationGatewayAvailableSslOptionsInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ApplicationGatewayAvailableWafRuleSetsResultImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ApplicationGatewayAvailableWafRuleSetsResultImpl.java new file mode 100644 index 000000000000..6d69c024d1d5 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ApplicationGatewayAvailableWafRuleSetsResultImpl.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGatewayAvailableWafRuleSetsResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGatewayFirewallRuleSet; + +class ApplicationGatewayAvailableWafRuleSetsResultImpl extends WrapperImpl implements ApplicationGatewayAvailableWafRuleSetsResult { + private final NetworkManager manager; + ApplicationGatewayAvailableWafRuleSetsResultImpl(ApplicationGatewayAvailableWafRuleSetsResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ApplicationGatewayAvailableWafRuleSetsResultInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ApplicationGatewayAvailableWafRuleSetsResultInner.java new file mode 100644 index 000000000000..9d8ce3ec2daf --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ApplicationGatewayAvailableWafRuleSetsResultInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGatewayFirewallRuleSet; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Response for ApplicationGatewayAvailableWafRuleSets API service call. + */ +public class ApplicationGatewayAvailableWafRuleSetsResultInner { + /** + * The list of application gateway rule sets. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the list of application gateway rule sets. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the list of application gateway rule sets. + * + * @param value the value value to set + * @return the ApplicationGatewayAvailableWafRuleSetsResultInner object itself. + */ + public ApplicationGatewayAvailableWafRuleSetsResultInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ApplicationGatewayBackendHealthImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ApplicationGatewayBackendHealthImpl.java new file mode 100644 index 000000000000..18c6630a4774 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ApplicationGatewayBackendHealthImpl.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGatewayBackendHealth; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGatewayBackendHealthPool; + +class ApplicationGatewayBackendHealthImpl extends WrapperImpl implements ApplicationGatewayBackendHealth { + private final NetworkManager manager; + ApplicationGatewayBackendHealthImpl(ApplicationGatewayBackendHealthInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public List backendAddressPools() { + return this.inner().backendAddressPools(); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ApplicationGatewayBackendHealthInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ApplicationGatewayBackendHealthInner.java new file mode 100644 index 000000000000..efd3392c8574 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ApplicationGatewayBackendHealthInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGatewayBackendHealthPool; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * List of ApplicationGatewayBackendHealthPool resources. + */ +public class ApplicationGatewayBackendHealthInner { + /** + * The backendAddressPools property. + */ + @JsonProperty(value = "backendAddressPools") + private List backendAddressPools; + + /** + * Get the backendAddressPools value. + * + * @return the backendAddressPools value + */ + public List backendAddressPools() { + return this.backendAddressPools; + } + + /** + * Set the backendAddressPools value. + * + * @param backendAddressPools the backendAddressPools value to set + * @return the ApplicationGatewayBackendHealthInner object itself. + */ + public ApplicationGatewayBackendHealthInner withBackendAddressPools(List backendAddressPools) { + this.backendAddressPools = backendAddressPools; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ApplicationGatewayImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ApplicationGatewayImpl.java new file mode 100644 index 000000000000..09230b66147f --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ApplicationGatewayImpl.java @@ -0,0 +1,311 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGateway; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGatewaySku; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGatewaySslPolicy; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGatewayOperationalState; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGatewayIPConfiguration; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGatewayAuthenticationCertificate; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGatewaySslCertificate; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGatewayFrontendIPConfiguration; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGatewayFrontendPort; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGatewayProbe; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGatewayBackendAddressPool; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGatewayBackendHttpSettings; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGatewayHttpListener; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGatewayUrlPathMap; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGatewayRequestRoutingRule; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGatewayRedirectConfiguration; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGatewayWebApplicationFirewallConfiguration; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGatewayAutoscaleConfiguration; + +class ApplicationGatewayImpl extends GroupableResourceCoreImpl implements ApplicationGateway, ApplicationGateway.Definition, ApplicationGateway.Update { + ApplicationGatewayImpl(String name, ApplicationGatewayInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + ApplicationGatewaysInner client = this.manager().inner().applicationGateways(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ApplicationGatewaysInner client = this.manager().inner().applicationGateways(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ApplicationGatewaysInner client = this.manager().inner().applicationGateways(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public List authenticationCertificates() { + return this.inner().authenticationCertificates(); + } + + @Override + public ApplicationGatewayAutoscaleConfiguration autoscaleConfiguration() { + return this.inner().autoscaleConfiguration(); + } + + @Override + public List backendAddressPools() { + return this.inner().backendAddressPools(); + } + + @Override + public List backendHttpSettingsCollection() { + return this.inner().backendHttpSettingsCollection(); + } + + @Override + public Boolean enableFips() { + return this.inner().enableFips(); + } + + @Override + public Boolean enableHttp2() { + return this.inner().enableHttp2(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public List frontendIPConfigurations() { + return this.inner().frontendIPConfigurations(); + } + + @Override + public List frontendPorts() { + return this.inner().frontendPorts(); + } + + @Override + public List gatewayIPConfigurations() { + return this.inner().gatewayIPConfigurations(); + } + + @Override + public List httpListeners() { + return this.inner().httpListeners(); + } + + @Override + public ApplicationGatewayOperationalState operationalState() { + return this.inner().operationalState(); + } + + @Override + public List probes() { + return this.inner().probes(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public List redirectConfigurations() { + return this.inner().redirectConfigurations(); + } + + @Override + public List requestRoutingRules() { + return this.inner().requestRoutingRules(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public ApplicationGatewaySku sku() { + return this.inner().sku(); + } + + @Override + public List sslCertificates() { + return this.inner().sslCertificates(); + } + + @Override + public ApplicationGatewaySslPolicy sslPolicy() { + return this.inner().sslPolicy(); + } + + @Override + public List urlPathMaps() { + return this.inner().urlPathMaps(); + } + + @Override + public ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration() { + return this.inner().webApplicationFirewallConfiguration(); + } + + @Override + public List zones() { + return this.inner().zones(); + } + + @Override + public ApplicationGatewayImpl withAuthenticationCertificates(List authenticationCertificates) { + this.inner().withAuthenticationCertificates(authenticationCertificates); + return this; + } + + @Override + public ApplicationGatewayImpl withAutoscaleConfiguration(ApplicationGatewayAutoscaleConfiguration autoscaleConfiguration) { + this.inner().withAutoscaleConfiguration(autoscaleConfiguration); + return this; + } + + @Override + public ApplicationGatewayImpl withBackendAddressPools(List backendAddressPools) { + this.inner().withBackendAddressPools(backendAddressPools); + return this; + } + + @Override + public ApplicationGatewayImpl withBackendHttpSettingsCollection(List backendHttpSettingsCollection) { + this.inner().withBackendHttpSettingsCollection(backendHttpSettingsCollection); + return this; + } + + @Override + public ApplicationGatewayImpl withEnableFips(Boolean enableFips) { + this.inner().withEnableFips(enableFips); + return this; + } + + @Override + public ApplicationGatewayImpl withEnableHttp2(Boolean enableHttp2) { + this.inner().withEnableHttp2(enableHttp2); + return this; + } + + @Override + public ApplicationGatewayImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public ApplicationGatewayImpl withFrontendIPConfigurations(List frontendIPConfigurations) { + this.inner().withFrontendIPConfigurations(frontendIPConfigurations); + return this; + } + + @Override + public ApplicationGatewayImpl withFrontendPorts(List frontendPorts) { + this.inner().withFrontendPorts(frontendPorts); + return this; + } + + @Override + public ApplicationGatewayImpl withGatewayIPConfigurations(List gatewayIPConfigurations) { + this.inner().withGatewayIPConfigurations(gatewayIPConfigurations); + return this; + } + + @Override + public ApplicationGatewayImpl withHttpListeners(List httpListeners) { + this.inner().withHttpListeners(httpListeners); + return this; + } + + @Override + public ApplicationGatewayImpl withProbes(List probes) { + this.inner().withProbes(probes); + return this; + } + + @Override + public ApplicationGatewayImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public ApplicationGatewayImpl withRedirectConfigurations(List redirectConfigurations) { + this.inner().withRedirectConfigurations(redirectConfigurations); + return this; + } + + @Override + public ApplicationGatewayImpl withRequestRoutingRules(List requestRoutingRules) { + this.inner().withRequestRoutingRules(requestRoutingRules); + return this; + } + + @Override + public ApplicationGatewayImpl withResourceGuid(String resourceGuid) { + this.inner().withResourceGuid(resourceGuid); + return this; + } + + @Override + public ApplicationGatewayImpl withSku(ApplicationGatewaySku sku) { + this.inner().withSku(sku); + return this; + } + + @Override + public ApplicationGatewayImpl withSslCertificates(List sslCertificates) { + this.inner().withSslCertificates(sslCertificates); + return this; + } + + @Override + public ApplicationGatewayImpl withSslPolicy(ApplicationGatewaySslPolicy sslPolicy) { + this.inner().withSslPolicy(sslPolicy); + return this; + } + + @Override + public ApplicationGatewayImpl withUrlPathMaps(List urlPathMaps) { + this.inner().withUrlPathMaps(urlPathMaps); + return this; + } + + @Override + public ApplicationGatewayImpl withWebApplicationFirewallConfiguration(ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration) { + this.inner().withWebApplicationFirewallConfiguration(webApplicationFirewallConfiguration); + return this; + } + + @Override + public ApplicationGatewayImpl withZones(List zones) { + this.inner().withZones(zones); + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ApplicationGatewayInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ApplicationGatewayInner.java new file mode 100644 index 000000000000..a8add4aa8de2 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ApplicationGatewayInner.java @@ -0,0 +1,656 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGatewaySku; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGatewaySslPolicy; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGatewayOperationalState; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGatewayIPConfiguration; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGatewayAuthenticationCertificate; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGatewaySslCertificate; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGatewayFrontendIPConfiguration; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGatewayFrontendPort; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGatewayProbe; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGatewayBackendAddressPool; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGatewayBackendHttpSettings; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGatewayHttpListener; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGatewayUrlPathMap; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGatewayRequestRoutingRule; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGatewayRedirectConfiguration; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGatewayWebApplicationFirewallConfiguration; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGatewayAutoscaleConfiguration; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Application gateway resource. + */ +@JsonFlatten +@SkipParentValidation +public class ApplicationGatewayInner extends Resource { + /** + * SKU of the application gateway resource. + */ + @JsonProperty(value = "properties.sku") + private ApplicationGatewaySku sku; + + /** + * SSL policy of the application gateway resource. + */ + @JsonProperty(value = "properties.sslPolicy") + private ApplicationGatewaySslPolicy sslPolicy; + + /** + * Operational state of the application gateway resource. Possible values + * include: 'Stopped', 'Starting', 'Running', 'Stopping'. + */ + @JsonProperty(value = "properties.operationalState", access = JsonProperty.Access.WRITE_ONLY) + private ApplicationGatewayOperationalState operationalState; + + /** + * Subnets of application the gateway resource. + */ + @JsonProperty(value = "properties.gatewayIPConfigurations") + private List gatewayIPConfigurations; + + /** + * Authentication certificates of the application gateway resource. + */ + @JsonProperty(value = "properties.authenticationCertificates") + private List authenticationCertificates; + + /** + * SSL certificates of the application gateway resource. + */ + @JsonProperty(value = "properties.sslCertificates") + private List sslCertificates; + + /** + * Frontend IP addresses of the application gateway resource. + */ + @JsonProperty(value = "properties.frontendIPConfigurations") + private List frontendIPConfigurations; + + /** + * Frontend ports of the application gateway resource. + */ + @JsonProperty(value = "properties.frontendPorts") + private List frontendPorts; + + /** + * Probes of the application gateway resource. + */ + @JsonProperty(value = "properties.probes") + private List probes; + + /** + * Backend address pool of the application gateway resource. + */ + @JsonProperty(value = "properties.backendAddressPools") + private List backendAddressPools; + + /** + * Backend http settings of the application gateway resource. + */ + @JsonProperty(value = "properties.backendHttpSettingsCollection") + private List backendHttpSettingsCollection; + + /** + * Http listeners of the application gateway resource. + */ + @JsonProperty(value = "properties.httpListeners") + private List httpListeners; + + /** + * URL path map of the application gateway resource. + */ + @JsonProperty(value = "properties.urlPathMaps") + private List urlPathMaps; + + /** + * Request routing rules of the application gateway resource. + */ + @JsonProperty(value = "properties.requestRoutingRules") + private List requestRoutingRules; + + /** + * Redirect configurations of the application gateway resource. + */ + @JsonProperty(value = "properties.redirectConfigurations") + private List redirectConfigurations; + + /** + * Web application firewall configuration. + */ + @JsonProperty(value = "properties.webApplicationFirewallConfiguration") + private ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration; + + /** + * Whether HTTP2 is enabled on the application gateway resource. + */ + @JsonProperty(value = "properties.enableHttp2") + private Boolean enableHttp2; + + /** + * Whether FIPS is enabled on the application gateway resource. + */ + @JsonProperty(value = "properties.enableFips") + private Boolean enableFips; + + /** + * Autoscale Configuration. + */ + @JsonProperty(value = "properties.autoscaleConfiguration") + private ApplicationGatewayAutoscaleConfiguration autoscaleConfiguration; + + /** + * Resource GUID property of the application gateway resource. + */ + @JsonProperty(value = "properties.resourceGuid") + private String resourceGuid; + + /** + * Provisioning state of the application gateway resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * A list of availability zones denoting where the resource needs to come + * from. + */ + @JsonProperty(value = "zones") + private List zones; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get sKU of the application gateway resource. + * + * @return the sku value + */ + public ApplicationGatewaySku sku() { + return this.sku; + } + + /** + * Set sKU of the application gateway resource. + * + * @param sku the sku value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withSku(ApplicationGatewaySku sku) { + this.sku = sku; + return this; + } + + /** + * Get sSL policy of the application gateway resource. + * + * @return the sslPolicy value + */ + public ApplicationGatewaySslPolicy sslPolicy() { + return this.sslPolicy; + } + + /** + * Set sSL policy of the application gateway resource. + * + * @param sslPolicy the sslPolicy value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withSslPolicy(ApplicationGatewaySslPolicy sslPolicy) { + this.sslPolicy = sslPolicy; + return this; + } + + /** + * Get operational state of the application gateway resource. Possible values include: 'Stopped', 'Starting', 'Running', 'Stopping'. + * + * @return the operationalState value + */ + public ApplicationGatewayOperationalState operationalState() { + return this.operationalState; + } + + /** + * Get subnets of application the gateway resource. + * + * @return the gatewayIPConfigurations value + */ + public List gatewayIPConfigurations() { + return this.gatewayIPConfigurations; + } + + /** + * Set subnets of application the gateway resource. + * + * @param gatewayIPConfigurations the gatewayIPConfigurations value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withGatewayIPConfigurations(List gatewayIPConfigurations) { + this.gatewayIPConfigurations = gatewayIPConfigurations; + return this; + } + + /** + * Get authentication certificates of the application gateway resource. + * + * @return the authenticationCertificates value + */ + public List authenticationCertificates() { + return this.authenticationCertificates; + } + + /** + * Set authentication certificates of the application gateway resource. + * + * @param authenticationCertificates the authenticationCertificates value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withAuthenticationCertificates(List authenticationCertificates) { + this.authenticationCertificates = authenticationCertificates; + return this; + } + + /** + * Get sSL certificates of the application gateway resource. + * + * @return the sslCertificates value + */ + public List sslCertificates() { + return this.sslCertificates; + } + + /** + * Set sSL certificates of the application gateway resource. + * + * @param sslCertificates the sslCertificates value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withSslCertificates(List sslCertificates) { + this.sslCertificates = sslCertificates; + return this; + } + + /** + * Get frontend IP addresses of the application gateway resource. + * + * @return the frontendIPConfigurations value + */ + public List frontendIPConfigurations() { + return this.frontendIPConfigurations; + } + + /** + * Set frontend IP addresses of the application gateway resource. + * + * @param frontendIPConfigurations the frontendIPConfigurations value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withFrontendIPConfigurations(List frontendIPConfigurations) { + this.frontendIPConfigurations = frontendIPConfigurations; + return this; + } + + /** + * Get frontend ports of the application gateway resource. + * + * @return the frontendPorts value + */ + public List frontendPorts() { + return this.frontendPorts; + } + + /** + * Set frontend ports of the application gateway resource. + * + * @param frontendPorts the frontendPorts value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withFrontendPorts(List frontendPorts) { + this.frontendPorts = frontendPorts; + return this; + } + + /** + * Get probes of the application gateway resource. + * + * @return the probes value + */ + public List probes() { + return this.probes; + } + + /** + * Set probes of the application gateway resource. + * + * @param probes the probes value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withProbes(List probes) { + this.probes = probes; + return this; + } + + /** + * Get backend address pool of the application gateway resource. + * + * @return the backendAddressPools value + */ + public List backendAddressPools() { + return this.backendAddressPools; + } + + /** + * Set backend address pool of the application gateway resource. + * + * @param backendAddressPools the backendAddressPools value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withBackendAddressPools(List backendAddressPools) { + this.backendAddressPools = backendAddressPools; + return this; + } + + /** + * Get backend http settings of the application gateway resource. + * + * @return the backendHttpSettingsCollection value + */ + public List backendHttpSettingsCollection() { + return this.backendHttpSettingsCollection; + } + + /** + * Set backend http settings of the application gateway resource. + * + * @param backendHttpSettingsCollection the backendHttpSettingsCollection value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withBackendHttpSettingsCollection(List backendHttpSettingsCollection) { + this.backendHttpSettingsCollection = backendHttpSettingsCollection; + return this; + } + + /** + * Get http listeners of the application gateway resource. + * + * @return the httpListeners value + */ + public List httpListeners() { + return this.httpListeners; + } + + /** + * Set http listeners of the application gateway resource. + * + * @param httpListeners the httpListeners value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withHttpListeners(List httpListeners) { + this.httpListeners = httpListeners; + return this; + } + + /** + * Get uRL path map of the application gateway resource. + * + * @return the urlPathMaps value + */ + public List urlPathMaps() { + return this.urlPathMaps; + } + + /** + * Set uRL path map of the application gateway resource. + * + * @param urlPathMaps the urlPathMaps value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withUrlPathMaps(List urlPathMaps) { + this.urlPathMaps = urlPathMaps; + return this; + } + + /** + * Get request routing rules of the application gateway resource. + * + * @return the requestRoutingRules value + */ + public List requestRoutingRules() { + return this.requestRoutingRules; + } + + /** + * Set request routing rules of the application gateway resource. + * + * @param requestRoutingRules the requestRoutingRules value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withRequestRoutingRules(List requestRoutingRules) { + this.requestRoutingRules = requestRoutingRules; + return this; + } + + /** + * Get redirect configurations of the application gateway resource. + * + * @return the redirectConfigurations value + */ + public List redirectConfigurations() { + return this.redirectConfigurations; + } + + /** + * Set redirect configurations of the application gateway resource. + * + * @param redirectConfigurations the redirectConfigurations value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withRedirectConfigurations(List redirectConfigurations) { + this.redirectConfigurations = redirectConfigurations; + return this; + } + + /** + * Get web application firewall configuration. + * + * @return the webApplicationFirewallConfiguration value + */ + public ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration() { + return this.webApplicationFirewallConfiguration; + } + + /** + * Set web application firewall configuration. + * + * @param webApplicationFirewallConfiguration the webApplicationFirewallConfiguration value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withWebApplicationFirewallConfiguration(ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration) { + this.webApplicationFirewallConfiguration = webApplicationFirewallConfiguration; + return this; + } + + /** + * Get whether HTTP2 is enabled on the application gateway resource. + * + * @return the enableHttp2 value + */ + public Boolean enableHttp2() { + return this.enableHttp2; + } + + /** + * Set whether HTTP2 is enabled on the application gateway resource. + * + * @param enableHttp2 the enableHttp2 value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withEnableHttp2(Boolean enableHttp2) { + this.enableHttp2 = enableHttp2; + return this; + } + + /** + * Get whether FIPS is enabled on the application gateway resource. + * + * @return the enableFips value + */ + public Boolean enableFips() { + return this.enableFips; + } + + /** + * Set whether FIPS is enabled on the application gateway resource. + * + * @param enableFips the enableFips value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withEnableFips(Boolean enableFips) { + this.enableFips = enableFips; + return this; + } + + /** + * Get autoscale Configuration. + * + * @return the autoscaleConfiguration value + */ + public ApplicationGatewayAutoscaleConfiguration autoscaleConfiguration() { + return this.autoscaleConfiguration; + } + + /** + * Set autoscale Configuration. + * + * @param autoscaleConfiguration the autoscaleConfiguration value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withAutoscaleConfiguration(ApplicationGatewayAutoscaleConfiguration autoscaleConfiguration) { + this.autoscaleConfiguration = autoscaleConfiguration; + return this; + } + + /** + * Get resource GUID property of the application gateway resource. + * + * @return the resourceGuid value + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Set resource GUID property of the application gateway resource. + * + * @param resourceGuid the resourceGuid value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withResourceGuid(String resourceGuid) { + this.resourceGuid = resourceGuid; + return this; + } + + /** + * Get provisioning state of the application gateway resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the application gateway resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get a list of availability zones denoting where the resource needs to come from. + * + * @return the zones value + */ + public List zones() { + return this.zones; + } + + /** + * Set a list of availability zones denoting where the resource needs to come from. + * + * @param zones the zones value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withZones(List zones) { + this.zones = zones; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ApplicationGatewaySslPredefinedPolicyImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ApplicationGatewaySslPredefinedPolicyImpl.java new file mode 100644 index 000000000000..416bbc7306b2 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ApplicationGatewaySslPredefinedPolicyImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGatewaySslPredefinedPolicy; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGatewaySslCipherSuite; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGatewaySslProtocol; + +class ApplicationGatewaySslPredefinedPolicyImpl extends WrapperImpl implements ApplicationGatewaySslPredefinedPolicy { + private final NetworkManager manager; + ApplicationGatewaySslPredefinedPolicyImpl(ApplicationGatewaySslPredefinedPolicyInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public List cipherSuites() { + return this.inner().cipherSuites(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public ApplicationGatewaySslProtocol minProtocolVersion() { + return this.inner().minProtocolVersion(); + } + + @Override + public String name() { + return this.inner().name(); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ApplicationGatewaySslPredefinedPolicyInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ApplicationGatewaySslPredefinedPolicyInner.java new file mode 100644 index 000000000000..aa376a07d50f --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ApplicationGatewaySslPredefinedPolicyInner.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.network.v2018_06_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGatewaySslCipherSuite; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGatewaySslProtocol; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * An Ssl predefined policy. + */ +@JsonFlatten +public class ApplicationGatewaySslPredefinedPolicyInner extends SubResource { + /** + * Name of the Ssl predefined policy. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Ssl cipher suites to be enabled in the specified order for application + * gateway. + */ + @JsonProperty(value = "properties.cipherSuites") + private List cipherSuites; + + /** + * Minimum version of Ssl protocol to be supported on application gateway. + * Possible values include: 'TLSv1_0', 'TLSv1_1', 'TLSv1_2'. + */ + @JsonProperty(value = "properties.minProtocolVersion") + private ApplicationGatewaySslProtocol minProtocolVersion; + + /** + * Get name of the Ssl predefined policy. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the Ssl predefined policy. + * + * @param name the name value to set + * @return the ApplicationGatewaySslPredefinedPolicyInner object itself. + */ + public ApplicationGatewaySslPredefinedPolicyInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get ssl cipher suites to be enabled in the specified order for application gateway. + * + * @return the cipherSuites value + */ + public List cipherSuites() { + return this.cipherSuites; + } + + /** + * Set ssl cipher suites to be enabled in the specified order for application gateway. + * + * @param cipherSuites the cipherSuites value to set + * @return the ApplicationGatewaySslPredefinedPolicyInner object itself. + */ + public ApplicationGatewaySslPredefinedPolicyInner withCipherSuites(List cipherSuites) { + this.cipherSuites = cipherSuites; + return this; + } + + /** + * Get minimum version of Ssl protocol to be supported on application gateway. Possible values include: 'TLSv1_0', 'TLSv1_1', 'TLSv1_2'. + * + * @return the minProtocolVersion value + */ + public ApplicationGatewaySslProtocol minProtocolVersion() { + return this.minProtocolVersion; + } + + /** + * Set minimum version of Ssl protocol to be supported on application gateway. Possible values include: 'TLSv1_0', 'TLSv1_1', 'TLSv1_2'. + * + * @param minProtocolVersion the minProtocolVersion value to set + * @return the ApplicationGatewaySslPredefinedPolicyInner object itself. + */ + public ApplicationGatewaySslPredefinedPolicyInner withMinProtocolVersion(ApplicationGatewaySslProtocol minProtocolVersion) { + this.minProtocolVersion = minProtocolVersion; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ApplicationGatewaysImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ApplicationGatewaysImpl.java new file mode 100644 index 000000000000..289d6d94a9b7 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ApplicationGatewaysImpl.java @@ -0,0 +1,220 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGateways; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGateway; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGatewayBackendHealth; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGatewayAvailableWafRuleSetsResult; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGatewayAvailableSslOptions; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGatewaySslPredefinedPolicy; + +class ApplicationGatewaysImpl extends GroupableResourcesCoreImpl implements ApplicationGateways { + protected ApplicationGatewaysImpl(NetworkManager manager) { + super(manager.inner().applicationGateways(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + ApplicationGatewaysInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ApplicationGatewaysInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + ApplicationGatewaysInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + ApplicationGatewaysInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ApplicationGateway call(ApplicationGatewayInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + ApplicationGatewaysInner client = this.inner(); + return this.wrapList(client.listAll()); + } + + @Override + public Observable listAsync() { + ApplicationGatewaysInner client = this.inner(); + return client.listAllAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ApplicationGateway call(ApplicationGatewayInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public ApplicationGatewayImpl define(String name) { + return wrapModel(name); + } + + @Override + public Completable startAsync(String resourceGroupName, String applicationGatewayName) { + ApplicationGatewaysInner client = this.inner(); + return client.startAsync(resourceGroupName, applicationGatewayName).toCompletable(); + } + + @Override + public Completable stopAsync(String resourceGroupName, String applicationGatewayName) { + ApplicationGatewaysInner client = this.inner(); + return client.stopAsync(resourceGroupName, applicationGatewayName).toCompletable(); + } + + @Override + public Observable backendHealthAsync(String resourceGroupName, String applicationGatewayName) { + ApplicationGatewaysInner client = this.inner(); + return client.backendHealthAsync(resourceGroupName, applicationGatewayName) + .map(new Func1() { + @Override + public ApplicationGatewayBackendHealth call(ApplicationGatewayBackendHealthInner inner) { + return new ApplicationGatewayBackendHealthImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAvailableWafRuleSetsAsync() { + ApplicationGatewaysInner client = this.inner(); + return client.listAvailableWafRuleSetsAsync() + .map(new Func1() { + @Override + public ApplicationGatewayAvailableWafRuleSetsResult call(ApplicationGatewayAvailableWafRuleSetsResultInner inner) { + return new ApplicationGatewayAvailableWafRuleSetsResultImpl(inner, manager()); + } + }); + } + + @Override + protected ApplicationGatewayImpl wrapModel(ApplicationGatewayInner inner) { + return new ApplicationGatewayImpl(inner.name(), inner, manager()); + } + + @Override + protected ApplicationGatewayImpl wrapModel(String name) { + return new ApplicationGatewayImpl(name, new ApplicationGatewayInner(), this.manager()); + } + + @Override + public Observable listAvailableSslOptionsAsync() { + ApplicationGatewaysInner client = this.inner(); + return client.listAvailableSslOptionsAsync() + .map(new Func1() { + @Override + public ApplicationGatewayAvailableSslOptions call(ApplicationGatewayAvailableSslOptionsInner inner) { + return new ApplicationGatewayAvailableSslOptionsImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAvailableSslPredefinedPoliciesAsync() { + ApplicationGatewaysInner client = this.inner(); + return client.listAvailableSslPredefinedPoliciesAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ApplicationGatewaySslPredefinedPolicy call(ApplicationGatewaySslPredefinedPolicyInner inner) { + return new ApplicationGatewaySslPredefinedPolicyImpl(inner, manager()); + } + }); + } + + @Override + public Observable getSslPredefinedPolicyAsync(String predefinedPolicyName) { + ApplicationGatewaysInner client = this.inner(); + return client.getSslPredefinedPolicyAsync(predefinedPolicyName) + .map(new Func1() { + @Override + public ApplicationGatewaySslPredefinedPolicy call(ApplicationGatewaySslPredefinedPolicyInner inner) { + return new ApplicationGatewaySslPredefinedPolicyImpl(inner, manager()); + } + }); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ApplicationGatewaysInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ApplicationGatewaysInner.java new file mode 100644 index 000000000000..47ecffdedf1d --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ApplicationGatewaysInner.java @@ -0,0 +1,2355 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_06_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ApplicationGateways. + */ +public class ApplicationGatewaysInner implements InnerSupportsGet, InnerSupportsDelete { + /** The Retrofit service to perform REST calls. */ + private ApplicationGatewaysService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of ApplicationGatewaysInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ApplicationGatewaysInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(ApplicationGatewaysService.class); + this.client = client; + } + + /** + * The interface defining all the services for ApplicationGateways to be + * used by Retrofit to perform actually REST calls. + */ + interface ApplicationGatewaysService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.ApplicationGateways delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("applicationGatewayName") String applicationGatewayName, @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.network.v2018_06_01.ApplicationGateways beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("applicationGatewayName") String applicationGatewayName, @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.network.v2018_06_01.ApplicationGateways getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("applicationGatewayName") String applicationGatewayName, @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.network.v2018_06_01.ApplicationGateways createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("applicationGatewayName") String applicationGatewayName, @Path("subscriptionId") String subscriptionId, @Body ApplicationGatewayInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.ApplicationGateways beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("applicationGatewayName") String applicationGatewayName, @Path("subscriptionId") String subscriptionId, @Body ApplicationGatewayInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.ApplicationGateways updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("applicationGatewayName") String applicationGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.ApplicationGateways beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}") + Observable> beginUpdateTags(@Path("resourceGroupName") String resourceGroupName, @Path("applicationGatewayName") String applicationGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.ApplicationGateways listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @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.network.v2018_06_01.ApplicationGateways listAll" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGateways") + Observable> listAll(@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.network.v2018_06_01.ApplicationGateways start" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/start") + Observable> start(@Path("resourceGroupName") String resourceGroupName, @Path("applicationGatewayName") String applicationGatewayName, @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.network.v2018_06_01.ApplicationGateways beginStart" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/start") + Observable> beginStart(@Path("resourceGroupName") String resourceGroupName, @Path("applicationGatewayName") String applicationGatewayName, @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.network.v2018_06_01.ApplicationGateways stop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/stop") + Observable> stop(@Path("resourceGroupName") String resourceGroupName, @Path("applicationGatewayName") String applicationGatewayName, @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.network.v2018_06_01.ApplicationGateways beginStop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/stop") + Observable> beginStop(@Path("resourceGroupName") String resourceGroupName, @Path("applicationGatewayName") String applicationGatewayName, @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.network.v2018_06_01.ApplicationGateways backendHealth" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendhealth") + Observable> backendHealth(@Path("resourceGroupName") String resourceGroupName, @Path("applicationGatewayName") String applicationGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @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.network.v2018_06_01.ApplicationGateways beginBackendHealth" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendhealth") + Observable> beginBackendHealth(@Path("resourceGroupName") String resourceGroupName, @Path("applicationGatewayName") String applicationGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @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.network.v2018_06_01.ApplicationGateways listAvailableWafRuleSets" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableWafRuleSets") + Observable> listAvailableWafRuleSets(@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.network.v2018_06_01.ApplicationGateways listAvailableSslOptions" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default") + Observable> listAvailableSslOptions(@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.network.v2018_06_01.ApplicationGateways listAvailableSslPredefinedPolicies" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies") + Observable> listAvailableSslPredefinedPolicies(@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.network.v2018_06_01.ApplicationGateways getSslPredefinedPolicy" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies/{predefinedPolicyName}") + Observable> getSslPredefinedPolicy(@Path("subscriptionId") String subscriptionId, @Path("predefinedPolicyName") String predefinedPolicyName, @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.network.v2018_06_01.ApplicationGateways listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.ApplicationGateways listAllNext" }) + @GET + Observable> listAllNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.ApplicationGateways listAvailableSslPredefinedPoliciesNext" }) + @GET + Observable> listAvailableSslPredefinedPoliciesNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String applicationGatewayName) { + deleteWithServiceResponseAsync(resourceGroupName, applicationGatewayName).toBlocking().last().body(); + } + + /** + * Deletes the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @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 applicationGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, applicationGatewayName), serviceCallback); + } + + /** + * Deletes the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String applicationGatewayName) { + return deleteWithServiceResponseAsync(resourceGroupName, applicationGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + Observable> observable = service.delete(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String applicationGatewayName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, applicationGatewayName).toBlocking().single().body(); + } + + /** + * Deletes the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String applicationGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, applicationGatewayName), serviceCallback); + } + + /** + * Deletes the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String applicationGatewayName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, applicationGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.beginDelete(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationGatewayInner object if successful. + */ + public ApplicationGatewayInner getByResourceGroup(String resourceGroupName, String applicationGatewayName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, applicationGatewayName).toBlocking().single().body(); + } + + /** + * Gets the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String applicationGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, applicationGatewayName), serviceCallback); + } + + /** + * Gets the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewayInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String applicationGatewayName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, applicationGatewayName).map(new Func1, ApplicationGatewayInner>() { + @Override + public ApplicationGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewayInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.getByResourceGroup(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param parameters Parameters supplied to the create or update application gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationGatewayInner object if successful. + */ + public ApplicationGatewayInner createOrUpdate(String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, applicationGatewayName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param parameters Parameters supplied to the create or update application gateway operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, applicationGatewayName, parameters), serviceCallback); + } + + /** + * Creates or updates the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param parameters Parameters supplied to the create or update application gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, applicationGatewayName, parameters).map(new Func1, ApplicationGatewayInner>() { + @Override + public ApplicationGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param parameters Parameters supplied to the create or update application gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param parameters Parameters supplied to the create or update application gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationGatewayInner object if successful. + */ + public ApplicationGatewayInner beginCreateOrUpdate(String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, applicationGatewayName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param parameters Parameters supplied to the create or update application gateway operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, applicationGatewayName, parameters), serviceCallback); + } + + /** + * Creates or updates the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param parameters Parameters supplied to the create or update application gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewayInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, applicationGatewayName, parameters).map(new Func1, ApplicationGatewayInner>() { + @Override + public ApplicationGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param parameters Parameters supplied to the create or update application gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewayInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + return service.beginCreateOrUpdate(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationGatewayInner object if successful. + */ + public ApplicationGatewayInner updateTags(String resourceGroupName, String applicationGatewayName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, applicationGatewayName).toBlocking().last().body(); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @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 updateTagsAsync(String resourceGroupName, String applicationGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, applicationGatewayName), serviceCallback); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String applicationGatewayName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, applicationGatewayName).map(new Func1, ApplicationGatewayInner>() { + @Override + public ApplicationGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + Observable> observable = service.updateTags(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationGatewayInner object if successful. + */ + public ApplicationGatewayInner updateTags(String resourceGroupName, String applicationGatewayName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, applicationGatewayName, tags).toBlocking().last().body(); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String applicationGatewayName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, applicationGatewayName, tags), serviceCallback); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String applicationGatewayName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, applicationGatewayName, tags).map(new Func1, ApplicationGatewayInner>() { + @Override + public ApplicationGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-06-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + Observable> observable = service.updateTags(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationGatewayInner object if successful. + */ + public ApplicationGatewayInner beginUpdateTags(String resourceGroupName, String applicationGatewayName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, applicationGatewayName).toBlocking().single().body(); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @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 beginUpdateTagsAsync(String resourceGroupName, String applicationGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, applicationGatewayName), serviceCallback); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewayInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String applicationGatewayName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, applicationGatewayName).map(new Func1, ApplicationGatewayInner>() { + @Override + public ApplicationGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewayInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.beginUpdateTags(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationGatewayInner object if successful. + */ + public ApplicationGatewayInner beginUpdateTags(String resourceGroupName, String applicationGatewayName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, applicationGatewayName, tags).toBlocking().single().body(); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String applicationGatewayName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, applicationGatewayName, tags), serviceCallback); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewayInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String applicationGatewayName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, applicationGatewayName, tags).map(new Func1, ApplicationGatewayInner>() { + @Override + public ApplicationGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewayInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-06-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.beginUpdateTags(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all application gateways in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ApplicationGatewayInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all application gateways in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all application gateways in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationGatewayInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all application gateways in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationGatewayInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all application gateways in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationGatewayInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the application gateways in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ApplicationGatewayInner> object if successful. + */ + public PagedList listAll() { + ServiceResponse> response = listAllSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listAllNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the application gateways in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAllAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listAllSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listAllNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the application gateways in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationGatewayInner> object + */ + public Observable> listAllAsync() { + return listAllWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the application gateways in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationGatewayInner> object + */ + public Observable>> listAllWithServiceResponseAsync() { + return listAllSinglePageAsync() + .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(listAllNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the application gateways in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationGatewayInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listAllSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.listAll(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listAllDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listAllDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Starts the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void start(String resourceGroupName, String applicationGatewayName) { + startWithServiceResponseAsync(resourceGroupName, applicationGatewayName).toBlocking().last().body(); + } + + /** + * Starts the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @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 startAsync(String resourceGroupName, String applicationGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(startWithServiceResponseAsync(resourceGroupName, applicationGatewayName), serviceCallback); + } + + /** + * Starts the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable startAsync(String resourceGroupName, String applicationGatewayName) { + return startWithServiceResponseAsync(resourceGroupName, applicationGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Starts the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> startWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + Observable> observable = service.start(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Starts the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginStart(String resourceGroupName, String applicationGatewayName) { + beginStartWithServiceResponseAsync(resourceGroupName, applicationGatewayName).toBlocking().single().body(); + } + + /** + * Starts the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @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 beginStartAsync(String resourceGroupName, String applicationGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginStartWithServiceResponseAsync(resourceGroupName, applicationGatewayName), serviceCallback); + } + + /** + * Starts the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginStartAsync(String resourceGroupName, String applicationGatewayName) { + return beginStartWithServiceResponseAsync(resourceGroupName, applicationGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Starts the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginStartWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.beginStart(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginStartDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginStartDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Stops the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void stop(String resourceGroupName, String applicationGatewayName) { + stopWithServiceResponseAsync(resourceGroupName, applicationGatewayName).toBlocking().last().body(); + } + + /** + * Stops the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @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 stopAsync(String resourceGroupName, String applicationGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(stopWithServiceResponseAsync(resourceGroupName, applicationGatewayName), serviceCallback); + } + + /** + * Stops the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable stopAsync(String resourceGroupName, String applicationGatewayName) { + return stopWithServiceResponseAsync(resourceGroupName, applicationGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Stops the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> stopWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + Observable> observable = service.stop(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Stops the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginStop(String resourceGroupName, String applicationGatewayName) { + beginStopWithServiceResponseAsync(resourceGroupName, applicationGatewayName).toBlocking().single().body(); + } + + /** + * Stops the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @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 beginStopAsync(String resourceGroupName, String applicationGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginStopWithServiceResponseAsync(resourceGroupName, applicationGatewayName), serviceCallback); + } + + /** + * Stops the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginStopAsync(String resourceGroupName, String applicationGatewayName) { + return beginStopWithServiceResponseAsync(resourceGroupName, applicationGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Stops the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginStopWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.beginStop(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginStopDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginStopDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationGatewayBackendHealthInner object if successful. + */ + public ApplicationGatewayBackendHealthInner backendHealth(String resourceGroupName, String applicationGatewayName) { + return backendHealthWithServiceResponseAsync(resourceGroupName, applicationGatewayName).toBlocking().last().body(); + } + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @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 backendHealthAsync(String resourceGroupName, String applicationGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(backendHealthWithServiceResponseAsync(resourceGroupName, applicationGatewayName), serviceCallback); + } + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable backendHealthAsync(String resourceGroupName, String applicationGatewayName) { + return backendHealthWithServiceResponseAsync(resourceGroupName, applicationGatewayName).map(new Func1, ApplicationGatewayBackendHealthInner>() { + @Override + public ApplicationGatewayBackendHealthInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> backendHealthWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + final String expand = null; + Observable> observable = service.backendHealth(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationGatewayBackendHealthInner object if successful. + */ + public ApplicationGatewayBackendHealthInner backendHealth(String resourceGroupName, String applicationGatewayName, String expand) { + return backendHealthWithServiceResponseAsync(resourceGroupName, applicationGatewayName, expand).toBlocking().last().body(); + } + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @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 backendHealthAsync(String resourceGroupName, String applicationGatewayName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(backendHealthWithServiceResponseAsync(resourceGroupName, applicationGatewayName, expand), serviceCallback); + } + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable backendHealthAsync(String resourceGroupName, String applicationGatewayName, String expand) { + return backendHealthWithServiceResponseAsync(resourceGroupName, applicationGatewayName, expand).map(new Func1, ApplicationGatewayBackendHealthInner>() { + @Override + public ApplicationGatewayBackendHealthInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> backendHealthWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + Observable> observable = service.backendHealth(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationGatewayBackendHealthInner object if successful. + */ + public ApplicationGatewayBackendHealthInner beginBackendHealth(String resourceGroupName, String applicationGatewayName) { + return beginBackendHealthWithServiceResponseAsync(resourceGroupName, applicationGatewayName).toBlocking().single().body(); + } + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @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 beginBackendHealthAsync(String resourceGroupName, String applicationGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginBackendHealthWithServiceResponseAsync(resourceGroupName, applicationGatewayName), serviceCallback); + } + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewayBackendHealthInner object + */ + public Observable beginBackendHealthAsync(String resourceGroupName, String applicationGatewayName) { + return beginBackendHealthWithServiceResponseAsync(resourceGroupName, applicationGatewayName).map(new Func1, ApplicationGatewayBackendHealthInner>() { + @Override + public ApplicationGatewayBackendHealthInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewayBackendHealthInner object + */ + public Observable> beginBackendHealthWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + final String expand = null; + return service.beginBackendHealth(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginBackendHealthDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationGatewayBackendHealthInner object if successful. + */ + public ApplicationGatewayBackendHealthInner beginBackendHealth(String resourceGroupName, String applicationGatewayName, String expand) { + return beginBackendHealthWithServiceResponseAsync(resourceGroupName, applicationGatewayName, expand).toBlocking().single().body(); + } + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @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 beginBackendHealthAsync(String resourceGroupName, String applicationGatewayName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginBackendHealthWithServiceResponseAsync(resourceGroupName, applicationGatewayName, expand), serviceCallback); + } + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewayBackendHealthInner object + */ + public Observable beginBackendHealthAsync(String resourceGroupName, String applicationGatewayName, String expand) { + return beginBackendHealthWithServiceResponseAsync(resourceGroupName, applicationGatewayName, expand).map(new Func1, ApplicationGatewayBackendHealthInner>() { + @Override + public ApplicationGatewayBackendHealthInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewayBackendHealthInner object + */ + public Observable> beginBackendHealthWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationGatewayName == null) { + throw new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.beginBackendHealth(resourceGroupName, applicationGatewayName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginBackendHealthDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginBackendHealthDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all available web application firewall rule sets. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationGatewayAvailableWafRuleSetsResultInner object if successful. + */ + public ApplicationGatewayAvailableWafRuleSetsResultInner listAvailableWafRuleSets() { + return listAvailableWafRuleSetsWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Lists all available web application firewall rule sets. + * + * @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 listAvailableWafRuleSetsAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listAvailableWafRuleSetsWithServiceResponseAsync(), serviceCallback); + } + + /** + * Lists all available web application firewall rule sets. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewayAvailableWafRuleSetsResultInner object + */ + public Observable listAvailableWafRuleSetsAsync() { + return listAvailableWafRuleSetsWithServiceResponseAsync().map(new Func1, ApplicationGatewayAvailableWafRuleSetsResultInner>() { + @Override + public ApplicationGatewayAvailableWafRuleSetsResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists all available web application firewall rule sets. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewayAvailableWafRuleSetsResultInner object + */ + public Observable> listAvailableWafRuleSetsWithServiceResponseAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.listAvailableWafRuleSets(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listAvailableWafRuleSetsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listAvailableWafRuleSetsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists available Ssl options for configuring Ssl policy. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationGatewayAvailableSslOptionsInner object if successful. + */ + public ApplicationGatewayAvailableSslOptionsInner listAvailableSslOptions() { + return listAvailableSslOptionsWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Lists available Ssl options for configuring Ssl policy. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAvailableSslOptionsAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listAvailableSslOptionsWithServiceResponseAsync(), serviceCallback); + } + + /** + * Lists available Ssl options for configuring Ssl policy. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewayAvailableSslOptionsInner object + */ + public Observable listAvailableSslOptionsAsync() { + return listAvailableSslOptionsWithServiceResponseAsync().map(new Func1, ApplicationGatewayAvailableSslOptionsInner>() { + @Override + public ApplicationGatewayAvailableSslOptionsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists available Ssl options for configuring Ssl policy. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewayAvailableSslOptionsInner object + */ + public Observable> listAvailableSslOptionsWithServiceResponseAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.listAvailableSslOptions(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listAvailableSslOptionsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listAvailableSslOptionsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ApplicationGatewaySslPredefinedPolicyInner> object if successful. + */ + public PagedList listAvailableSslPredefinedPolicies() { + ServiceResponse> response = listAvailableSslPredefinedPoliciesSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listAvailableSslPredefinedPoliciesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAvailableSslPredefinedPoliciesAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listAvailableSslPredefinedPoliciesSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listAvailableSslPredefinedPoliciesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationGatewaySslPredefinedPolicyInner> object + */ + public Observable> listAvailableSslPredefinedPoliciesAsync() { + return listAvailableSslPredefinedPoliciesWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationGatewaySslPredefinedPolicyInner> object + */ + public Observable>> listAvailableSslPredefinedPoliciesWithServiceResponseAsync() { + return listAvailableSslPredefinedPoliciesSinglePageAsync() + .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(listAvailableSslPredefinedPoliciesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationGatewaySslPredefinedPolicyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listAvailableSslPredefinedPoliciesSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.listAvailableSslPredefinedPolicies(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listAvailableSslPredefinedPoliciesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listAvailableSslPredefinedPoliciesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets Ssl predefined policy with the specified policy name. + * + * @param predefinedPolicyName Name of Ssl predefined policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationGatewaySslPredefinedPolicyInner object if successful. + */ + public ApplicationGatewaySslPredefinedPolicyInner getSslPredefinedPolicy(String predefinedPolicyName) { + return getSslPredefinedPolicyWithServiceResponseAsync(predefinedPolicyName).toBlocking().single().body(); + } + + /** + * Gets Ssl predefined policy with the specified policy name. + * + * @param predefinedPolicyName Name of Ssl predefined policy. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getSslPredefinedPolicyAsync(String predefinedPolicyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getSslPredefinedPolicyWithServiceResponseAsync(predefinedPolicyName), serviceCallback); + } + + /** + * Gets Ssl predefined policy with the specified policy name. + * + * @param predefinedPolicyName Name of Ssl predefined policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewaySslPredefinedPolicyInner object + */ + public Observable getSslPredefinedPolicyAsync(String predefinedPolicyName) { + return getSslPredefinedPolicyWithServiceResponseAsync(predefinedPolicyName).map(new Func1, ApplicationGatewaySslPredefinedPolicyInner>() { + @Override + public ApplicationGatewaySslPredefinedPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets Ssl predefined policy with the specified policy name. + * + * @param predefinedPolicyName Name of Ssl predefined policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGatewaySslPredefinedPolicyInner object + */ + public Observable> getSslPredefinedPolicyWithServiceResponseAsync(String predefinedPolicyName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (predefinedPolicyName == null) { + throw new IllegalArgumentException("Parameter predefinedPolicyName is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.getSslPredefinedPolicy(this.client.subscriptionId(), predefinedPolicyName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getSslPredefinedPolicyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getSslPredefinedPolicyDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all application gateways in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ApplicationGatewayInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all application gateways in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all application gateways in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationGatewayInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all application gateways in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationGatewayInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all application gateways in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationGatewayInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the application gateways in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ApplicationGatewayInner> object if successful. + */ + public PagedList listAllNext(final String nextPageLink) { + ServiceResponse> response = listAllNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listAllNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the application gateways in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAllNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listAllNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listAllNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the application gateways in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationGatewayInner> object + */ + public Observable> listAllNextAsync(final String nextPageLink) { + return listAllNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the application gateways in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationGatewayInner> object + */ + public Observable>> listAllNextWithServiceResponseAsync(final String nextPageLink) { + return listAllNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listAllNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the application gateways in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationGatewayInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listAllNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listAllNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listAllNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listAllNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ApplicationGatewaySslPredefinedPolicyInner> object if successful. + */ + public PagedList listAvailableSslPredefinedPoliciesNext(final String nextPageLink) { + ServiceResponse> response = listAvailableSslPredefinedPoliciesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listAvailableSslPredefinedPoliciesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @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> listAvailableSslPredefinedPoliciesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listAvailableSslPredefinedPoliciesNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listAvailableSslPredefinedPoliciesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @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<ApplicationGatewaySslPredefinedPolicyInner> object + */ + public Observable> listAvailableSslPredefinedPoliciesNextAsync(final String nextPageLink) { + return listAvailableSslPredefinedPoliciesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @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<ApplicationGatewaySslPredefinedPolicyInner> object + */ + public Observable>> listAvailableSslPredefinedPoliciesNextWithServiceResponseAsync(final String nextPageLink) { + return listAvailableSslPredefinedPoliciesNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listAvailableSslPredefinedPoliciesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationGatewaySslPredefinedPolicyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listAvailableSslPredefinedPoliciesNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listAvailableSslPredefinedPoliciesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listAvailableSslPredefinedPoliciesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listAvailableSslPredefinedPoliciesNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ApplicationSecurityGroupImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ApplicationSecurityGroupImpl.java new file mode 100644 index 000000000000..e5c334ec1d35 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ApplicationSecurityGroupImpl.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.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationSecurityGroup; +import rx.Observable; + +class ApplicationSecurityGroupImpl extends GroupableResourceCoreImpl implements ApplicationSecurityGroup, ApplicationSecurityGroup.Definition, ApplicationSecurityGroup.Update { + ApplicationSecurityGroupImpl(String name, ApplicationSecurityGroupInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + ApplicationSecurityGroupsInner client = this.manager().inner().applicationSecurityGroups(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ApplicationSecurityGroupsInner client = this.manager().inner().applicationSecurityGroups(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ApplicationSecurityGroupsInner client = this.manager().inner().applicationSecurityGroups(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ApplicationSecurityGroupInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ApplicationSecurityGroupInner.java new file mode 100644 index 000000000000..4d7b9244fc3d --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ApplicationSecurityGroupInner.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.network.v2018_06_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * An application security group in a resource group. + */ +@JsonFlatten +@SkipParentValidation +public class ApplicationSecurityGroupInner extends Resource { + /** + * The resource GUID property of the application security group resource. + * It uniquely identifies a resource, even if the user changes its name or + * migrate the resource across subscriptions or resource groups. + */ + @JsonProperty(value = "properties.resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /** + * The provisioning state of the application security group resource. + * Possible values are: 'Succeeded', 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the resource GUID property of the application security group resource. It uniquely identifies a resource, even if the user changes its name or migrate the resource across subscriptions or resource groups. + * + * @return the resourceGuid value + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Get the provisioning state of the application security group resource. Possible values are: 'Succeeded', 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the ApplicationSecurityGroupInner object itself. + */ + public ApplicationSecurityGroupInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ApplicationSecurityGroupsImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ApplicationSecurityGroupsImpl.java new file mode 100644 index 000000000000..9b87d53137f3 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ApplicationSecurityGroupsImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationSecurityGroups; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationSecurityGroup; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class ApplicationSecurityGroupsImpl extends GroupableResourcesCoreImpl implements ApplicationSecurityGroups { + protected ApplicationSecurityGroupsImpl(NetworkManager manager) { + super(manager.inner().applicationSecurityGroups(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + ApplicationSecurityGroupsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ApplicationSecurityGroupsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + ApplicationSecurityGroupsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + ApplicationSecurityGroupsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ApplicationSecurityGroup call(ApplicationSecurityGroupInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + ApplicationSecurityGroupsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + ApplicationSecurityGroupsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ApplicationSecurityGroup call(ApplicationSecurityGroupInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public ApplicationSecurityGroupImpl define(String name) { + return wrapModel(name); + } + + @Override + protected ApplicationSecurityGroupImpl wrapModel(ApplicationSecurityGroupInner inner) { + return new ApplicationSecurityGroupImpl(inner.name(), inner, manager()); + } + + @Override + protected ApplicationSecurityGroupImpl wrapModel(String name) { + return new ApplicationSecurityGroupImpl(name, new ApplicationSecurityGroupInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ApplicationSecurityGroupsInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ApplicationSecurityGroupsInner.java new file mode 100644 index 000000000000..2609413f0ce5 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ApplicationSecurityGroupsInner.java @@ -0,0 +1,948 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.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 ApplicationSecurityGroups. + */ +public class ApplicationSecurityGroupsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private ApplicationSecurityGroupsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of ApplicationSecurityGroupsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ApplicationSecurityGroupsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(ApplicationSecurityGroupsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ApplicationSecurityGroups to be + * used by Retrofit to perform actually REST calls. + */ + interface ApplicationSecurityGroupsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.ApplicationSecurityGroups delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("applicationSecurityGroupName") String applicationSecurityGroupName, @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.network.v2018_06_01.ApplicationSecurityGroups beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("applicationSecurityGroupName") String applicationSecurityGroupName, @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.network.v2018_06_01.ApplicationSecurityGroups getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("applicationSecurityGroupName") String applicationSecurityGroupName, @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.network.v2018_06_01.ApplicationSecurityGroups createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("applicationSecurityGroupName") String applicationSecurityGroupName, @Path("subscriptionId") String subscriptionId, @Body ApplicationSecurityGroupInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.ApplicationSecurityGroups beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("applicationSecurityGroupName") String applicationSecurityGroupName, @Path("subscriptionId") String subscriptionId, @Body ApplicationSecurityGroupInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.ApplicationSecurityGroups list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationSecurityGroups") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.ApplicationSecurityGroups listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @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.network.v2018_06_01.ApplicationSecurityGroups listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.ApplicationSecurityGroups listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String applicationSecurityGroupName) { + deleteWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName).toBlocking().last().body(); + } + + /** + * Deletes the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @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 applicationSecurityGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName), serviceCallback); + } + + /** + * Deletes the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String applicationSecurityGroupName) { + return deleteWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String applicationSecurityGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter applicationSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + Observable> observable = service.delete(resourceGroupName, applicationSecurityGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String applicationSecurityGroupName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName).toBlocking().single().body(); + } + + /** + * Deletes the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String applicationSecurityGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName), serviceCallback); + } + + /** + * Deletes the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String applicationSecurityGroupName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String applicationSecurityGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter applicationSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.beginDelete(resourceGroupName, applicationSecurityGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets information about the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationSecurityGroupInner object if successful. + */ + public ApplicationSecurityGroupInner getByResourceGroup(String resourceGroupName, String applicationSecurityGroupName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName).toBlocking().single().body(); + } + + /** + * Gets information about the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String applicationSecurityGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName), serviceCallback); + } + + /** + * Gets information about the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationSecurityGroupInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String applicationSecurityGroupName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName).map(new Func1, ApplicationSecurityGroupInner>() { + @Override + public ApplicationSecurityGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets information about the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationSecurityGroupInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String applicationSecurityGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter applicationSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.getByResourceGroup(resourceGroupName, applicationSecurityGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates an application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationSecurityGroupInner object if successful. + */ + public ApplicationSecurityGroupInner createOrUpdate(String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates an application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName, parameters), serviceCallback); + } + + /** + * Creates or updates an application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName, parameters).map(new Func1, ApplicationSecurityGroupInner>() { + @Override + public ApplicationSecurityGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates an application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter applicationSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, applicationSecurityGroupName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates an application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationSecurityGroupInner object if successful. + */ + public ApplicationSecurityGroupInner beginCreateOrUpdate(String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates an application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName, parameters), serviceCallback); + } + + /** + * Creates or updates an application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationSecurityGroupInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName, parameters).map(new Func1, ApplicationSecurityGroupInner>() { + @Override + public ApplicationSecurityGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates an application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationSecurityGroupInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (applicationSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter applicationSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + return service.beginCreateOrUpdate(resourceGroupName, applicationSecurityGroupName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all application security groups in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ApplicationSecurityGroupInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all application security groups in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all application security groups in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationSecurityGroupInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all application security groups in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationSecurityGroupInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all application security groups in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationSecurityGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the application security groups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ApplicationSecurityGroupInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the application security groups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the application security groups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationSecurityGroupInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the application security groups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationSecurityGroupInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the application security groups in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationSecurityGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all application security groups in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ApplicationSecurityGroupInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all application security groups in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all application security groups in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationSecurityGroupInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all application security groups in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationSecurityGroupInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all application security groups in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationSecurityGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the application security groups in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ApplicationSecurityGroupInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the application security groups in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the application security groups in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationSecurityGroupInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the application security groups in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationSecurityGroupInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the application security groups in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationSecurityGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/AvailableEndpointServicesImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/AvailableEndpointServicesImpl.java new file mode 100644 index 000000000000..85c0f2583c90 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/AvailableEndpointServicesImpl.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. + * abc + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_06_01.AvailableEndpointServices; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_06_01.EndpointServiceResult; + +class AvailableEndpointServicesImpl extends WrapperImpl implements AvailableEndpointServices { + private final NetworkManager manager; + + AvailableEndpointServicesImpl(NetworkManager manager) { + super(manager.inner().availableEndpointServices()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + private EndpointServiceResultImpl wrapEndpointServiceResultModel(EndpointServiceResultInner inner) { + return new EndpointServiceResultImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String location) { + AvailableEndpointServicesInner client = this.inner(); + return client.listAsync(location) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public EndpointServiceResult call(EndpointServiceResultInner inner) { + return wrapEndpointServiceResultModel(inner); + } + }); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/AvailableEndpointServicesInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/AvailableEndpointServicesInner.java new file mode 100644 index 000000000000..1f3c6a5b1d77 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/AvailableEndpointServicesInner.java @@ -0,0 +1,293 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in AvailableEndpointServices. + */ +public class AvailableEndpointServicesInner { + /** The Retrofit service to perform REST calls. */ + private AvailableEndpointServicesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of AvailableEndpointServicesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public AvailableEndpointServicesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(AvailableEndpointServicesService.class); + this.client = client; + } + + /** + * The interface defining all the services for AvailableEndpointServices to be + * used by Retrofit to perform actually REST calls. + */ + interface AvailableEndpointServicesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.AvailableEndpointServices list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/virtualNetworkAvailableEndpointServices") + Observable> list(@Path("location") String location, @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.network.v2018_06_01.AvailableEndpointServices listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List what values of endpoint services are available for use. + * + * @param location The location to check available endpoint services. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EndpointServiceResultInner> object if successful. + */ + public PagedList list(final String location) { + ServiceResponse> response = listSinglePageAsync(location).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List what values of endpoint services are available for use. + * + * @param location The location to check available endpoint services. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String location, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(location), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List what values of endpoint services are available for use. + * + * @param location The location to check available endpoint services. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EndpointServiceResultInner> object + */ + public Observable> listAsync(final String location) { + return listWithServiceResponseAsync(location) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List what values of endpoint services are available for use. + * + * @param location The location to check available endpoint services. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EndpointServiceResultInner> object + */ + public Observable>> listWithServiceResponseAsync(final String location) { + return listSinglePageAsync(location) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List what values of endpoint services are available for use. + * + ServiceResponse> * @param location The location to check available endpoint services. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EndpointServiceResultInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String location) { + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.list(location, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List what values of endpoint services are available for use. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EndpointServiceResultInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List what values of endpoint services are available for use. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List what values of endpoint services are available for use. + * + * @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<EndpointServiceResultInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List what values of endpoint services are available for use. + * + * @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<EndpointServiceResultInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List what values of endpoint services are available for use. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EndpointServiceResultInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/AvailableProvidersListImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/AvailableProvidersListImpl.java new file mode 100644 index 000000000000..5bd97a9bcf61 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/AvailableProvidersListImpl.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.AvailableProvidersList; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.AvailableProvidersListCountry; + +class AvailableProvidersListImpl extends WrapperImpl implements AvailableProvidersList { + private final NetworkManager manager; + AvailableProvidersListImpl(AvailableProvidersListInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public List countries() { + return this.inner().countries(); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/AvailableProvidersListInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/AvailableProvidersListInner.java new file mode 100644 index 000000000000..5304e1f20bd3 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/AvailableProvidersListInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.AvailableProvidersListCountry; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * List of available countries with details. + */ +public class AvailableProvidersListInner { + /** + * List of available countries. + */ + @JsonProperty(value = "countries", required = true) + private List countries; + + /** + * Get list of available countries. + * + * @return the countries value + */ + public List countries() { + return this.countries; + } + + /** + * Set list of available countries. + * + * @param countries the countries value to set + * @return the AvailableProvidersListInner object itself. + */ + public AvailableProvidersListInner withCountries(List countries) { + this.countries = countries; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/AzureFirewallImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/AzureFirewallImpl.java new file mode 100644 index 000000000000..313ddb25f0d9 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/AzureFirewallImpl.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_06_01.AzureFirewall; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.AzureFirewallApplicationRuleCollection; +import com.microsoft.azure.management.network.v2018_06_01.AzureFirewallNetworkRuleCollection; +import com.microsoft.azure.management.network.v2018_06_01.AzureFirewallIPConfiguration; +import com.microsoft.azure.management.network.v2018_06_01.ProvisioningState; + +class AzureFirewallImpl extends GroupableResourceCoreImpl implements AzureFirewall, AzureFirewall.Definition, AzureFirewall.Update { + AzureFirewallImpl(String name, AzureFirewallInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + AzureFirewallsInner client = this.manager().inner().azureFirewalls(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + AzureFirewallsInner client = this.manager().inner().azureFirewalls(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + AzureFirewallsInner client = this.manager().inner().azureFirewalls(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public List applicationRuleCollections() { + return this.inner().applicationRuleCollections(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public List ipConfigurations() { + return this.inner().ipConfigurations(); + } + + @Override + public List networkRuleCollections() { + return this.inner().networkRuleCollections(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public AzureFirewallImpl withApplicationRuleCollections(List applicationRuleCollections) { + this.inner().withApplicationRuleCollections(applicationRuleCollections); + return this; + } + + @Override + public AzureFirewallImpl withIpConfigurations(List ipConfigurations) { + this.inner().withIpConfigurations(ipConfigurations); + return this; + } + + @Override + public AzureFirewallImpl withNetworkRuleCollections(List networkRuleCollections) { + this.inner().withNetworkRuleCollections(networkRuleCollections); + return this; + } + + @Override + public AzureFirewallImpl withProvisioningState(ProvisioningState provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/AzureFirewallInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/AzureFirewallInner.java new file mode 100644 index 000000000000..29ca8ff7b9dc --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/AzureFirewallInner.java @@ -0,0 +1,174 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.AzureFirewallApplicationRuleCollection; +import com.microsoft.azure.management.network.v2018_06_01.AzureFirewallNetworkRuleCollection; +import com.microsoft.azure.management.network.v2018_06_01.AzureFirewallIPConfiguration; +import com.microsoft.azure.management.network.v2018_06_01.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Azure Firewall resource. + */ +@JsonFlatten +@SkipParentValidation +public class AzureFirewallInner extends Resource { + /** + * Collection of application rule collections used by a Azure Firewall. + */ + @JsonProperty(value = "properties.applicationRuleCollections") + private List applicationRuleCollections; + + /** + * Collection of network rule collections used by a Azure Firewall. + */ + @JsonProperty(value = "properties.networkRuleCollections") + private List networkRuleCollections; + + /** + * IP configuration of the Azure Firewall resource. + */ + @JsonProperty(value = "properties.ipConfigurations") + private List ipConfigurations; + + /** + * The provisioning state of the resource. Possible values include: + * 'Succeeded', 'Updating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningState provisioningState; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get collection of application rule collections used by a Azure Firewall. + * + * @return the applicationRuleCollections value + */ + public List applicationRuleCollections() { + return this.applicationRuleCollections; + } + + /** + * Set collection of application rule collections used by a Azure Firewall. + * + * @param applicationRuleCollections the applicationRuleCollections value to set + * @return the AzureFirewallInner object itself. + */ + public AzureFirewallInner withApplicationRuleCollections(List applicationRuleCollections) { + this.applicationRuleCollections = applicationRuleCollections; + return this; + } + + /** + * Get collection of network rule collections used by a Azure Firewall. + * + * @return the networkRuleCollections value + */ + public List networkRuleCollections() { + return this.networkRuleCollections; + } + + /** + * Set collection of network rule collections used by a Azure Firewall. + * + * @param networkRuleCollections the networkRuleCollections value to set + * @return the AzureFirewallInner object itself. + */ + public AzureFirewallInner withNetworkRuleCollections(List networkRuleCollections) { + this.networkRuleCollections = networkRuleCollections; + return this; + } + + /** + * Get iP configuration of the Azure Firewall resource. + * + * @return the ipConfigurations value + */ + public List ipConfigurations() { + return this.ipConfigurations; + } + + /** + * Set iP configuration of the Azure Firewall resource. + * + * @param ipConfigurations the ipConfigurations value to set + * @return the AzureFirewallInner object itself. + */ + public AzureFirewallInner withIpConfigurations(List ipConfigurations) { + this.ipConfigurations = ipConfigurations; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the AzureFirewallInner object itself. + */ + public AzureFirewallInner withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the AzureFirewallInner object itself. + */ + public AzureFirewallInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/AzureFirewallsImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/AzureFirewallsImpl.java new file mode 100644 index 000000000000..4795ac569249 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/AzureFirewallsImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_06_01.AzureFirewalls; +import com.microsoft.azure.management.network.v2018_06_01.AzureFirewall; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class AzureFirewallsImpl extends GroupableResourcesCoreImpl implements AzureFirewalls { + protected AzureFirewallsImpl(NetworkManager manager) { + super(manager.inner().azureFirewalls(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + AzureFirewallsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + AzureFirewallsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + AzureFirewallsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + AzureFirewallsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public AzureFirewall call(AzureFirewallInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + AzureFirewallsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + AzureFirewallsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public AzureFirewall call(AzureFirewallInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public AzureFirewallImpl define(String name) { + return wrapModel(name); + } + + @Override + protected AzureFirewallImpl wrapModel(AzureFirewallInner inner) { + return new AzureFirewallImpl(inner.name(), inner, manager()); + } + + @Override + protected AzureFirewallImpl wrapModel(String name) { + return new AzureFirewallImpl(name, new AzureFirewallInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/AzureFirewallsInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/AzureFirewallsInner.java new file mode 100644 index 000000000000..4d9717efac26 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/AzureFirewallsInner.java @@ -0,0 +1,948 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.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 AzureFirewalls. + */ +public class AzureFirewallsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private AzureFirewallsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of AzureFirewallsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public AzureFirewallsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(AzureFirewallsService.class); + this.client = client; + } + + /** + * The interface defining all the services for AzureFirewalls to be + * used by Retrofit to perform actually REST calls. + */ + interface AzureFirewallsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.AzureFirewalls delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("azureFirewallName") String azureFirewallName, @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.network.v2018_06_01.AzureFirewalls beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("azureFirewallName") String azureFirewallName, @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.network.v2018_06_01.AzureFirewalls getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("azureFirewallName") String azureFirewallName, @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.network.v2018_06_01.AzureFirewalls createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("azureFirewallName") String azureFirewallName, @Path("subscriptionId") String subscriptionId, @Body AzureFirewallInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.AzureFirewalls beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("azureFirewallName") String azureFirewallName, @Path("subscriptionId") String subscriptionId, @Body AzureFirewallInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.AzureFirewalls listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @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.network.v2018_06_01.AzureFirewalls list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/azureFirewalls") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.AzureFirewalls listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.AzureFirewalls listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String azureFirewallName) { + deleteWithServiceResponseAsync(resourceGroupName, azureFirewallName).toBlocking().last().body(); + } + + /** + * Deletes the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @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 azureFirewallName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, azureFirewallName), serviceCallback); + } + + /** + * Deletes the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String azureFirewallName) { + return deleteWithServiceResponseAsync(resourceGroupName, azureFirewallName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String azureFirewallName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (azureFirewallName == null) { + throw new IllegalArgumentException("Parameter azureFirewallName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + Observable> observable = service.delete(resourceGroupName, azureFirewallName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String azureFirewallName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, azureFirewallName).toBlocking().single().body(); + } + + /** + * Deletes the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String azureFirewallName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, azureFirewallName), serviceCallback); + } + + /** + * Deletes the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String azureFirewallName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, azureFirewallName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String azureFirewallName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (azureFirewallName == null) { + throw new IllegalArgumentException("Parameter azureFirewallName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.beginDelete(resourceGroupName, azureFirewallName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AzureFirewallInner object if successful. + */ + public AzureFirewallInner getByResourceGroup(String resourceGroupName, String azureFirewallName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, azureFirewallName).toBlocking().single().body(); + } + + /** + * Gets the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String azureFirewallName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, azureFirewallName), serviceCallback); + } + + /** + * Gets the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AzureFirewallInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String azureFirewallName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, azureFirewallName).map(new Func1, AzureFirewallInner>() { + @Override + public AzureFirewallInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AzureFirewallInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String azureFirewallName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (azureFirewallName == null) { + throw new IllegalArgumentException("Parameter azureFirewallName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.getByResourceGroup(resourceGroupName, azureFirewallName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to the create or update Azure Firewall operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AzureFirewallInner object if successful. + */ + public AzureFirewallInner createOrUpdate(String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, azureFirewallName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to the create or update Azure Firewall operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, azureFirewallName, parameters), serviceCallback); + } + + /** + * Creates or updates the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to the create or update Azure Firewall operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, azureFirewallName, parameters).map(new Func1, AzureFirewallInner>() { + @Override + public AzureFirewallInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to the create or update Azure Firewall operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (azureFirewallName == null) { + throw new IllegalArgumentException("Parameter azureFirewallName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, azureFirewallName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to the create or update Azure Firewall operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AzureFirewallInner object if successful. + */ + public AzureFirewallInner beginCreateOrUpdate(String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, azureFirewallName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to the create or update Azure Firewall operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, azureFirewallName, parameters), serviceCallback); + } + + /** + * Creates or updates the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to the create or update Azure Firewall operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AzureFirewallInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, azureFirewallName, parameters).map(new Func1, AzureFirewallInner>() { + @Override + public AzureFirewallInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to the create or update Azure Firewall operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AzureFirewallInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (azureFirewallName == null) { + throw new IllegalArgumentException("Parameter azureFirewallName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + return service.beginCreateOrUpdate(resourceGroupName, azureFirewallName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all Azure Firewalls in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AzureFirewallInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all Azure Firewalls in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all Azure Firewalls in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AzureFirewallInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all Azure Firewalls in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AzureFirewallInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all Azure Firewalls in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AzureFirewallInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the Azure Firewalls in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AzureFirewallInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the Azure Firewalls in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the Azure Firewalls in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AzureFirewallInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the Azure Firewalls in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AzureFirewallInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the Azure Firewalls in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AzureFirewallInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all Azure Firewalls in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AzureFirewallInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all Azure Firewalls in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all Azure Firewalls in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AzureFirewallInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all Azure Firewalls in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AzureFirewallInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all Azure Firewalls in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AzureFirewallInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the Azure Firewalls in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AzureFirewallInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the Azure Firewalls in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the Azure Firewalls in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AzureFirewallInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the Azure Firewalls in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AzureFirewallInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the Azure Firewalls in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AzureFirewallInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/AzureReachabilityReportImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/AzureReachabilityReportImpl.java new file mode 100644 index 000000000000..a1066ef00889 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/AzureReachabilityReportImpl.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.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.AzureReachabilityReport; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_06_01.AzureReachabilityReportLocation; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.AzureReachabilityReportItem; + +class AzureReachabilityReportImpl extends WrapperImpl implements AzureReachabilityReport { + private final NetworkManager manager; + AzureReachabilityReportImpl(AzureReachabilityReportInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public String aggregationLevel() { + return this.inner().aggregationLevel(); + } + + @Override + public AzureReachabilityReportLocation providerLocation() { + return this.inner().providerLocation(); + } + + @Override + public List reachabilityReport() { + return this.inner().reachabilityReport(); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/AzureReachabilityReportInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/AzureReachabilityReportInner.java new file mode 100644 index 000000000000..f7367a5c264b --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/AzureReachabilityReportInner.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.AzureReachabilityReportLocation; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.AzureReachabilityReportItem; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Azure reachability report details. + */ +public class AzureReachabilityReportInner { + /** + * The aggregation level of Azure reachability report. Can be Country, + * State or City. + */ + @JsonProperty(value = "aggregationLevel", required = true) + private String aggregationLevel; + + /** + * The providerLocation property. + */ + @JsonProperty(value = "providerLocation", required = true) + private AzureReachabilityReportLocation providerLocation; + + /** + * List of Azure reachability report items. + */ + @JsonProperty(value = "reachabilityReport", required = true) + private List reachabilityReport; + + /** + * Get the aggregation level of Azure reachability report. Can be Country, State or City. + * + * @return the aggregationLevel value + */ + public String aggregationLevel() { + return this.aggregationLevel; + } + + /** + * Set the aggregation level of Azure reachability report. Can be Country, State or City. + * + * @param aggregationLevel the aggregationLevel value to set + * @return the AzureReachabilityReportInner object itself. + */ + public AzureReachabilityReportInner withAggregationLevel(String aggregationLevel) { + this.aggregationLevel = aggregationLevel; + return this; + } + + /** + * Get the providerLocation value. + * + * @return the providerLocation value + */ + public AzureReachabilityReportLocation providerLocation() { + return this.providerLocation; + } + + /** + * Set the providerLocation value. + * + * @param providerLocation the providerLocation value to set + * @return the AzureReachabilityReportInner object itself. + */ + public AzureReachabilityReportInner withProviderLocation(AzureReachabilityReportLocation providerLocation) { + this.providerLocation = providerLocation; + return this; + } + + /** + * Get list of Azure reachability report items. + * + * @return the reachabilityReport value + */ + public List reachabilityReport() { + return this.reachabilityReport; + } + + /** + * Set list of Azure reachability report items. + * + * @param reachabilityReport the reachabilityReport value to set + * @return the AzureReachabilityReportInner object itself. + */ + public AzureReachabilityReportInner withReachabilityReport(List reachabilityReport) { + this.reachabilityReport = reachabilityReport; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/BackendAddressPoolImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/BackendAddressPoolImpl.java new file mode 100644 index 000000000000..de72721f686b --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/BackendAddressPoolImpl.java @@ -0,0 +1,87 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.BackendAddressPool; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_06_01.VirtualMachineScaleSetNetworkInterfaceIPConfiguration; +import java.util.List; +import com.microsoft.azure.SubResource; + +class BackendAddressPoolImpl extends IndexableRefreshableWrapperImpl implements BackendAddressPool { + private final NetworkManager manager; + private String resourceGroupName; + private String loadBalancerName; + private String backendAddressPoolName; + + BackendAddressPoolImpl(BackendAddressPoolInner inner, NetworkManager manager) { + super(null, inner); + this.manager = manager; + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.loadBalancerName = IdParsingUtils.getValueFromIdByName(inner.id(), "loadBalancers"); + this.backendAddressPoolName = IdParsingUtils.getValueFromIdByName(inner.id(), "backendAddressPools"); + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + LoadBalancerBackendAddressPoolsInner client = this.manager().inner().loadBalancerBackendAddressPools(); + return client.getAsync(this.resourceGroupName, this.loadBalancerName, this.backendAddressPoolName); + } + + + + @Override + public List backendIPConfigurations() { + List lst = new ArrayList(); + if (this.inner().backendIPConfigurations() != null) { + for (NetworkInterfaceIPConfigurationInner inner : this.inner().backendIPConfigurations()) { + lst.add( new VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public List loadBalancingRules() { + return this.inner().loadBalancingRules(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public SubResource outboundNatRule() { + return this.inner().outboundNatRule(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/BackendAddressPoolInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/BackendAddressPoolInner.java new file mode 100644 index 000000000000..50ab7872dbe4 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/BackendAddressPoolInner.java @@ -0,0 +1,147 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import java.util.List; +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Pool of backend IP addresses. + */ +@JsonFlatten +public class BackendAddressPoolInner extends SubResource { + /** + * Gets collection of references to IP addresses defined in network + * interfaces. + */ + @JsonProperty(value = "properties.backendIPConfigurations", access = JsonProperty.Access.WRITE_ONLY) + private List backendIPConfigurations; + + /** + * Gets load balancing rules that use this backend address pool. + */ + @JsonProperty(value = "properties.loadBalancingRules", access = JsonProperty.Access.WRITE_ONLY) + private List loadBalancingRules; + + /** + * Gets outbound rules that use this backend address pool. + */ + @JsonProperty(value = "properties.outboundNatRule", access = JsonProperty.Access.WRITE_ONLY) + private SubResource outboundNatRule; + + /** + * Get provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Gets name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get gets collection of references to IP addresses defined in network interfaces. + * + * @return the backendIPConfigurations value + */ + public List backendIPConfigurations() { + return this.backendIPConfigurations; + } + + /** + * Get gets load balancing rules that use this backend address pool. + * + * @return the loadBalancingRules value + */ + public List loadBalancingRules() { + return this.loadBalancingRules; + } + + /** + * Get gets outbound rules that use this backend address pool. + * + * @return the outboundNatRule value + */ + public SubResource outboundNatRule() { + return this.outboundNatRule; + } + + /** + * Get get provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set get provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the BackendAddressPoolInner object itself. + */ + public BackendAddressPoolInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get gets name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set gets name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the BackendAddressPoolInner object itself. + */ + public BackendAddressPoolInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the BackendAddressPoolInner object itself. + */ + public BackendAddressPoolInner withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/BgpPeerStatusListResultImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/BgpPeerStatusListResultImpl.java new file mode 100644 index 000000000000..e6bb8e2df126 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/BgpPeerStatusListResultImpl.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.BgpPeerStatusListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.BgpPeerStatus; + +class BgpPeerStatusListResultImpl extends WrapperImpl implements BgpPeerStatusListResult { + private final NetworkManager manager; + BgpPeerStatusListResultImpl(BgpPeerStatusListResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/BgpPeerStatusListResultInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/BgpPeerStatusListResultInner.java new file mode 100644 index 000000000000..c396f0f7fb2d --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/BgpPeerStatusListResultInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.BgpPeerStatus; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Response for list BGP peer status API service call. + */ +public class BgpPeerStatusListResultInner { + /** + * List of BGP peers. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get list of BGP peers. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set list of BGP peers. + * + * @param value the value value to set + * @return the BgpPeerStatusListResultInner object itself. + */ + public BgpPeerStatusListResultInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/BgpServiceCommunitiesImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/BgpServiceCommunitiesImpl.java new file mode 100644 index 000000000000..12a00c1cd3f7 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/BgpServiceCommunitiesImpl.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_06_01.BgpServiceCommunities; +import com.microsoft.azure.management.network.v2018_06_01.BgpServiceCommunity; +import rx.Observable; +import rx.Completable; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class BgpServiceCommunitiesImpl extends GroupableResourcesCoreImpl implements BgpServiceCommunities { + protected BgpServiceCommunitiesImpl(NetworkManager manager) { + super(manager.inner().bgpServiceCommunities(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + return null; // NOP Retrieve by resource group not supported + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + BgpServiceCommunitiesInner client = this.inner(); + return Completable.error(new Throwable("Delete by RG not supported for this resource")); // NOP Delete by RG not supported + } + + @Override + public PagedList list() { + BgpServiceCommunitiesInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + BgpServiceCommunitiesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public BgpServiceCommunity call(BgpServiceCommunityInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + protected BgpServiceCommunityImpl wrapModel(BgpServiceCommunityInner inner) { + return new BgpServiceCommunityImpl(inner.name(), inner, manager()); + } + + @Override + protected BgpServiceCommunityImpl wrapModel(String name) { + return null; // Model is not creatable + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/BgpServiceCommunitiesInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/BgpServiceCommunitiesInner.java new file mode 100644 index 000000000000..4fa5db74fa74 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/BgpServiceCommunitiesInner.java @@ -0,0 +1,285 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in BgpServiceCommunities. + */ +public class BgpServiceCommunitiesInner { + /** The Retrofit service to perform REST calls. */ + private BgpServiceCommunitiesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of BgpServiceCommunitiesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public BgpServiceCommunitiesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(BgpServiceCommunitiesService.class); + this.client = client; + } + + /** + * The interface defining all the services for BgpServiceCommunities to be + * used by Retrofit to perform actually REST calls. + */ + interface BgpServiceCommunitiesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.BgpServiceCommunities list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/bgpServiceCommunities") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.BgpServiceCommunities listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets all the available bgp service communities. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<BgpServiceCommunityInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the available bgp service communities. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the available bgp service communities. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BgpServiceCommunityInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the available bgp service communities. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BgpServiceCommunityInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the available bgp service communities. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<BgpServiceCommunityInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the available bgp service communities. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<BgpServiceCommunityInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the available bgp service communities. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the available bgp service communities. + * + * @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<BgpServiceCommunityInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the available bgp service communities. + * + * @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<BgpServiceCommunityInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the available bgp service communities. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<BgpServiceCommunityInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/BgpServiceCommunityImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/BgpServiceCommunityImpl.java new file mode 100644 index 000000000000..0a27deb59d8f --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/BgpServiceCommunityImpl.java @@ -0,0 +1,52 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_06_01.BgpServiceCommunity; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.BGPCommunity; + +class BgpServiceCommunityImpl extends GroupableResourceCoreImpl implements BgpServiceCommunity { + BgpServiceCommunityImpl(String name, BgpServiceCommunityInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + BgpServiceCommunitiesInner client = this.manager().inner().bgpServiceCommunities(); + return null; // NOP createResourceAsync implementation as create is not supported + } + + @Override + public Observable updateResourceAsync() { + BgpServiceCommunitiesInner client = this.manager().inner().bgpServiceCommunities(); + return null; // NOP updateResourceAsync implementation as update is not supported + } + + @Override + protected Observable getInnerAsync() { + BgpServiceCommunitiesInner client = this.manager().inner().bgpServiceCommunities(); + return null; // NOP getInnerAsync implementation as get is not supported + } + + + + @Override + public List bgpCommunities() { + return this.inner().bgpCommunities(); + } + + @Override + public String serviceName() { + return this.inner().serviceName(); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/BgpServiceCommunityInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/BgpServiceCommunityInner.java new file mode 100644 index 000000000000..a59c957e47e4 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/BgpServiceCommunityInner.java @@ -0,0 +1,102 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.BGPCommunity; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Service Community Properties. + */ +@JsonFlatten +@SkipParentValidation +public class BgpServiceCommunityInner extends Resource { + /** + * The name of the bgp community. e.g. Skype. + */ + @JsonProperty(value = "properties.serviceName") + private String serviceName; + + /** + * Get a list of bgp communities. + */ + @JsonProperty(value = "properties.bgpCommunities") + private List bgpCommunities; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the name of the bgp community. e.g. Skype. + * + * @return the serviceName value + */ + public String serviceName() { + return this.serviceName; + } + + /** + * Set the name of the bgp community. e.g. Skype. + * + * @param serviceName the serviceName value to set + * @return the BgpServiceCommunityInner object itself. + */ + public BgpServiceCommunityInner withServiceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + + /** + * Get get a list of bgp communities. + * + * @return the bgpCommunities value + */ + public List bgpCommunities() { + return this.bgpCommunities; + } + + /** + * Set get a list of bgp communities. + * + * @param bgpCommunities the bgpCommunities value to set + * @return the BgpServiceCommunityInner object itself. + */ + public BgpServiceCommunityInner withBgpCommunities(List bgpCommunities) { + this.bgpCommunities = bgpCommunities; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the BgpServiceCommunityInner object itself. + */ + public BgpServiceCommunityInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ConnectionMonitorInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ConnectionMonitorInner.java new file mode 100644 index 000000000000..ff25d73fdbf2 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ConnectionMonitorInner.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.network.v2018_06_01.implementation; + +import java.util.Map; +import com.microsoft.azure.management.network.v2018_06_01.ConnectionMonitorSource; +import com.microsoft.azure.management.network.v2018_06_01.ConnectionMonitorDestination; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Parameters that define the operation to create a connection monitor. + */ +@JsonFlatten +public class ConnectionMonitorInner { + /** + * Connection monitor location. + */ + @JsonProperty(value = "location") + private String location; + + /** + * Connection monitor tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The source property. + */ + @JsonProperty(value = "properties.source", required = true) + private ConnectionMonitorSource source; + + /** + * The destination property. + */ + @JsonProperty(value = "properties.destination", required = true) + private ConnectionMonitorDestination destination; + + /** + * Determines if the connection monitor will start automatically once + * created. + */ + @JsonProperty(value = "properties.autoStart") + private Boolean autoStart; + + /** + * Monitoring interval in seconds. + */ + @JsonProperty(value = "properties.monitoringIntervalInSeconds") + private Integer monitoringIntervalInSeconds; + + /** + * Get connection monitor location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set connection monitor location. + * + * @param location the location value to set + * @return the ConnectionMonitorInner object itself. + */ + public ConnectionMonitorInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get connection monitor tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set connection monitor tags. + * + * @param tags the tags value to set + * @return the ConnectionMonitorInner object itself. + */ + public ConnectionMonitorInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the source value. + * + * @return the source value + */ + public ConnectionMonitorSource source() { + return this.source; + } + + /** + * Set the source value. + * + * @param source the source value to set + * @return the ConnectionMonitorInner object itself. + */ + public ConnectionMonitorInner withSource(ConnectionMonitorSource source) { + this.source = source; + return this; + } + + /** + * Get the destination value. + * + * @return the destination value + */ + public ConnectionMonitorDestination destination() { + return this.destination; + } + + /** + * Set the destination value. + * + * @param destination the destination value to set + * @return the ConnectionMonitorInner object itself. + */ + public ConnectionMonitorInner withDestination(ConnectionMonitorDestination destination) { + this.destination = destination; + return this; + } + + /** + * Get determines if the connection monitor will start automatically once created. + * + * @return the autoStart value + */ + public Boolean autoStart() { + return this.autoStart; + } + + /** + * Set determines if the connection monitor will start automatically once created. + * + * @param autoStart the autoStart value to set + * @return the ConnectionMonitorInner object itself. + */ + public ConnectionMonitorInner withAutoStart(Boolean autoStart) { + this.autoStart = autoStart; + return this; + } + + /** + * Get monitoring interval in seconds. + * + * @return the monitoringIntervalInSeconds value + */ + public Integer monitoringIntervalInSeconds() { + return this.monitoringIntervalInSeconds; + } + + /** + * Set monitoring interval in seconds. + * + * @param monitoringIntervalInSeconds the monitoringIntervalInSeconds value to set + * @return the ConnectionMonitorInner object itself. + */ + public ConnectionMonitorInner withMonitoringIntervalInSeconds(Integer monitoringIntervalInSeconds) { + this.monitoringIntervalInSeconds = monitoringIntervalInSeconds; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ConnectionMonitorQueryResultImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ConnectionMonitorQueryResultImpl.java new file mode 100644 index 000000000000..12277d17eb4c --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ConnectionMonitorQueryResultImpl.java @@ -0,0 +1,39 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.ConnectionMonitorQueryResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_06_01.ConnectionMonitorSourceStatus; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.ConnectionStateSnapshot; + +class ConnectionMonitorQueryResultImpl extends WrapperImpl implements ConnectionMonitorQueryResult { + private final NetworkManager manager; + ConnectionMonitorQueryResultImpl(ConnectionMonitorQueryResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public ConnectionMonitorSourceStatus sourceStatus() { + return this.inner().sourceStatus(); + } + + @Override + public List states() { + return this.inner().states(); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ConnectionMonitorQueryResultInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ConnectionMonitorQueryResultInner.java new file mode 100644 index 000000000000..64e55e1f2f2f --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ConnectionMonitorQueryResultInner.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.ConnectionMonitorSourceStatus; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.ConnectionStateSnapshot; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * List of connection states snaphots. + */ +public class ConnectionMonitorQueryResultInner { + /** + * Status of connection monitor source. Possible values include: 'Uknown', + * 'Active', 'Inactive'. + */ + @JsonProperty(value = "sourceStatus") + private ConnectionMonitorSourceStatus sourceStatus; + + /** + * Information about connection states. + */ + @JsonProperty(value = "states") + private List states; + + /** + * Get status of connection monitor source. Possible values include: 'Uknown', 'Active', 'Inactive'. + * + * @return the sourceStatus value + */ + public ConnectionMonitorSourceStatus sourceStatus() { + return this.sourceStatus; + } + + /** + * Set status of connection monitor source. Possible values include: 'Uknown', 'Active', 'Inactive'. + * + * @param sourceStatus the sourceStatus value to set + * @return the ConnectionMonitorQueryResultInner object itself. + */ + public ConnectionMonitorQueryResultInner withSourceStatus(ConnectionMonitorSourceStatus sourceStatus) { + this.sourceStatus = sourceStatus; + return this; + } + + /** + * Get information about connection states. + * + * @return the states value + */ + public List states() { + return this.states; + } + + /** + * Set information about connection states. + * + * @param states the states value to set + * @return the ConnectionMonitorQueryResultInner object itself. + */ + public ConnectionMonitorQueryResultInner withStates(List states) { + this.states = states; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ConnectionMonitorResultImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ConnectionMonitorResultImpl.java new file mode 100644 index 000000000000..e2f9818e9983 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ConnectionMonitorResultImpl.java @@ -0,0 +1,206 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.ConnectionMonitorResult; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.Map; +import com.microsoft.azure.management.network.v2018_06_01.ConnectionMonitorSource; +import com.microsoft.azure.management.network.v2018_06_01.ConnectionMonitorDestination; +import com.microsoft.azure.management.network.v2018_06_01.ProvisioningState; +import org.joda.time.DateTime; +import rx.functions.Func1; + +class ConnectionMonitorResultImpl extends CreatableUpdatableImpl implements ConnectionMonitorResult, ConnectionMonitorResult.Definition, ConnectionMonitorResult.Update { + private final NetworkManager manager; + private String resourceGroupName; + private String networkWatcherName; + private String connectionMonitorName; + private ConnectionMonitorInner createOrUpdateParameter; + + ConnectionMonitorResultImpl(String name, NetworkManager manager) { + super(name, new ConnectionMonitorResultInner()); + this.manager = manager; + // Set resource name + this.connectionMonitorName = name; + // + this.createOrUpdateParameter = new ConnectionMonitorInner(); + } + + ConnectionMonitorResultImpl(ConnectionMonitorResultInner inner, NetworkManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.connectionMonitorName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.networkWatcherName = IdParsingUtils.getValueFromIdByName(inner.id(), "networkWatchers"); + this.connectionMonitorName = IdParsingUtils.getValueFromIdByName(inner.id(), "connectionMonitors"); + // + this.createOrUpdateParameter = new ConnectionMonitorInner(); + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ConnectionMonitorsInner client = this.manager().inner().connectionMonitors(); + return client.createOrUpdateAsync(this.resourceGroupName, this.networkWatcherName, this.connectionMonitorName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public ConnectionMonitorResultInner call(ConnectionMonitorResultInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ConnectionMonitorsInner client = this.manager().inner().connectionMonitors(); + return client.createOrUpdateAsync(this.resourceGroupName, this.networkWatcherName, this.connectionMonitorName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public ConnectionMonitorResultInner call(ConnectionMonitorResultInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ConnectionMonitorsInner client = this.manager().inner().connectionMonitors(); + return client.getAsync(this.resourceGroupName, this.networkWatcherName, this.connectionMonitorName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createOrUpdateParameter = new ConnectionMonitorInner(); + } + + @Override + public Boolean autoStart() { + return this.inner().autoStart(); + } + + @Override + public ConnectionMonitorDestination destination() { + return this.inner().destination(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public Integer monitoringIntervalInSeconds() { + return this.inner().monitoringIntervalInSeconds(); + } + + @Override + public String monitoringStatus() { + return this.inner().monitoringStatus(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public ConnectionMonitorSource source() { + return this.inner().source(); + } + + @Override + public DateTime startTime() { + return this.inner().startTime(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public ConnectionMonitorResultImpl withExistingNetworkWatcher(String resourceGroupName, String networkWatcherName) { + this.resourceGroupName = resourceGroupName; + this.networkWatcherName = networkWatcherName; + return this; + } + + @Override + public ConnectionMonitorResultImpl withDestination(ConnectionMonitorDestination destination) { + this.createOrUpdateParameter.withDestination(destination); + return this; + } + + @Override + public ConnectionMonitorResultImpl withSource(ConnectionMonitorSource source) { + this.createOrUpdateParameter.withSource(source); + return this; + } + + @Override + public ConnectionMonitorResultImpl withAutoStart(Boolean autoStart) { + this.createOrUpdateParameter.withAutoStart(autoStart); + return this; + } + + @Override + public ConnectionMonitorResultImpl withLocation(String location) { + this.createOrUpdateParameter.withLocation(location); + return this; + } + + @Override + public ConnectionMonitorResultImpl withMonitoringIntervalInSeconds(Integer monitoringIntervalInSeconds) { + this.createOrUpdateParameter.withMonitoringIntervalInSeconds(monitoringIntervalInSeconds); + return this; + } + + @Override + public ConnectionMonitorResultImpl withTags(Map tags) { + this.createOrUpdateParameter.withTags(tags); + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ConnectionMonitorResultInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ConnectionMonitorResultInner.java new file mode 100644 index 000000000000..7eb0f6f30438 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ConnectionMonitorResultInner.java @@ -0,0 +1,234 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.ConnectionMonitorSource; +import com.microsoft.azure.management.network.v2018_06_01.ConnectionMonitorDestination; +import com.microsoft.azure.management.network.v2018_06_01.ProvisioningState; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * Information about the connection monitor. + */ +@JsonFlatten +public class ConnectionMonitorResultInner extends Resource { + /** + * The etag property. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * The source property. + */ + @JsonProperty(value = "properties.source", required = true) + private ConnectionMonitorSource source; + + /** + * The destination property. + */ + @JsonProperty(value = "properties.destination", required = true) + private ConnectionMonitorDestination destination; + + /** + * Determines if the connection monitor will start automatically once + * created. + */ + @JsonProperty(value = "properties.autoStart") + private Boolean autoStart; + + /** + * Monitoring interval in seconds. + */ + @JsonProperty(value = "properties.monitoringIntervalInSeconds") + private Integer monitoringIntervalInSeconds; + + /** + * The provisioning state of the connection monitor. Possible values + * include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningState provisioningState; + + /** + * The date and time when the connection monitor was started. + */ + @JsonProperty(value = "properties.startTime") + private DateTime startTime; + + /** + * The monitoring status of the connection monitor. + */ + @JsonProperty(value = "properties.monitoringStatus") + private String monitoringStatus; + + /** + * Get the etag value. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag value. + * + * @param etag the etag value to set + * @return the ConnectionMonitorResultInner object itself. + */ + public ConnectionMonitorResultInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get the source value. + * + * @return the source value + */ + public ConnectionMonitorSource source() { + return this.source; + } + + /** + * Set the source value. + * + * @param source the source value to set + * @return the ConnectionMonitorResultInner object itself. + */ + public ConnectionMonitorResultInner withSource(ConnectionMonitorSource source) { + this.source = source; + return this; + } + + /** + * Get the destination value. + * + * @return the destination value + */ + public ConnectionMonitorDestination destination() { + return this.destination; + } + + /** + * Set the destination value. + * + * @param destination the destination value to set + * @return the ConnectionMonitorResultInner object itself. + */ + public ConnectionMonitorResultInner withDestination(ConnectionMonitorDestination destination) { + this.destination = destination; + return this; + } + + /** + * Get determines if the connection monitor will start automatically once created. + * + * @return the autoStart value + */ + public Boolean autoStart() { + return this.autoStart; + } + + /** + * Set determines if the connection monitor will start automatically once created. + * + * @param autoStart the autoStart value to set + * @return the ConnectionMonitorResultInner object itself. + */ + public ConnectionMonitorResultInner withAutoStart(Boolean autoStart) { + this.autoStart = autoStart; + return this; + } + + /** + * Get monitoring interval in seconds. + * + * @return the monitoringIntervalInSeconds value + */ + public Integer monitoringIntervalInSeconds() { + return this.monitoringIntervalInSeconds; + } + + /** + * Set monitoring interval in seconds. + * + * @param monitoringIntervalInSeconds the monitoringIntervalInSeconds value to set + * @return the ConnectionMonitorResultInner object itself. + */ + public ConnectionMonitorResultInner withMonitoringIntervalInSeconds(Integer monitoringIntervalInSeconds) { + this.monitoringIntervalInSeconds = monitoringIntervalInSeconds; + return this; + } + + /** + * Get the provisioning state of the connection monitor. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the connection monitor. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ConnectionMonitorResultInner object itself. + */ + public ConnectionMonitorResultInner withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the date and time when the connection monitor was started. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set the date and time when the connection monitor was started. + * + * @param startTime the startTime value to set + * @return the ConnectionMonitorResultInner object itself. + */ + public ConnectionMonitorResultInner withStartTime(DateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the monitoring status of the connection monitor. + * + * @return the monitoringStatus value + */ + public String monitoringStatus() { + return this.monitoringStatus; + } + + /** + * Set the monitoring status of the connection monitor. + * + * @param monitoringStatus the monitoringStatus value to set + * @return the ConnectionMonitorResultInner object itself. + */ + public ConnectionMonitorResultInner withMonitoringStatus(String monitoringStatus) { + this.monitoringStatus = monitoringStatus; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ConnectionMonitorsImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ConnectionMonitorsImpl.java new file mode 100644 index 000000000000..a07db62790e3 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ConnectionMonitorsImpl.java @@ -0,0 +1,106 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_06_01.ConnectionMonitors; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.ConnectionMonitorQueryResult; +import com.microsoft.azure.management.network.v2018_06_01.ConnectionMonitorResult; + +class ConnectionMonitorsImpl extends WrapperImpl implements ConnectionMonitors { + private final NetworkManager manager; + + ConnectionMonitorsImpl(NetworkManager manager) { + super(manager.inner().connectionMonitors()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public ConnectionMonitorResultImpl define(String name) { + return wrapModel(name); + } + + private ConnectionMonitorResultImpl wrapModel(ConnectionMonitorResultInner inner) { + return new ConnectionMonitorResultImpl(inner, manager()); + } + + private ConnectionMonitorResultImpl wrapModel(String name) { + return new ConnectionMonitorResultImpl(name, this.manager()); + } + + @Override + public Completable stopAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + ConnectionMonitorsInner client = this.inner(); + return client.stopAsync(resourceGroupName, networkWatcherName, connectionMonitorName).toCompletable(); + } + + @Override + public Completable startAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + ConnectionMonitorsInner client = this.inner(); + return client.startAsync(resourceGroupName, networkWatcherName, connectionMonitorName).toCompletable(); + } + + @Override + public Observable queryAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + ConnectionMonitorsInner client = this.inner(); + return client.queryAsync(resourceGroupName, networkWatcherName, connectionMonitorName) + .map(new Func1() { + @Override + public ConnectionMonitorQueryResult call(ConnectionMonitorQueryResultInner inner) { + return new ConnectionMonitorQueryResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync(String resourceGroupName, String networkWatcherName) { + ConnectionMonitorsInner client = this.inner(); + return client.listAsync(resourceGroupName, networkWatcherName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public ConnectionMonitorResult call(ConnectionMonitorResultInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + ConnectionMonitorsInner client = this.inner(); + return client.getAsync(resourceGroupName, networkWatcherName, connectionMonitorName) + .map(new Func1() { + @Override + public ConnectionMonitorResult call(ConnectionMonitorResultInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + ConnectionMonitorsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, networkWatcherName, connectionMonitorName).toCompletable(); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ConnectionMonitorsInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ConnectionMonitorsInner.java new file mode 100644 index 000000000000..c5133805d595 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ConnectionMonitorsInner.java @@ -0,0 +1,1130 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ConnectionMonitors. + */ +public class ConnectionMonitorsInner { + /** The Retrofit service to perform REST calls. */ + private ConnectionMonitorsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of ConnectionMonitorsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ConnectionMonitorsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(ConnectionMonitorsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ConnectionMonitors to be + * used by Retrofit to perform actually REST calls. + */ + interface ConnectionMonitorsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.ConnectionMonitors createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("connectionMonitorName") String connectionMonitorName, @Path("subscriptionId") String subscriptionId, @Body ConnectionMonitorInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.ConnectionMonitors beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("connectionMonitorName") String connectionMonitorName, @Path("subscriptionId") String subscriptionId, @Body ConnectionMonitorInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.ConnectionMonitors get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("connectionMonitorName") String connectionMonitorName, @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.network.v2018_06_01.ConnectionMonitors delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("connectionMonitorName") String connectionMonitorName, @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.network.v2018_06_01.ConnectionMonitors beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("connectionMonitorName") String connectionMonitorName, @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.network.v2018_06_01.ConnectionMonitors stop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/stop") + Observable> stop(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("connectionMonitorName") String connectionMonitorName, @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.network.v2018_06_01.ConnectionMonitors beginStop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/stop") + Observable> beginStop(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("connectionMonitorName") String connectionMonitorName, @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.network.v2018_06_01.ConnectionMonitors start" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/start") + Observable> start(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("connectionMonitorName") String connectionMonitorName, @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.network.v2018_06_01.ConnectionMonitors beginStart" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/start") + Observable> beginStart(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("connectionMonitorName") String connectionMonitorName, @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.network.v2018_06_01.ConnectionMonitors query" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/query") + Observable> query(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("connectionMonitorName") String connectionMonitorName, @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.network.v2018_06_01.ConnectionMonitors beginQuery" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/query") + Observable> beginQuery(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("connectionMonitorName") String connectionMonitorName, @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.network.v2018_06_01.ConnectionMonitors list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Create or update a connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param parameters Parameters that define the operation to create a connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ConnectionMonitorResultInner object if successful. + */ + public ConnectionMonitorResultInner createOrUpdate(String resourceGroupName, String networkWatcherName, String connectionMonitorName, ConnectionMonitorInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName, parameters).toBlocking().last().body(); + } + + /** + * Create or update a connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param parameters Parameters that define the operation to create a connection monitor. + * @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 networkWatcherName, String connectionMonitorName, ConnectionMonitorInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName, parameters), serviceCallback); + } + + /** + * Create or update a connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param parameters Parameters that define the operation to create a connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, ConnectionMonitorInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName, parameters).map(new Func1, ConnectionMonitorResultInner>() { + @Override + public ConnectionMonitorResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param parameters Parameters that define the operation to create a connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, ConnectionMonitorInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (connectionMonitorName == null) { + throw new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, networkWatcherName, connectionMonitorName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or update a connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param parameters Parameters that define the operation to create a connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ConnectionMonitorResultInner object if successful. + */ + public ConnectionMonitorResultInner beginCreateOrUpdate(String resourceGroupName, String networkWatcherName, String connectionMonitorName, ConnectionMonitorInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName, parameters).toBlocking().single().body(); + } + + /** + * Create or update a connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param parameters Parameters that define the operation to create a connection monitor. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, ConnectionMonitorInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName, parameters), serviceCallback); + } + + /** + * Create or update a connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param parameters Parameters that define the operation to create a connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConnectionMonitorResultInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, ConnectionMonitorInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName, parameters).map(new Func1, ConnectionMonitorResultInner>() { + @Override + public ConnectionMonitorResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param parameters Parameters that define the operation to create a connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConnectionMonitorResultInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, ConnectionMonitorInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (connectionMonitorName == null) { + throw new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + return service.beginCreateOrUpdate(resourceGroupName, networkWatcherName, connectionMonitorName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a connection monitor by name. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ConnectionMonitorResultInner object if successful. + */ + public ConnectionMonitorResultInner get(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return getWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).toBlocking().single().body(); + } + + /** + * Gets a connection monitor by name. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @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 networkWatcherName, String connectionMonitorName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName), serviceCallback); + } + + /** + * Gets a connection monitor by name. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConnectionMonitorResultInner object + */ + public Observable getAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return getWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).map(new Func1, ConnectionMonitorResultInner>() { + @Override + public ConnectionMonitorResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a connection monitor by name. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConnectionMonitorResultInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (connectionMonitorName == null) { + throw new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.get(resourceGroupName, networkWatcherName, connectionMonitorName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + deleteWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).toBlocking().last().body(); + } + + /** + * Deletes the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @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 networkWatcherName, String connectionMonitorName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName), serviceCallback); + } + + /** + * Deletes the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return deleteWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (connectionMonitorName == null) { + throw new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + Observable> observable = service.delete(resourceGroupName, networkWatcherName, connectionMonitorName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).toBlocking().single().body(); + } + + /** + * Deletes the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName), serviceCallback); + } + + /** + * Deletes the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (connectionMonitorName == null) { + throw new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.beginDelete(resourceGroupName, networkWatcherName, connectionMonitorName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Stops the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void stop(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + stopWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).toBlocking().last().body(); + } + + /** + * Stops the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @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 stopAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(stopWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName), serviceCallback); + } + + /** + * Stops the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable stopAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return stopWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Stops the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> stopWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (connectionMonitorName == null) { + throw new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + Observable> observable = service.stop(resourceGroupName, networkWatcherName, connectionMonitorName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Stops the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginStop(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + beginStopWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).toBlocking().single().body(); + } + + /** + * Stops the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @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 beginStopAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginStopWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName), serviceCallback); + } + + /** + * Stops the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginStopAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return beginStopWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Stops the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginStopWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (connectionMonitorName == null) { + throw new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.beginStop(resourceGroupName, networkWatcherName, connectionMonitorName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginStopDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginStopDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Starts the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void start(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + startWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).toBlocking().last().body(); + } + + /** + * Starts the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @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 startAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(startWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName), serviceCallback); + } + + /** + * Starts the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable startAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return startWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Starts the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> startWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (connectionMonitorName == null) { + throw new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + Observable> observable = service.start(resourceGroupName, networkWatcherName, connectionMonitorName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Starts the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginStart(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + beginStartWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).toBlocking().single().body(); + } + + /** + * Starts the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @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 beginStartAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginStartWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName), serviceCallback); + } + + /** + * Starts the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginStartAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return beginStartWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Starts the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginStartWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (connectionMonitorName == null) { + throw new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.beginStart(resourceGroupName, networkWatcherName, connectionMonitorName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginStartDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginStartDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Query a snapshot of the most recent connection states. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name given to the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ConnectionMonitorQueryResultInner object if successful. + */ + public ConnectionMonitorQueryResultInner query(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return queryWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).toBlocking().last().body(); + } + + /** + * Query a snapshot of the most recent connection states. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name given to the connection monitor. + * @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 queryAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(queryWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName), serviceCallback); + } + + /** + * Query a snapshot of the most recent connection states. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name given to the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable queryAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return queryWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).map(new Func1, ConnectionMonitorQueryResultInner>() { + @Override + public ConnectionMonitorQueryResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Query a snapshot of the most recent connection states. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name given to the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> queryWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (connectionMonitorName == null) { + throw new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + Observable> observable = service.query(resourceGroupName, networkWatcherName, connectionMonitorName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Query a snapshot of the most recent connection states. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name given to the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ConnectionMonitorQueryResultInner object if successful. + */ + public ConnectionMonitorQueryResultInner beginQuery(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return beginQueryWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).toBlocking().single().body(); + } + + /** + * Query a snapshot of the most recent connection states. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name given to the connection monitor. + * @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 beginQueryAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginQueryWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName), serviceCallback); + } + + /** + * Query a snapshot of the most recent connection states. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name given to the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConnectionMonitorQueryResultInner object + */ + public Observable beginQueryAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return beginQueryWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).map(new Func1, ConnectionMonitorQueryResultInner>() { + @Override + public ConnectionMonitorQueryResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Query a snapshot of the most recent connection states. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name given to the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConnectionMonitorQueryResultInner object + */ + public Observable> beginQueryWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (connectionMonitorName == null) { + throw new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.beginQuery(resourceGroupName, networkWatcherName, connectionMonitorName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginQueryDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginQueryDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all connection monitors for the specified Network Watcher. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<ConnectionMonitorResultInner> object if successful. + */ + public List list(String resourceGroupName, String networkWatcherName) { + return listWithServiceResponseAsync(resourceGroupName, networkWatcherName).toBlocking().single().body(); + } + + /** + * Lists all connection monitors for the specified Network Watcher. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(String resourceGroupName, String networkWatcherName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, networkWatcherName), serviceCallback); + } + + /** + * Lists all connection monitors for the specified Network Watcher. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ConnectionMonitorResultInner> object + */ + public Observable> listAsync(String resourceGroupName, String networkWatcherName) { + return listWithServiceResponseAsync(resourceGroupName, networkWatcherName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all connection monitors for the specified Network Watcher. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ConnectionMonitorResultInner> object + */ + public Observable>> listWithServiceResponseAsync(String resourceGroupName, String networkWatcherName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.list(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ConnectionResetSharedKeyImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ConnectionResetSharedKeyImpl.java new file mode 100644 index 000000000000..4c40458f4ba6 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ConnectionResetSharedKeyImpl.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.ConnectionResetSharedKey; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class ConnectionResetSharedKeyImpl extends WrapperImpl implements ConnectionResetSharedKey { + private final NetworkManager manager; + ConnectionResetSharedKeyImpl(ConnectionResetSharedKeyInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public int keyLength() { + return this.inner().keyLength(); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ConnectionResetSharedKeyInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ConnectionResetSharedKeyInner.java new file mode 100644 index 000000000000..02ac2cbe6dcc --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ConnectionResetSharedKeyInner.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.network.v2018_06_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The virtual network connection reset shared key. + */ +public class ConnectionResetSharedKeyInner { + /** + * The virtual network connection reset shared key length, should between 1 + * and 128. + */ + @JsonProperty(value = "keyLength", required = true) + private int keyLength; + + /** + * Get the virtual network connection reset shared key length, should between 1 and 128. + * + * @return the keyLength value + */ + public int keyLength() { + return this.keyLength; + } + + /** + * Set the virtual network connection reset shared key length, should between 1 and 128. + * + * @param keyLength the keyLength value to set + * @return the ConnectionResetSharedKeyInner object itself. + */ + public ConnectionResetSharedKeyInner withKeyLength(int keyLength) { + this.keyLength = keyLength; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ConnectionSharedKeyImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ConnectionSharedKeyImpl.java new file mode 100644 index 000000000000..ddfa8614a4f0 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ConnectionSharedKeyImpl.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.ConnectionSharedKey; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class ConnectionSharedKeyImpl extends WrapperImpl implements ConnectionSharedKey { + private final NetworkManager manager; + ConnectionSharedKeyImpl(ConnectionSharedKeyInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String value() { + return this.inner().value(); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ConnectionSharedKeyInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ConnectionSharedKeyInner.java new file mode 100644 index 000000000000..b8468b256542 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ConnectionSharedKeyInner.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.network.v2018_06_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.SubResource; + +/** + * Response for GetConnectionSharedKey API service call. + */ +public class ConnectionSharedKeyInner extends SubResource { + /** + * The virtual network connection shared key value. + */ + @JsonProperty(value = "value", required = true) + private String value; + + /** + * Get the virtual network connection shared key value. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the virtual network connection shared key value. + * + * @param value the value value to set + * @return the ConnectionSharedKeyInner object itself. + */ + public ConnectionSharedKeyInner withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ConnectivityInformationImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ConnectivityInformationImpl.java new file mode 100644 index 000000000000..cdd60ff39533 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ConnectivityInformationImpl.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.ConnectivityInformation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_06_01.ConnectionStatus; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.ConnectivityHop; + +class ConnectivityInformationImpl extends WrapperImpl implements ConnectivityInformation { + private final NetworkManager manager; + ConnectivityInformationImpl(ConnectivityInformationInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Integer avgLatencyInMs() { + return this.inner().avgLatencyInMs(); + } + + @Override + public ConnectionStatus connectionStatus() { + return this.inner().connectionStatus(); + } + + @Override + public List hops() { + return this.inner().hops(); + } + + @Override + public Integer maxLatencyInMs() { + return this.inner().maxLatencyInMs(); + } + + @Override + public Integer minLatencyInMs() { + return this.inner().minLatencyInMs(); + } + + @Override + public Integer probesFailed() { + return this.inner().probesFailed(); + } + + @Override + public Integer probesSent() { + return this.inner().probesSent(); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ConnectivityInformationInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ConnectivityInformationInner.java new file mode 100644 index 000000000000..570a71ccd112 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ConnectivityInformationInner.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.network.v2018_06_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.ConnectivityHop; +import com.microsoft.azure.management.network.v2018_06_01.ConnectionStatus; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information on the connectivity status. + */ +public class ConnectivityInformationInner { + /** + * List of hops between the source and the destination. + */ + @JsonProperty(value = "hops", access = JsonProperty.Access.WRITE_ONLY) + private List hops; + + /** + * The connection status. Possible values include: 'Unknown', 'Connected', + * 'Disconnected', 'Degraded'. + */ + @JsonProperty(value = "connectionStatus", access = JsonProperty.Access.WRITE_ONLY) + private ConnectionStatus connectionStatus; + + /** + * Average latency in milliseconds. + */ + @JsonProperty(value = "avgLatencyInMs", access = JsonProperty.Access.WRITE_ONLY) + private Integer avgLatencyInMs; + + /** + * Minimum latency in milliseconds. + */ + @JsonProperty(value = "minLatencyInMs", access = JsonProperty.Access.WRITE_ONLY) + private Integer minLatencyInMs; + + /** + * Maximum latency in milliseconds. + */ + @JsonProperty(value = "maxLatencyInMs", access = JsonProperty.Access.WRITE_ONLY) + private Integer maxLatencyInMs; + + /** + * Total number of probes sent. + */ + @JsonProperty(value = "probesSent", access = JsonProperty.Access.WRITE_ONLY) + private Integer probesSent; + + /** + * Number of failed probes. + */ + @JsonProperty(value = "probesFailed", access = JsonProperty.Access.WRITE_ONLY) + private Integer probesFailed; + + /** + * Get list of hops between the source and the destination. + * + * @return the hops value + */ + public List hops() { + return this.hops; + } + + /** + * Get the connection status. Possible values include: 'Unknown', 'Connected', 'Disconnected', 'Degraded'. + * + * @return the connectionStatus value + */ + public ConnectionStatus connectionStatus() { + return this.connectionStatus; + } + + /** + * Get average latency in milliseconds. + * + * @return the avgLatencyInMs value + */ + public Integer avgLatencyInMs() { + return this.avgLatencyInMs; + } + + /** + * Get minimum latency in milliseconds. + * + * @return the minLatencyInMs value + */ + public Integer minLatencyInMs() { + return this.minLatencyInMs; + } + + /** + * Get maximum latency in milliseconds. + * + * @return the maxLatencyInMs value + */ + public Integer maxLatencyInMs() { + return this.maxLatencyInMs; + } + + /** + * Get total number of probes sent. + * + * @return the probesSent value + */ + public Integer probesSent() { + return this.probesSent; + } + + /** + * Get number of failed probes. + * + * @return the probesFailed value + */ + public Integer probesFailed() { + return this.probesFailed; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/DdosProtectionPlanImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/DdosProtectionPlanImpl.java new file mode 100644 index 000000000000..e106fd044ac6 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/DdosProtectionPlanImpl.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_06_01.DdosProtectionPlan; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.SubResource; + +class DdosProtectionPlanImpl extends GroupableResourceCoreImpl implements DdosProtectionPlan, DdosProtectionPlan.Definition, DdosProtectionPlan.Update { + DdosProtectionPlanImpl(String name, DdosProtectionPlanInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + DdosProtectionPlansInner client = this.manager().inner().ddosProtectionPlans(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + DdosProtectionPlansInner client = this.manager().inner().ddosProtectionPlans(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + DdosProtectionPlansInner client = this.manager().inner().ddosProtectionPlans(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public List virtualNetworks() { + return this.inner().virtualNetworks(); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/DdosProtectionPlanInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/DdosProtectionPlanInner.java new file mode 100644 index 000000000000..9abbc0988a58 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/DdosProtectionPlanInner.java @@ -0,0 +1,86 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import java.util.List; +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * A DDoS protection plan in a resource group. + */ +@JsonFlatten +public class DdosProtectionPlanInner extends Resource { + /** + * The resource GUID property of the DDoS protection plan resource. It + * uniquely identifies the resource, even if the user changes its name or + * migrate the resource across subscriptions or resource groups. + */ + @JsonProperty(value = "properties.resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /** + * The provisioning state of the DDoS protection plan resource. Possible + * values are: 'Succeeded', 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The list of virtual networks associated with the DDoS protection plan + * resource. This list is read-only. + */ + @JsonProperty(value = "properties.virtualNetworks", access = JsonProperty.Access.WRITE_ONLY) + private List virtualNetworks; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get the resource GUID property of the DDoS protection plan resource. It uniquely identifies the resource, even if the user changes its name or migrate the resource across subscriptions or resource groups. + * + * @return the resourceGuid value + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Get the provisioning state of the DDoS protection plan resource. Possible values are: 'Succeeded', 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the list of virtual networks associated with the DDoS protection plan resource. This list is read-only. + * + * @return the virtualNetworks value + */ + public List virtualNetworks() { + return this.virtualNetworks; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/DdosProtectionPlansImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/DdosProtectionPlansImpl.java new file mode 100644 index 000000000000..212fbf0b62dc --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/DdosProtectionPlansImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_06_01.DdosProtectionPlans; +import com.microsoft.azure.management.network.v2018_06_01.DdosProtectionPlan; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class DdosProtectionPlansImpl extends GroupableResourcesCoreImpl implements DdosProtectionPlans { + protected DdosProtectionPlansImpl(NetworkManager manager) { + super(manager.inner().ddosProtectionPlans(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + DdosProtectionPlansInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + DdosProtectionPlansInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + DdosProtectionPlansInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + DdosProtectionPlansInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public DdosProtectionPlan call(DdosProtectionPlanInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + DdosProtectionPlansInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + DdosProtectionPlansInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public DdosProtectionPlan call(DdosProtectionPlanInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public DdosProtectionPlanImpl define(String name) { + return wrapModel(name); + } + + @Override + protected DdosProtectionPlanImpl wrapModel(DdosProtectionPlanInner inner) { + return new DdosProtectionPlanImpl(inner.name(), inner, manager()); + } + + @Override + protected DdosProtectionPlanImpl wrapModel(String name) { + return new DdosProtectionPlanImpl(name, new DdosProtectionPlanInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/DdosProtectionPlansInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/DdosProtectionPlansInner.java new file mode 100644 index 000000000000..329a7031430f --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/DdosProtectionPlansInner.java @@ -0,0 +1,948 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.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 DdosProtectionPlans. + */ +public class DdosProtectionPlansInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private DdosProtectionPlansService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of DdosProtectionPlansInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public DdosProtectionPlansInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(DdosProtectionPlansService.class); + this.client = client; + } + + /** + * The interface defining all the services for DdosProtectionPlans to be + * used by Retrofit to perform actually REST calls. + */ + interface DdosProtectionPlansService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.DdosProtectionPlans delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("ddosProtectionPlanName") String ddosProtectionPlanName, @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.network.v2018_06_01.DdosProtectionPlans beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("ddosProtectionPlanName") String ddosProtectionPlanName, @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.network.v2018_06_01.DdosProtectionPlans getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("ddosProtectionPlanName") String ddosProtectionPlanName, @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.network.v2018_06_01.DdosProtectionPlans createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("ddosProtectionPlanName") String ddosProtectionPlanName, @Path("subscriptionId") String subscriptionId, @Body DdosProtectionPlanInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.DdosProtectionPlans beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("ddosProtectionPlanName") String ddosProtectionPlanName, @Path("subscriptionId") String subscriptionId, @Body DdosProtectionPlanInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.DdosProtectionPlans list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/ddosProtectionPlans") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.DdosProtectionPlans listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @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.network.v2018_06_01.DdosProtectionPlans listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.DdosProtectionPlans listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String ddosProtectionPlanName) { + deleteWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName).toBlocking().last().body(); + } + + /** + * Deletes the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @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 ddosProtectionPlanName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName), serviceCallback); + } + + /** + * Deletes the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String ddosProtectionPlanName) { + return deleteWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String ddosProtectionPlanName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (ddosProtectionPlanName == null) { + throw new IllegalArgumentException("Parameter ddosProtectionPlanName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + Observable> observable = service.delete(resourceGroupName, ddosProtectionPlanName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String ddosProtectionPlanName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName).toBlocking().single().body(); + } + + /** + * Deletes the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String ddosProtectionPlanName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName), serviceCallback); + } + + /** + * Deletes the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String ddosProtectionPlanName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String ddosProtectionPlanName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (ddosProtectionPlanName == null) { + throw new IllegalArgumentException("Parameter ddosProtectionPlanName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.beginDelete(resourceGroupName, ddosProtectionPlanName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets information about the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DdosProtectionPlanInner object if successful. + */ + public DdosProtectionPlanInner getByResourceGroup(String resourceGroupName, String ddosProtectionPlanName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName).toBlocking().single().body(); + } + + /** + * Gets information about the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String ddosProtectionPlanName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName), serviceCallback); + } + + /** + * Gets information about the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DdosProtectionPlanInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String ddosProtectionPlanName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName).map(new Func1, DdosProtectionPlanInner>() { + @Override + public DdosProtectionPlanInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets information about the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DdosProtectionPlanInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String ddosProtectionPlanName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (ddosProtectionPlanName == null) { + throw new IllegalArgumentException("Parameter ddosProtectionPlanName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.getByResourceGroup(resourceGroupName, ddosProtectionPlanName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param parameters Parameters supplied to the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DdosProtectionPlanInner object if successful. + */ + public DdosProtectionPlanInner createOrUpdate(String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates a DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param parameters Parameters supplied to the create or update operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName, parameters), serviceCallback); + } + + /** + * Creates or updates a DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param parameters Parameters supplied to the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName, parameters).map(new Func1, DdosProtectionPlanInner>() { + @Override + public DdosProtectionPlanInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param parameters Parameters supplied to the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (ddosProtectionPlanName == null) { + throw new IllegalArgumentException("Parameter ddosProtectionPlanName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, ddosProtectionPlanName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param parameters Parameters supplied to the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DdosProtectionPlanInner object if successful. + */ + public DdosProtectionPlanInner beginCreateOrUpdate(String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates a DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param parameters Parameters supplied to the create or update operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName, parameters), serviceCallback); + } + + /** + * Creates or updates a DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param parameters Parameters supplied to the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DdosProtectionPlanInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName, parameters).map(new Func1, DdosProtectionPlanInner>() { + @Override + public DdosProtectionPlanInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param parameters Parameters supplied to the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DdosProtectionPlanInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (ddosProtectionPlanName == null) { + throw new IllegalArgumentException("Parameter ddosProtectionPlanName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + return service.beginCreateOrUpdate(resourceGroupName, ddosProtectionPlanName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all DDoS protection plans in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DdosProtectionPlanInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all DDoS protection plans in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all DDoS protection plans in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DdosProtectionPlanInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all DDoS protection plans in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DdosProtectionPlanInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all DDoS protection plans in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DdosProtectionPlanInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the DDoS protection plans in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DdosProtectionPlanInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the DDoS protection plans in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the DDoS protection plans in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DdosProtectionPlanInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the DDoS protection plans in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DdosProtectionPlanInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the DDoS protection plans in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DdosProtectionPlanInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all DDoS protection plans in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DdosProtectionPlanInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all DDoS protection plans in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all DDoS protection plans in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DdosProtectionPlanInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all DDoS protection plans in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DdosProtectionPlanInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all DDoS protection plans in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DdosProtectionPlanInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the DDoS protection plans in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DdosProtectionPlanInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the DDoS protection plans in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the DDoS protection plans in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DdosProtectionPlanInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the DDoS protection plans in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DdosProtectionPlanInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the DDoS protection plans in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DdosProtectionPlanInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/DefaultSecurityRulesImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/DefaultSecurityRulesImpl.java new file mode 100644 index 000000000000..e8cd22180c24 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/DefaultSecurityRulesImpl.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.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_06_01.DefaultSecurityRules; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_06_01.NetworkSecurityGroupSecurityRuleModel; + +class DefaultSecurityRulesImpl extends WrapperImpl implements DefaultSecurityRules { + private final NetworkManager manager; + + DefaultSecurityRulesImpl(NetworkManager manager) { + super(manager.inner().defaultSecurityRules()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + private NetworkSecurityGroupSecurityRuleModelImpl wrapModel(SecurityRuleInner inner) { + return new NetworkSecurityGroupSecurityRuleModelImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String networkSecurityGroupName) { + DefaultSecurityRulesInner client = this.inner(); + return client.listAsync(resourceGroupName, networkSecurityGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NetworkSecurityGroupSecurityRuleModel call(SecurityRuleInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String networkSecurityGroupName, String defaultSecurityRuleName) { + DefaultSecurityRulesInner client = this.inner(); + return client.getAsync(resourceGroupName, networkSecurityGroupName, defaultSecurityRuleName) + .map(new Func1() { + @Override + public NetworkSecurityGroupSecurityRuleModel call(SecurityRuleInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/DefaultSecurityRulesInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/DefaultSecurityRulesInner.java new file mode 100644 index 000000000000..7bdd67bb85fd --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/DefaultSecurityRulesInner.java @@ -0,0 +1,397 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.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 DefaultSecurityRules. + */ +public class DefaultSecurityRulesInner { + /** The Retrofit service to perform REST calls. */ + private DefaultSecurityRulesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of DefaultSecurityRulesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public DefaultSecurityRulesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(DefaultSecurityRulesService.class); + this.client = client; + } + + /** + * The interface defining all the services for DefaultSecurityRules to be + * used by Retrofit to perform actually REST calls. + */ + interface DefaultSecurityRulesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.DefaultSecurityRules list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("networkSecurityGroupName") String networkSecurityGroupName, @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.network.v2018_06_01.DefaultSecurityRules get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules/{defaultSecurityRuleName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("networkSecurityGroupName") String networkSecurityGroupName, @Path("defaultSecurityRuleName") String defaultSecurityRuleName, @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.network.v2018_06_01.DefaultSecurityRules listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets all default security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SecurityRuleInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String networkSecurityGroupName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, networkSecurityGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all default security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String networkSecurityGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, networkSecurityGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all default security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SecurityRuleInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String networkSecurityGroupName) { + return listWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all default security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SecurityRuleInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String networkSecurityGroupName) { + return listSinglePageAsync(resourceGroupName, networkSecurityGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all default security rules in a network security group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SecurityRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String networkSecurityGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.list(resourceGroupName, networkSecurityGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get the specified default network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param defaultSecurityRuleName The name of the default security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SecurityRuleInner object if successful. + */ + public SecurityRuleInner get(String resourceGroupName, String networkSecurityGroupName, String defaultSecurityRuleName) { + return getWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, defaultSecurityRuleName).toBlocking().single().body(); + } + + /** + * Get the specified default network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param defaultSecurityRuleName The name of the default security rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String networkSecurityGroupName, String defaultSecurityRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, defaultSecurityRuleName), serviceCallback); + } + + /** + * Get the specified default network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param defaultSecurityRuleName The name of the default security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecurityRuleInner object + */ + public Observable getAsync(String resourceGroupName, String networkSecurityGroupName, String defaultSecurityRuleName) { + return getWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, defaultSecurityRuleName).map(new Func1, SecurityRuleInner>() { + @Override + public SecurityRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the specified default network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param defaultSecurityRuleName The name of the default security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecurityRuleInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName, String defaultSecurityRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (defaultSecurityRuleName == null) { + throw new IllegalArgumentException("Parameter defaultSecurityRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.get(resourceGroupName, networkSecurityGroupName, defaultSecurityRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all default security rules in a network security group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SecurityRuleInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all default security rules in a network security group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all default security rules in a network security group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SecurityRuleInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all default security rules in a network security group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SecurityRuleInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all default security rules in a network security group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SecurityRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/DnsNameAvailabilityResultInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/DnsNameAvailabilityResultInner.java new file mode 100644 index 000000000000..55c40ef1af11 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/DnsNameAvailabilityResultInner.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.network.v2018_06_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Response for the CheckDnsNameAvailability API service call. + */ +public class DnsNameAvailabilityResultInner { + /** + * Domain availability (True/False). + */ + @JsonProperty(value = "available") + private Boolean available; + + /** + * Get domain availability (True/False). + * + * @return the available value + */ + public Boolean available() { + return this.available; + } + + /** + * Set domain availability (True/False). + * + * @param available the available value to set + * @return the DnsNameAvailabilityResultInner object itself. + */ + public DnsNameAvailabilityResultInner withAvailable(Boolean available) { + this.available = available; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/EffectiveNetworkSecurityGroupListResultImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/EffectiveNetworkSecurityGroupListResultImpl.java new file mode 100644 index 000000000000..edba1455cb73 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/EffectiveNetworkSecurityGroupListResultImpl.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.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.EffectiveNetworkSecurityGroupListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.EffectiveNetworkSecurityGroup; + +class EffectiveNetworkSecurityGroupListResultImpl extends WrapperImpl implements EffectiveNetworkSecurityGroupListResult { + private final NetworkManager manager; + EffectiveNetworkSecurityGroupListResultImpl(EffectiveNetworkSecurityGroupListResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public String nextLink() { + return this.inner().nextLink(); + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/EffectiveNetworkSecurityGroupListResultInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/EffectiveNetworkSecurityGroupListResultInner.java new file mode 100644 index 000000000000..fd732d552bf9 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/EffectiveNetworkSecurityGroupListResultInner.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.network.v2018_06_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.EffectiveNetworkSecurityGroup; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Response for list effective network security groups API service call. + */ +public class EffectiveNetworkSecurityGroupListResultInner { + /** + * A list of effective network security groups. + */ + @JsonProperty(value = "value") + private List value; + + /** + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get a list of effective network security groups. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set a list of effective network security groups. + * + * @param value the value value to set + * @return the EffectiveNetworkSecurityGroupListResultInner object itself. + */ + public EffectiveNetworkSecurityGroupListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the URL to get the next set of results. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/EffectiveRouteListResultImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/EffectiveRouteListResultImpl.java new file mode 100644 index 000000000000..2a6ffcbeb727 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/EffectiveRouteListResultImpl.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.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.EffectiveRouteListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.EffectiveRoute; + +class EffectiveRouteListResultImpl extends WrapperImpl implements EffectiveRouteListResult { + private final NetworkManager manager; + EffectiveRouteListResultImpl(EffectiveRouteListResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public String nextLink() { + return this.inner().nextLink(); + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/EffectiveRouteListResultInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/EffectiveRouteListResultInner.java new file mode 100644 index 000000000000..67f07087d092 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/EffectiveRouteListResultInner.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.network.v2018_06_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.EffectiveRoute; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Response for list effective route API service call. + */ +public class EffectiveRouteListResultInner { + /** + * A list of effective routes. + */ + @JsonProperty(value = "value") + private List value; + + /** + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get a list of effective routes. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set a list of effective routes. + * + * @param value the value value to set + * @return the EffectiveRouteListResultInner object itself. + */ + public EffectiveRouteListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the URL to get the next set of results. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/EndpointServiceResultImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/EndpointServiceResultImpl.java new file mode 100644 index 000000000000..e82c45e44e4e --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/EndpointServiceResultImpl.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.EndpointServiceResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; + +class EndpointServiceResultImpl extends WrapperImpl implements EndpointServiceResult { + private final NetworkManager manager; + + EndpointServiceResultImpl(EndpointServiceResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/EndpointServiceResultInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/EndpointServiceResultInner.java new file mode 100644 index 000000000000..aa3a8f3e6212 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/EndpointServiceResultInner.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.network.v2018_06_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.SubResource; + +/** + * Endpoint service. + */ +public class EndpointServiceResultInner extends SubResource { + /** + * Name of the endpoint service. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * Type of the endpoint service. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Get name of the endpoint service. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get type of the endpoint service. + * + * @return the type value + */ + public String type() { + return this.type; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitAuthorizationImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitAuthorizationImpl.java new file mode 100644 index 000000000000..6729ac9c65a8 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitAuthorizationImpl.java @@ -0,0 +1,140 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCircuitAuthorization; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_06_01.AuthorizationUseStatus; + +class ExpressRouteCircuitAuthorizationImpl extends CreatableUpdatableImpl implements ExpressRouteCircuitAuthorization, ExpressRouteCircuitAuthorization.Definition, ExpressRouteCircuitAuthorization.Update { + private final NetworkManager manager; + private String resourceGroupName; + private String circuitName; + private String authorizationName; + + ExpressRouteCircuitAuthorizationImpl(String name, NetworkManager manager) { + super(name, new ExpressRouteCircuitAuthorizationInner()); + this.manager = manager; + // Set resource name + this.authorizationName = name; + // + } + + ExpressRouteCircuitAuthorizationImpl(ExpressRouteCircuitAuthorizationInner inner, NetworkManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.authorizationName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.circuitName = IdParsingUtils.getValueFromIdByName(inner.id(), "expressRouteCircuits"); + this.authorizationName = IdParsingUtils.getValueFromIdByName(inner.id(), "authorizations"); + // + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ExpressRouteCircuitAuthorizationsInner client = this.manager().inner().expressRouteCircuitAuthorizations(); + return client.createOrUpdateAsync(this.resourceGroupName, this.circuitName, this.authorizationName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ExpressRouteCircuitAuthorizationsInner client = this.manager().inner().expressRouteCircuitAuthorizations(); + return client.createOrUpdateAsync(this.resourceGroupName, this.circuitName, this.authorizationName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ExpressRouteCircuitAuthorizationsInner client = this.manager().inner().expressRouteCircuitAuthorizations(); + return client.getAsync(this.resourceGroupName, this.circuitName, this.authorizationName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String authorizationKey() { + return this.inner().authorizationKey(); + } + + @Override + public AuthorizationUseStatus authorizationUseStatus() { + return this.inner().authorizationUseStatus(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public ExpressRouteCircuitAuthorizationImpl withExistingExpressRouteCircuit(String resourceGroupName, String circuitName) { + this.resourceGroupName = resourceGroupName; + this.circuitName = circuitName; + return this; + } + + @Override + public ExpressRouteCircuitAuthorizationImpl withAuthorizationKey(String authorizationKey) { + this.inner().withAuthorizationKey(authorizationKey); + return this; + } + + @Override + public ExpressRouteCircuitAuthorizationImpl withAuthorizationUseStatus(AuthorizationUseStatus authorizationUseStatus) { + this.inner().withAuthorizationUseStatus(authorizationUseStatus); + return this; + } + + @Override + public ExpressRouteCircuitAuthorizationImpl withId(String id) { + this.inner().withId(id); + return this; + } + + @Override + public ExpressRouteCircuitAuthorizationImpl withName(String name) { + this.inner().withName(name); + return this; + } + + @Override + public ExpressRouteCircuitAuthorizationImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitAuthorizationInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitAuthorizationInner.java new file mode 100644 index 000000000000..71a500ee16e1 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitAuthorizationInner.java @@ -0,0 +1,143 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.AuthorizationUseStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Authorization in an ExpressRouteCircuit resource. + */ +@JsonFlatten +public class ExpressRouteCircuitAuthorizationInner extends SubResource { + /** + * The authorization key. + */ + @JsonProperty(value = "properties.authorizationKey") + private String authorizationKey; + + /** + * AuthorizationUseStatus. Possible values are: 'Available' and 'InUse'. + * Possible values include: 'Available', 'InUse'. + */ + @JsonProperty(value = "properties.authorizationUseStatus") + private AuthorizationUseStatus authorizationUseStatus; + + /** + * Gets the provisioning state of the public IP resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Gets name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get the authorization key. + * + * @return the authorizationKey value + */ + public String authorizationKey() { + return this.authorizationKey; + } + + /** + * Set the authorization key. + * + * @param authorizationKey the authorizationKey value to set + * @return the ExpressRouteCircuitAuthorizationInner object itself. + */ + public ExpressRouteCircuitAuthorizationInner withAuthorizationKey(String authorizationKey) { + this.authorizationKey = authorizationKey; + return this; + } + + /** + * Get authorizationUseStatus. Possible values are: 'Available' and 'InUse'. Possible values include: 'Available', 'InUse'. + * + * @return the authorizationUseStatus value + */ + public AuthorizationUseStatus authorizationUseStatus() { + return this.authorizationUseStatus; + } + + /** + * Set authorizationUseStatus. Possible values are: 'Available' and 'InUse'. Possible values include: 'Available', 'InUse'. + * + * @param authorizationUseStatus the authorizationUseStatus value to set + * @return the ExpressRouteCircuitAuthorizationInner object itself. + */ + public ExpressRouteCircuitAuthorizationInner withAuthorizationUseStatus(AuthorizationUseStatus authorizationUseStatus) { + this.authorizationUseStatus = authorizationUseStatus; + return this; + } + + /** + * Get gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ExpressRouteCircuitAuthorizationInner object itself. + */ + public ExpressRouteCircuitAuthorizationInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get gets name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set gets name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the ExpressRouteCircuitAuthorizationInner object itself. + */ + public ExpressRouteCircuitAuthorizationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitAuthorizationsImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitAuthorizationsImpl.java new file mode 100644 index 000000000000..f9c80b4d4d10 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitAuthorizationsImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCircuitAuthorizations; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCircuitAuthorization; + +class ExpressRouteCircuitAuthorizationsImpl extends WrapperImpl implements ExpressRouteCircuitAuthorizations { + private final NetworkManager manager; + + ExpressRouteCircuitAuthorizationsImpl(NetworkManager manager) { + super(manager.inner().expressRouteCircuitAuthorizations()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public ExpressRouteCircuitAuthorizationImpl define(String name) { + return wrapModel(name); + } + + private ExpressRouteCircuitAuthorizationImpl wrapModel(ExpressRouteCircuitAuthorizationInner inner) { + return new ExpressRouteCircuitAuthorizationImpl(inner, manager()); + } + + private ExpressRouteCircuitAuthorizationImpl wrapModel(String name) { + return new ExpressRouteCircuitAuthorizationImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String circuitName) { + ExpressRouteCircuitAuthorizationsInner client = this.inner(); + return client.listAsync(resourceGroupName, circuitName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ExpressRouteCircuitAuthorization call(ExpressRouteCircuitAuthorizationInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String circuitName, String authorizationName) { + ExpressRouteCircuitAuthorizationsInner client = this.inner(); + return client.getAsync(resourceGroupName, circuitName, authorizationName) + .map(new Func1() { + @Override + public ExpressRouteCircuitAuthorization call(ExpressRouteCircuitAuthorizationInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String circuitName, String authorizationName) { + ExpressRouteCircuitAuthorizationsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, circuitName, authorizationName).toCompletable(); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitAuthorizationsInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitAuthorizationsInner.java new file mode 100644 index 000000000000..d9201d97ae10 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitAuthorizationsInner.java @@ -0,0 +1,764 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.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 ExpressRouteCircuitAuthorizations. + */ +public class ExpressRouteCircuitAuthorizationsInner { + /** The Retrofit service to perform REST calls. */ + private ExpressRouteCircuitAuthorizationsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRouteCircuitAuthorizationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ExpressRouteCircuitAuthorizationsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(ExpressRouteCircuitAuthorizationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ExpressRouteCircuitAuthorizations to be + * used by Retrofit to perform actually REST calls. + */ + interface ExpressRouteCircuitAuthorizationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCircuitAuthorizations delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("authorizationName") String authorizationName, @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.network.v2018_06_01.ExpressRouteCircuitAuthorizations beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("authorizationName") String authorizationName, @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.network.v2018_06_01.ExpressRouteCircuitAuthorizations get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("authorizationName") String authorizationName, @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.network.v2018_06_01.ExpressRouteCircuitAuthorizations createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("authorizationName") String authorizationName, @Path("subscriptionId") String subscriptionId, @Body ExpressRouteCircuitAuthorizationInner authorizationParameters, @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.network.v2018_06_01.ExpressRouteCircuitAuthorizations beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("authorizationName") String authorizationName, @Path("subscriptionId") String subscriptionId, @Body ExpressRouteCircuitAuthorizationInner authorizationParameters, @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.network.v2018_06_01.ExpressRouteCircuitAuthorizations list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @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.network.v2018_06_01.ExpressRouteCircuitAuthorizations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String circuitName, String authorizationName) { + deleteWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName).toBlocking().last().body(); + } + + /** + * Deletes the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @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 circuitName, String authorizationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName), serviceCallback); + } + + /** + * Deletes the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String circuitName, String authorizationName) { + return deleteWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String circuitName, String authorizationName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (authorizationName == null) { + throw new IllegalArgumentException("Parameter authorizationName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + Observable> observable = service.delete(resourceGroupName, circuitName, authorizationName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String circuitName, String authorizationName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName).toBlocking().single().body(); + } + + /** + * Deletes the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String circuitName, String authorizationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName), serviceCallback); + } + + /** + * Deletes the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String circuitName, String authorizationName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String circuitName, String authorizationName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (authorizationName == null) { + throw new IllegalArgumentException("Parameter authorizationName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.beginDelete(resourceGroupName, circuitName, authorizationName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitAuthorizationInner object if successful. + */ + public ExpressRouteCircuitAuthorizationInner get(String resourceGroupName, String circuitName, String authorizationName) { + return getWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName).toBlocking().single().body(); + } + + /** + * Gets the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @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 circuitName, String authorizationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName), serviceCallback); + } + + /** + * Gets the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitAuthorizationInner object + */ + public Observable getAsync(String resourceGroupName, String circuitName, String authorizationName) { + return getWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName).map(new Func1, ExpressRouteCircuitAuthorizationInner>() { + @Override + public ExpressRouteCircuitAuthorizationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitAuthorizationInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String circuitName, String authorizationName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (authorizationName == null) { + throw new IllegalArgumentException("Parameter authorizationName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.get(resourceGroupName, circuitName, authorizationName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates an authorization in the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @param authorizationParameters Parameters supplied to the create or update express route circuit authorization operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitAuthorizationInner object if successful. + */ + public ExpressRouteCircuitAuthorizationInner createOrUpdate(String resourceGroupName, String circuitName, String authorizationName, ExpressRouteCircuitAuthorizationInner authorizationParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters).toBlocking().last().body(); + } + + /** + * Creates or updates an authorization in the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @param authorizationParameters Parameters supplied to the create or update express route circuit authorization operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String circuitName, String authorizationName, ExpressRouteCircuitAuthorizationInner authorizationParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters), serviceCallback); + } + + /** + * Creates or updates an authorization in the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @param authorizationParameters Parameters supplied to the create or update express route circuit authorization operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String circuitName, String authorizationName, ExpressRouteCircuitAuthorizationInner authorizationParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters).map(new Func1, ExpressRouteCircuitAuthorizationInner>() { + @Override + public ExpressRouteCircuitAuthorizationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates an authorization in the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @param authorizationParameters Parameters supplied to the create or update express route circuit authorization operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String circuitName, String authorizationName, ExpressRouteCircuitAuthorizationInner authorizationParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (authorizationName == null) { + throw new IllegalArgumentException("Parameter authorizationName 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 (authorizationParameters == null) { + throw new IllegalArgumentException("Parameter authorizationParameters is required and cannot be null."); + } + Validator.validate(authorizationParameters); + final String apiVersion = "2018-06-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, circuitName, authorizationName, this.client.subscriptionId(), authorizationParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates an authorization in the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @param authorizationParameters Parameters supplied to the create or update express route circuit authorization operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitAuthorizationInner object if successful. + */ + public ExpressRouteCircuitAuthorizationInner beginCreateOrUpdate(String resourceGroupName, String circuitName, String authorizationName, ExpressRouteCircuitAuthorizationInner authorizationParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters).toBlocking().single().body(); + } + + /** + * Creates or updates an authorization in the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @param authorizationParameters Parameters supplied to the create or update express route circuit authorization operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String circuitName, String authorizationName, ExpressRouteCircuitAuthorizationInner authorizationParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters), serviceCallback); + } + + /** + * Creates or updates an authorization in the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @param authorizationParameters Parameters supplied to the create or update express route circuit authorization operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitAuthorizationInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String circuitName, String authorizationName, ExpressRouteCircuitAuthorizationInner authorizationParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters).map(new Func1, ExpressRouteCircuitAuthorizationInner>() { + @Override + public ExpressRouteCircuitAuthorizationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates an authorization in the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @param authorizationParameters Parameters supplied to the create or update express route circuit authorization operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitAuthorizationInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String circuitName, String authorizationName, ExpressRouteCircuitAuthorizationInner authorizationParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (authorizationName == null) { + throw new IllegalArgumentException("Parameter authorizationName 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 (authorizationParameters == null) { + throw new IllegalArgumentException("Parameter authorizationParameters is required and cannot be null."); + } + Validator.validate(authorizationParameters); + final String apiVersion = "2018-06-01"; + return service.beginCreateOrUpdate(resourceGroupName, circuitName, authorizationName, this.client.subscriptionId(), authorizationParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all authorizations in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteCircuitAuthorizationInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String circuitName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, circuitName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all authorizations in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String circuitName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, circuitName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all authorizations in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCircuitAuthorizationInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String circuitName) { + return listWithServiceResponseAsync(resourceGroupName, circuitName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all authorizations in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCircuitAuthorizationInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String circuitName) { + return listSinglePageAsync(resourceGroupName, circuitName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all authorizations in an express route circuit. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param circuitName The name of the circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteCircuitAuthorizationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String circuitName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.list(resourceGroupName, circuitName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all authorizations in an express route circuit. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteCircuitAuthorizationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all authorizations in an express route circuit. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all authorizations in an express route circuit. + * + * @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<ExpressRouteCircuitAuthorizationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all authorizations in an express route circuit. + * + * @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<ExpressRouteCircuitAuthorizationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all authorizations in an express route circuit. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteCircuitAuthorizationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitConnectionImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitConnectionImpl.java new file mode 100644 index 000000000000..0549832a5722 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitConnectionImpl.java @@ -0,0 +1,165 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCircuitConnection; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_06_01.CircuitConnectionStatus; + +class ExpressRouteCircuitConnectionImpl extends CreatableUpdatableImpl implements ExpressRouteCircuitConnection, ExpressRouteCircuitConnection.Definition, ExpressRouteCircuitConnection.Update { + private final NetworkManager manager; + private String resourceGroupName; + private String circuitName; + private String peeringName; + private String connectionName; + + ExpressRouteCircuitConnectionImpl(String name, NetworkManager manager) { + super(name, new ExpressRouteCircuitConnectionInner()); + this.manager = manager; + // Set resource name + this.connectionName = name; + // + } + + ExpressRouteCircuitConnectionImpl(ExpressRouteCircuitConnectionInner inner, NetworkManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.connectionName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.circuitName = IdParsingUtils.getValueFromIdByName(inner.id(), "expressRouteCircuits"); + this.peeringName = IdParsingUtils.getValueFromIdByName(inner.id(), "peerings"); + this.connectionName = IdParsingUtils.getValueFromIdByName(inner.id(), "connections"); + // + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ExpressRouteCircuitConnectionsInner client = this.manager().inner().expressRouteCircuitConnections(); + return client.createOrUpdateAsync(this.resourceGroupName, this.circuitName, this.peeringName, this.connectionName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ExpressRouteCircuitConnectionsInner client = this.manager().inner().expressRouteCircuitConnections(); + return client.createOrUpdateAsync(this.resourceGroupName, this.circuitName, this.peeringName, this.connectionName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ExpressRouteCircuitConnectionsInner client = this.manager().inner().expressRouteCircuitConnections(); + return client.getAsync(this.resourceGroupName, this.circuitName, this.peeringName, this.connectionName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String addressPrefix() { + return this.inner().addressPrefix(); + } + + @Override + public String authorizationKey() { + return this.inner().authorizationKey(); + } + + @Override + public CircuitConnectionStatus circuitConnectionStatus() { + return this.inner().circuitConnectionStatus(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public SubResource expressRouteCircuitPeering() { + return this.inner().expressRouteCircuitPeering(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public SubResource peerExpressRouteCircuitPeering() { + return this.inner().peerExpressRouteCircuitPeering(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public ExpressRouteCircuitConnectionImpl withExistingPeering(String resourceGroupName, String circuitName, String peeringName) { + this.resourceGroupName = resourceGroupName; + this.circuitName = circuitName; + this.peeringName = peeringName; + return this; + } + + @Override + public ExpressRouteCircuitConnectionImpl withAddressPrefix(String addressPrefix) { + this.inner().withAddressPrefix(addressPrefix); + return this; + } + + @Override + public ExpressRouteCircuitConnectionImpl withAuthorizationKey(String authorizationKey) { + this.inner().withAuthorizationKey(authorizationKey); + return this; + } + + @Override + public ExpressRouteCircuitConnectionImpl withExpressRouteCircuitPeering(SubResource expressRouteCircuitPeering) { + this.inner().withExpressRouteCircuitPeering(expressRouteCircuitPeering); + return this; + } + + @Override + public ExpressRouteCircuitConnectionImpl withId(String id) { + this.inner().withId(id); + return this; + } + + @Override + public ExpressRouteCircuitConnectionImpl withName(String name) { + this.inner().withName(name); + return this; + } + + @Override + public ExpressRouteCircuitConnectionImpl withPeerExpressRouteCircuitPeering(SubResource peerExpressRouteCircuitPeering) { + this.inner().withPeerExpressRouteCircuitPeering(peerExpressRouteCircuitPeering); + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitConnectionInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitConnectionInner.java new file mode 100644 index 000000000000..5f1a602b66cc --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitConnectionInner.java @@ -0,0 +1,202 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_06_01.CircuitConnectionStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Express Route Circuit Connection in an ExpressRouteCircuitPeering resource. + */ +@JsonFlatten +public class ExpressRouteCircuitConnectionInner extends SubResource { + /** + * Reference to Express Route Circuit Private Peering Resource of the + * circuit initiating connection. + */ + @JsonProperty(value = "properties.expressRouteCircuitPeering") + private SubResource expressRouteCircuitPeering; + + /** + * Reference to Express Route Circuit Private Peering Resource of the + * peered circuit. + */ + @JsonProperty(value = "properties.peerExpressRouteCircuitPeering") + private SubResource peerExpressRouteCircuitPeering; + + /** + * /29 IP address space to carve out Customer addresses for tunnels. + */ + @JsonProperty(value = "properties.addressPrefix") + private String addressPrefix; + + /** + * The authorization key. + */ + @JsonProperty(value = "properties.authorizationKey") + private String authorizationKey; + + /** + * Express Route Circuit Connection State. Possible values are: 'Connected' + * and 'Disconnected'. Possible values include: 'Connected', 'Connecting', + * 'Disconnected'. + */ + @JsonProperty(value = "properties.circuitConnectionStatus", access = JsonProperty.Access.WRITE_ONLY) + private CircuitConnectionStatus circuitConnectionStatus; + + /** + * Provisioning state of the circuit connection resource. Possible values + * are: 'Succeded', 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Gets name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get reference to Express Route Circuit Private Peering Resource of the circuit initiating connection. + * + * @return the expressRouteCircuitPeering value + */ + public SubResource expressRouteCircuitPeering() { + return this.expressRouteCircuitPeering; + } + + /** + * Set reference to Express Route Circuit Private Peering Resource of the circuit initiating connection. + * + * @param expressRouteCircuitPeering the expressRouteCircuitPeering value to set + * @return the ExpressRouteCircuitConnectionInner object itself. + */ + public ExpressRouteCircuitConnectionInner withExpressRouteCircuitPeering(SubResource expressRouteCircuitPeering) { + this.expressRouteCircuitPeering = expressRouteCircuitPeering; + return this; + } + + /** + * Get reference to Express Route Circuit Private Peering Resource of the peered circuit. + * + * @return the peerExpressRouteCircuitPeering value + */ + public SubResource peerExpressRouteCircuitPeering() { + return this.peerExpressRouteCircuitPeering; + } + + /** + * Set reference to Express Route Circuit Private Peering Resource of the peered circuit. + * + * @param peerExpressRouteCircuitPeering the peerExpressRouteCircuitPeering value to set + * @return the ExpressRouteCircuitConnectionInner object itself. + */ + public ExpressRouteCircuitConnectionInner withPeerExpressRouteCircuitPeering(SubResource peerExpressRouteCircuitPeering) { + this.peerExpressRouteCircuitPeering = peerExpressRouteCircuitPeering; + return this; + } + + /** + * Get /29 IP address space to carve out Customer addresses for tunnels. + * + * @return the addressPrefix value + */ + public String addressPrefix() { + return this.addressPrefix; + } + + /** + * Set /29 IP address space to carve out Customer addresses for tunnels. + * + * @param addressPrefix the addressPrefix value to set + * @return the ExpressRouteCircuitConnectionInner object itself. + */ + public ExpressRouteCircuitConnectionInner withAddressPrefix(String addressPrefix) { + this.addressPrefix = addressPrefix; + return this; + } + + /** + * Get the authorization key. + * + * @return the authorizationKey value + */ + public String authorizationKey() { + return this.authorizationKey; + } + + /** + * Set the authorization key. + * + * @param authorizationKey the authorizationKey value to set + * @return the ExpressRouteCircuitConnectionInner object itself. + */ + public ExpressRouteCircuitConnectionInner withAuthorizationKey(String authorizationKey) { + this.authorizationKey = authorizationKey; + return this; + } + + /** + * Get express Route Circuit Connection State. Possible values are: 'Connected' and 'Disconnected'. Possible values include: 'Connected', 'Connecting', 'Disconnected'. + * + * @return the circuitConnectionStatus value + */ + public CircuitConnectionStatus circuitConnectionStatus() { + return this.circuitConnectionStatus; + } + + /** + * Get provisioning state of the circuit connection resource. Possible values are: 'Succeded', 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get gets name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set gets name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the ExpressRouteCircuitConnectionInner object itself. + */ + public ExpressRouteCircuitConnectionInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitConnectionsImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitConnectionsImpl.java new file mode 100644 index 000000000000..fed451a68cce --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitConnectionsImpl.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCircuitConnections; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCircuitConnection; + +class ExpressRouteCircuitConnectionsImpl extends WrapperImpl implements ExpressRouteCircuitConnections { + private final NetworkManager manager; + + ExpressRouteCircuitConnectionsImpl(NetworkManager manager) { + super(manager.inner().expressRouteCircuitConnections()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public ExpressRouteCircuitConnectionImpl define(String name) { + return wrapModel(name); + } + + private ExpressRouteCircuitConnectionImpl wrapModel(ExpressRouteCircuitConnectionInner inner) { + return new ExpressRouteCircuitConnectionImpl(inner, manager()); + } + + private ExpressRouteCircuitConnectionImpl wrapModel(String name) { + return new ExpressRouteCircuitConnectionImpl(name, this.manager()); + } + + @Override + public Observable getAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName) { + ExpressRouteCircuitConnectionsInner client = this.inner(); + return client.getAsync(resourceGroupName, circuitName, peeringName, connectionName) + .map(new Func1() { + @Override + public ExpressRouteCircuitConnection call(ExpressRouteCircuitConnectionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName) { + ExpressRouteCircuitConnectionsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, circuitName, peeringName, connectionName).toCompletable(); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitConnectionsInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitConnectionsInner.java new file mode 100644 index 000000000000..91bbb1cd5735 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitConnectionsInner.java @@ -0,0 +1,553 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ExpressRouteCircuitConnections. + */ +public class ExpressRouteCircuitConnectionsInner { + /** The Retrofit service to perform REST calls. */ + private ExpressRouteCircuitConnectionsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRouteCircuitConnectionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ExpressRouteCircuitConnectionsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(ExpressRouteCircuitConnectionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ExpressRouteCircuitConnections to be + * used by Retrofit to perform actually REST calls. + */ + interface ExpressRouteCircuitConnectionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCircuitConnections delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("connectionName") String connectionName, @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.network.v2018_06_01.ExpressRouteCircuitConnections beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("connectionName") String connectionName, @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.network.v2018_06_01.ExpressRouteCircuitConnections get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("connectionName") String connectionName, @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.network.v2018_06_01.ExpressRouteCircuitConnections createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("connectionName") String connectionName, @Path("subscriptionId") String subscriptionId, @Body ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters, @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.network.v2018_06_01.ExpressRouteCircuitConnections beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("connectionName") String connectionName, @Path("subscriptionId") String subscriptionId, @Body ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String circuitName, String peeringName, String connectionName) { + deleteWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName).toBlocking().last().body(); + } + + /** + * Deletes the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName), serviceCallback); + } + + /** + * Deletes the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName) { + return deleteWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (connectionName == null) { + throw new IllegalArgumentException("Parameter connectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + Observable> observable = service.delete(resourceGroupName, circuitName, peeringName, connectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String circuitName, String peeringName, String connectionName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName).toBlocking().single().body(); + } + + /** + * Deletes the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName), serviceCallback); + } + + /** + * Deletes the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (connectionName == null) { + throw new IllegalArgumentException("Parameter connectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.beginDelete(resourceGroupName, circuitName, peeringName, connectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitConnectionInner object if successful. + */ + public ExpressRouteCircuitConnectionInner get(String resourceGroupName, String circuitName, String peeringName, String connectionName) { + return getWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName).toBlocking().single().body(); + } + + /** + * Gets the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName), serviceCallback); + } + + /** + * Gets the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitConnectionInner object + */ + public Observable getAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName) { + return getWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName).map(new Func1, ExpressRouteCircuitConnectionInner>() { + @Override + public ExpressRouteCircuitConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitConnectionInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (connectionName == null) { + throw new IllegalArgumentException("Parameter connectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.get(resourceGroupName, circuitName, peeringName, connectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a Express Route Circuit Connection in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param expressRouteCircuitConnectionParameters Parameters supplied to the create or update express route circuit circuit connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitConnectionInner object if successful. + */ + public ExpressRouteCircuitConnectionInner createOrUpdate(String resourceGroupName, String circuitName, String peeringName, String connectionName, ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters).toBlocking().last().body(); + } + + /** + * Creates or updates a Express Route Circuit Connection in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param expressRouteCircuitConnectionParameters Parameters supplied to the create or update express route circuit circuit connection operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName, ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters), serviceCallback); + } + + /** + * Creates or updates a Express Route Circuit Connection in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param expressRouteCircuitConnectionParameters Parameters supplied to the create or update express route circuit circuit connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName, ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters).map(new Func1, ExpressRouteCircuitConnectionInner>() { + @Override + public ExpressRouteCircuitConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a Express Route Circuit Connection in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param expressRouteCircuitConnectionParameters Parameters supplied to the create or update express route circuit circuit connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName, ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (connectionName == null) { + throw new IllegalArgumentException("Parameter connectionName 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 (expressRouteCircuitConnectionParameters == null) { + throw new IllegalArgumentException("Parameter expressRouteCircuitConnectionParameters is required and cannot be null."); + } + Validator.validate(expressRouteCircuitConnectionParameters); + final String apiVersion = "2018-06-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, circuitName, peeringName, connectionName, this.client.subscriptionId(), expressRouteCircuitConnectionParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a Express Route Circuit Connection in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param expressRouteCircuitConnectionParameters Parameters supplied to the create or update express route circuit circuit connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitConnectionInner object if successful. + */ + public ExpressRouteCircuitConnectionInner beginCreateOrUpdate(String resourceGroupName, String circuitName, String peeringName, String connectionName, ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters).toBlocking().single().body(); + } + + /** + * Creates or updates a Express Route Circuit Connection in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param expressRouteCircuitConnectionParameters Parameters supplied to the create or update express route circuit circuit connection operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName, ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters), serviceCallback); + } + + /** + * Creates or updates a Express Route Circuit Connection in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param expressRouteCircuitConnectionParameters Parameters supplied to the create or update express route circuit circuit connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitConnectionInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName, ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters).map(new Func1, ExpressRouteCircuitConnectionInner>() { + @Override + public ExpressRouteCircuitConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a Express Route Circuit Connection in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param expressRouteCircuitConnectionParameters Parameters supplied to the create or update express route circuit circuit connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitConnectionInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName, ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (connectionName == null) { + throw new IllegalArgumentException("Parameter connectionName 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 (expressRouteCircuitConnectionParameters == null) { + throw new IllegalArgumentException("Parameter expressRouteCircuitConnectionParameters is required and cannot be null."); + } + Validator.validate(expressRouteCircuitConnectionParameters); + final String apiVersion = "2018-06-01"; + return service.beginCreateOrUpdate(resourceGroupName, circuitName, peeringName, connectionName, this.client.subscriptionId(), expressRouteCircuitConnectionParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitImpl.java new file mode 100644 index 000000000000..5c27ec3a203b --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitImpl.java @@ -0,0 +1,191 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCircuit; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCircuitSku; +import com.microsoft.azure.management.network.v2018_06_01.ServiceProviderProvisioningState; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCircuitServiceProviderProperties; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCircuitAuthorization; +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCircuitPeering; + +class ExpressRouteCircuitImpl extends GroupableResourceCoreImpl implements ExpressRouteCircuit, ExpressRouteCircuit.Definition, ExpressRouteCircuit.Update { + ExpressRouteCircuitImpl(String name, ExpressRouteCircuitInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + ExpressRouteCircuitsInner client = this.manager().inner().expressRouteCircuits(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ExpressRouteCircuitsInner client = this.manager().inner().expressRouteCircuits(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ExpressRouteCircuitsInner client = this.manager().inner().expressRouteCircuits(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public Boolean allowClassicOperations() { + return this.inner().allowClassicOperations(); + } + + @Override + public List authorizations() { + List lst = new ArrayList(); + if (this.inner().authorizations() != null) { + for (ExpressRouteCircuitAuthorizationInner inner : this.inner().authorizations()) { + lst.add( new ExpressRouteCircuitAuthorizationImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String circuitProvisioningState() { + return this.inner().circuitProvisioningState(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String gatewayManagerEtag() { + return this.inner().gatewayManagerEtag(); + } + + @Override + public List peerings() { + List lst = new ArrayList(); + if (this.inner().peerings() != null) { + for (ExpressRouteCircuitPeeringInner inner : this.inner().peerings()) { + lst.add( new ExpressRouteCircuitPeeringImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String serviceKey() { + return this.inner().serviceKey(); + } + + @Override + public String serviceProviderNotes() { + return this.inner().serviceProviderNotes(); + } + + @Override + public ExpressRouteCircuitServiceProviderProperties serviceProviderProperties() { + return this.inner().serviceProviderProperties(); + } + + @Override + public ServiceProviderProvisioningState serviceProviderProvisioningState() { + return this.inner().serviceProviderProvisioningState(); + } + + @Override + public ExpressRouteCircuitSku sku() { + return this.inner().sku(); + } + + @Override + public ExpressRouteCircuitImpl withAllowClassicOperations(Boolean allowClassicOperations) { + this.inner().withAllowClassicOperations(allowClassicOperations); + return this; + } + + @Override + public ExpressRouteCircuitImpl withAuthorizations(List authorizations) { + this.inner().withAuthorizations(authorizations); + return this; + } + + @Override + public ExpressRouteCircuitImpl withCircuitProvisioningState(String circuitProvisioningState) { + this.inner().withCircuitProvisioningState(circuitProvisioningState); + return this; + } + + @Override + public ExpressRouteCircuitImpl withGatewayManagerEtag(String gatewayManagerEtag) { + this.inner().withGatewayManagerEtag(gatewayManagerEtag); + return this; + } + + @Override + public ExpressRouteCircuitImpl withPeerings(List peerings) { + this.inner().withPeerings(peerings); + return this; + } + + @Override + public ExpressRouteCircuitImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public ExpressRouteCircuitImpl withServiceKey(String serviceKey) { + this.inner().withServiceKey(serviceKey); + return this; + } + + @Override + public ExpressRouteCircuitImpl withServiceProviderNotes(String serviceProviderNotes) { + this.inner().withServiceProviderNotes(serviceProviderNotes); + return this; + } + + @Override + public ExpressRouteCircuitImpl withServiceProviderProperties(ExpressRouteCircuitServiceProviderProperties serviceProviderProperties) { + this.inner().withServiceProviderProperties(serviceProviderProperties); + return this; + } + + @Override + public ExpressRouteCircuitImpl withServiceProviderProvisioningState(ServiceProviderProvisioningState serviceProviderProvisioningState) { + this.inner().withServiceProviderProvisioningState(serviceProviderProvisioningState); + return this; + } + + @Override + public ExpressRouteCircuitImpl withSku(ExpressRouteCircuitSku sku) { + this.inner().withSku(sku); + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitInner.java new file mode 100644 index 000000000000..da050c77e563 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitInner.java @@ -0,0 +1,358 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCircuitSku; +import com.microsoft.azure.management.network.v2018_06_01.ServiceProviderProvisioningState; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCircuitServiceProviderProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * ExpressRouteCircuit resource. + */ +@JsonFlatten +@SkipParentValidation +public class ExpressRouteCircuitInner extends Resource { + /** + * The SKU. + */ + @JsonProperty(value = "sku") + private ExpressRouteCircuitSku sku; + + /** + * Allow classic operations. + */ + @JsonProperty(value = "properties.allowClassicOperations") + private Boolean allowClassicOperations; + + /** + * The CircuitProvisioningState state of the resource. + */ + @JsonProperty(value = "properties.circuitProvisioningState") + private String circuitProvisioningState; + + /** + * The ServiceProviderProvisioningState state of the resource. Possible + * values are 'NotProvisioned', 'Provisioning', 'Provisioned', and + * 'Deprovisioning'. Possible values include: 'NotProvisioned', + * 'Provisioning', 'Provisioned', 'Deprovisioning'. + */ + @JsonProperty(value = "properties.serviceProviderProvisioningState") + private ServiceProviderProvisioningState serviceProviderProvisioningState; + + /** + * The list of authorizations. + */ + @JsonProperty(value = "properties.authorizations") + private List authorizations; + + /** + * The list of peerings. + */ + @JsonProperty(value = "properties.peerings") + private List peerings; + + /** + * The ServiceKey. + */ + @JsonProperty(value = "properties.serviceKey") + private String serviceKey; + + /** + * The ServiceProviderNotes. + */ + @JsonProperty(value = "properties.serviceProviderNotes") + private String serviceProviderNotes; + + /** + * The ServiceProviderProperties. + */ + @JsonProperty(value = "properties.serviceProviderProperties") + private ExpressRouteCircuitServiceProviderProperties serviceProviderProperties; + + /** + * Gets the provisioning state of the public IP resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * The GatewayManager Etag. + */ + @JsonProperty(value = "properties.gatewayManagerEtag") + private String gatewayManagerEtag; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the SKU. + * + * @return the sku value + */ + public ExpressRouteCircuitSku sku() { + return this.sku; + } + + /** + * Set the SKU. + * + * @param sku the sku value to set + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withSku(ExpressRouteCircuitSku sku) { + this.sku = sku; + return this; + } + + /** + * Get allow classic operations. + * + * @return the allowClassicOperations value + */ + public Boolean allowClassicOperations() { + return this.allowClassicOperations; + } + + /** + * Set allow classic operations. + * + * @param allowClassicOperations the allowClassicOperations value to set + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withAllowClassicOperations(Boolean allowClassicOperations) { + this.allowClassicOperations = allowClassicOperations; + return this; + } + + /** + * Get the CircuitProvisioningState state of the resource. + * + * @return the circuitProvisioningState value + */ + public String circuitProvisioningState() { + return this.circuitProvisioningState; + } + + /** + * Set the CircuitProvisioningState state of the resource. + * + * @param circuitProvisioningState the circuitProvisioningState value to set + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withCircuitProvisioningState(String circuitProvisioningState) { + this.circuitProvisioningState = circuitProvisioningState; + return this; + } + + /** + * Get the ServiceProviderProvisioningState state of the resource. Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned', and 'Deprovisioning'. Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', 'Deprovisioning'. + * + * @return the serviceProviderProvisioningState value + */ + public ServiceProviderProvisioningState serviceProviderProvisioningState() { + return this.serviceProviderProvisioningState; + } + + /** + * Set the ServiceProviderProvisioningState state of the resource. Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned', and 'Deprovisioning'. Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', 'Deprovisioning'. + * + * @param serviceProviderProvisioningState the serviceProviderProvisioningState value to set + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withServiceProviderProvisioningState(ServiceProviderProvisioningState serviceProviderProvisioningState) { + this.serviceProviderProvisioningState = serviceProviderProvisioningState; + return this; + } + + /** + * Get the list of authorizations. + * + * @return the authorizations value + */ + public List authorizations() { + return this.authorizations; + } + + /** + * Set the list of authorizations. + * + * @param authorizations the authorizations value to set + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withAuthorizations(List authorizations) { + this.authorizations = authorizations; + return this; + } + + /** + * Get the list of peerings. + * + * @return the peerings value + */ + public List peerings() { + return this.peerings; + } + + /** + * Set the list of peerings. + * + * @param peerings the peerings value to set + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withPeerings(List peerings) { + this.peerings = peerings; + return this; + } + + /** + * Get the ServiceKey. + * + * @return the serviceKey value + */ + public String serviceKey() { + return this.serviceKey; + } + + /** + * Set the ServiceKey. + * + * @param serviceKey the serviceKey value to set + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withServiceKey(String serviceKey) { + this.serviceKey = serviceKey; + return this; + } + + /** + * Get the ServiceProviderNotes. + * + * @return the serviceProviderNotes value + */ + public String serviceProviderNotes() { + return this.serviceProviderNotes; + } + + /** + * Set the ServiceProviderNotes. + * + * @param serviceProviderNotes the serviceProviderNotes value to set + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withServiceProviderNotes(String serviceProviderNotes) { + this.serviceProviderNotes = serviceProviderNotes; + return this; + } + + /** + * Get the ServiceProviderProperties. + * + * @return the serviceProviderProperties value + */ + public ExpressRouteCircuitServiceProviderProperties serviceProviderProperties() { + return this.serviceProviderProperties; + } + + /** + * Set the ServiceProviderProperties. + * + * @param serviceProviderProperties the serviceProviderProperties value to set + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withServiceProviderProperties(ExpressRouteCircuitServiceProviderProperties serviceProviderProperties) { + this.serviceProviderProperties = serviceProviderProperties; + return this; + } + + /** + * Get gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the GatewayManager Etag. + * + * @return the gatewayManagerEtag value + */ + public String gatewayManagerEtag() { + return this.gatewayManagerEtag; + } + + /** + * Set the GatewayManager Etag. + * + * @param gatewayManagerEtag the gatewayManagerEtag value to set + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withGatewayManagerEtag(String gatewayManagerEtag) { + this.gatewayManagerEtag = gatewayManagerEtag; + return this; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitPeeringImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitPeeringImpl.java new file mode 100644 index 000000000000..967b340a7b21 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitPeeringImpl.java @@ -0,0 +1,329 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCircuitPeering; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_06_01.ExpressRoutePeeringType; +import com.microsoft.azure.management.network.v2018_06_01.ExpressRoutePeeringState; +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCircuitPeeringConfig; +import com.microsoft.azure.management.network.v2018_06_01.Ipv6ExpressRouteCircuitPeeringConfig; +import java.util.List; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCircuitConnection; +import com.microsoft.azure.management.network.v2018_06_01.RouteFilter; +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCircuitStats; + +class ExpressRouteCircuitPeeringImpl extends CreatableUpdatableImpl implements ExpressRouteCircuitPeering, ExpressRouteCircuitPeering.Definition, ExpressRouteCircuitPeering.Update { + private final NetworkManager manager; + private String resourceGroupName; + private String circuitName; + private String peeringName; + + ExpressRouteCircuitPeeringImpl(String name, NetworkManager manager) { + super(name, new ExpressRouteCircuitPeeringInner()); + this.manager = manager; + // Set resource name + this.peeringName = name; + // + } + + ExpressRouteCircuitPeeringImpl(ExpressRouteCircuitPeeringInner inner, NetworkManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.peeringName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.circuitName = IdParsingUtils.getValueFromIdByName(inner.id(), "expressRouteCircuits"); + this.peeringName = IdParsingUtils.getValueFromIdByName(inner.id(), "peerings"); + // + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ExpressRouteCircuitPeeringsInner client = this.manager().inner().expressRouteCircuitPeerings(); + return client.createOrUpdateAsync(this.resourceGroupName, this.circuitName, this.peeringName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ExpressRouteCircuitPeeringsInner client = this.manager().inner().expressRouteCircuitPeerings(); + return client.createOrUpdateAsync(this.resourceGroupName, this.circuitName, this.peeringName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ExpressRouteCircuitPeeringsInner client = this.manager().inner().expressRouteCircuitPeerings(); + return client.getAsync(this.resourceGroupName, this.circuitName, this.peeringName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public Integer azureASN() { + return this.inner().azureASN(); + } + + @Override + public List connections() { + List lst = new ArrayList(); + if (this.inner().connections() != null) { + for (ExpressRouteCircuitConnectionInner inner : this.inner().connections()) { + lst.add( new ExpressRouteCircuitConnectionImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String gatewayManagerEtag() { + return this.inner().gatewayManagerEtag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig() { + return this.inner().ipv6PeeringConfig(); + } + + @Override + public String lastModifiedBy() { + return this.inner().lastModifiedBy(); + } + + @Override + public ExpressRouteCircuitPeeringConfig microsoftPeeringConfig() { + return this.inner().microsoftPeeringConfig(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Long peerASN() { + return this.inner().peerASN(); + } + + @Override + public ExpressRoutePeeringType peeringType() { + return this.inner().peeringType(); + } + + @Override + public String primaryAzurePort() { + return this.inner().primaryAzurePort(); + } + + @Override + public String primaryPeerAddressPrefix() { + return this.inner().primaryPeerAddressPrefix(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public RouteFilter routeFilter() { + RouteFilterInner inner = this.inner().routeFilter(); + if (inner != null) { + return new RouteFilterImpl(inner.name(), inner, manager()); + } else { + return null; + } + } + + @Override + public String secondaryAzurePort() { + return this.inner().secondaryAzurePort(); + } + + @Override + public String secondaryPeerAddressPrefix() { + return this.inner().secondaryPeerAddressPrefix(); + } + + @Override + public String sharedKey() { + return this.inner().sharedKey(); + } + + @Override + public ExpressRoutePeeringState state() { + return this.inner().state(); + } + + @Override + public ExpressRouteCircuitStats stats() { + ExpressRouteCircuitStatsInner inner = this.inner().stats(); + if (inner != null) { + return new ExpressRouteCircuitStatsImpl(inner, manager()); + } else { + return null; + } + } + + @Override + public Integer vlanId() { + return this.inner().vlanId(); + } + + @Override + public ExpressRouteCircuitPeeringImpl withExistingExpressRouteCircuit(String resourceGroupName, String circuitName) { + this.resourceGroupName = resourceGroupName; + this.circuitName = circuitName; + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withAzureASN(Integer azureASN) { + this.inner().withAzureASN(azureASN); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withConnections(List connections) { + this.inner().withConnections(connections); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withGatewayManagerEtag(String gatewayManagerEtag) { + this.inner().withGatewayManagerEtag(gatewayManagerEtag); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withId(String id) { + this.inner().withId(id); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withIpv6PeeringConfig(Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig) { + this.inner().withIpv6PeeringConfig(ipv6PeeringConfig); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withLastModifiedBy(String lastModifiedBy) { + this.inner().withLastModifiedBy(lastModifiedBy); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withMicrosoftPeeringConfig(ExpressRouteCircuitPeeringConfig microsoftPeeringConfig) { + this.inner().withMicrosoftPeeringConfig(microsoftPeeringConfig); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withName(String name) { + this.inner().withName(name); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withPeerASN(Long peerASN) { + this.inner().withPeerASN(peerASN); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withPeeringType(ExpressRoutePeeringType peeringType) { + this.inner().withPeeringType(peeringType); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withPrimaryAzurePort(String primaryAzurePort) { + this.inner().withPrimaryAzurePort(primaryAzurePort); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withPrimaryPeerAddressPrefix(String primaryPeerAddressPrefix) { + this.inner().withPrimaryPeerAddressPrefix(primaryPeerAddressPrefix); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withRouteFilter(RouteFilterInner routeFilter) { + this.inner().withRouteFilter(routeFilter); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withSecondaryAzurePort(String secondaryAzurePort) { + this.inner().withSecondaryAzurePort(secondaryAzurePort); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withSecondaryPeerAddressPrefix(String secondaryPeerAddressPrefix) { + this.inner().withSecondaryPeerAddressPrefix(secondaryPeerAddressPrefix); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withSharedKey(String sharedKey) { + this.inner().withSharedKey(sharedKey); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withState(ExpressRoutePeeringState state) { + this.inner().withState(state); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withStats(ExpressRouteCircuitStatsInner stats) { + this.inner().withStats(stats); + return this; + } + + @Override + public ExpressRouteCircuitPeeringImpl withVlanId(Integer vlanId) { + this.inner().withVlanId(vlanId); + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitPeeringInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitPeeringInner.java new file mode 100644 index 000000000000..9eb6931c6914 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitPeeringInner.java @@ -0,0 +1,538 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.ExpressRoutePeeringType; +import com.microsoft.azure.management.network.v2018_06_01.ExpressRoutePeeringState; +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCircuitPeeringConfig; +import com.microsoft.azure.management.network.v2018_06_01.Ipv6ExpressRouteCircuitPeeringConfig; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Peering in an ExpressRouteCircuit resource. + */ +@JsonFlatten +public class ExpressRouteCircuitPeeringInner extends SubResource { + /** + * The peering type. Possible values include: 'AzurePublicPeering', + * 'AzurePrivatePeering', 'MicrosoftPeering'. + */ + @JsonProperty(value = "properties.peeringType") + private ExpressRoutePeeringType peeringType; + + /** + * The peering state. Possible values include: 'Disabled', 'Enabled'. + */ + @JsonProperty(value = "properties.state") + private ExpressRoutePeeringState state; + + /** + * The Azure ASN. + */ + @JsonProperty(value = "properties.azureASN") + private Integer azureASN; + + /** + * The peer ASN. + */ + @JsonProperty(value = "properties.peerASN") + private Long peerASN; + + /** + * The primary address prefix. + */ + @JsonProperty(value = "properties.primaryPeerAddressPrefix") + private String primaryPeerAddressPrefix; + + /** + * The secondary address prefix. + */ + @JsonProperty(value = "properties.secondaryPeerAddressPrefix") + private String secondaryPeerAddressPrefix; + + /** + * The primary port. + */ + @JsonProperty(value = "properties.primaryAzurePort") + private String primaryAzurePort; + + /** + * The secondary port. + */ + @JsonProperty(value = "properties.secondaryAzurePort") + private String secondaryAzurePort; + + /** + * The shared key. + */ + @JsonProperty(value = "properties.sharedKey") + private String sharedKey; + + /** + * The VLAN ID. + */ + @JsonProperty(value = "properties.vlanId") + private Integer vlanId; + + /** + * The Microsoft peering configuration. + */ + @JsonProperty(value = "properties.microsoftPeeringConfig") + private ExpressRouteCircuitPeeringConfig microsoftPeeringConfig; + + /** + * Gets peering stats. + */ + @JsonProperty(value = "properties.stats") + private ExpressRouteCircuitStatsInner stats; + + /** + * Gets the provisioning state of the public IP resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * The GatewayManager Etag. + */ + @JsonProperty(value = "properties.gatewayManagerEtag") + private String gatewayManagerEtag; + + /** + * Gets whether the provider or the customer last modified the peering. + */ + @JsonProperty(value = "properties.lastModifiedBy") + private String lastModifiedBy; + + /** + * The reference of the RouteFilter resource. + */ + @JsonProperty(value = "properties.routeFilter") + private RouteFilterInner routeFilter; + + /** + * The IPv6 peering configuration. + */ + @JsonProperty(value = "properties.ipv6PeeringConfig") + private Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig; + + /** + * The list of circuit connections associated with Azure Private Peering + * for this circuit. + */ + @JsonProperty(value = "properties.connections") + private List connections; + + /** + * Gets name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get the peering type. Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering'. + * + * @return the peeringType value + */ + public ExpressRoutePeeringType peeringType() { + return this.peeringType; + } + + /** + * Set the peering type. Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering'. + * + * @param peeringType the peeringType value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withPeeringType(ExpressRoutePeeringType peeringType) { + this.peeringType = peeringType; + return this; + } + + /** + * Get the peering state. Possible values include: 'Disabled', 'Enabled'. + * + * @return the state value + */ + public ExpressRoutePeeringState state() { + return this.state; + } + + /** + * Set the peering state. Possible values include: 'Disabled', 'Enabled'. + * + * @param state the state value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withState(ExpressRoutePeeringState state) { + this.state = state; + return this; + } + + /** + * Get the Azure ASN. + * + * @return the azureASN value + */ + public Integer azureASN() { + return this.azureASN; + } + + /** + * Set the Azure ASN. + * + * @param azureASN the azureASN value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withAzureASN(Integer azureASN) { + this.azureASN = azureASN; + return this; + } + + /** + * Get the peer ASN. + * + * @return the peerASN value + */ + public Long peerASN() { + return this.peerASN; + } + + /** + * Set the peer ASN. + * + * @param peerASN the peerASN value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withPeerASN(Long peerASN) { + this.peerASN = peerASN; + return this; + } + + /** + * Get the primary address prefix. + * + * @return the primaryPeerAddressPrefix value + */ + public String primaryPeerAddressPrefix() { + return this.primaryPeerAddressPrefix; + } + + /** + * Set the primary address prefix. + * + * @param primaryPeerAddressPrefix the primaryPeerAddressPrefix value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withPrimaryPeerAddressPrefix(String primaryPeerAddressPrefix) { + this.primaryPeerAddressPrefix = primaryPeerAddressPrefix; + return this; + } + + /** + * Get the secondary address prefix. + * + * @return the secondaryPeerAddressPrefix value + */ + public String secondaryPeerAddressPrefix() { + return this.secondaryPeerAddressPrefix; + } + + /** + * Set the secondary address prefix. + * + * @param secondaryPeerAddressPrefix the secondaryPeerAddressPrefix value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withSecondaryPeerAddressPrefix(String secondaryPeerAddressPrefix) { + this.secondaryPeerAddressPrefix = secondaryPeerAddressPrefix; + return this; + } + + /** + * Get the primary port. + * + * @return the primaryAzurePort value + */ + public String primaryAzurePort() { + return this.primaryAzurePort; + } + + /** + * Set the primary port. + * + * @param primaryAzurePort the primaryAzurePort value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withPrimaryAzurePort(String primaryAzurePort) { + this.primaryAzurePort = primaryAzurePort; + return this; + } + + /** + * Get the secondary port. + * + * @return the secondaryAzurePort value + */ + public String secondaryAzurePort() { + return this.secondaryAzurePort; + } + + /** + * Set the secondary port. + * + * @param secondaryAzurePort the secondaryAzurePort value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withSecondaryAzurePort(String secondaryAzurePort) { + this.secondaryAzurePort = secondaryAzurePort; + return this; + } + + /** + * Get the shared key. + * + * @return the sharedKey value + */ + public String sharedKey() { + return this.sharedKey; + } + + /** + * Set the shared key. + * + * @param sharedKey the sharedKey value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withSharedKey(String sharedKey) { + this.sharedKey = sharedKey; + return this; + } + + /** + * Get the VLAN ID. + * + * @return the vlanId value + */ + public Integer vlanId() { + return this.vlanId; + } + + /** + * Set the VLAN ID. + * + * @param vlanId the vlanId value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withVlanId(Integer vlanId) { + this.vlanId = vlanId; + return this; + } + + /** + * Get the Microsoft peering configuration. + * + * @return the microsoftPeeringConfig value + */ + public ExpressRouteCircuitPeeringConfig microsoftPeeringConfig() { + return this.microsoftPeeringConfig; + } + + /** + * Set the Microsoft peering configuration. + * + * @param microsoftPeeringConfig the microsoftPeeringConfig value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withMicrosoftPeeringConfig(ExpressRouteCircuitPeeringConfig microsoftPeeringConfig) { + this.microsoftPeeringConfig = microsoftPeeringConfig; + return this; + } + + /** + * Get gets peering stats. + * + * @return the stats value + */ + public ExpressRouteCircuitStatsInner stats() { + return this.stats; + } + + /** + * Set gets peering stats. + * + * @param stats the stats value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withStats(ExpressRouteCircuitStatsInner stats) { + this.stats = stats; + return this; + } + + /** + * Get gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the GatewayManager Etag. + * + * @return the gatewayManagerEtag value + */ + public String gatewayManagerEtag() { + return this.gatewayManagerEtag; + } + + /** + * Set the GatewayManager Etag. + * + * @param gatewayManagerEtag the gatewayManagerEtag value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withGatewayManagerEtag(String gatewayManagerEtag) { + this.gatewayManagerEtag = gatewayManagerEtag; + return this; + } + + /** + * Get gets whether the provider or the customer last modified the peering. + * + * @return the lastModifiedBy value + */ + public String lastModifiedBy() { + return this.lastModifiedBy; + } + + /** + * Set gets whether the provider or the customer last modified the peering. + * + * @param lastModifiedBy the lastModifiedBy value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withLastModifiedBy(String lastModifiedBy) { + this.lastModifiedBy = lastModifiedBy; + return this; + } + + /** + * Get the reference of the RouteFilter resource. + * + * @return the routeFilter value + */ + public RouteFilterInner routeFilter() { + return this.routeFilter; + } + + /** + * Set the reference of the RouteFilter resource. + * + * @param routeFilter the routeFilter value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withRouteFilter(RouteFilterInner routeFilter) { + this.routeFilter = routeFilter; + return this; + } + + /** + * Get the IPv6 peering configuration. + * + * @return the ipv6PeeringConfig value + */ + public Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig() { + return this.ipv6PeeringConfig; + } + + /** + * Set the IPv6 peering configuration. + * + * @param ipv6PeeringConfig the ipv6PeeringConfig value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withIpv6PeeringConfig(Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig) { + this.ipv6PeeringConfig = ipv6PeeringConfig; + return this; + } + + /** + * Get the list of circuit connections associated with Azure Private Peering for this circuit. + * + * @return the connections value + */ + public List connections() { + return this.connections; + } + + /** + * Set the list of circuit connections associated with Azure Private Peering for this circuit. + * + * @param connections the connections value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withConnections(List connections) { + this.connections = connections; + return this; + } + + /** + * Get gets name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set gets name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the ExpressRouteCircuitPeeringInner object itself. + */ + public ExpressRouteCircuitPeeringInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitPeeringsImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitPeeringsImpl.java new file mode 100644 index 000000000000..c5212143dd66 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitPeeringsImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCircuitPeerings; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCircuitPeering; + +class ExpressRouteCircuitPeeringsImpl extends WrapperImpl implements ExpressRouteCircuitPeerings { + private final NetworkManager manager; + + ExpressRouteCircuitPeeringsImpl(NetworkManager manager) { + super(manager.inner().expressRouteCircuitPeerings()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public ExpressRouteCircuitPeeringImpl define(String name) { + return wrapModel(name); + } + + private ExpressRouteCircuitPeeringImpl wrapModel(ExpressRouteCircuitPeeringInner inner) { + return new ExpressRouteCircuitPeeringImpl(inner, manager()); + } + + private ExpressRouteCircuitPeeringImpl wrapModel(String name) { + return new ExpressRouteCircuitPeeringImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String circuitName) { + ExpressRouteCircuitPeeringsInner client = this.inner(); + return client.listAsync(resourceGroupName, circuitName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ExpressRouteCircuitPeering call(ExpressRouteCircuitPeeringInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String circuitName, String peeringName) { + ExpressRouteCircuitPeeringsInner client = this.inner(); + return client.getAsync(resourceGroupName, circuitName, peeringName) + .map(new Func1() { + @Override + public ExpressRouteCircuitPeering call(ExpressRouteCircuitPeeringInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String circuitName, String peeringName) { + ExpressRouteCircuitPeeringsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, circuitName, peeringName).toCompletable(); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitPeeringsInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitPeeringsInner.java new file mode 100644 index 000000000000..49d6bcd643a4 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitPeeringsInner.java @@ -0,0 +1,764 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.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 ExpressRouteCircuitPeerings. + */ +public class ExpressRouteCircuitPeeringsInner { + /** The Retrofit service to perform REST calls. */ + private ExpressRouteCircuitPeeringsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRouteCircuitPeeringsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ExpressRouteCircuitPeeringsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(ExpressRouteCircuitPeeringsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ExpressRouteCircuitPeerings to be + * used by Retrofit to perform actually REST calls. + */ + interface ExpressRouteCircuitPeeringsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCircuitPeerings delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @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.network.v2018_06_01.ExpressRouteCircuitPeerings beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @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.network.v2018_06_01.ExpressRouteCircuitPeerings get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @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.network.v2018_06_01.ExpressRouteCircuitPeerings createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("subscriptionId") String subscriptionId, @Body ExpressRouteCircuitPeeringInner peeringParameters, @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.network.v2018_06_01.ExpressRouteCircuitPeerings beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("subscriptionId") String subscriptionId, @Body ExpressRouteCircuitPeeringInner peeringParameters, @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.network.v2018_06_01.ExpressRouteCircuitPeerings list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @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.network.v2018_06_01.ExpressRouteCircuitPeerings listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified peering from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String circuitName, String peeringName) { + deleteWithServiceResponseAsync(resourceGroupName, circuitName, peeringName).toBlocking().last().body(); + } + + /** + * Deletes the specified peering from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @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 circuitName, String peeringName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, circuitName, peeringName), serviceCallback); + } + + /** + * Deletes the specified peering from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String circuitName, String peeringName) { + return deleteWithServiceResponseAsync(resourceGroupName, circuitName, peeringName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified peering from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + Observable> observable = service.delete(resourceGroupName, circuitName, peeringName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified peering from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String circuitName, String peeringName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, circuitName, peeringName).toBlocking().single().body(); + } + + /** + * Deletes the specified peering from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String circuitName, String peeringName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, circuitName, peeringName), serviceCallback); + } + + /** + * Deletes the specified peering from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String circuitName, String peeringName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, circuitName, peeringName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified peering from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.beginDelete(resourceGroupName, circuitName, peeringName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified peering for the express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitPeeringInner object if successful. + */ + public ExpressRouteCircuitPeeringInner get(String resourceGroupName, String circuitName, String peeringName) { + return getWithServiceResponseAsync(resourceGroupName, circuitName, peeringName).toBlocking().single().body(); + } + + /** + * Gets the specified peering for the express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @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 circuitName, String peeringName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, circuitName, peeringName), serviceCallback); + } + + /** + * Gets the specified peering for the express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitPeeringInner object + */ + public Observable getAsync(String resourceGroupName, String circuitName, String peeringName) { + return getWithServiceResponseAsync(resourceGroupName, circuitName, peeringName).map(new Func1, ExpressRouteCircuitPeeringInner>() { + @Override + public ExpressRouteCircuitPeeringInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified peering for the express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitPeeringInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.get(resourceGroupName, circuitName, peeringName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a peering in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update express route circuit peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitPeeringInner object if successful. + */ + public ExpressRouteCircuitPeeringInner createOrUpdate(String resourceGroupName, String circuitName, String peeringName, ExpressRouteCircuitPeeringInner peeringParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, peeringParameters).toBlocking().last().body(); + } + + /** + * Creates or updates a peering in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update express route circuit peering operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String circuitName, String peeringName, ExpressRouteCircuitPeeringInner peeringParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, peeringParameters), serviceCallback); + } + + /** + * Creates or updates a peering in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update express route circuit peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String circuitName, String peeringName, ExpressRouteCircuitPeeringInner peeringParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, peeringParameters).map(new Func1, ExpressRouteCircuitPeeringInner>() { + @Override + public ExpressRouteCircuitPeeringInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a peering in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update express route circuit peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, ExpressRouteCircuitPeeringInner peeringParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName 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 (peeringParameters == null) { + throw new IllegalArgumentException("Parameter peeringParameters is required and cannot be null."); + } + Validator.validate(peeringParameters); + final String apiVersion = "2018-06-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, circuitName, peeringName, this.client.subscriptionId(), peeringParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a peering in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update express route circuit peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitPeeringInner object if successful. + */ + public ExpressRouteCircuitPeeringInner beginCreateOrUpdate(String resourceGroupName, String circuitName, String peeringName, ExpressRouteCircuitPeeringInner peeringParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, peeringParameters).toBlocking().single().body(); + } + + /** + * Creates or updates a peering in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update express route circuit peering operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String circuitName, String peeringName, ExpressRouteCircuitPeeringInner peeringParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, peeringParameters), serviceCallback); + } + + /** + * Creates or updates a peering in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update express route circuit peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitPeeringInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String circuitName, String peeringName, ExpressRouteCircuitPeeringInner peeringParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, peeringParameters).map(new Func1, ExpressRouteCircuitPeeringInner>() { + @Override + public ExpressRouteCircuitPeeringInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a peering in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update express route circuit peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitPeeringInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, ExpressRouteCircuitPeeringInner peeringParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName 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 (peeringParameters == null) { + throw new IllegalArgumentException("Parameter peeringParameters is required and cannot be null."); + } + Validator.validate(peeringParameters); + final String apiVersion = "2018-06-01"; + return service.beginCreateOrUpdate(resourceGroupName, circuitName, peeringName, this.client.subscriptionId(), peeringParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all peerings in a specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteCircuitPeeringInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String circuitName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, circuitName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all peerings in a specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String circuitName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, circuitName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all peerings in a specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCircuitPeeringInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String circuitName) { + return listWithServiceResponseAsync(resourceGroupName, circuitName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all peerings in a specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCircuitPeeringInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String circuitName) { + return listSinglePageAsync(resourceGroupName, circuitName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all peerings in a specified express route circuit. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteCircuitPeeringInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String circuitName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.list(resourceGroupName, circuitName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all peerings in a specified express route circuit. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteCircuitPeeringInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all peerings in a specified express route circuit. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all peerings in a specified express route circuit. + * + * @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<ExpressRouteCircuitPeeringInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all peerings in a specified express route circuit. + * + * @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<ExpressRouteCircuitPeeringInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all peerings in a specified express route circuit. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteCircuitPeeringInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitStatsImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitStatsImpl.java new file mode 100644 index 000000000000..6d399851b16a --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitStatsImpl.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCircuitStats; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class ExpressRouteCircuitStatsImpl extends WrapperImpl implements ExpressRouteCircuitStats { + private final NetworkManager manager; + ExpressRouteCircuitStatsImpl(ExpressRouteCircuitStatsInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Long primarybytesIn() { + return this.inner().primarybytesIn(); + } + + @Override + public Long primarybytesOut() { + return this.inner().primarybytesOut(); + } + + @Override + public Long secondarybytesIn() { + return this.inner().secondarybytesIn(); + } + + @Override + public Long secondarybytesOut() { + return this.inner().secondarybytesOut(); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitStatsInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitStatsInner.java new file mode 100644 index 000000000000..bfe16644550e --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitStatsInner.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.network.v2018_06_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains stats associated with the peering. + */ +public class ExpressRouteCircuitStatsInner { + /** + * Gets BytesIn of the peering. + */ + @JsonProperty(value = "primarybytesIn") + private Long primarybytesIn; + + /** + * Gets BytesOut of the peering. + */ + @JsonProperty(value = "primarybytesOut") + private Long primarybytesOut; + + /** + * Gets BytesIn of the peering. + */ + @JsonProperty(value = "secondarybytesIn") + private Long secondarybytesIn; + + /** + * Gets BytesOut of the peering. + */ + @JsonProperty(value = "secondarybytesOut") + private Long secondarybytesOut; + + /** + * Get gets BytesIn of the peering. + * + * @return the primarybytesIn value + */ + public Long primarybytesIn() { + return this.primarybytesIn; + } + + /** + * Set gets BytesIn of the peering. + * + * @param primarybytesIn the primarybytesIn value to set + * @return the ExpressRouteCircuitStatsInner object itself. + */ + public ExpressRouteCircuitStatsInner withPrimarybytesIn(Long primarybytesIn) { + this.primarybytesIn = primarybytesIn; + return this; + } + + /** + * Get gets BytesOut of the peering. + * + * @return the primarybytesOut value + */ + public Long primarybytesOut() { + return this.primarybytesOut; + } + + /** + * Set gets BytesOut of the peering. + * + * @param primarybytesOut the primarybytesOut value to set + * @return the ExpressRouteCircuitStatsInner object itself. + */ + public ExpressRouteCircuitStatsInner withPrimarybytesOut(Long primarybytesOut) { + this.primarybytesOut = primarybytesOut; + return this; + } + + /** + * Get gets BytesIn of the peering. + * + * @return the secondarybytesIn value + */ + public Long secondarybytesIn() { + return this.secondarybytesIn; + } + + /** + * Set gets BytesIn of the peering. + * + * @param secondarybytesIn the secondarybytesIn value to set + * @return the ExpressRouteCircuitStatsInner object itself. + */ + public ExpressRouteCircuitStatsInner withSecondarybytesIn(Long secondarybytesIn) { + this.secondarybytesIn = secondarybytesIn; + return this; + } + + /** + * Get gets BytesOut of the peering. + * + * @return the secondarybytesOut value + */ + public Long secondarybytesOut() { + return this.secondarybytesOut; + } + + /** + * Set gets BytesOut of the peering. + * + * @param secondarybytesOut the secondarybytesOut value to set + * @return the ExpressRouteCircuitStatsInner object itself. + */ + public ExpressRouteCircuitStatsInner withSecondarybytesOut(Long secondarybytesOut) { + this.secondarybytesOut = secondarybytesOut; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitsArpTableListResultImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitsArpTableListResultImpl.java new file mode 100644 index 000000000000..3adec1f84cd5 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitsArpTableListResultImpl.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.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCircuitsArpTableListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCircuitArpTable; + +class ExpressRouteCircuitsArpTableListResultImpl extends WrapperImpl implements ExpressRouteCircuitsArpTableListResult { + private final NetworkManager manager; + ExpressRouteCircuitsArpTableListResultImpl(ExpressRouteCircuitsArpTableListResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public String nextLink() { + return this.inner().nextLink(); + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitsArpTableListResultInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitsArpTableListResultInner.java new file mode 100644 index 000000000000..c175d9617cce --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitsArpTableListResultInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCircuitArpTable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Response for ListArpTable associated with the Express Route Circuits API. + */ +public class ExpressRouteCircuitsArpTableListResultInner { + /** + * Gets list of the ARP table. + */ + @JsonProperty(value = "value") + private List value; + + /** + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get gets list of the ARP table. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set gets list of the ARP table. + * + * @param value the value value to set + * @return the ExpressRouteCircuitsArpTableListResultInner object itself. + */ + public ExpressRouteCircuitsArpTableListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the URL to get the next set of results. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the URL to get the next set of results. + * + * @param nextLink the nextLink value to set + * @return the ExpressRouteCircuitsArpTableListResultInner object itself. + */ + public ExpressRouteCircuitsArpTableListResultInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitsImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitsImpl.java new file mode 100644 index 000000000000..572cdc20fdba --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitsImpl.java @@ -0,0 +1,202 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCircuits; +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCircuit; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCircuitsArpTableListResult; +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCircuitsRoutesTableListResult; +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCircuitsRoutesTableSummaryListResult; +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCircuitStats; + +class ExpressRouteCircuitsImpl extends GroupableResourcesCoreImpl implements ExpressRouteCircuits { + protected ExpressRouteCircuitsImpl(NetworkManager manager) { + super(manager.inner().expressRouteCircuits(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + ExpressRouteCircuitsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ExpressRouteCircuitsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + ExpressRouteCircuitsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + ExpressRouteCircuitsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ExpressRouteCircuit call(ExpressRouteCircuitInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + ExpressRouteCircuitsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + ExpressRouteCircuitsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ExpressRouteCircuit call(ExpressRouteCircuitInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public ExpressRouteCircuitImpl define(String name) { + return wrapModel(name); + } + + @Override + protected ExpressRouteCircuitImpl wrapModel(ExpressRouteCircuitInner inner) { + return new ExpressRouteCircuitImpl(inner.name(), inner, manager()); + } + + @Override + protected ExpressRouteCircuitImpl wrapModel(String name) { + return new ExpressRouteCircuitImpl(name, new ExpressRouteCircuitInner(), this.manager()); + } + + @Override + public Observable listArpTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + ExpressRouteCircuitsInner client = this.inner(); + return client.listArpTableAsync(resourceGroupName, circuitName, peeringName, devicePath) + .map(new Func1() { + @Override + public ExpressRouteCircuitsArpTableListResult call(ExpressRouteCircuitsArpTableListResultInner inner) { + return new ExpressRouteCircuitsArpTableListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listRoutesTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + ExpressRouteCircuitsInner client = this.inner(); + return client.listRoutesTableAsync(resourceGroupName, circuitName, peeringName, devicePath) + .map(new Func1() { + @Override + public ExpressRouteCircuitsRoutesTableListResult call(ExpressRouteCircuitsRoutesTableListResultInner inner) { + return new ExpressRouteCircuitsRoutesTableListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listRoutesTableSummaryAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + ExpressRouteCircuitsInner client = this.inner(); + return client.listRoutesTableSummaryAsync(resourceGroupName, circuitName, peeringName, devicePath) + .map(new Func1() { + @Override + public ExpressRouteCircuitsRoutesTableSummaryListResult call(ExpressRouteCircuitsRoutesTableSummaryListResultInner inner) { + return new ExpressRouteCircuitsRoutesTableSummaryListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable getStatsAsync(String resourceGroupName, String circuitName) { + ExpressRouteCircuitsInner client = this.inner(); + return client.getStatsAsync(resourceGroupName, circuitName) + .map(new Func1() { + @Override + public ExpressRouteCircuitStats call(ExpressRouteCircuitStatsInner inner) { + return new ExpressRouteCircuitStatsImpl(inner, manager()); + } + }); + } + + @Override + public Observable getPeeringStatsAsync(String resourceGroupName, String circuitName, String peeringName) { + ExpressRouteCircuitsInner client = this.inner(); + return client.getPeeringStatsAsync(resourceGroupName, circuitName, peeringName) + .map(new Func1() { + @Override + public ExpressRouteCircuitStats call(ExpressRouteCircuitStatsInner inner) { + return new ExpressRouteCircuitStatsImpl(inner, manager()); + } + }); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitsInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitsInner.java new file mode 100644 index 000000000000..f98de4297ec0 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitsInner.java @@ -0,0 +1,2021 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_06_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ExpressRouteCircuits. + */ +public class ExpressRouteCircuitsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private ExpressRouteCircuitsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRouteCircuitsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ExpressRouteCircuitsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(ExpressRouteCircuitsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ExpressRouteCircuits to be + * used by Retrofit to perform actually REST calls. + */ + interface ExpressRouteCircuitsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCircuits delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @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.network.v2018_06_01.ExpressRouteCircuits beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @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.network.v2018_06_01.ExpressRouteCircuits getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @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.network.v2018_06_01.ExpressRouteCircuits createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("subscriptionId") String subscriptionId, @Body ExpressRouteCircuitInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCircuits beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("subscriptionId") String subscriptionId, @Body ExpressRouteCircuitInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCircuits updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCircuits beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}") + Observable> beginUpdateTags(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCircuits listArpTable" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/arpTables/{devicePath}") + Observable> listArpTable(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("devicePath") String devicePath, @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.network.v2018_06_01.ExpressRouteCircuits beginListArpTable" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/arpTables/{devicePath}") + Observable> beginListArpTable(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("devicePath") String devicePath, @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.network.v2018_06_01.ExpressRouteCircuits listRoutesTable" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTables/{devicePath}") + Observable> listRoutesTable(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("devicePath") String devicePath, @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.network.v2018_06_01.ExpressRouteCircuits beginListRoutesTable" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTables/{devicePath}") + Observable> beginListRoutesTable(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("devicePath") String devicePath, @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.network.v2018_06_01.ExpressRouteCircuits listRoutesTableSummary" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTablesSummary/{devicePath}") + Observable> listRoutesTableSummary(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("devicePath") String devicePath, @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.network.v2018_06_01.ExpressRouteCircuits beginListRoutesTableSummary" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTablesSummary/{devicePath}") + Observable> beginListRoutesTableSummary(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("devicePath") String devicePath, @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.network.v2018_06_01.ExpressRouteCircuits getStats" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/stats") + Observable> getStats(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @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.network.v2018_06_01.ExpressRouteCircuits getPeeringStats" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/stats") + Observable> getPeeringStats(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @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.network.v2018_06_01.ExpressRouteCircuits listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @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.network.v2018_06_01.ExpressRouteCircuits list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCircuits") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCircuits listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCircuits listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String circuitName) { + deleteWithServiceResponseAsync(resourceGroupName, circuitName).toBlocking().last().body(); + } + + /** + * Deletes the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @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 circuitName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, circuitName), serviceCallback); + } + + /** + * Deletes the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String circuitName) { + return deleteWithServiceResponseAsync(resourceGroupName, circuitName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String circuitName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + Observable> observable = service.delete(resourceGroupName, circuitName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String circuitName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, circuitName).toBlocking().single().body(); + } + + /** + * Deletes the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String circuitName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, circuitName), serviceCallback); + } + + /** + * Deletes the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String circuitName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, circuitName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String circuitName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.beginDelete(resourceGroupName, circuitName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets information about the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitInner object if successful. + */ + public ExpressRouteCircuitInner getByResourceGroup(String resourceGroupName, String circuitName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, circuitName).toBlocking().single().body(); + } + + /** + * Gets information about the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of express route circuit. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String circuitName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, circuitName), serviceCallback); + } + + /** + * Gets information about the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String circuitName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, circuitName).map(new Func1, ExpressRouteCircuitInner>() { + @Override + public ExpressRouteCircuitInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets information about the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String circuitName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.getByResourceGroup(resourceGroupName, circuitName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param parameters Parameters supplied to the create or update express route circuit operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitInner object if successful. + */ + public ExpressRouteCircuitInner createOrUpdate(String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param parameters Parameters supplied to the create or update express route circuit operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, parameters), serviceCallback); + } + + /** + * Creates or updates an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param parameters Parameters supplied to the create or update express route circuit operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, parameters).map(new Func1, ExpressRouteCircuitInner>() { + @Override + public ExpressRouteCircuitInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param parameters Parameters supplied to the create or update express route circuit operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, circuitName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param parameters Parameters supplied to the create or update express route circuit operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitInner object if successful. + */ + public ExpressRouteCircuitInner beginCreateOrUpdate(String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param parameters Parameters supplied to the create or update express route circuit operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, parameters), serviceCallback); + } + + /** + * Creates or updates an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param parameters Parameters supplied to the create or update express route circuit operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, parameters).map(new Func1, ExpressRouteCircuitInner>() { + @Override + public ExpressRouteCircuitInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param parameters Parameters supplied to the create or update express route circuit operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + return service.beginCreateOrUpdate(resourceGroupName, circuitName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitInner object if successful. + */ + public ExpressRouteCircuitInner updateTags(String resourceGroupName, String circuitName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, circuitName).toBlocking().last().body(); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @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 updateTagsAsync(String resourceGroupName, String circuitName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, circuitName), serviceCallback); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String circuitName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, circuitName).map(new Func1, ExpressRouteCircuitInner>() { + @Override + public ExpressRouteCircuitInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String circuitName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + Observable> observable = service.updateTags(resourceGroupName, circuitName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitInner object if successful. + */ + public ExpressRouteCircuitInner updateTags(String resourceGroupName, String circuitName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, circuitName, tags).toBlocking().last().body(); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String circuitName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, circuitName, tags), serviceCallback); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String circuitName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, circuitName, tags).map(new Func1, ExpressRouteCircuitInner>() { + @Override + public ExpressRouteCircuitInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String circuitName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-06-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + Observable> observable = service.updateTags(resourceGroupName, circuitName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitInner object if successful. + */ + public ExpressRouteCircuitInner beginUpdateTags(String resourceGroupName, String circuitName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, circuitName).toBlocking().single().body(); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @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 beginUpdateTagsAsync(String resourceGroupName, String circuitName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, circuitName), serviceCallback); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String circuitName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, circuitName).map(new Func1, ExpressRouteCircuitInner>() { + @Override + public ExpressRouteCircuitInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String circuitName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.beginUpdateTags(resourceGroupName, circuitName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitInner object if successful. + */ + public ExpressRouteCircuitInner beginUpdateTags(String resourceGroupName, String circuitName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, circuitName, tags).toBlocking().single().body(); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String circuitName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, circuitName, tags), serviceCallback); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String circuitName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, circuitName, tags).map(new Func1, ExpressRouteCircuitInner>() { + @Override + public ExpressRouteCircuitInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String circuitName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-06-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.beginUpdateTags(resourceGroupName, circuitName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the currently advertised ARP table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitsArpTableListResultInner object if successful. + */ + public ExpressRouteCircuitsArpTableListResultInner listArpTable(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return listArpTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).toBlocking().last().body(); + } + + /** + * Gets the currently advertised ARP table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @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 listArpTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listArpTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath), serviceCallback); + } + + /** + * Gets the currently advertised ARP table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable listArpTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return listArpTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).map(new Func1, ExpressRouteCircuitsArpTableListResultInner>() { + @Override + public ExpressRouteCircuitsArpTableListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the currently advertised ARP table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> listArpTableWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (devicePath == null) { + throw new IllegalArgumentException("Parameter devicePath is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + Observable> observable = service.listArpTable(resourceGroupName, circuitName, peeringName, devicePath, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Gets the currently advertised ARP table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitsArpTableListResultInner object if successful. + */ + public ExpressRouteCircuitsArpTableListResultInner beginListArpTable(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return beginListArpTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).toBlocking().single().body(); + } + + /** + * Gets the currently advertised ARP table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @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 beginListArpTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginListArpTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath), serviceCallback); + } + + /** + * Gets the currently advertised ARP table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitsArpTableListResultInner object + */ + public Observable beginListArpTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return beginListArpTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).map(new Func1, ExpressRouteCircuitsArpTableListResultInner>() { + @Override + public ExpressRouteCircuitsArpTableListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the currently advertised ARP table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitsArpTableListResultInner object + */ + public Observable> beginListArpTableWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (devicePath == null) { + throw new IllegalArgumentException("Parameter devicePath is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.beginListArpTable(resourceGroupName, circuitName, peeringName, devicePath, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginListArpTableDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginListArpTableDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the currently advertised routes table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitsRoutesTableListResultInner object if successful. + */ + public ExpressRouteCircuitsRoutesTableListResultInner listRoutesTable(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return listRoutesTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).toBlocking().last().body(); + } + + /** + * Gets the currently advertised routes table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @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 listRoutesTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listRoutesTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath), serviceCallback); + } + + /** + * Gets the currently advertised routes table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable listRoutesTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return listRoutesTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).map(new Func1, ExpressRouteCircuitsRoutesTableListResultInner>() { + @Override + public ExpressRouteCircuitsRoutesTableListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the currently advertised routes table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> listRoutesTableWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (devicePath == null) { + throw new IllegalArgumentException("Parameter devicePath is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + Observable> observable = service.listRoutesTable(resourceGroupName, circuitName, peeringName, devicePath, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Gets the currently advertised routes table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitsRoutesTableListResultInner object if successful. + */ + public ExpressRouteCircuitsRoutesTableListResultInner beginListRoutesTable(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return beginListRoutesTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).toBlocking().single().body(); + } + + /** + * Gets the currently advertised routes table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @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 beginListRoutesTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginListRoutesTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath), serviceCallback); + } + + /** + * Gets the currently advertised routes table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitsRoutesTableListResultInner object + */ + public Observable beginListRoutesTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return beginListRoutesTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).map(new Func1, ExpressRouteCircuitsRoutesTableListResultInner>() { + @Override + public ExpressRouteCircuitsRoutesTableListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the currently advertised routes table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitsRoutesTableListResultInner object + */ + public Observable> beginListRoutesTableWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (devicePath == null) { + throw new IllegalArgumentException("Parameter devicePath is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.beginListRoutesTable(resourceGroupName, circuitName, peeringName, devicePath, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginListRoutesTableDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginListRoutesTableDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitsRoutesTableSummaryListResultInner object if successful. + */ + public ExpressRouteCircuitsRoutesTableSummaryListResultInner listRoutesTableSummary(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return listRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).toBlocking().last().body(); + } + + /** + * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @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 listRoutesTableSummaryAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath), serviceCallback); + } + + /** + * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable listRoutesTableSummaryAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return listRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).map(new Func1, ExpressRouteCircuitsRoutesTableSummaryListResultInner>() { + @Override + public ExpressRouteCircuitsRoutesTableSummaryListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> listRoutesTableSummaryWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (devicePath == null) { + throw new IllegalArgumentException("Parameter devicePath is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + Observable> observable = service.listRoutesTableSummary(resourceGroupName, circuitName, peeringName, devicePath, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitsRoutesTableSummaryListResultInner object if successful. + */ + public ExpressRouteCircuitsRoutesTableSummaryListResultInner beginListRoutesTableSummary(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return beginListRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).toBlocking().single().body(); + } + + /** + * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @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 beginListRoutesTableSummaryAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginListRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath), serviceCallback); + } + + /** + * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitsRoutesTableSummaryListResultInner object + */ + public Observable beginListRoutesTableSummaryAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return beginListRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).map(new Func1, ExpressRouteCircuitsRoutesTableSummaryListResultInner>() { + @Override + public ExpressRouteCircuitsRoutesTableSummaryListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitsRoutesTableSummaryListResultInner object + */ + public Observable> beginListRoutesTableSummaryWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (devicePath == null) { + throw new IllegalArgumentException("Parameter devicePath is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.beginListRoutesTableSummary(resourceGroupName, circuitName, peeringName, devicePath, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginListRoutesTableSummaryDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginListRoutesTableSummaryDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the stats from an express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitStatsInner object if successful. + */ + public ExpressRouteCircuitStatsInner getStats(String resourceGroupName, String circuitName) { + return getStatsWithServiceResponseAsync(resourceGroupName, circuitName).toBlocking().single().body(); + } + + /** + * Gets all the stats from an express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getStatsAsync(String resourceGroupName, String circuitName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getStatsWithServiceResponseAsync(resourceGroupName, circuitName), serviceCallback); + } + + /** + * Gets all the stats from an express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitStatsInner object + */ + public Observable getStatsAsync(String resourceGroupName, String circuitName) { + return getStatsWithServiceResponseAsync(resourceGroupName, circuitName).map(new Func1, ExpressRouteCircuitStatsInner>() { + @Override + public ExpressRouteCircuitStatsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets all the stats from an express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitStatsInner object + */ + public Observable> getStatsWithServiceResponseAsync(String resourceGroupName, String circuitName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.getStats(resourceGroupName, circuitName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getStatsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getStatsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all stats from an express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitStatsInner object if successful. + */ + public ExpressRouteCircuitStatsInner getPeeringStats(String resourceGroupName, String circuitName, String peeringName) { + return getPeeringStatsWithServiceResponseAsync(resourceGroupName, circuitName, peeringName).toBlocking().single().body(); + } + + /** + * Gets all stats from an express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @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 getPeeringStatsAsync(String resourceGroupName, String circuitName, String peeringName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getPeeringStatsWithServiceResponseAsync(resourceGroupName, circuitName, peeringName), serviceCallback); + } + + /** + * Gets all stats from an express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitStatsInner object + */ + public Observable getPeeringStatsAsync(String resourceGroupName, String circuitName, String peeringName) { + return getPeeringStatsWithServiceResponseAsync(resourceGroupName, circuitName, peeringName).map(new Func1, ExpressRouteCircuitStatsInner>() { + @Override + public ExpressRouteCircuitStatsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets all stats from an express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitStatsInner object + */ + public Observable> getPeeringStatsWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (circuitName == null) { + throw new IllegalArgumentException("Parameter circuitName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.getPeeringStats(resourceGroupName, circuitName, peeringName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getPeeringStatsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getPeeringStatsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the express route circuits in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteCircuitInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the express route circuits in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the express route circuits in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCircuitInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the express route circuits in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCircuitInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the express route circuits in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteCircuitInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the express route circuits in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteCircuitInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the express route circuits in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the express route circuits in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCircuitInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the express route circuits in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCircuitInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the express route circuits in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteCircuitInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the express route circuits in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteCircuitInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the express route circuits in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the express route circuits in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCircuitInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the express route circuits in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCircuitInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the express route circuits in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteCircuitInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the express route circuits in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteCircuitInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the express route circuits in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the express route circuits in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCircuitInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the express route circuits in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCircuitInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the express route circuits in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteCircuitInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitsRoutesTableListResultImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitsRoutesTableListResultImpl.java new file mode 100644 index 000000000000..20a58d229b62 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitsRoutesTableListResultImpl.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.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCircuitsRoutesTableListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCircuitRoutesTable; + +class ExpressRouteCircuitsRoutesTableListResultImpl extends WrapperImpl implements ExpressRouteCircuitsRoutesTableListResult { + private final NetworkManager manager; + ExpressRouteCircuitsRoutesTableListResultImpl(ExpressRouteCircuitsRoutesTableListResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public String nextLink() { + return this.inner().nextLink(); + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitsRoutesTableListResultInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitsRoutesTableListResultInner.java new file mode 100644 index 000000000000..ebbd51132ae7 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitsRoutesTableListResultInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCircuitRoutesTable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Response for ListRoutesTable associated with the Express Route Circuits API. + */ +public class ExpressRouteCircuitsRoutesTableListResultInner { + /** + * The list of routes table. + */ + @JsonProperty(value = "value") + private List value; + + /** + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the list of routes table. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the list of routes table. + * + * @param value the value value to set + * @return the ExpressRouteCircuitsRoutesTableListResultInner object itself. + */ + public ExpressRouteCircuitsRoutesTableListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the URL to get the next set of results. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the URL to get the next set of results. + * + * @param nextLink the nextLink value to set + * @return the ExpressRouteCircuitsRoutesTableListResultInner object itself. + */ + public ExpressRouteCircuitsRoutesTableListResultInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitsRoutesTableSummaryListResultImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitsRoutesTableSummaryListResultImpl.java new file mode 100644 index 000000000000..1155f08637bf --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitsRoutesTableSummaryListResultImpl.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.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCircuitsRoutesTableSummaryListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCircuitRoutesTableSummary; + +class ExpressRouteCircuitsRoutesTableSummaryListResultImpl extends WrapperImpl implements ExpressRouteCircuitsRoutesTableSummaryListResult { + private final NetworkManager manager; + ExpressRouteCircuitsRoutesTableSummaryListResultImpl(ExpressRouteCircuitsRoutesTableSummaryListResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public String nextLink() { + return this.inner().nextLink(); + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitsRoutesTableSummaryListResultInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitsRoutesTableSummaryListResultInner.java new file mode 100644 index 000000000000..0139fd990ec9 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitsRoutesTableSummaryListResultInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCircuitRoutesTableSummary; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Response for ListRoutesTable associated with the Express Route Circuits API. + */ +public class ExpressRouteCircuitsRoutesTableSummaryListResultInner { + /** + * A list of the routes table. + */ + @JsonProperty(value = "value") + private List value; + + /** + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get a list of the routes table. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set a list of the routes table. + * + * @param value the value value to set + * @return the ExpressRouteCircuitsRoutesTableSummaryListResultInner object itself. + */ + public ExpressRouteCircuitsRoutesTableSummaryListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the URL to get the next set of results. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the URL to get the next set of results. + * + * @param nextLink the nextLink value to set + * @return the ExpressRouteCircuitsRoutesTableSummaryListResultInner object itself. + */ + public ExpressRouteCircuitsRoutesTableSummaryListResultInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCrossConnectionImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCrossConnectionImpl.java new file mode 100644 index 000000000000..32a35554679e --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCrossConnectionImpl.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCrossConnection; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCircuitReference; +import com.microsoft.azure.management.network.v2018_06_01.ServiceProviderProvisioningState; +import java.util.List; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCrossConnectionPeering; + +class ExpressRouteCrossConnectionImpl extends GroupableResourceCoreImpl implements ExpressRouteCrossConnection, ExpressRouteCrossConnection.Definition, ExpressRouteCrossConnection.Update { + ExpressRouteCrossConnectionImpl(String name, ExpressRouteCrossConnectionInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + ExpressRouteCrossConnectionsInner client = this.manager().inner().expressRouteCrossConnections(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ExpressRouteCrossConnectionsInner client = this.manager().inner().expressRouteCrossConnections(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ExpressRouteCrossConnectionsInner client = this.manager().inner().expressRouteCrossConnections(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public Integer bandwidthInMbps() { + return this.inner().bandwidthInMbps(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public ExpressRouteCircuitReference expressRouteCircuit() { + return this.inner().expressRouteCircuit(); + } + + @Override + public String peeringLocation() { + return this.inner().peeringLocation(); + } + + @Override + public List peerings() { + List lst = new ArrayList(); + if (this.inner().peerings() != null) { + for (ExpressRouteCrossConnectionPeeringInner inner : this.inner().peerings()) { + lst.add( new ExpressRouteCrossConnectionPeeringImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String primaryAzurePort() { + return this.inner().primaryAzurePort(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String secondaryAzurePort() { + return this.inner().secondaryAzurePort(); + } + + @Override + public String serviceProviderNotes() { + return this.inner().serviceProviderNotes(); + } + + @Override + public ServiceProviderProvisioningState serviceProviderProvisioningState() { + return this.inner().serviceProviderProvisioningState(); + } + + @Override + public Integer sTag() { + return this.inner().sTag(); + } + + @Override + public ExpressRouteCrossConnectionImpl withBandwidthInMbps(Integer bandwidthInMbps) { + this.inner().withBandwidthInMbps(bandwidthInMbps); + return this; + } + + @Override + public ExpressRouteCrossConnectionImpl withExpressRouteCircuit(ExpressRouteCircuitReference expressRouteCircuit) { + this.inner().withExpressRouteCircuit(expressRouteCircuit); + return this; + } + + @Override + public ExpressRouteCrossConnectionImpl withPeeringLocation(String peeringLocation) { + this.inner().withPeeringLocation(peeringLocation); + return this; + } + + @Override + public ExpressRouteCrossConnectionImpl withPeerings(List peerings) { + this.inner().withPeerings(peerings); + return this; + } + + @Override + public ExpressRouteCrossConnectionImpl withServiceProviderNotes(String serviceProviderNotes) { + this.inner().withServiceProviderNotes(serviceProviderNotes); + return this; + } + + @Override + public ExpressRouteCrossConnectionImpl withServiceProviderProvisioningState(ServiceProviderProvisioningState serviceProviderProvisioningState) { + this.inner().withServiceProviderProvisioningState(serviceProviderProvisioningState); + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCrossConnectionInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCrossConnectionInner.java new file mode 100644 index 000000000000..dd8a79ee0ce8 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCrossConnectionInner.java @@ -0,0 +1,287 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCircuitReference; +import com.microsoft.azure.management.network.v2018_06_01.ServiceProviderProvisioningState; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * ExpressRouteCrossConnection resource. + */ +@JsonFlatten +@SkipParentValidation +public class ExpressRouteCrossConnectionInner extends Resource { + /** + * The name of the primary port. + */ + @JsonProperty(value = "properties.primaryAzurePort", access = JsonProperty.Access.WRITE_ONLY) + private String primaryAzurePort; + + /** + * The name of the secondary port. + */ + @JsonProperty(value = "properties.secondaryAzurePort", access = JsonProperty.Access.WRITE_ONLY) + private String secondaryAzurePort; + + /** + * The identifier of the circuit traffic. + */ + @JsonProperty(value = "properties.sTag", access = JsonProperty.Access.WRITE_ONLY) + private Integer sTag; + + /** + * The peering location of the ExpressRoute circuit. + */ + @JsonProperty(value = "properties.peeringLocation") + private String peeringLocation; + + /** + * The circuit bandwidth In Mbps. + */ + @JsonProperty(value = "properties.bandwidthInMbps") + private Integer bandwidthInMbps; + + /** + * The ExpressRouteCircuit. + */ + @JsonProperty(value = "properties.expressRouteCircuit") + private ExpressRouteCircuitReference expressRouteCircuit; + + /** + * The provisioning state of the circuit in the connectivity provider + * system. Possible values are 'NotProvisioned', 'Provisioning', + * 'Provisioned'. Possible values include: 'NotProvisioned', + * 'Provisioning', 'Provisioned', 'Deprovisioning'. + */ + @JsonProperty(value = "properties.serviceProviderProvisioningState") + private ServiceProviderProvisioningState serviceProviderProvisioningState; + + /** + * Additional read only notes set by the connectivity provider. + */ + @JsonProperty(value = "properties.serviceProviderNotes") + private String serviceProviderNotes; + + /** + * Gets the provisioning state of the public IP resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The list of peerings. + */ + @JsonProperty(value = "properties.peerings") + private List peerings; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the name of the primary port. + * + * @return the primaryAzurePort value + */ + public String primaryAzurePort() { + return this.primaryAzurePort; + } + + /** + * Get the name of the secondary port. + * + * @return the secondaryAzurePort value + */ + public String secondaryAzurePort() { + return this.secondaryAzurePort; + } + + /** + * Get the identifier of the circuit traffic. + * + * @return the sTag value + */ + public Integer sTag() { + return this.sTag; + } + + /** + * Get the peering location of the ExpressRoute circuit. + * + * @return the peeringLocation value + */ + public String peeringLocation() { + return this.peeringLocation; + } + + /** + * Set the peering location of the ExpressRoute circuit. + * + * @param peeringLocation the peeringLocation value to set + * @return the ExpressRouteCrossConnectionInner object itself. + */ + public ExpressRouteCrossConnectionInner withPeeringLocation(String peeringLocation) { + this.peeringLocation = peeringLocation; + return this; + } + + /** + * Get the circuit bandwidth In Mbps. + * + * @return the bandwidthInMbps value + */ + public Integer bandwidthInMbps() { + return this.bandwidthInMbps; + } + + /** + * Set the circuit bandwidth In Mbps. + * + * @param bandwidthInMbps the bandwidthInMbps value to set + * @return the ExpressRouteCrossConnectionInner object itself. + */ + public ExpressRouteCrossConnectionInner withBandwidthInMbps(Integer bandwidthInMbps) { + this.bandwidthInMbps = bandwidthInMbps; + return this; + } + + /** + * Get the ExpressRouteCircuit. + * + * @return the expressRouteCircuit value + */ + public ExpressRouteCircuitReference expressRouteCircuit() { + return this.expressRouteCircuit; + } + + /** + * Set the ExpressRouteCircuit. + * + * @param expressRouteCircuit the expressRouteCircuit value to set + * @return the ExpressRouteCrossConnectionInner object itself. + */ + public ExpressRouteCrossConnectionInner withExpressRouteCircuit(ExpressRouteCircuitReference expressRouteCircuit) { + this.expressRouteCircuit = expressRouteCircuit; + return this; + } + + /** + * Get the provisioning state of the circuit in the connectivity provider system. Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned'. Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', 'Deprovisioning'. + * + * @return the serviceProviderProvisioningState value + */ + public ServiceProviderProvisioningState serviceProviderProvisioningState() { + return this.serviceProviderProvisioningState; + } + + /** + * Set the provisioning state of the circuit in the connectivity provider system. Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned'. Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', 'Deprovisioning'. + * + * @param serviceProviderProvisioningState the serviceProviderProvisioningState value to set + * @return the ExpressRouteCrossConnectionInner object itself. + */ + public ExpressRouteCrossConnectionInner withServiceProviderProvisioningState(ServiceProviderProvisioningState serviceProviderProvisioningState) { + this.serviceProviderProvisioningState = serviceProviderProvisioningState; + return this; + } + + /** + * Get additional read only notes set by the connectivity provider. + * + * @return the serviceProviderNotes value + */ + public String serviceProviderNotes() { + return this.serviceProviderNotes; + } + + /** + * Set additional read only notes set by the connectivity provider. + * + * @param serviceProviderNotes the serviceProviderNotes value to set + * @return the ExpressRouteCrossConnectionInner object itself. + */ + public ExpressRouteCrossConnectionInner withServiceProviderNotes(String serviceProviderNotes) { + this.serviceProviderNotes = serviceProviderNotes; + return this; + } + + /** + * Get gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the list of peerings. + * + * @return the peerings value + */ + public List peerings() { + return this.peerings; + } + + /** + * Set the list of peerings. + * + * @param peerings the peerings value to set + * @return the ExpressRouteCrossConnectionInner object itself. + */ + public ExpressRouteCrossConnectionInner withPeerings(List peerings) { + this.peerings = peerings; + return this; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the ExpressRouteCrossConnectionInner object itself. + */ + public ExpressRouteCrossConnectionInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCrossConnectionPeeringImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCrossConnectionPeeringImpl.java new file mode 100644 index 000000000000..dc506377fa12 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCrossConnectionPeeringImpl.java @@ -0,0 +1,251 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCrossConnectionPeering; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_06_01.ExpressRoutePeeringType; +import com.microsoft.azure.management.network.v2018_06_01.ExpressRoutePeeringState; +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCircuitPeeringConfig; +import com.microsoft.azure.management.network.v2018_06_01.Ipv6ExpressRouteCircuitPeeringConfig; + +class ExpressRouteCrossConnectionPeeringImpl extends CreatableUpdatableImpl implements ExpressRouteCrossConnectionPeering, ExpressRouteCrossConnectionPeering.Definition, ExpressRouteCrossConnectionPeering.Update { + private final NetworkManager manager; + private String resourceGroupName; + private String crossConnectionName; + private String peeringName; + + ExpressRouteCrossConnectionPeeringImpl(String name, NetworkManager manager) { + super(name, new ExpressRouteCrossConnectionPeeringInner()); + this.manager = manager; + // Set resource name + this.peeringName = name; + // + } + + ExpressRouteCrossConnectionPeeringImpl(ExpressRouteCrossConnectionPeeringInner inner, NetworkManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.peeringName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.crossConnectionName = IdParsingUtils.getValueFromIdByName(inner.id(), "expressRouteCrossConnections"); + this.peeringName = IdParsingUtils.getValueFromIdByName(inner.id(), "peerings"); + // + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ExpressRouteCrossConnectionPeeringsInner client = this.manager().inner().expressRouteCrossConnectionPeerings(); + return client.createOrUpdateAsync(this.resourceGroupName, this.crossConnectionName, this.peeringName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ExpressRouteCrossConnectionPeeringsInner client = this.manager().inner().expressRouteCrossConnectionPeerings(); + return client.createOrUpdateAsync(this.resourceGroupName, this.crossConnectionName, this.peeringName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ExpressRouteCrossConnectionPeeringsInner client = this.manager().inner().expressRouteCrossConnectionPeerings(); + return client.getAsync(this.resourceGroupName, this.crossConnectionName, this.peeringName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public Integer azureASN() { + return this.inner().azureASN(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String gatewayManagerEtag() { + return this.inner().gatewayManagerEtag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig() { + return this.inner().ipv6PeeringConfig(); + } + + @Override + public String lastModifiedBy() { + return this.inner().lastModifiedBy(); + } + + @Override + public ExpressRouteCircuitPeeringConfig microsoftPeeringConfig() { + return this.inner().microsoftPeeringConfig(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Long peerASN() { + return this.inner().peerASN(); + } + + @Override + public ExpressRoutePeeringType peeringType() { + return this.inner().peeringType(); + } + + @Override + public String primaryAzurePort() { + return this.inner().primaryAzurePort(); + } + + @Override + public String primaryPeerAddressPrefix() { + return this.inner().primaryPeerAddressPrefix(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String secondaryAzurePort() { + return this.inner().secondaryAzurePort(); + } + + @Override + public String secondaryPeerAddressPrefix() { + return this.inner().secondaryPeerAddressPrefix(); + } + + @Override + public String sharedKey() { + return this.inner().sharedKey(); + } + + @Override + public ExpressRoutePeeringState state() { + return this.inner().state(); + } + + @Override + public Integer vlanId() { + return this.inner().vlanId(); + } + + @Override + public ExpressRouteCrossConnectionPeeringImpl withExistingExpressRouteCrossConnection(String resourceGroupName, String crossConnectionName) { + this.resourceGroupName = resourceGroupName; + this.crossConnectionName = crossConnectionName; + return this; + } + + @Override + public ExpressRouteCrossConnectionPeeringImpl withGatewayManagerEtag(String gatewayManagerEtag) { + this.inner().withGatewayManagerEtag(gatewayManagerEtag); + return this; + } + + @Override + public ExpressRouteCrossConnectionPeeringImpl withId(String id) { + this.inner().withId(id); + return this; + } + + @Override + public ExpressRouteCrossConnectionPeeringImpl withIpv6PeeringConfig(Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig) { + this.inner().withIpv6PeeringConfig(ipv6PeeringConfig); + return this; + } + + @Override + public ExpressRouteCrossConnectionPeeringImpl withLastModifiedBy(String lastModifiedBy) { + this.inner().withLastModifiedBy(lastModifiedBy); + return this; + } + + @Override + public ExpressRouteCrossConnectionPeeringImpl withMicrosoftPeeringConfig(ExpressRouteCircuitPeeringConfig microsoftPeeringConfig) { + this.inner().withMicrosoftPeeringConfig(microsoftPeeringConfig); + return this; + } + + @Override + public ExpressRouteCrossConnectionPeeringImpl withName(String name) { + this.inner().withName(name); + return this; + } + + @Override + public ExpressRouteCrossConnectionPeeringImpl withPeerASN(Long peerASN) { + this.inner().withPeerASN(peerASN); + return this; + } + + @Override + public ExpressRouteCrossConnectionPeeringImpl withPeeringType(ExpressRoutePeeringType peeringType) { + this.inner().withPeeringType(peeringType); + return this; + } + + @Override + public ExpressRouteCrossConnectionPeeringImpl withPrimaryPeerAddressPrefix(String primaryPeerAddressPrefix) { + this.inner().withPrimaryPeerAddressPrefix(primaryPeerAddressPrefix); + return this; + } + + @Override + public ExpressRouteCrossConnectionPeeringImpl withSecondaryPeerAddressPrefix(String secondaryPeerAddressPrefix) { + this.inner().withSecondaryPeerAddressPrefix(secondaryPeerAddressPrefix); + return this; + } + + @Override + public ExpressRouteCrossConnectionPeeringImpl withSharedKey(String sharedKey) { + this.inner().withSharedKey(sharedKey); + return this; + } + + @Override + public ExpressRouteCrossConnectionPeeringImpl withState(ExpressRoutePeeringState state) { + this.inner().withState(state); + return this; + } + + @Override + public ExpressRouteCrossConnectionPeeringImpl withVlanId(Integer vlanId) { + this.inner().withVlanId(vlanId); + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCrossConnectionPeeringInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCrossConnectionPeeringInner.java new file mode 100644 index 000000000000..a231bf5fe6a3 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCrossConnectionPeeringInner.java @@ -0,0 +1,414 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.ExpressRoutePeeringType; +import com.microsoft.azure.management.network.v2018_06_01.ExpressRoutePeeringState; +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCircuitPeeringConfig; +import com.microsoft.azure.management.network.v2018_06_01.Ipv6ExpressRouteCircuitPeeringConfig; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Peering in an ExpressRoute Cross Connection resource. + */ +@JsonFlatten +public class ExpressRouteCrossConnectionPeeringInner extends SubResource { + /** + * The peering type. Possible values include: 'AzurePublicPeering', + * 'AzurePrivatePeering', 'MicrosoftPeering'. + */ + @JsonProperty(value = "properties.peeringType") + private ExpressRoutePeeringType peeringType; + + /** + * The peering state. Possible values include: 'Disabled', 'Enabled'. + */ + @JsonProperty(value = "properties.state") + private ExpressRoutePeeringState state; + + /** + * The Azure ASN. + */ + @JsonProperty(value = "properties.azureASN", access = JsonProperty.Access.WRITE_ONLY) + private Integer azureASN; + + /** + * The peer ASN. + */ + @JsonProperty(value = "properties.peerASN") + private Long peerASN; + + /** + * The primary address prefix. + */ + @JsonProperty(value = "properties.primaryPeerAddressPrefix") + private String primaryPeerAddressPrefix; + + /** + * The secondary address prefix. + */ + @JsonProperty(value = "properties.secondaryPeerAddressPrefix") + private String secondaryPeerAddressPrefix; + + /** + * The primary port. + */ + @JsonProperty(value = "properties.primaryAzurePort", access = JsonProperty.Access.WRITE_ONLY) + private String primaryAzurePort; + + /** + * The secondary port. + */ + @JsonProperty(value = "properties.secondaryAzurePort", access = JsonProperty.Access.WRITE_ONLY) + private String secondaryAzurePort; + + /** + * The shared key. + */ + @JsonProperty(value = "properties.sharedKey") + private String sharedKey; + + /** + * The VLAN ID. + */ + @JsonProperty(value = "properties.vlanId") + private Integer vlanId; + + /** + * The Microsoft peering configuration. + */ + @JsonProperty(value = "properties.microsoftPeeringConfig") + private ExpressRouteCircuitPeeringConfig microsoftPeeringConfig; + + /** + * Gets the provisioning state of the public IP resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The GatewayManager Etag. + */ + @JsonProperty(value = "properties.gatewayManagerEtag") + private String gatewayManagerEtag; + + /** + * Gets whether the provider or the customer last modified the peering. + */ + @JsonProperty(value = "properties.lastModifiedBy") + private String lastModifiedBy; + + /** + * The IPv6 peering configuration. + */ + @JsonProperty(value = "properties.ipv6PeeringConfig") + private Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig; + + /** + * Gets name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get the peering type. Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering'. + * + * @return the peeringType value + */ + public ExpressRoutePeeringType peeringType() { + return this.peeringType; + } + + /** + * Set the peering type. Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering'. + * + * @param peeringType the peeringType value to set + * @return the ExpressRouteCrossConnectionPeeringInner object itself. + */ + public ExpressRouteCrossConnectionPeeringInner withPeeringType(ExpressRoutePeeringType peeringType) { + this.peeringType = peeringType; + return this; + } + + /** + * Get the peering state. Possible values include: 'Disabled', 'Enabled'. + * + * @return the state value + */ + public ExpressRoutePeeringState state() { + return this.state; + } + + /** + * Set the peering state. Possible values include: 'Disabled', 'Enabled'. + * + * @param state the state value to set + * @return the ExpressRouteCrossConnectionPeeringInner object itself. + */ + public ExpressRouteCrossConnectionPeeringInner withState(ExpressRoutePeeringState state) { + this.state = state; + return this; + } + + /** + * Get the Azure ASN. + * + * @return the azureASN value + */ + public Integer azureASN() { + return this.azureASN; + } + + /** + * Get the peer ASN. + * + * @return the peerASN value + */ + public Long peerASN() { + return this.peerASN; + } + + /** + * Set the peer ASN. + * + * @param peerASN the peerASN value to set + * @return the ExpressRouteCrossConnectionPeeringInner object itself. + */ + public ExpressRouteCrossConnectionPeeringInner withPeerASN(Long peerASN) { + this.peerASN = peerASN; + return this; + } + + /** + * Get the primary address prefix. + * + * @return the primaryPeerAddressPrefix value + */ + public String primaryPeerAddressPrefix() { + return this.primaryPeerAddressPrefix; + } + + /** + * Set the primary address prefix. + * + * @param primaryPeerAddressPrefix the primaryPeerAddressPrefix value to set + * @return the ExpressRouteCrossConnectionPeeringInner object itself. + */ + public ExpressRouteCrossConnectionPeeringInner withPrimaryPeerAddressPrefix(String primaryPeerAddressPrefix) { + this.primaryPeerAddressPrefix = primaryPeerAddressPrefix; + return this; + } + + /** + * Get the secondary address prefix. + * + * @return the secondaryPeerAddressPrefix value + */ + public String secondaryPeerAddressPrefix() { + return this.secondaryPeerAddressPrefix; + } + + /** + * Set the secondary address prefix. + * + * @param secondaryPeerAddressPrefix the secondaryPeerAddressPrefix value to set + * @return the ExpressRouteCrossConnectionPeeringInner object itself. + */ + public ExpressRouteCrossConnectionPeeringInner withSecondaryPeerAddressPrefix(String secondaryPeerAddressPrefix) { + this.secondaryPeerAddressPrefix = secondaryPeerAddressPrefix; + return this; + } + + /** + * Get the primary port. + * + * @return the primaryAzurePort value + */ + public String primaryAzurePort() { + return this.primaryAzurePort; + } + + /** + * Get the secondary port. + * + * @return the secondaryAzurePort value + */ + public String secondaryAzurePort() { + return this.secondaryAzurePort; + } + + /** + * Get the shared key. + * + * @return the sharedKey value + */ + public String sharedKey() { + return this.sharedKey; + } + + /** + * Set the shared key. + * + * @param sharedKey the sharedKey value to set + * @return the ExpressRouteCrossConnectionPeeringInner object itself. + */ + public ExpressRouteCrossConnectionPeeringInner withSharedKey(String sharedKey) { + this.sharedKey = sharedKey; + return this; + } + + /** + * Get the VLAN ID. + * + * @return the vlanId value + */ + public Integer vlanId() { + return this.vlanId; + } + + /** + * Set the VLAN ID. + * + * @param vlanId the vlanId value to set + * @return the ExpressRouteCrossConnectionPeeringInner object itself. + */ + public ExpressRouteCrossConnectionPeeringInner withVlanId(Integer vlanId) { + this.vlanId = vlanId; + return this; + } + + /** + * Get the Microsoft peering configuration. + * + * @return the microsoftPeeringConfig value + */ + public ExpressRouteCircuitPeeringConfig microsoftPeeringConfig() { + return this.microsoftPeeringConfig; + } + + /** + * Set the Microsoft peering configuration. + * + * @param microsoftPeeringConfig the microsoftPeeringConfig value to set + * @return the ExpressRouteCrossConnectionPeeringInner object itself. + */ + public ExpressRouteCrossConnectionPeeringInner withMicrosoftPeeringConfig(ExpressRouteCircuitPeeringConfig microsoftPeeringConfig) { + this.microsoftPeeringConfig = microsoftPeeringConfig; + return this; + } + + /** + * Get gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the GatewayManager Etag. + * + * @return the gatewayManagerEtag value + */ + public String gatewayManagerEtag() { + return this.gatewayManagerEtag; + } + + /** + * Set the GatewayManager Etag. + * + * @param gatewayManagerEtag the gatewayManagerEtag value to set + * @return the ExpressRouteCrossConnectionPeeringInner object itself. + */ + public ExpressRouteCrossConnectionPeeringInner withGatewayManagerEtag(String gatewayManagerEtag) { + this.gatewayManagerEtag = gatewayManagerEtag; + return this; + } + + /** + * Get gets whether the provider or the customer last modified the peering. + * + * @return the lastModifiedBy value + */ + public String lastModifiedBy() { + return this.lastModifiedBy; + } + + /** + * Set gets whether the provider or the customer last modified the peering. + * + * @param lastModifiedBy the lastModifiedBy value to set + * @return the ExpressRouteCrossConnectionPeeringInner object itself. + */ + public ExpressRouteCrossConnectionPeeringInner withLastModifiedBy(String lastModifiedBy) { + this.lastModifiedBy = lastModifiedBy; + return this; + } + + /** + * Get the IPv6 peering configuration. + * + * @return the ipv6PeeringConfig value + */ + public Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig() { + return this.ipv6PeeringConfig; + } + + /** + * Set the IPv6 peering configuration. + * + * @param ipv6PeeringConfig the ipv6PeeringConfig value to set + * @return the ExpressRouteCrossConnectionPeeringInner object itself. + */ + public ExpressRouteCrossConnectionPeeringInner withIpv6PeeringConfig(Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig) { + this.ipv6PeeringConfig = ipv6PeeringConfig; + return this; + } + + /** + * Get gets name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set gets name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the ExpressRouteCrossConnectionPeeringInner object itself. + */ + public ExpressRouteCrossConnectionPeeringInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCrossConnectionPeeringsImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCrossConnectionPeeringsImpl.java new file mode 100644 index 000000000000..be7fc3a23b1a --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCrossConnectionPeeringsImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCrossConnectionPeerings; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCrossConnectionPeering; + +class ExpressRouteCrossConnectionPeeringsImpl extends WrapperImpl implements ExpressRouteCrossConnectionPeerings { + private final NetworkManager manager; + + ExpressRouteCrossConnectionPeeringsImpl(NetworkManager manager) { + super(manager.inner().expressRouteCrossConnectionPeerings()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public ExpressRouteCrossConnectionPeeringImpl define(String name) { + return wrapModel(name); + } + + private ExpressRouteCrossConnectionPeeringImpl wrapModel(ExpressRouteCrossConnectionPeeringInner inner) { + return new ExpressRouteCrossConnectionPeeringImpl(inner, manager()); + } + + private ExpressRouteCrossConnectionPeeringImpl wrapModel(String name) { + return new ExpressRouteCrossConnectionPeeringImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String crossConnectionName) { + ExpressRouteCrossConnectionPeeringsInner client = this.inner(); + return client.listAsync(resourceGroupName, crossConnectionName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ExpressRouteCrossConnectionPeering call(ExpressRouteCrossConnectionPeeringInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String crossConnectionName, String peeringName) { + ExpressRouteCrossConnectionPeeringsInner client = this.inner(); + return client.getAsync(resourceGroupName, crossConnectionName, peeringName) + .map(new Func1() { + @Override + public ExpressRouteCrossConnectionPeering call(ExpressRouteCrossConnectionPeeringInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String crossConnectionName, String peeringName) { + ExpressRouteCrossConnectionPeeringsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, crossConnectionName, peeringName).toCompletable(); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCrossConnectionPeeringsInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCrossConnectionPeeringsInner.java new file mode 100644 index 000000000000..8af66d12951d --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCrossConnectionPeeringsInner.java @@ -0,0 +1,764 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.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 ExpressRouteCrossConnectionPeerings. + */ +public class ExpressRouteCrossConnectionPeeringsInner { + /** The Retrofit service to perform REST calls. */ + private ExpressRouteCrossConnectionPeeringsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRouteCrossConnectionPeeringsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ExpressRouteCrossConnectionPeeringsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(ExpressRouteCrossConnectionPeeringsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ExpressRouteCrossConnectionPeerings to be + * used by Retrofit to perform actually REST calls. + */ + interface ExpressRouteCrossConnectionPeeringsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCrossConnectionPeerings list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @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.network.v2018_06_01.ExpressRouteCrossConnectionPeerings delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("peeringName") String peeringName, @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.network.v2018_06_01.ExpressRouteCrossConnectionPeerings beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("peeringName") String peeringName, @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.network.v2018_06_01.ExpressRouteCrossConnectionPeerings get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("peeringName") String peeringName, @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.network.v2018_06_01.ExpressRouteCrossConnectionPeerings createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("peeringName") String peeringName, @Path("subscriptionId") String subscriptionId, @Body ExpressRouteCrossConnectionPeeringInner peeringParameters, @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.network.v2018_06_01.ExpressRouteCrossConnectionPeerings beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("peeringName") String peeringName, @Path("subscriptionId") String subscriptionId, @Body ExpressRouteCrossConnectionPeeringInner peeringParameters, @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.network.v2018_06_01.ExpressRouteCrossConnectionPeerings listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteCrossConnectionPeeringInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String crossConnectionName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, crossConnectionName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String crossConnectionName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, crossConnectionName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCrossConnectionPeeringInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String crossConnectionName) { + return listWithServiceResponseAsync(resourceGroupName, crossConnectionName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCrossConnectionPeeringInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String crossConnectionName) { + return listSinglePageAsync(resourceGroupName, crossConnectionName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteCrossConnectionPeeringInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String crossConnectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.list(resourceGroupName, crossConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes the specified peering from the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String crossConnectionName, String peeringName) { + deleteWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName).toBlocking().last().body(); + } + + /** + * Deletes the specified peering from the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @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 crossConnectionName, String peeringName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName), serviceCallback); + } + + /** + * Deletes the specified peering from the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String crossConnectionName, String peeringName) { + return deleteWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified peering from the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String crossConnectionName, String peeringName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + Observable> observable = service.delete(resourceGroupName, crossConnectionName, peeringName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified peering from the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String crossConnectionName, String peeringName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName).toBlocking().single().body(); + } + + /** + * Deletes the specified peering from the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String crossConnectionName, String peeringName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName), serviceCallback); + } + + /** + * Deletes the specified peering from the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String crossConnectionName, String peeringName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified peering from the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String crossConnectionName, String peeringName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.beginDelete(resourceGroupName, crossConnectionName, peeringName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified peering for the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCrossConnectionPeeringInner object if successful. + */ + public ExpressRouteCrossConnectionPeeringInner get(String resourceGroupName, String crossConnectionName, String peeringName) { + return getWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName).toBlocking().single().body(); + } + + /** + * Gets the specified peering for the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @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 crossConnectionName, String peeringName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName), serviceCallback); + } + + /** + * Gets the specified peering for the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCrossConnectionPeeringInner object + */ + public Observable getAsync(String resourceGroupName, String crossConnectionName, String peeringName) { + return getWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName).map(new Func1, ExpressRouteCrossConnectionPeeringInner>() { + @Override + public ExpressRouteCrossConnectionPeeringInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified peering for the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCrossConnectionPeeringInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String crossConnectionName, String peeringName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.get(resourceGroupName, crossConnectionName, peeringName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a peering in the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCrossConnectionPeeringInner object if successful. + */ + public ExpressRouteCrossConnectionPeeringInner createOrUpdate(String resourceGroupName, String crossConnectionName, String peeringName, ExpressRouteCrossConnectionPeeringInner peeringParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, peeringParameters).toBlocking().last().body(); + } + + /** + * Creates or updates a peering in the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String crossConnectionName, String peeringName, ExpressRouteCrossConnectionPeeringInner peeringParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, peeringParameters), serviceCallback); + } + + /** + * Creates or updates a peering in the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String crossConnectionName, String peeringName, ExpressRouteCrossConnectionPeeringInner peeringParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, peeringParameters).map(new Func1, ExpressRouteCrossConnectionPeeringInner>() { + @Override + public ExpressRouteCrossConnectionPeeringInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a peering in the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String crossConnectionName, String peeringName, ExpressRouteCrossConnectionPeeringInner peeringParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName 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 (peeringParameters == null) { + throw new IllegalArgumentException("Parameter peeringParameters is required and cannot be null."); + } + Validator.validate(peeringParameters); + final String apiVersion = "2018-06-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, crossConnectionName, peeringName, this.client.subscriptionId(), peeringParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a peering in the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCrossConnectionPeeringInner object if successful. + */ + public ExpressRouteCrossConnectionPeeringInner beginCreateOrUpdate(String resourceGroupName, String crossConnectionName, String peeringName, ExpressRouteCrossConnectionPeeringInner peeringParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, peeringParameters).toBlocking().single().body(); + } + + /** + * Creates or updates a peering in the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String crossConnectionName, String peeringName, ExpressRouteCrossConnectionPeeringInner peeringParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, peeringParameters), serviceCallback); + } + + /** + * Creates or updates a peering in the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCrossConnectionPeeringInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String crossConnectionName, String peeringName, ExpressRouteCrossConnectionPeeringInner peeringParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, peeringParameters).map(new Func1, ExpressRouteCrossConnectionPeeringInner>() { + @Override + public ExpressRouteCrossConnectionPeeringInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a peering in the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCrossConnectionPeeringInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String crossConnectionName, String peeringName, ExpressRouteCrossConnectionPeeringInner peeringParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName 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 (peeringParameters == null) { + throw new IllegalArgumentException("Parameter peeringParameters is required and cannot be null."); + } + Validator.validate(peeringParameters); + final String apiVersion = "2018-06-01"; + return service.beginCreateOrUpdate(resourceGroupName, crossConnectionName, peeringName, this.client.subscriptionId(), peeringParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteCrossConnectionPeeringInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @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<ExpressRouteCrossConnectionPeeringInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @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<ExpressRouteCrossConnectionPeeringInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteCrossConnectionPeeringInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCrossConnectionsImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCrossConnectionsImpl.java new file mode 100644 index 000000000000..8ab69815a160 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCrossConnectionsImpl.java @@ -0,0 +1,140 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCrossConnections; +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCrossConnection; +import rx.Observable; +import rx.Completable; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCircuitsArpTableListResult; +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCrossConnectionsRoutesTableSummaryListResult; +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCircuitsRoutesTableListResult; + +class ExpressRouteCrossConnectionsImpl extends GroupableResourcesCoreImpl implements ExpressRouteCrossConnections { + protected ExpressRouteCrossConnectionsImpl(NetworkManager manager) { + super(manager.inner().expressRouteCrossConnections(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + ExpressRouteCrossConnectionsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ExpressRouteCrossConnectionsInner client = this.inner(); + return Completable.error(new Throwable("Delete by RG not supported for this resource")); // NOP Delete by RG not supported + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + ExpressRouteCrossConnectionsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + ExpressRouteCrossConnectionsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ExpressRouteCrossConnection call(ExpressRouteCrossConnectionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + ExpressRouteCrossConnectionsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + ExpressRouteCrossConnectionsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ExpressRouteCrossConnection call(ExpressRouteCrossConnectionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public ExpressRouteCrossConnectionImpl define(String name) { + return wrapModel(name); + } + + @Override + protected ExpressRouteCrossConnectionImpl wrapModel(ExpressRouteCrossConnectionInner inner) { + return new ExpressRouteCrossConnectionImpl(inner.name(), inner, manager()); + } + + @Override + protected ExpressRouteCrossConnectionImpl wrapModel(String name) { + return new ExpressRouteCrossConnectionImpl(name, new ExpressRouteCrossConnectionInner(), this.manager()); + } + + @Override + public Observable listArpTableAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + ExpressRouteCrossConnectionsInner client = this.inner(); + return client.listArpTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath) + .map(new Func1() { + @Override + public ExpressRouteCircuitsArpTableListResult call(ExpressRouteCircuitsArpTableListResultInner inner) { + return new ExpressRouteCircuitsArpTableListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listRoutesTableSummaryAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + ExpressRouteCrossConnectionsInner client = this.inner(); + return client.listRoutesTableSummaryAsync(resourceGroupName, crossConnectionName, peeringName, devicePath) + .map(new Func1() { + @Override + public ExpressRouteCrossConnectionsRoutesTableSummaryListResult call(ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner inner) { + return new ExpressRouteCrossConnectionsRoutesTableSummaryListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listRoutesTableAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + ExpressRouteCrossConnectionsInner client = this.inner(); + return client.listRoutesTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath) + .map(new Func1() { + @Override + public ExpressRouteCircuitsRoutesTableListResult call(ExpressRouteCircuitsRoutesTableListResultInner inner) { + return new ExpressRouteCircuitsRoutesTableListResultImpl(inner, manager()); + } + }); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCrossConnectionsInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCrossConnectionsInner.java new file mode 100644 index 000000000000..abf009110bce --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCrossConnectionsInner.java @@ -0,0 +1,1676 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_06_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ExpressRouteCrossConnections. + */ +public class ExpressRouteCrossConnectionsInner implements InnerSupportsGet, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private ExpressRouteCrossConnectionsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRouteCrossConnectionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ExpressRouteCrossConnectionsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(ExpressRouteCrossConnectionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ExpressRouteCrossConnections to be + * used by Retrofit to perform actually REST calls. + */ + interface ExpressRouteCrossConnectionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCrossConnections list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCrossConnections") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCrossConnections listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @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.network.v2018_06_01.ExpressRouteCrossConnections getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @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.network.v2018_06_01.ExpressRouteCrossConnections createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("subscriptionId") String subscriptionId, @Body ExpressRouteCrossConnectionInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCrossConnections beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("subscriptionId") String subscriptionId, @Body ExpressRouteCrossConnectionInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCrossConnections updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject crossConnectionParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCrossConnections beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}") + Observable> beginUpdateTags(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject crossConnectionParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCrossConnections listArpTable" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/arpTables/{devicePath}") + Observable> listArpTable(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("peeringName") String peeringName, @Path("devicePath") String devicePath, @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.network.v2018_06_01.ExpressRouteCrossConnections beginListArpTable" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/arpTables/{devicePath}") + Observable> beginListArpTable(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("peeringName") String peeringName, @Path("devicePath") String devicePath, @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.network.v2018_06_01.ExpressRouteCrossConnections listRoutesTableSummary" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/routeTablesSummary/{devicePath}") + Observable> listRoutesTableSummary(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("peeringName") String peeringName, @Path("devicePath") String devicePath, @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.network.v2018_06_01.ExpressRouteCrossConnections beginListRoutesTableSummary" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/routeTablesSummary/{devicePath}") + Observable> beginListRoutesTableSummary(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("peeringName") String peeringName, @Path("devicePath") String devicePath, @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.network.v2018_06_01.ExpressRouteCrossConnections listRoutesTable" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/routeTables/{devicePath}") + Observable> listRoutesTable(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("peeringName") String peeringName, @Path("devicePath") String devicePath, @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.network.v2018_06_01.ExpressRouteCrossConnections beginListRoutesTable" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/routeTables/{devicePath}") + Observable> beginListRoutesTable(@Path("resourceGroupName") String resourceGroupName, @Path("crossConnectionName") String crossConnectionName, @Path("peeringName") String peeringName, @Path("devicePath") String devicePath, @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.network.v2018_06_01.ExpressRouteCrossConnections listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCrossConnections listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteCrossConnectionInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCrossConnectionInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCrossConnectionInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteCrossConnectionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteCrossConnectionInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCrossConnectionInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCrossConnectionInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteCrossConnectionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets details about the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group (peering location of the circuit). + * @param crossConnectionName The name of the ExpressRouteCrossConnection (service key of the circuit). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCrossConnectionInner object if successful. + */ + public ExpressRouteCrossConnectionInner getByResourceGroup(String resourceGroupName, String crossConnectionName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, crossConnectionName).toBlocking().single().body(); + } + + /** + * Gets details about the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group (peering location of the circuit). + * @param crossConnectionName The name of the ExpressRouteCrossConnection (service key of the circuit). + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String crossConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, crossConnectionName), serviceCallback); + } + + /** + * Gets details about the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group (peering location of the circuit). + * @param crossConnectionName The name of the ExpressRouteCrossConnection (service key of the circuit). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCrossConnectionInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String crossConnectionName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, crossConnectionName).map(new Func1, ExpressRouteCrossConnectionInner>() { + @Override + public ExpressRouteCrossConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets details about the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group (peering location of the circuit). + * @param crossConnectionName The name of the ExpressRouteCrossConnection (service key of the circuit). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCrossConnectionInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String crossConnectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.getByResourceGroup(resourceGroupName, crossConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Update the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param parameters Parameters supplied to the update express route crossConnection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCrossConnectionInner object if successful. + */ + public ExpressRouteCrossConnectionInner createOrUpdate(String resourceGroupName, String crossConnectionName, ExpressRouteCrossConnectionInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, crossConnectionName, parameters).toBlocking().last().body(); + } + + /** + * Update the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param parameters Parameters supplied to the update express route crossConnection operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String crossConnectionName, ExpressRouteCrossConnectionInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, crossConnectionName, parameters), serviceCallback); + } + + /** + * Update the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param parameters Parameters supplied to the update express route crossConnection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String crossConnectionName, ExpressRouteCrossConnectionInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, crossConnectionName, parameters).map(new Func1, ExpressRouteCrossConnectionInner>() { + @Override + public ExpressRouteCrossConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param parameters Parameters supplied to the update express route crossConnection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String crossConnectionName, ExpressRouteCrossConnectionInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, crossConnectionName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Update the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param parameters Parameters supplied to the update express route crossConnection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCrossConnectionInner object if successful. + */ + public ExpressRouteCrossConnectionInner beginCreateOrUpdate(String resourceGroupName, String crossConnectionName, ExpressRouteCrossConnectionInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, crossConnectionName, parameters).toBlocking().single().body(); + } + + /** + * Update the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param parameters Parameters supplied to the update express route crossConnection operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String crossConnectionName, ExpressRouteCrossConnectionInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, crossConnectionName, parameters), serviceCallback); + } + + /** + * Update the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param parameters Parameters supplied to the update express route crossConnection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCrossConnectionInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String crossConnectionName, ExpressRouteCrossConnectionInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, crossConnectionName, parameters).map(new Func1, ExpressRouteCrossConnectionInner>() { + @Override + public ExpressRouteCrossConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param parameters Parameters supplied to the update express route crossConnection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCrossConnectionInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String crossConnectionName, ExpressRouteCrossConnectionInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + return service.beginCreateOrUpdate(resourceGroupName, crossConnectionName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCrossConnectionInner object if successful. + */ + public ExpressRouteCrossConnectionInner updateTags(String resourceGroupName, String crossConnectionName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, crossConnectionName).toBlocking().last().body(); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String crossConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, crossConnectionName), serviceCallback); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String crossConnectionName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, crossConnectionName).map(new Func1, ExpressRouteCrossConnectionInner>() { + @Override + public ExpressRouteCrossConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String crossConnectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + final Map tags = null; + TagsObject crossConnectionParameters = new TagsObject(); + crossConnectionParameters.withTags(null); + Observable> observable = service.updateTags(resourceGroupName, crossConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), crossConnectionParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCrossConnectionInner object if successful. + */ + public ExpressRouteCrossConnectionInner updateTags(String resourceGroupName, String crossConnectionName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, crossConnectionName, tags).toBlocking().last().body(); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String crossConnectionName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, crossConnectionName, tags), serviceCallback); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String crossConnectionName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, crossConnectionName, tags).map(new Func1, ExpressRouteCrossConnectionInner>() { + @Override + public ExpressRouteCrossConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String crossConnectionName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-06-01"; + TagsObject crossConnectionParameters = new TagsObject(); + crossConnectionParameters.withTags(tags); + Observable> observable = service.updateTags(resourceGroupName, crossConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), crossConnectionParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCrossConnectionInner object if successful. + */ + public ExpressRouteCrossConnectionInner beginUpdateTags(String resourceGroupName, String crossConnectionName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, crossConnectionName).toBlocking().single().body(); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String crossConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, crossConnectionName), serviceCallback); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCrossConnectionInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String crossConnectionName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, crossConnectionName).map(new Func1, ExpressRouteCrossConnectionInner>() { + @Override + public ExpressRouteCrossConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCrossConnectionInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String crossConnectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + final Map tags = null; + TagsObject crossConnectionParameters = new TagsObject(); + crossConnectionParameters.withTags(null); + return service.beginUpdateTags(resourceGroupName, crossConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), crossConnectionParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCrossConnectionInner object if successful. + */ + public ExpressRouteCrossConnectionInner beginUpdateTags(String resourceGroupName, String crossConnectionName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, crossConnectionName, tags).toBlocking().single().body(); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String crossConnectionName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, crossConnectionName, tags), serviceCallback); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCrossConnectionInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String crossConnectionName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, crossConnectionName, tags).map(new Func1, ExpressRouteCrossConnectionInner>() { + @Override + public ExpressRouteCrossConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCrossConnectionInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String crossConnectionName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-06-01"; + TagsObject crossConnectionParameters = new TagsObject(); + crossConnectionParameters.withTags(tags); + return service.beginUpdateTags(resourceGroupName, crossConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), crossConnectionParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitsArpTableListResultInner object if successful. + */ + public ExpressRouteCircuitsArpTableListResultInner listArpTable(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + return listArpTableWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).toBlocking().last().body(); + } + + /** + * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device + * @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 listArpTableAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listArpTableWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath), serviceCallback); + } + + /** + * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable listArpTableAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + return listArpTableWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).map(new Func1, ExpressRouteCircuitsArpTableListResultInner>() { + @Override + public ExpressRouteCircuitsArpTableListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> listArpTableWithServiceResponseAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (devicePath == null) { + throw new IllegalArgumentException("Parameter devicePath is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + Observable> observable = service.listArpTable(resourceGroupName, crossConnectionName, peeringName, devicePath, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitsArpTableListResultInner object if successful. + */ + public ExpressRouteCircuitsArpTableListResultInner beginListArpTable(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + return beginListArpTableWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).toBlocking().single().body(); + } + + /** + * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device + * @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 beginListArpTableAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginListArpTableWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath), serviceCallback); + } + + /** + * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitsArpTableListResultInner object + */ + public Observable beginListArpTableAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + return beginListArpTableWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).map(new Func1, ExpressRouteCircuitsArpTableListResultInner>() { + @Override + public ExpressRouteCircuitsArpTableListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitsArpTableListResultInner object + */ + public Observable> beginListArpTableWithServiceResponseAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (devicePath == null) { + throw new IllegalArgumentException("Parameter devicePath is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.beginListArpTable(resourceGroupName, crossConnectionName, peeringName, devicePath, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginListArpTableDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginListArpTableDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the route table summary associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner object if successful. + */ + public ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner listRoutesTableSummary(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + return listRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).toBlocking().last().body(); + } + + /** + * Gets the route table summary associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @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 listRoutesTableSummaryAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath), serviceCallback); + } + + /** + * Gets the route table summary associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable listRoutesTableSummaryAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + return listRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).map(new Func1, ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner>() { + @Override + public ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the route table summary associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> listRoutesTableSummaryWithServiceResponseAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (devicePath == null) { + throw new IllegalArgumentException("Parameter devicePath is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + Observable> observable = service.listRoutesTableSummary(resourceGroupName, crossConnectionName, peeringName, devicePath, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Gets the route table summary associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner object if successful. + */ + public ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner beginListRoutesTableSummary(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + return beginListRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).toBlocking().single().body(); + } + + /** + * Gets the route table summary associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @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 beginListRoutesTableSummaryAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginListRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath), serviceCallback); + } + + /** + * Gets the route table summary associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner object + */ + public Observable beginListRoutesTableSummaryAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + return beginListRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).map(new Func1, ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner>() { + @Override + public ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the route table summary associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner object + */ + public Observable> beginListRoutesTableSummaryWithServiceResponseAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (devicePath == null) { + throw new IllegalArgumentException("Parameter devicePath is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.beginListRoutesTableSummary(resourceGroupName, crossConnectionName, peeringName, devicePath, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginListRoutesTableSummaryDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginListRoutesTableSummaryDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the currently advertised routes table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitsRoutesTableListResultInner object if successful. + */ + public ExpressRouteCircuitsRoutesTableListResultInner listRoutesTable(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + return listRoutesTableWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).toBlocking().last().body(); + } + + /** + * Gets the currently advertised routes table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @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 listRoutesTableAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listRoutesTableWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath), serviceCallback); + } + + /** + * Gets the currently advertised routes table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable listRoutesTableAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + return listRoutesTableWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).map(new Func1, ExpressRouteCircuitsRoutesTableListResultInner>() { + @Override + public ExpressRouteCircuitsRoutesTableListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the currently advertised routes table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> listRoutesTableWithServiceResponseAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (devicePath == null) { + throw new IllegalArgumentException("Parameter devicePath is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + Observable> observable = service.listRoutesTable(resourceGroupName, crossConnectionName, peeringName, devicePath, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Gets the currently advertised routes table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteCircuitsRoutesTableListResultInner object if successful. + */ + public ExpressRouteCircuitsRoutesTableListResultInner beginListRoutesTable(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + return beginListRoutesTableWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).toBlocking().single().body(); + } + + /** + * Gets the currently advertised routes table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @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 beginListRoutesTableAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginListRoutesTableWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath), serviceCallback); + } + + /** + * Gets the currently advertised routes table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitsRoutesTableListResultInner object + */ + public Observable beginListRoutesTableAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + return beginListRoutesTableWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).map(new Func1, ExpressRouteCircuitsRoutesTableListResultInner>() { + @Override + public ExpressRouteCircuitsRoutesTableListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the currently advertised routes table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteCircuitsRoutesTableListResultInner object + */ + public Observable> beginListRoutesTableWithServiceResponseAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (crossConnectionName == null) { + throw new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."); + } + if (peeringName == null) { + throw new IllegalArgumentException("Parameter peeringName is required and cannot be null."); + } + if (devicePath == null) { + throw new IllegalArgumentException("Parameter devicePath is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.beginListRoutesTable(resourceGroupName, crossConnectionName, peeringName, devicePath, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginListRoutesTableDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginListRoutesTableDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteCrossConnectionInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCrossConnectionInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCrossConnectionInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteCrossConnectionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteCrossConnectionInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCrossConnectionInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteCrossConnectionInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteCrossConnectionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCrossConnectionsRoutesTableSummaryListResultImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCrossConnectionsRoutesTableSummaryListResultImpl.java new file mode 100644 index 000000000000..69f47db659e7 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCrossConnectionsRoutesTableSummaryListResultImpl.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.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCrossConnectionsRoutesTableSummaryListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCrossConnectionRoutesTableSummary; + +class ExpressRouteCrossConnectionsRoutesTableSummaryListResultImpl extends WrapperImpl implements ExpressRouteCrossConnectionsRoutesTableSummaryListResult { + private final NetworkManager manager; + ExpressRouteCrossConnectionsRoutesTableSummaryListResultImpl(ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public String nextLink() { + return this.inner().nextLink(); + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner.java new file mode 100644 index 000000000000..4087c14d63b7 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner.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.network.v2018_06_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCrossConnectionRoutesTableSummary; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Response for ListRoutesTable associated with the Express Route Cross + * Connections. + */ +public class ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner { + /** + * A list of the routes table. + */ + @JsonProperty(value = "value") + private List value; + + /** + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get a list of the routes table. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set a list of the routes table. + * + * @param value the value value to set + * @return the ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner object itself. + */ + public ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the URL to get the next set of results. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteServiceProviderImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteServiceProviderImpl.java new file mode 100644 index 000000000000..3fe67a9eb4d0 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteServiceProviderImpl.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteServiceProvider; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteServiceProviderBandwidthsOffered; + +class ExpressRouteServiceProviderImpl extends GroupableResourceCoreImpl implements ExpressRouteServiceProvider { + ExpressRouteServiceProviderImpl(String name, ExpressRouteServiceProviderInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + ExpressRouteServiceProvidersInner client = this.manager().inner().expressRouteServiceProviders(); + return null; // NOP createResourceAsync implementation as create is not supported + } + + @Override + public Observable updateResourceAsync() { + ExpressRouteServiceProvidersInner client = this.manager().inner().expressRouteServiceProviders(); + return null; // NOP updateResourceAsync implementation as update is not supported + } + + @Override + protected Observable getInnerAsync() { + ExpressRouteServiceProvidersInner client = this.manager().inner().expressRouteServiceProviders(); + return null; // NOP getInnerAsync implementation as get is not supported + } + + + + @Override + public List bandwidthsOffered() { + return this.inner().bandwidthsOffered(); + } + + @Override + public List peeringLocations() { + return this.inner().peeringLocations(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteServiceProviderInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteServiceProviderInner.java new file mode 100644 index 000000000000..e746c8202c45 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteServiceProviderInner.java @@ -0,0 +1,128 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteServiceProviderBandwidthsOffered; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * A ExpressRouteResourceProvider object. + */ +@JsonFlatten +@SkipParentValidation +public class ExpressRouteServiceProviderInner extends Resource { + /** + * Get a list of peering locations. + */ + @JsonProperty(value = "properties.peeringLocations") + private List peeringLocations; + + /** + * Gets bandwidths offered. + */ + @JsonProperty(value = "properties.bandwidthsOffered") + private List bandwidthsOffered; + + /** + * Gets the provisioning state of the resource. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get get a list of peering locations. + * + * @return the peeringLocations value + */ + public List peeringLocations() { + return this.peeringLocations; + } + + /** + * Set get a list of peering locations. + * + * @param peeringLocations the peeringLocations value to set + * @return the ExpressRouteServiceProviderInner object itself. + */ + public ExpressRouteServiceProviderInner withPeeringLocations(List peeringLocations) { + this.peeringLocations = peeringLocations; + return this; + } + + /** + * Get gets bandwidths offered. + * + * @return the bandwidthsOffered value + */ + public List bandwidthsOffered() { + return this.bandwidthsOffered; + } + + /** + * Set gets bandwidths offered. + * + * @param bandwidthsOffered the bandwidthsOffered value to set + * @return the ExpressRouteServiceProviderInner object itself. + */ + public ExpressRouteServiceProviderInner withBandwidthsOffered(List bandwidthsOffered) { + this.bandwidthsOffered = bandwidthsOffered; + return this; + } + + /** + * Get gets the provisioning state of the resource. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set gets the provisioning state of the resource. + * + * @param provisioningState the provisioningState value to set + * @return the ExpressRouteServiceProviderInner object itself. + */ + public ExpressRouteServiceProviderInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the ExpressRouteServiceProviderInner object itself. + */ + public ExpressRouteServiceProviderInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteServiceProvidersImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteServiceProvidersImpl.java new file mode 100644 index 000000000000..98204d9e4d92 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteServiceProvidersImpl.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteServiceProviders; +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteServiceProvider; +import rx.Observable; +import rx.Completable; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class ExpressRouteServiceProvidersImpl extends GroupableResourcesCoreImpl implements ExpressRouteServiceProviders { + protected ExpressRouteServiceProvidersImpl(NetworkManager manager) { + super(manager.inner().expressRouteServiceProviders(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + return null; // NOP Retrieve by resource group not supported + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ExpressRouteServiceProvidersInner client = this.inner(); + return Completable.error(new Throwable("Delete by RG not supported for this resource")); // NOP Delete by RG not supported + } + + @Override + public PagedList list() { + ExpressRouteServiceProvidersInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + ExpressRouteServiceProvidersInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ExpressRouteServiceProvider call(ExpressRouteServiceProviderInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + protected ExpressRouteServiceProviderImpl wrapModel(ExpressRouteServiceProviderInner inner) { + return new ExpressRouteServiceProviderImpl(inner.name(), inner, manager()); + } + + @Override + protected ExpressRouteServiceProviderImpl wrapModel(String name) { + return null; // Model is not creatable + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteServiceProvidersInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteServiceProvidersInner.java new file mode 100644 index 000000000000..c662aba61862 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteServiceProvidersInner.java @@ -0,0 +1,285 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ExpressRouteServiceProviders. + */ +public class ExpressRouteServiceProvidersInner { + /** The Retrofit service to perform REST calls. */ + private ExpressRouteServiceProvidersService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRouteServiceProvidersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ExpressRouteServiceProvidersInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(ExpressRouteServiceProvidersService.class); + this.client = client; + } + + /** + * The interface defining all the services for ExpressRouteServiceProviders to be + * used by Retrofit to perform actually REST calls. + */ + interface ExpressRouteServiceProvidersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.ExpressRouteServiceProviders list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteServiceProviders") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.ExpressRouteServiceProviders listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets all the available express route service providers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteServiceProviderInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the available express route service providers. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the available express route service providers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteServiceProviderInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the available express route service providers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteServiceProviderInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the available express route service providers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteServiceProviderInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the available express route service providers. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteServiceProviderInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the available express route service providers. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the available express route service providers. + * + * @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<ExpressRouteServiceProviderInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the available express route service providers. + * + * @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<ExpressRouteServiceProviderInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the available express route service providers. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteServiceProviderInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/FlowLogInformationImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/FlowLogInformationImpl.java new file mode 100644 index 000000000000..2aec16bd0799 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/FlowLogInformationImpl.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.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.FlowLogInformation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_06_01.TrafficAnalyticsProperties; +import com.microsoft.azure.management.network.v2018_06_01.RetentionPolicyParameters; + +class FlowLogInformationImpl extends WrapperImpl implements FlowLogInformation { + private final NetworkManager manager; + FlowLogInformationImpl(FlowLogInformationInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public boolean enabled() { + return this.inner().enabled(); + } + + @Override + public TrafficAnalyticsProperties flowAnalyticsConfiguration() { + return this.inner().flowAnalyticsConfiguration(); + } + + @Override + public RetentionPolicyParameters retentionPolicy() { + return this.inner().retentionPolicy(); + } + + @Override + public String storageId() { + return this.inner().storageId(); + } + + @Override + public String targetResourceId() { + return this.inner().targetResourceId(); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/FlowLogInformationInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/FlowLogInformationInner.java new file mode 100644 index 000000000000..de60aecf2b8c --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/FlowLogInformationInner.java @@ -0,0 +1,153 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.RetentionPolicyParameters; +import com.microsoft.azure.management.network.v2018_06_01.TrafficAnalyticsProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Information on the configuration of flow log and traffic analytics + * (optional) . + */ +@JsonFlatten +public class FlowLogInformationInner { + /** + * The ID of the resource to configure for flow log and traffic analytics + * (optional) . + */ + @JsonProperty(value = "targetResourceId", required = true) + private String targetResourceId; + + /** + * ID of the storage account which is used to store the flow log. + */ + @JsonProperty(value = "properties.storageId", required = true) + private String storageId; + + /** + * Flag to enable/disable flow logging. + */ + @JsonProperty(value = "properties.enabled", required = true) + private boolean enabled; + + /** + * The retentionPolicy property. + */ + @JsonProperty(value = "properties.retentionPolicy") + private RetentionPolicyParameters retentionPolicy; + + /** + * The flowAnalyticsConfiguration property. + */ + @JsonProperty(value = "flowAnalyticsConfiguration") + private TrafficAnalyticsProperties flowAnalyticsConfiguration; + + /** + * Get the ID of the resource to configure for flow log and traffic analytics (optional) . + * + * @return the targetResourceId value + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Set the ID of the resource to configure for flow log and traffic analytics (optional) . + * + * @param targetResourceId the targetResourceId value to set + * @return the FlowLogInformationInner object itself. + */ + public FlowLogInformationInner withTargetResourceId(String targetResourceId) { + this.targetResourceId = targetResourceId; + return this; + } + + /** + * Get iD of the storage account which is used to store the flow log. + * + * @return the storageId value + */ + public String storageId() { + return this.storageId; + } + + /** + * Set iD of the storage account which is used to store the flow log. + * + * @param storageId the storageId value to set + * @return the FlowLogInformationInner object itself. + */ + public FlowLogInformationInner withStorageId(String storageId) { + this.storageId = storageId; + return this; + } + + /** + * Get flag to enable/disable flow logging. + * + * @return the enabled value + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set flag to enable/disable flow logging. + * + * @param enabled the enabled value to set + * @return the FlowLogInformationInner object itself. + */ + public FlowLogInformationInner withEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the retentionPolicy value. + * + * @return the retentionPolicy value + */ + public RetentionPolicyParameters retentionPolicy() { + return this.retentionPolicy; + } + + /** + * Set the retentionPolicy value. + * + * @param retentionPolicy the retentionPolicy value to set + * @return the FlowLogInformationInner object itself. + */ + public FlowLogInformationInner withRetentionPolicy(RetentionPolicyParameters retentionPolicy) { + this.retentionPolicy = retentionPolicy; + return this; + } + + /** + * Get the flowAnalyticsConfiguration value. + * + * @return the flowAnalyticsConfiguration value + */ + public TrafficAnalyticsProperties flowAnalyticsConfiguration() { + return this.flowAnalyticsConfiguration; + } + + /** + * Set the flowAnalyticsConfiguration value. + * + * @param flowAnalyticsConfiguration the flowAnalyticsConfiguration value to set + * @return the FlowLogInformationInner object itself. + */ + public FlowLogInformationInner withFlowAnalyticsConfiguration(TrafficAnalyticsProperties flowAnalyticsConfiguration) { + this.flowAnalyticsConfiguration = flowAnalyticsConfiguration; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/FrontendIPConfigurationImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/FrontendIPConfigurationImpl.java new file mode 100644 index 000000000000..2cdbc8ec1387 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/FrontendIPConfigurationImpl.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.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.FrontendIPConfiguration; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_06_01.IPAllocationMethod; +import com.microsoft.azure.management.network.v2018_06_01.PublicIPAddress; +import com.microsoft.azure.management.network.v2018_06_01.Subnet; + +class FrontendIPConfigurationImpl extends IndexableRefreshableWrapperImpl implements FrontendIPConfiguration { + private final NetworkManager manager; + private String resourceGroupName; + private String loadBalancerName; + private String frontendIPConfigurationName; + + FrontendIPConfigurationImpl(FrontendIPConfigurationInner inner, NetworkManager manager) { + super(null, inner); + this.manager = manager; + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.loadBalancerName = IdParsingUtils.getValueFromIdByName(inner.id(), "loadBalancers"); + this.frontendIPConfigurationName = IdParsingUtils.getValueFromIdByName(inner.id(), "frontendIPConfigurations"); + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + LoadBalancerFrontendIPConfigurationsInner client = this.manager().inner().loadBalancerFrontendIPConfigurations(); + return client.getAsync(this.resourceGroupName, this.loadBalancerName, this.frontendIPConfigurationName); + } + + + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public List inboundNatPools() { + return this.inner().inboundNatPools(); + } + + @Override + public List inboundNatRules() { + return this.inner().inboundNatRules(); + } + + @Override + public List loadBalancingRules() { + return this.inner().loadBalancingRules(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List outboundNatRules() { + return this.inner().outboundNatRules(); + } + + @Override + public String privateIPAddress() { + return this.inner().privateIPAddress(); + } + + @Override + public IPAllocationMethod privateIPAllocationMethod() { + return this.inner().privateIPAllocationMethod(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public PublicIPAddress publicIPAddress() { + PublicIPAddressInner inner = this.inner().publicIPAddress(); + if (inner != null) { + return new PublicIPAddressImpl(inner.name(), inner, manager()); + } else { + return null; + } + } + + @Override + public Subnet subnet() { + SubnetInner inner = this.inner().subnet(); + if (inner != null) { + return new SubnetImpl(inner, manager()); + } else { + return null; + } + } + + @Override + public List zones() { + return this.inner().zones(); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/FrontendIPConfigurationInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/FrontendIPConfigurationInner.java new file mode 100644 index 000000000000..20fa089be8bc --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/FrontendIPConfigurationInner.java @@ -0,0 +1,294 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_06_01.IPAllocationMethod; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Frontend IP address of the load balancer. + */ +@JsonFlatten +public class FrontendIPConfigurationInner extends SubResource { + /** + * Read only. Inbound rules URIs that use this frontend IP. + */ + @JsonProperty(value = "properties.inboundNatRules", access = JsonProperty.Access.WRITE_ONLY) + private List inboundNatRules; + + /** + * Read only. Inbound pools URIs that use this frontend IP. + */ + @JsonProperty(value = "properties.inboundNatPools", access = JsonProperty.Access.WRITE_ONLY) + private List inboundNatPools; + + /** + * Read only. Outbound rules URIs that use this frontend IP. + */ + @JsonProperty(value = "properties.outboundNatRules", access = JsonProperty.Access.WRITE_ONLY) + private List outboundNatRules; + + /** + * Gets load balancing rules URIs that use this frontend IP. + */ + @JsonProperty(value = "properties.loadBalancingRules", access = JsonProperty.Access.WRITE_ONLY) + private List loadBalancingRules; + + /** + * The private IP address of the IP configuration. + */ + @JsonProperty(value = "properties.privateIPAddress") + private String privateIPAddress; + + /** + * The Private IP allocation method. Possible values are: 'Static' and + * 'Dynamic'. Possible values include: 'Static', 'Dynamic'. + */ + @JsonProperty(value = "properties.privateIPAllocationMethod") + private IPAllocationMethod privateIPAllocationMethod; + + /** + * The reference of the subnet resource. + */ + @JsonProperty(value = "properties.subnet") + private SubnetInner subnet; + + /** + * The reference of the Public IP resource. + */ + @JsonProperty(value = "properties.publicIPAddress") + private PublicIPAddressInner publicIPAddress; + + /** + * Gets the provisioning state of the public IP resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * A list of availability zones denoting the IP allocated for the resource + * needs to come from. + */ + @JsonProperty(value = "zones") + private List zones; + + /** + * Get read only. Inbound rules URIs that use this frontend IP. + * + * @return the inboundNatRules value + */ + public List inboundNatRules() { + return this.inboundNatRules; + } + + /** + * Get read only. Inbound pools URIs that use this frontend IP. + * + * @return the inboundNatPools value + */ + public List inboundNatPools() { + return this.inboundNatPools; + } + + /** + * Get read only. Outbound rules URIs that use this frontend IP. + * + * @return the outboundNatRules value + */ + public List outboundNatRules() { + return this.outboundNatRules; + } + + /** + * Get gets load balancing rules URIs that use this frontend IP. + * + * @return the loadBalancingRules value + */ + public List loadBalancingRules() { + return this.loadBalancingRules; + } + + /** + * Get the private IP address of the IP configuration. + * + * @return the privateIPAddress value + */ + public String privateIPAddress() { + return this.privateIPAddress; + } + + /** + * Set the private IP address of the IP configuration. + * + * @param privateIPAddress the privateIPAddress value to set + * @return the FrontendIPConfigurationInner object itself. + */ + public FrontendIPConfigurationInner withPrivateIPAddress(String privateIPAddress) { + this.privateIPAddress = privateIPAddress; + return this; + } + + /** + * Get the Private IP allocation method. Possible values are: 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic'. + * + * @return the privateIPAllocationMethod value + */ + public IPAllocationMethod privateIPAllocationMethod() { + return this.privateIPAllocationMethod; + } + + /** + * Set the Private IP allocation method. Possible values are: 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic'. + * + * @param privateIPAllocationMethod the privateIPAllocationMethod value to set + * @return the FrontendIPConfigurationInner object itself. + */ + public FrontendIPConfigurationInner withPrivateIPAllocationMethod(IPAllocationMethod privateIPAllocationMethod) { + this.privateIPAllocationMethod = privateIPAllocationMethod; + return this; + } + + /** + * Get the reference of the subnet resource. + * + * @return the subnet value + */ + public SubnetInner subnet() { + return this.subnet; + } + + /** + * Set the reference of the subnet resource. + * + * @param subnet the subnet value to set + * @return the FrontendIPConfigurationInner object itself. + */ + public FrontendIPConfigurationInner withSubnet(SubnetInner subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get the reference of the Public IP resource. + * + * @return the publicIPAddress value + */ + public PublicIPAddressInner publicIPAddress() { + return this.publicIPAddress; + } + + /** + * Set the reference of the Public IP resource. + * + * @param publicIPAddress the publicIPAddress value to set + * @return the FrontendIPConfigurationInner object itself. + */ + public FrontendIPConfigurationInner withPublicIPAddress(PublicIPAddressInner publicIPAddress) { + this.publicIPAddress = publicIPAddress; + return this; + } + + /** + * Get gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the FrontendIPConfigurationInner object itself. + */ + public FrontendIPConfigurationInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the FrontendIPConfigurationInner object itself. + */ + public FrontendIPConfigurationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the FrontendIPConfigurationInner object itself. + */ + public FrontendIPConfigurationInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get a list of availability zones denoting the IP allocated for the resource needs to come from. + * + * @return the zones value + */ + public List zones() { + return this.zones; + } + + /** + * Set a list of availability zones denoting the IP allocated for the resource needs to come from. + * + * @param zones the zones value to set + * @return the FrontendIPConfigurationInner object itself. + */ + public FrontendIPConfigurationInner withZones(List zones) { + this.zones = zones; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/GatewayRouteListResultImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/GatewayRouteListResultImpl.java new file mode 100644 index 000000000000..98213112fb34 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/GatewayRouteListResultImpl.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.GatewayRouteListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.GatewayRoute; + +class GatewayRouteListResultImpl extends WrapperImpl implements GatewayRouteListResult { + private final NetworkManager manager; + GatewayRouteListResultImpl(GatewayRouteListResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/GatewayRouteListResultInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/GatewayRouteListResultInner.java new file mode 100644 index 000000000000..92e4549771a8 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/GatewayRouteListResultInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.GatewayRoute; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * List of virtual network gateway routes. + */ +public class GatewayRouteListResultInner { + /** + * List of gateway routes. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get list of gateway routes. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set list of gateway routes. + * + * @param value the value value to set + * @return the GatewayRouteListResultInner object itself. + */ + public GatewayRouteListResultInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/HubVirtualNetworkConnectionImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/HubVirtualNetworkConnectionImpl.java new file mode 100644 index 000000000000..ea5b302808f5 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/HubVirtualNetworkConnectionImpl.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.HubVirtualNetworkConnection; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_06_01.ProvisioningState; +import com.microsoft.azure.SubResource; +import java.util.Map; + +class HubVirtualNetworkConnectionImpl extends IndexableRefreshableWrapperImpl implements HubVirtualNetworkConnection { + private final NetworkManager manager; + private String resourceGroupName; + private String virtualHubName; + private String connectionName; + + HubVirtualNetworkConnectionImpl(HubVirtualNetworkConnectionInner inner, NetworkManager manager) { + super(null, inner); + this.manager = manager; + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.virtualHubName = IdParsingUtils.getValueFromIdByName(inner.id(), "virtualHubs"); + this.connectionName = IdParsingUtils.getValueFromIdByName(inner.id(), "hubVirtualNetworkConnections"); + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + HubVirtualNetworkConnectionsInner client = this.manager().inner().hubVirtualNetworkConnections(); + return client.getAsync(this.resourceGroupName, this.virtualHubName, this.connectionName); + } + + + + @Override + public Boolean allowHubToRemoteVnetTransit() { + return this.inner().allowHubToRemoteVnetTransit(); + } + + @Override + public Boolean allowRemoteVnetToUseHubVnetGateways() { + return this.inner().allowRemoteVnetToUseHubVnetGateways(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public SubResource remoteVirtualNetwork() { + return this.inner().remoteVirtualNetwork(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/HubVirtualNetworkConnectionInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/HubVirtualNetworkConnectionInner.java new file mode 100644 index 000000000000..9aacd555e7ca --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/HubVirtualNetworkConnectionInner.java @@ -0,0 +1,171 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_06_01.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * HubVirtualNetworkConnection Resource. + */ +@JsonFlatten +@SkipParentValidation +public class HubVirtualNetworkConnectionInner extends Resource { + /** + * Reference to the remote virtual network. + */ + @JsonProperty(value = "properties.remoteVirtualNetwork") + private SubResource remoteVirtualNetwork; + + /** + * VirtualHub to RemoteVnet transit to enabled or not. + */ + @JsonProperty(value = "properties.allowHubToRemoteVnetTransit") + private Boolean allowHubToRemoteVnetTransit; + + /** + * Allow RemoteVnet to use Virtual Hub's gateways. + */ + @JsonProperty(value = "properties.allowRemoteVnetToUseHubVnetGateways") + private Boolean allowRemoteVnetToUseHubVnetGateways; + + /** + * The provisioning state of the resource. Possible values include: + * 'Succeeded', 'Updating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningState provisioningState; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get reference to the remote virtual network. + * + * @return the remoteVirtualNetwork value + */ + public SubResource remoteVirtualNetwork() { + return this.remoteVirtualNetwork; + } + + /** + * Set reference to the remote virtual network. + * + * @param remoteVirtualNetwork the remoteVirtualNetwork value to set + * @return the HubVirtualNetworkConnectionInner object itself. + */ + public HubVirtualNetworkConnectionInner withRemoteVirtualNetwork(SubResource remoteVirtualNetwork) { + this.remoteVirtualNetwork = remoteVirtualNetwork; + return this; + } + + /** + * Get virtualHub to RemoteVnet transit to enabled or not. + * + * @return the allowHubToRemoteVnetTransit value + */ + public Boolean allowHubToRemoteVnetTransit() { + return this.allowHubToRemoteVnetTransit; + } + + /** + * Set virtualHub to RemoteVnet transit to enabled or not. + * + * @param allowHubToRemoteVnetTransit the allowHubToRemoteVnetTransit value to set + * @return the HubVirtualNetworkConnectionInner object itself. + */ + public HubVirtualNetworkConnectionInner withAllowHubToRemoteVnetTransit(Boolean allowHubToRemoteVnetTransit) { + this.allowHubToRemoteVnetTransit = allowHubToRemoteVnetTransit; + return this; + } + + /** + * Get allow RemoteVnet to use Virtual Hub's gateways. + * + * @return the allowRemoteVnetToUseHubVnetGateways value + */ + public Boolean allowRemoteVnetToUseHubVnetGateways() { + return this.allowRemoteVnetToUseHubVnetGateways; + } + + /** + * Set allow RemoteVnet to use Virtual Hub's gateways. + * + * @param allowRemoteVnetToUseHubVnetGateways the allowRemoteVnetToUseHubVnetGateways value to set + * @return the HubVirtualNetworkConnectionInner object itself. + */ + public HubVirtualNetworkConnectionInner withAllowRemoteVnetToUseHubVnetGateways(Boolean allowRemoteVnetToUseHubVnetGateways) { + this.allowRemoteVnetToUseHubVnetGateways = allowRemoteVnetToUseHubVnetGateways; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the HubVirtualNetworkConnectionInner object itself. + */ + public HubVirtualNetworkConnectionInner withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the HubVirtualNetworkConnectionInner object itself. + */ + public HubVirtualNetworkConnectionInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/HubVirtualNetworkConnectionsImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/HubVirtualNetworkConnectionsImpl.java new file mode 100644 index 000000000000..22383e8fae7b --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/HubVirtualNetworkConnectionsImpl.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.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_06_01.HubVirtualNetworkConnections; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_06_01.HubVirtualNetworkConnection; + +class HubVirtualNetworkConnectionsImpl extends WrapperImpl implements HubVirtualNetworkConnections { + private final NetworkManager manager; + + HubVirtualNetworkConnectionsImpl(NetworkManager manager) { + super(manager.inner().hubVirtualNetworkConnections()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + private HubVirtualNetworkConnectionImpl wrapModel(HubVirtualNetworkConnectionInner inner) { + return new HubVirtualNetworkConnectionImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String virtualHubName) { + HubVirtualNetworkConnectionsInner client = this.inner(); + return client.listAsync(resourceGroupName, virtualHubName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public HubVirtualNetworkConnection call(HubVirtualNetworkConnectionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String virtualHubName, String connectionName) { + HubVirtualNetworkConnectionsInner client = this.inner(); + return client.getAsync(resourceGroupName, virtualHubName, connectionName) + .map(new Func1() { + @Override + public HubVirtualNetworkConnection call(HubVirtualNetworkConnectionInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/HubVirtualNetworkConnectionsInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/HubVirtualNetworkConnectionsInner.java new file mode 100644 index 000000000000..187cd06d6d72 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/HubVirtualNetworkConnectionsInner.java @@ -0,0 +1,397 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_06_01.ErrorException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.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 HubVirtualNetworkConnections. + */ +public class HubVirtualNetworkConnectionsInner { + /** The Retrofit service to perform REST calls. */ + private HubVirtualNetworkConnectionsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of HubVirtualNetworkConnectionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public HubVirtualNetworkConnectionsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(HubVirtualNetworkConnectionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for HubVirtualNetworkConnections to be + * used by Retrofit to perform actually REST calls. + */ + interface HubVirtualNetworkConnectionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.HubVirtualNetworkConnections get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubVirtualNetworkConnections/{connectionName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualHubName") String virtualHubName, @Path("connectionName") String connectionName, @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.network.v2018_06_01.HubVirtualNetworkConnections list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubVirtualNetworkConnections") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualHubName") String virtualHubName, @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.network.v2018_06_01.HubVirtualNetworkConnections listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Retrieves the details of a HubVirtualNetworkConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the HubVirtualNetworkConnectionInner object if successful. + */ + public HubVirtualNetworkConnectionInner get(String resourceGroupName, String virtualHubName, String connectionName) { + return getWithServiceResponseAsync(resourceGroupName, virtualHubName, connectionName).toBlocking().single().body(); + } + + /** + * Retrieves the details of a HubVirtualNetworkConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the vpn connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String virtualHubName, String connectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, virtualHubName, connectionName), serviceCallback); + } + + /** + * Retrieves the details of a HubVirtualNetworkConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the HubVirtualNetworkConnectionInner object + */ + public Observable getAsync(String resourceGroupName, String virtualHubName, String connectionName) { + return getWithServiceResponseAsync(resourceGroupName, virtualHubName, connectionName).map(new Func1, HubVirtualNetworkConnectionInner>() { + @Override + public HubVirtualNetworkConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Retrieves the details of a HubVirtualNetworkConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the HubVirtualNetworkConnectionInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String virtualHubName, String connectionName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualHubName == null) { + throw new IllegalArgumentException("Parameter virtualHubName is required and cannot be null."); + } + if (connectionName == null) { + throw new IllegalArgumentException("Parameter connectionName is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.get(this.client.subscriptionId(), resourceGroupName, virtualHubName, connectionName, 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 ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException 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<HubVirtualNetworkConnectionInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String virtualHubName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, virtualHubName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String virtualHubName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, virtualHubName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<HubVirtualNetworkConnectionInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String virtualHubName) { + return listWithServiceResponseAsync(resourceGroupName, virtualHubName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<HubVirtualNetworkConnectionInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String virtualHubName) { + return listSinglePageAsync(resourceGroupName, virtualHubName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + ServiceResponse> * @param resourceGroupName The resource group name of the VirtualHub. + ServiceResponse> * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<HubVirtualNetworkConnectionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String virtualHubName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualHubName == null) { + throw new IllegalArgumentException("Parameter virtualHubName is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.list(this.client.subscriptionId(), resourceGroupName, virtualHubName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException 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<HubVirtualNetworkConnectionInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + * @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<HubVirtualNetworkConnectionInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + * @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<HubVirtualNetworkConnectionInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<HubVirtualNetworkConnectionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/IPAddressAvailabilityResultImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/IPAddressAvailabilityResultImpl.java new file mode 100644 index 000000000000..1267dbd265fb --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/IPAddressAvailabilityResultImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.IPAddressAvailabilityResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class IPAddressAvailabilityResultImpl extends WrapperImpl implements IPAddressAvailabilityResult { + private final NetworkManager manager; + IPAddressAvailabilityResultImpl(IPAddressAvailabilityResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Boolean available() { + return this.inner().available(); + } + + @Override + public List availableIPAddresses() { + return this.inner().availableIPAddresses(); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/IPAddressAvailabilityResultInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/IPAddressAvailabilityResultInner.java new file mode 100644 index 000000000000..2042673de7a9 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/IPAddressAvailabilityResultInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Response for CheckIPAddressAvailability API service call. + */ +public class IPAddressAvailabilityResultInner { + /** + * Private IP address availability. + */ + @JsonProperty(value = "available") + private Boolean available; + + /** + * Contains other available private IP addresses if the asked for address + * is taken. + */ + @JsonProperty(value = "availableIPAddresses") + private List availableIPAddresses; + + /** + * Get private IP address availability. + * + * @return the available value + */ + public Boolean available() { + return this.available; + } + + /** + * Set private IP address availability. + * + * @param available the available value to set + * @return the IPAddressAvailabilityResultInner object itself. + */ + public IPAddressAvailabilityResultInner withAvailable(Boolean available) { + this.available = available; + return this; + } + + /** + * Get contains other available private IP addresses if the asked for address is taken. + * + * @return the availableIPAddresses value + */ + public List availableIPAddresses() { + return this.availableIPAddresses; + } + + /** + * Set contains other available private IP addresses if the asked for address is taken. + * + * @param availableIPAddresses the availableIPAddresses value to set + * @return the IPAddressAvailabilityResultInner object itself. + */ + public IPAddressAvailabilityResultInner withAvailableIPAddresses(List availableIPAddresses) { + this.availableIPAddresses = availableIPAddresses; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/IdParsingUtils.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/IdParsingUtils.java new file mode 100644 index 000000000000..305820ddec23 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/InboundNatRuleImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/InboundNatRuleImpl.java new file mode 100644 index 000000000000..5d447a8fdbce --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/InboundNatRuleImpl.java @@ -0,0 +1,202 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.InboundNatRule; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_06_01.TransportProtocol; +import com.microsoft.azure.management.network.v2018_06_01.VirtualMachineScaleSetNetworkInterfaceIPConfiguration; + +class InboundNatRuleImpl extends CreatableUpdatableImpl implements InboundNatRule, InboundNatRule.Definition, InboundNatRule.Update { + private final NetworkManager manager; + private String resourceGroupName; + private String loadBalancerName; + private String inboundNatRuleName; + + InboundNatRuleImpl(String name, NetworkManager manager) { + super(name, new InboundNatRuleInner()); + this.manager = manager; + // Set resource name + this.inboundNatRuleName = name; + // + } + + InboundNatRuleImpl(InboundNatRuleInner inner, NetworkManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.inboundNatRuleName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.loadBalancerName = IdParsingUtils.getValueFromIdByName(inner.id(), "loadBalancers"); + this.inboundNatRuleName = IdParsingUtils.getValueFromIdByName(inner.id(), "inboundNatRules"); + // + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + InboundNatRulesInner client = this.manager().inner().inboundNatRules(); + return client.createOrUpdateAsync(this.resourceGroupName, this.loadBalancerName, this.inboundNatRuleName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + InboundNatRulesInner client = this.manager().inner().inboundNatRules(); + return client.createOrUpdateAsync(this.resourceGroupName, this.loadBalancerName, this.inboundNatRuleName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + InboundNatRulesInner client = this.manager().inner().inboundNatRules(); + return client.getAsync(this.resourceGroupName, this.loadBalancerName, this.inboundNatRuleName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public VirtualMachineScaleSetNetworkInterfaceIPConfiguration backendIPConfiguration() { + NetworkInterfaceIPConfigurationInner inner = this.inner().backendIPConfiguration(); + if (inner != null) { + return new VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl(inner, manager()); + } else { + return null; + } + } + + @Override + public Integer backendPort() { + return this.inner().backendPort(); + } + + @Override + public Boolean enableFloatingIP() { + return this.inner().enableFloatingIP(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public SubResource frontendIPConfiguration() { + return this.inner().frontendIPConfiguration(); + } + + @Override + public Integer frontendPort() { + return this.inner().frontendPort(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Integer idleTimeoutInMinutes() { + return this.inner().idleTimeoutInMinutes(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public TransportProtocol protocol() { + return this.inner().protocol(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public InboundNatRuleImpl withExistingLoadBalancer(String resourceGroupName, String loadBalancerName) { + this.resourceGroupName = resourceGroupName; + this.loadBalancerName = loadBalancerName; + return this; + } + + @Override + public InboundNatRuleImpl withBackendPort(Integer backendPort) { + this.inner().withBackendPort(backendPort); + return this; + } + + @Override + public InboundNatRuleImpl withEnableFloatingIP(Boolean enableFloatingIP) { + this.inner().withEnableFloatingIP(enableFloatingIP); + return this; + } + + @Override + public InboundNatRuleImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public InboundNatRuleImpl withFrontendIPConfiguration(SubResource frontendIPConfiguration) { + this.inner().withFrontendIPConfiguration(frontendIPConfiguration); + return this; + } + + @Override + public InboundNatRuleImpl withFrontendPort(Integer frontendPort) { + this.inner().withFrontendPort(frontendPort); + return this; + } + + @Override + public InboundNatRuleImpl withId(String id) { + this.inner().withId(id); + return this; + } + + @Override + public InboundNatRuleImpl withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { + this.inner().withIdleTimeoutInMinutes(idleTimeoutInMinutes); + return this; + } + + @Override + public InboundNatRuleImpl withName(String name) { + this.inner().withName(name); + return this; + } + + @Override + public InboundNatRuleImpl withProtocol(TransportProtocol protocol) { + this.inner().withProtocol(protocol); + return this; + } + + @Override + public InboundNatRuleImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/InboundNatRuleInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/InboundNatRuleInner.java new file mode 100644 index 000000000000..ce9159b6cc2e --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/InboundNatRuleInner.java @@ -0,0 +1,282 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_06_01.TransportProtocol; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Inbound NAT rule of the load balancer. + */ +@JsonFlatten +public class InboundNatRuleInner extends SubResource { + /** + * A reference to frontend IP addresses. + */ + @JsonProperty(value = "properties.frontendIPConfiguration") + private SubResource frontendIPConfiguration; + + /** + * A reference to a private IP address defined on a network interface of a + * VM. Traffic sent to the frontend port of each of the frontend IP + * configurations is forwarded to the backend IP. + */ + @JsonProperty(value = "properties.backendIPConfiguration", access = JsonProperty.Access.WRITE_ONLY) + private NetworkInterfaceIPConfigurationInner backendIPConfiguration; + + /** + * Possible values include: 'Udp', 'Tcp', 'All'. + */ + @JsonProperty(value = "properties.protocol") + private TransportProtocol protocol; + + /** + * The port for the external endpoint. Port numbers for each rule must be + * unique within the Load Balancer. Acceptable values range from 1 to + * 65534. + */ + @JsonProperty(value = "properties.frontendPort") + private Integer frontendPort; + + /** + * The port used for the internal endpoint. Acceptable values range from 1 + * to 65535. + */ + @JsonProperty(value = "properties.backendPort") + private Integer backendPort; + + /** + * The timeout for the TCP idle connection. The value can be set between 4 + * and 30 minutes. The default value is 4 minutes. This element is only + * used when the protocol is set to TCP. + */ + @JsonProperty(value = "properties.idleTimeoutInMinutes") + private Integer idleTimeoutInMinutes; + + /** + * Configures a virtual machine's endpoint for the floating IP capability + * required to configure a SQL AlwaysOn Availability Group. This setting is + * required when using the SQL AlwaysOn Availability Groups in SQL server. + * This setting can't be changed after you create the endpoint. + */ + @JsonProperty(value = "properties.enableFloatingIP") + private Boolean enableFloatingIP; + + /** + * Gets the provisioning state of the public IP resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Gets name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get a reference to frontend IP addresses. + * + * @return the frontendIPConfiguration value + */ + public SubResource frontendIPConfiguration() { + return this.frontendIPConfiguration; + } + + /** + * Set a reference to frontend IP addresses. + * + * @param frontendIPConfiguration the frontendIPConfiguration value to set + * @return the InboundNatRuleInner object itself. + */ + public InboundNatRuleInner withFrontendIPConfiguration(SubResource frontendIPConfiguration) { + this.frontendIPConfiguration = frontendIPConfiguration; + return this; + } + + /** + * Get a reference to a private IP address defined on a network interface of a VM. Traffic sent to the frontend port of each of the frontend IP configurations is forwarded to the backend IP. + * + * @return the backendIPConfiguration value + */ + public NetworkInterfaceIPConfigurationInner backendIPConfiguration() { + return this.backendIPConfiguration; + } + + /** + * Get possible values include: 'Udp', 'Tcp', 'All'. + * + * @return the protocol value + */ + public TransportProtocol protocol() { + return this.protocol; + } + + /** + * Set possible values include: 'Udp', 'Tcp', 'All'. + * + * @param protocol the protocol value to set + * @return the InboundNatRuleInner object itself. + */ + public InboundNatRuleInner withProtocol(TransportProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values range from 1 to 65534. + * + * @return the frontendPort value + */ + public Integer frontendPort() { + return this.frontendPort; + } + + /** + * Set the port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values range from 1 to 65534. + * + * @param frontendPort the frontendPort value to set + * @return the InboundNatRuleInner object itself. + */ + public InboundNatRuleInner withFrontendPort(Integer frontendPort) { + this.frontendPort = frontendPort; + return this; + } + + /** + * Get the port used for the internal endpoint. Acceptable values range from 1 to 65535. + * + * @return the backendPort value + */ + public Integer backendPort() { + return this.backendPort; + } + + /** + * Set the port used for the internal endpoint. Acceptable values range from 1 to 65535. + * + * @param backendPort the backendPort value to set + * @return the InboundNatRuleInner object itself. + */ + public InboundNatRuleInner withBackendPort(Integer backendPort) { + this.backendPort = backendPort; + return this; + } + + /** + * Get the timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. + * + * @return the idleTimeoutInMinutes value + */ + public Integer idleTimeoutInMinutes() { + return this.idleTimeoutInMinutes; + } + + /** + * Set the timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. + * + * @param idleTimeoutInMinutes the idleTimeoutInMinutes value to set + * @return the InboundNatRuleInner object itself. + */ + public InboundNatRuleInner withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { + this.idleTimeoutInMinutes = idleTimeoutInMinutes; + return this; + } + + /** + * Get configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint. + * + * @return the enableFloatingIP value + */ + public Boolean enableFloatingIP() { + return this.enableFloatingIP; + } + + /** + * Set configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint. + * + * @param enableFloatingIP the enableFloatingIP value to set + * @return the InboundNatRuleInner object itself. + */ + public InboundNatRuleInner withEnableFloatingIP(Boolean enableFloatingIP) { + this.enableFloatingIP = enableFloatingIP; + return this; + } + + /** + * Get gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the InboundNatRuleInner object itself. + */ + public InboundNatRuleInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get gets name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set gets name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the InboundNatRuleInner object itself. + */ + public InboundNatRuleInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the InboundNatRuleInner object itself. + */ + public InboundNatRuleInner withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/InboundNatRulesImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/InboundNatRulesImpl.java new file mode 100644 index 000000000000..b9971d18de7e --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/InboundNatRulesImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_06_01.InboundNatRules; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_06_01.InboundNatRule; + +class InboundNatRulesImpl extends WrapperImpl implements InboundNatRules { + private final NetworkManager manager; + + InboundNatRulesImpl(NetworkManager manager) { + super(manager.inner().inboundNatRules()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public InboundNatRuleImpl define(String name) { + return wrapModel(name); + } + + private InboundNatRuleImpl wrapModel(InboundNatRuleInner inner) { + return new InboundNatRuleImpl(inner, manager()); + } + + private InboundNatRuleImpl wrapModel(String name) { + return new InboundNatRuleImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String loadBalancerName) { + InboundNatRulesInner client = this.inner(); + return client.listAsync(resourceGroupName, loadBalancerName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public InboundNatRule call(InboundNatRuleInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName) { + InboundNatRulesInner client = this.inner(); + return client.getAsync(resourceGroupName, loadBalancerName, inboundNatRuleName) + .map(new Func1() { + @Override + public InboundNatRule call(InboundNatRuleInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName) { + InboundNatRulesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, loadBalancerName, inboundNatRuleName).toCompletable(); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/InboundNatRulesInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/InboundNatRulesInner.java new file mode 100644 index 000000000000..230b5a958004 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/InboundNatRulesInner.java @@ -0,0 +1,853 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.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 InboundNatRules. + */ +public class InboundNatRulesInner { + /** The Retrofit service to perform REST calls. */ + private InboundNatRulesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of InboundNatRulesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public InboundNatRulesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(InboundNatRulesService.class); + this.client = client; + } + + /** + * The interface defining all the services for InboundNatRules to be + * used by Retrofit to perform actually REST calls. + */ + interface InboundNatRulesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.InboundNatRules list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @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.network.v2018_06_01.InboundNatRules delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("inboundNatRuleName") String inboundNatRuleName, @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.network.v2018_06_01.InboundNatRules beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("inboundNatRuleName") String inboundNatRuleName, @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.network.v2018_06_01.InboundNatRules get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("inboundNatRuleName") String inboundNatRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @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.network.v2018_06_01.InboundNatRules createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("inboundNatRuleName") String inboundNatRuleName, @Path("subscriptionId") String subscriptionId, @Body InboundNatRuleInner inboundNatRuleParameters, @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.network.v2018_06_01.InboundNatRules beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("inboundNatRuleName") String inboundNatRuleName, @Path("subscriptionId") String subscriptionId, @Body InboundNatRuleInner inboundNatRuleParameters, @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.network.v2018_06_01.InboundNatRules listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets all the inbound nat rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<InboundNatRuleInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String loadBalancerName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, loadBalancerName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the inbound nat rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String loadBalancerName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, loadBalancerName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the inbound nat rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<InboundNatRuleInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String loadBalancerName) { + return listWithServiceResponseAsync(resourceGroupName, loadBalancerName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the inbound nat rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<InboundNatRuleInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String loadBalancerName) { + return listSinglePageAsync(resourceGroupName, loadBalancerName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the inbound nat rules in a load balancer. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<InboundNatRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String loadBalancerName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.list(resourceGroupName, loadBalancerName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String loadBalancerName, String inboundNatRuleName) { + deleteWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName).toBlocking().last().body(); + } + + /** + * Deletes the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName), serviceCallback); + } + + /** + * Deletes the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName) { + return deleteWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (inboundNatRuleName == null) { + throw new IllegalArgumentException("Parameter inboundNatRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + Observable> observable = service.delete(resourceGroupName, loadBalancerName, inboundNatRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String loadBalancerName, String inboundNatRuleName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName).toBlocking().single().body(); + } + + /** + * Deletes the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName), serviceCallback); + } + + /** + * Deletes the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (inboundNatRuleName == null) { + throw new IllegalArgumentException("Parameter inboundNatRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.beginDelete(resourceGroupName, loadBalancerName, inboundNatRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the InboundNatRuleInner object if successful. + */ + public InboundNatRuleInner get(String resourceGroupName, String loadBalancerName, String inboundNatRuleName) { + return getWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName).toBlocking().single().body(); + } + + /** + * Gets the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName), serviceCallback); + } + + /** + * Gets the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InboundNatRuleInner object + */ + public Observable getAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName) { + return getWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName).map(new Func1, InboundNatRuleInner>() { + @Override + public InboundNatRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InboundNatRuleInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (inboundNatRuleName == null) { + throw new IllegalArgumentException("Parameter inboundNatRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + final String expand = null; + return service.get(resourceGroupName, loadBalancerName, inboundNatRuleName, this.client.subscriptionId(), apiVersion, expand, 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); + } + } + }); + } + + /** + * Gets the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the InboundNatRuleInner object if successful. + */ + public InboundNatRuleInner get(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, String expand) { + return getWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, expand).toBlocking().single().body(); + } + + /** + * Gets the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param expand Expands referenced resources. + * @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 loadBalancerName, String inboundNatRuleName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, expand), serviceCallback); + } + + /** + * Gets the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InboundNatRuleInner object + */ + public Observable getAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, String expand) { + return getWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, expand).map(new Func1, InboundNatRuleInner>() { + @Override + public InboundNatRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InboundNatRuleInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (inboundNatRuleName == null) { + throw new IllegalArgumentException("Parameter inboundNatRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.get(resourceGroupName, loadBalancerName, inboundNatRuleName, this.client.subscriptionId(), apiVersion, expand, 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param inboundNatRuleParameters Parameters supplied to the create or update inbound nat rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the InboundNatRuleInner object if successful. + */ + public InboundNatRuleInner createOrUpdate(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, InboundNatRuleInner inboundNatRuleParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters).toBlocking().last().body(); + } + + /** + * Creates or updates a load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param inboundNatRuleParameters Parameters supplied to the create or update inbound nat rule operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, InboundNatRuleInner inboundNatRuleParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters), serviceCallback); + } + + /** + * Creates or updates a load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param inboundNatRuleParameters Parameters supplied to the create or update inbound nat rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, InboundNatRuleInner inboundNatRuleParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters).map(new Func1, InboundNatRuleInner>() { + @Override + public InboundNatRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param inboundNatRuleParameters Parameters supplied to the create or update inbound nat rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, InboundNatRuleInner inboundNatRuleParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (inboundNatRuleName == null) { + throw new IllegalArgumentException("Parameter inboundNatRuleName 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 (inboundNatRuleParameters == null) { + throw new IllegalArgumentException("Parameter inboundNatRuleParameters is required and cannot be null."); + } + Validator.validate(inboundNatRuleParameters); + final String apiVersion = "2018-06-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, loadBalancerName, inboundNatRuleName, this.client.subscriptionId(), inboundNatRuleParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param inboundNatRuleParameters Parameters supplied to the create or update inbound nat rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the InboundNatRuleInner object if successful. + */ + public InboundNatRuleInner beginCreateOrUpdate(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, InboundNatRuleInner inboundNatRuleParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters).toBlocking().single().body(); + } + + /** + * Creates or updates a load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param inboundNatRuleParameters Parameters supplied to the create or update inbound nat rule operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, InboundNatRuleInner inboundNatRuleParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters), serviceCallback); + } + + /** + * Creates or updates a load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param inboundNatRuleParameters Parameters supplied to the create or update inbound nat rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InboundNatRuleInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, InboundNatRuleInner inboundNatRuleParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters).map(new Func1, InboundNatRuleInner>() { + @Override + public InboundNatRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a load balancer inbound nat rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound nat rule. + * @param inboundNatRuleParameters Parameters supplied to the create or update inbound nat rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InboundNatRuleInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, InboundNatRuleInner inboundNatRuleParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (inboundNatRuleName == null) { + throw new IllegalArgumentException("Parameter inboundNatRuleName 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 (inboundNatRuleParameters == null) { + throw new IllegalArgumentException("Parameter inboundNatRuleParameters is required and cannot be null."); + } + Validator.validate(inboundNatRuleParameters); + final String apiVersion = "2018-06-01"; + return service.beginCreateOrUpdate(resourceGroupName, loadBalancerName, inboundNatRuleName, this.client.subscriptionId(), inboundNatRuleParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the inbound nat rules in a load balancer. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<InboundNatRuleInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the inbound nat rules in a load balancer. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the inbound nat rules in a load balancer. + * + * @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<InboundNatRuleInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the inbound nat rules in a load balancer. + * + * @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<InboundNatRuleInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the inbound nat rules in a load balancer. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<InboundNatRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LoadBalancerBackendAddressPoolsImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LoadBalancerBackendAddressPoolsImpl.java new file mode 100644 index 000000000000..b87c1d566a83 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LoadBalancerBackendAddressPoolsImpl.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.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_06_01.LoadBalancerBackendAddressPools; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_06_01.BackendAddressPool; + +class LoadBalancerBackendAddressPoolsImpl extends WrapperImpl implements LoadBalancerBackendAddressPools { + private final NetworkManager manager; + + LoadBalancerBackendAddressPoolsImpl(NetworkManager manager) { + super(manager.inner().loadBalancerBackendAddressPools()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + private BackendAddressPoolImpl wrapModel(BackendAddressPoolInner inner) { + return new BackendAddressPoolImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String loadBalancerName) { + LoadBalancerBackendAddressPoolsInner client = this.inner(); + return client.listAsync(resourceGroupName, loadBalancerName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public BackendAddressPool call(BackendAddressPoolInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String loadBalancerName, String backendAddressPoolName) { + LoadBalancerBackendAddressPoolsInner client = this.inner(); + return client.getAsync(resourceGroupName, loadBalancerName, backendAddressPoolName) + .map(new Func1() { + @Override + public BackendAddressPool call(BackendAddressPoolInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LoadBalancerBackendAddressPoolsInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LoadBalancerBackendAddressPoolsInner.java new file mode 100644 index 000000000000..0388d9a5d031 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LoadBalancerBackendAddressPoolsInner.java @@ -0,0 +1,397 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.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 LoadBalancerBackendAddressPools. + */ +public class LoadBalancerBackendAddressPoolsInner { + /** The Retrofit service to perform REST calls. */ + private LoadBalancerBackendAddressPoolsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of LoadBalancerBackendAddressPoolsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LoadBalancerBackendAddressPoolsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(LoadBalancerBackendAddressPoolsService.class); + this.client = client; + } + + /** + * The interface defining all the services for LoadBalancerBackendAddressPools to be + * used by Retrofit to perform actually REST calls. + */ + interface LoadBalancerBackendAddressPoolsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.LoadBalancerBackendAddressPools list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @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.network.v2018_06_01.LoadBalancerBackendAddressPools get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("backendAddressPoolName") String backendAddressPoolName, @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.network.v2018_06_01.LoadBalancerBackendAddressPools listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets all the load balancer backed address pools. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<BackendAddressPoolInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String loadBalancerName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, loadBalancerName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the load balancer backed address pools. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String loadBalancerName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, loadBalancerName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the load balancer backed address pools. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BackendAddressPoolInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String loadBalancerName) { + return listWithServiceResponseAsync(resourceGroupName, loadBalancerName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the load balancer backed address pools. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BackendAddressPoolInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String loadBalancerName) { + return listSinglePageAsync(resourceGroupName, loadBalancerName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the load balancer backed address pools. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<BackendAddressPoolInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String loadBalancerName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.list(resourceGroupName, loadBalancerName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BackendAddressPoolInner object if successful. + */ + public BackendAddressPoolInner get(String resourceGroupName, String loadBalancerName, String backendAddressPoolName) { + return getWithServiceResponseAsync(resourceGroupName, loadBalancerName, backendAddressPoolName).toBlocking().single().body(); + } + + /** + * Gets load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @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 loadBalancerName, String backendAddressPoolName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, loadBalancerName, backendAddressPoolName), serviceCallback); + } + + /** + * Gets load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BackendAddressPoolInner object + */ + public Observable getAsync(String resourceGroupName, String loadBalancerName, String backendAddressPoolName) { + return getWithServiceResponseAsync(resourceGroupName, loadBalancerName, backendAddressPoolName).map(new Func1, BackendAddressPoolInner>() { + @Override + public BackendAddressPoolInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BackendAddressPoolInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, String backendAddressPoolName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (backendAddressPoolName == null) { + throw new IllegalArgumentException("Parameter backendAddressPoolName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.get(resourceGroupName, loadBalancerName, backendAddressPoolName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the load balancer backed address pools. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<BackendAddressPoolInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the load balancer backed address pools. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the load balancer backed address pools. + * + * @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<BackendAddressPoolInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the load balancer backed address pools. + * + * @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<BackendAddressPoolInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the load balancer backed address pools. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<BackendAddressPoolInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LoadBalancerFrontendIPConfigurationsImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LoadBalancerFrontendIPConfigurationsImpl.java new file mode 100644 index 000000000000..1a7def1cd48f --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LoadBalancerFrontendIPConfigurationsImpl.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.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_06_01.LoadBalancerFrontendIPConfigurations; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_06_01.FrontendIPConfiguration; + +class LoadBalancerFrontendIPConfigurationsImpl extends WrapperImpl implements LoadBalancerFrontendIPConfigurations { + private final NetworkManager manager; + + LoadBalancerFrontendIPConfigurationsImpl(NetworkManager manager) { + super(manager.inner().loadBalancerFrontendIPConfigurations()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + private FrontendIPConfigurationImpl wrapModel(FrontendIPConfigurationInner inner) { + return new FrontendIPConfigurationImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String loadBalancerName) { + LoadBalancerFrontendIPConfigurationsInner client = this.inner(); + return client.listAsync(resourceGroupName, loadBalancerName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public FrontendIPConfiguration call(FrontendIPConfigurationInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String loadBalancerName, String frontendIPConfigurationName) { + LoadBalancerFrontendIPConfigurationsInner client = this.inner(); + return client.getAsync(resourceGroupName, loadBalancerName, frontendIPConfigurationName) + .map(new Func1() { + @Override + public FrontendIPConfiguration call(FrontendIPConfigurationInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LoadBalancerFrontendIPConfigurationsInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LoadBalancerFrontendIPConfigurationsInner.java new file mode 100644 index 000000000000..f638747960ce --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LoadBalancerFrontendIPConfigurationsInner.java @@ -0,0 +1,397 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.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 LoadBalancerFrontendIPConfigurations. + */ +public class LoadBalancerFrontendIPConfigurationsInner { + /** The Retrofit service to perform REST calls. */ + private LoadBalancerFrontendIPConfigurationsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of LoadBalancerFrontendIPConfigurationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LoadBalancerFrontendIPConfigurationsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(LoadBalancerFrontendIPConfigurationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for LoadBalancerFrontendIPConfigurations to be + * used by Retrofit to perform actually REST calls. + */ + interface LoadBalancerFrontendIPConfigurationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.LoadBalancerFrontendIPConfigurations list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/frontendIPConfigurations") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @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.network.v2018_06_01.LoadBalancerFrontendIPConfigurations get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/frontendIPConfigurations/{frontendIPConfigurationName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("frontendIPConfigurationName") String frontendIPConfigurationName, @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.network.v2018_06_01.LoadBalancerFrontendIPConfigurations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets all the load balancer frontend IP configurations. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<FrontendIPConfigurationInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String loadBalancerName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, loadBalancerName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the load balancer frontend IP configurations. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String loadBalancerName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, loadBalancerName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the load balancer frontend IP configurations. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<FrontendIPConfigurationInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String loadBalancerName) { + return listWithServiceResponseAsync(resourceGroupName, loadBalancerName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the load balancer frontend IP configurations. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<FrontendIPConfigurationInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String loadBalancerName) { + return listSinglePageAsync(resourceGroupName, loadBalancerName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the load balancer frontend IP configurations. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<FrontendIPConfigurationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String loadBalancerName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.list(resourceGroupName, loadBalancerName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets load balancer frontend IP configuration. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param frontendIPConfigurationName The name of the frontend IP configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the FrontendIPConfigurationInner object if successful. + */ + public FrontendIPConfigurationInner get(String resourceGroupName, String loadBalancerName, String frontendIPConfigurationName) { + return getWithServiceResponseAsync(resourceGroupName, loadBalancerName, frontendIPConfigurationName).toBlocking().single().body(); + } + + /** + * Gets load balancer frontend IP configuration. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param frontendIPConfigurationName The name of the frontend IP configuration. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String loadBalancerName, String frontendIPConfigurationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, loadBalancerName, frontendIPConfigurationName), serviceCallback); + } + + /** + * Gets load balancer frontend IP configuration. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param frontendIPConfigurationName The name of the frontend IP configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FrontendIPConfigurationInner object + */ + public Observable getAsync(String resourceGroupName, String loadBalancerName, String frontendIPConfigurationName) { + return getWithServiceResponseAsync(resourceGroupName, loadBalancerName, frontendIPConfigurationName).map(new Func1, FrontendIPConfigurationInner>() { + @Override + public FrontendIPConfigurationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets load balancer frontend IP configuration. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param frontendIPConfigurationName The name of the frontend IP configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FrontendIPConfigurationInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, String frontendIPConfigurationName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (frontendIPConfigurationName == null) { + throw new IllegalArgumentException("Parameter frontendIPConfigurationName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.get(resourceGroupName, loadBalancerName, frontendIPConfigurationName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the load balancer frontend IP configurations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<FrontendIPConfigurationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the load balancer frontend IP configurations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the load balancer frontend IP configurations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<FrontendIPConfigurationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the load balancer frontend IP configurations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<FrontendIPConfigurationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the load balancer frontend IP configurations. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<FrontendIPConfigurationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LoadBalancerImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LoadBalancerImpl.java new file mode 100644 index 000000000000..448f78b3ccd3 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LoadBalancerImpl.java @@ -0,0 +1,207 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_06_01.LoadBalancer; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_06_01.LoadBalancerSku; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.InboundNatPool; +import com.microsoft.azure.management.network.v2018_06_01.OutboundNatRule; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_06_01.BackendAddressPool; +import com.microsoft.azure.management.network.v2018_06_01.FrontendIPConfiguration; +import com.microsoft.azure.management.network.v2018_06_01.InboundNatRule; +import com.microsoft.azure.management.network.v2018_06_01.LoadBalancingRule; +import com.microsoft.azure.management.network.v2018_06_01.Probe; + +class LoadBalancerImpl extends GroupableResourceCoreImpl implements LoadBalancer, LoadBalancer.Definition, LoadBalancer.Update { + LoadBalancerImpl(String name, LoadBalancerInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + LoadBalancersInner client = this.manager().inner().loadBalancers(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + LoadBalancersInner client = this.manager().inner().loadBalancers(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + LoadBalancersInner client = this.manager().inner().loadBalancers(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public List backendAddressPools() { + List lst = new ArrayList(); + if (this.inner().backendAddressPools() != null) { + for (BackendAddressPoolInner inner : this.inner().backendAddressPools()) { + lst.add( new BackendAddressPoolImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public List frontendIPConfigurations() { + List lst = new ArrayList(); + if (this.inner().frontendIPConfigurations() != null) { + for (FrontendIPConfigurationInner inner : this.inner().frontendIPConfigurations()) { + lst.add( new FrontendIPConfigurationImpl(inner, manager())); + } + } + return lst; + } + + @Override + public List inboundNatPools() { + return this.inner().inboundNatPools(); + } + + @Override + public List inboundNatRules() { + List lst = new ArrayList(); + if (this.inner().inboundNatRules() != null) { + for (InboundNatRuleInner inner : this.inner().inboundNatRules()) { + lst.add( new InboundNatRuleImpl(inner, manager())); + } + } + return lst; + } + + @Override + public List loadBalancingRules() { + List lst = new ArrayList(); + if (this.inner().loadBalancingRules() != null) { + for (LoadBalancingRuleInner inner : this.inner().loadBalancingRules()) { + lst.add( new LoadBalancingRuleImpl(inner, manager())); + } + } + return lst; + } + + @Override + public List outboundNatRules() { + return this.inner().outboundNatRules(); + } + + @Override + public List probes() { + List lst = new ArrayList(); + if (this.inner().probes() != null) { + for (ProbeInner inner : this.inner().probes()) { + lst.add( new ProbeImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public LoadBalancerSku sku() { + return this.inner().sku(); + } + + @Override + public LoadBalancerImpl withBackendAddressPools(List backendAddressPools) { + this.inner().withBackendAddressPools(backendAddressPools); + return this; + } + + @Override + public LoadBalancerImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public LoadBalancerImpl withFrontendIPConfigurations(List frontendIPConfigurations) { + this.inner().withFrontendIPConfigurations(frontendIPConfigurations); + return this; + } + + @Override + public LoadBalancerImpl withInboundNatPools(List inboundNatPools) { + this.inner().withInboundNatPools(inboundNatPools); + return this; + } + + @Override + public LoadBalancerImpl withInboundNatRules(List inboundNatRules) { + this.inner().withInboundNatRules(inboundNatRules); + return this; + } + + @Override + public LoadBalancerImpl withLoadBalancingRules(List loadBalancingRules) { + this.inner().withLoadBalancingRules(loadBalancingRules); + return this; + } + + @Override + public LoadBalancerImpl withOutboundNatRules(List outboundNatRules) { + this.inner().withOutboundNatRules(outboundNatRules); + return this; + } + + @Override + public LoadBalancerImpl withProbes(List probes) { + this.inner().withProbes(probes); + return this; + } + + @Override + public LoadBalancerImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public LoadBalancerImpl withResourceGuid(String resourceGuid) { + this.inner().withResourceGuid(resourceGuid); + return this; + } + + @Override + public LoadBalancerImpl withSku(LoadBalancerSku sku) { + this.inner().withSku(sku); + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LoadBalancerInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LoadBalancerInner.java new file mode 100644 index 000000000000..53304722fb7d --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LoadBalancerInner.java @@ -0,0 +1,352 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.LoadBalancerSku; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.InboundNatPool; +import com.microsoft.azure.management.network.v2018_06_01.OutboundNatRule; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * LoadBalancer resource. + */ +@JsonFlatten +@SkipParentValidation +public class LoadBalancerInner extends Resource { + /** + * The load balancer SKU. + */ + @JsonProperty(value = "sku") + private LoadBalancerSku sku; + + /** + * Object representing the frontend IPs to be used for the load balancer. + */ + @JsonProperty(value = "properties.frontendIPConfigurations") + private List frontendIPConfigurations; + + /** + * Collection of backend address pools used by a load balancer. + */ + @JsonProperty(value = "properties.backendAddressPools") + private List backendAddressPools; + + /** + * Object collection representing the load balancing rules Gets the + * provisioning. + */ + @JsonProperty(value = "properties.loadBalancingRules") + private List loadBalancingRules; + + /** + * Collection of probe objects used in the load balancer. + */ + @JsonProperty(value = "properties.probes") + private List probes; + + /** + * Collection of inbound NAT Rules used by a load balancer. Defining + * inbound NAT rules on your load balancer is mutually exclusive with + * defining an inbound NAT pool. Inbound NAT pools are referenced from + * virtual machine scale sets. NICs that are associated with individual + * virtual machines cannot reference an Inbound NAT pool. They have to + * reference individual inbound NAT rules. + */ + @JsonProperty(value = "properties.inboundNatRules") + private List inboundNatRules; + + /** + * Defines an external port range for inbound NAT to a single backend port + * on NICs associated with a load balancer. Inbound NAT rules are created + * automatically for each NIC associated with the Load Balancer using an + * external port from this range. Defining an Inbound NAT pool on your Load + * Balancer is mutually exclusive with defining inbound Nat rules. Inbound + * NAT pools are referenced from virtual machine scale sets. NICs that are + * associated with individual virtual machines cannot reference an inbound + * NAT pool. They have to reference individual inbound NAT rules. + */ + @JsonProperty(value = "properties.inboundNatPools") + private List inboundNatPools; + + /** + * The outbound NAT rules. + */ + @JsonProperty(value = "properties.outboundNatRules") + private List outboundNatRules; + + /** + * The resource GUID property of the load balancer resource. + */ + @JsonProperty(value = "properties.resourceGuid") + private String resourceGuid; + + /** + * Gets the provisioning state of the PublicIP resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the load balancer SKU. + * + * @return the sku value + */ + public LoadBalancerSku sku() { + return this.sku; + } + + /** + * Set the load balancer SKU. + * + * @param sku the sku value to set + * @return the LoadBalancerInner object itself. + */ + public LoadBalancerInner withSku(LoadBalancerSku sku) { + this.sku = sku; + return this; + } + + /** + * Get object representing the frontend IPs to be used for the load balancer. + * + * @return the frontendIPConfigurations value + */ + public List frontendIPConfigurations() { + return this.frontendIPConfigurations; + } + + /** + * Set object representing the frontend IPs to be used for the load balancer. + * + * @param frontendIPConfigurations the frontendIPConfigurations value to set + * @return the LoadBalancerInner object itself. + */ + public LoadBalancerInner withFrontendIPConfigurations(List frontendIPConfigurations) { + this.frontendIPConfigurations = frontendIPConfigurations; + return this; + } + + /** + * Get collection of backend address pools used by a load balancer. + * + * @return the backendAddressPools value + */ + public List backendAddressPools() { + return this.backendAddressPools; + } + + /** + * Set collection of backend address pools used by a load balancer. + * + * @param backendAddressPools the backendAddressPools value to set + * @return the LoadBalancerInner object itself. + */ + public LoadBalancerInner withBackendAddressPools(List backendAddressPools) { + this.backendAddressPools = backendAddressPools; + return this; + } + + /** + * Get object collection representing the load balancing rules Gets the provisioning. + * + * @return the loadBalancingRules value + */ + public List loadBalancingRules() { + return this.loadBalancingRules; + } + + /** + * Set object collection representing the load balancing rules Gets the provisioning. + * + * @param loadBalancingRules the loadBalancingRules value to set + * @return the LoadBalancerInner object itself. + */ + public LoadBalancerInner withLoadBalancingRules(List loadBalancingRules) { + this.loadBalancingRules = loadBalancingRules; + return this; + } + + /** + * Get collection of probe objects used in the load balancer. + * + * @return the probes value + */ + public List probes() { + return this.probes; + } + + /** + * Set collection of probe objects used in the load balancer. + * + * @param probes the probes value to set + * @return the LoadBalancerInner object itself. + */ + public LoadBalancerInner withProbes(List probes) { + this.probes = probes; + return this; + } + + /** + * Get collection of inbound NAT Rules used by a load balancer. Defining inbound NAT rules on your load balancer is mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot reference an Inbound NAT pool. They have to reference individual inbound NAT rules. + * + * @return the inboundNatRules value + */ + public List inboundNatRules() { + return this.inboundNatRules; + } + + /** + * Set collection of inbound NAT Rules used by a load balancer. Defining inbound NAT rules on your load balancer is mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot reference an Inbound NAT pool. They have to reference individual inbound NAT rules. + * + * @param inboundNatRules the inboundNatRules value to set + * @return the LoadBalancerInner object itself. + */ + public LoadBalancerInner withInboundNatRules(List inboundNatRules) { + this.inboundNatRules = inboundNatRules; + return this; + } + + /** + * Get defines an external port range for inbound NAT to a single backend port on NICs associated with a load balancer. Inbound NAT rules are created automatically for each NIC associated with the Load Balancer using an external port from this range. Defining an Inbound NAT pool on your Load Balancer is mutually exclusive with defining inbound Nat rules. Inbound NAT pools are referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot reference an inbound NAT pool. They have to reference individual inbound NAT rules. + * + * @return the inboundNatPools value + */ + public List inboundNatPools() { + return this.inboundNatPools; + } + + /** + * Set defines an external port range for inbound NAT to a single backend port on NICs associated with a load balancer. Inbound NAT rules are created automatically for each NIC associated with the Load Balancer using an external port from this range. Defining an Inbound NAT pool on your Load Balancer is mutually exclusive with defining inbound Nat rules. Inbound NAT pools are referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot reference an inbound NAT pool. They have to reference individual inbound NAT rules. + * + * @param inboundNatPools the inboundNatPools value to set + * @return the LoadBalancerInner object itself. + */ + public LoadBalancerInner withInboundNatPools(List inboundNatPools) { + this.inboundNatPools = inboundNatPools; + return this; + } + + /** + * Get the outbound NAT rules. + * + * @return the outboundNatRules value + */ + public List outboundNatRules() { + return this.outboundNatRules; + } + + /** + * Set the outbound NAT rules. + * + * @param outboundNatRules the outboundNatRules value to set + * @return the LoadBalancerInner object itself. + */ + public LoadBalancerInner withOutboundNatRules(List outboundNatRules) { + this.outboundNatRules = outboundNatRules; + return this; + } + + /** + * Get the resource GUID property of the load balancer resource. + * + * @return the resourceGuid value + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Set the resource GUID property of the load balancer resource. + * + * @param resourceGuid the resourceGuid value to set + * @return the LoadBalancerInner object itself. + */ + public LoadBalancerInner withResourceGuid(String resourceGuid) { + this.resourceGuid = resourceGuid; + return this; + } + + /** + * Get gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the LoadBalancerInner object itself. + */ + public LoadBalancerInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the LoadBalancerInner object itself. + */ + public LoadBalancerInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the LoadBalancerInner object itself. + */ + public LoadBalancerInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LoadBalancerLoadBalancingRulesImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LoadBalancerLoadBalancingRulesImpl.java new file mode 100644 index 000000000000..fec03f0315c5 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LoadBalancerLoadBalancingRulesImpl.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.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_06_01.LoadBalancerLoadBalancingRules; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_06_01.LoadBalancingRule; + +class LoadBalancerLoadBalancingRulesImpl extends WrapperImpl implements LoadBalancerLoadBalancingRules { + private final NetworkManager manager; + + LoadBalancerLoadBalancingRulesImpl(NetworkManager manager) { + super(manager.inner().loadBalancerLoadBalancingRules()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + private LoadBalancingRuleImpl wrapModel(LoadBalancingRuleInner inner) { + return new LoadBalancingRuleImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String loadBalancerName) { + LoadBalancerLoadBalancingRulesInner client = this.inner(); + return client.listAsync(resourceGroupName, loadBalancerName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public LoadBalancingRule call(LoadBalancingRuleInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String loadBalancerName, String loadBalancingRuleName) { + LoadBalancerLoadBalancingRulesInner client = this.inner(); + return client.getAsync(resourceGroupName, loadBalancerName, loadBalancingRuleName) + .map(new Func1() { + @Override + public LoadBalancingRule call(LoadBalancingRuleInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LoadBalancerLoadBalancingRulesInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LoadBalancerLoadBalancingRulesInner.java new file mode 100644 index 000000000000..cc4ce55f0a63 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LoadBalancerLoadBalancingRulesInner.java @@ -0,0 +1,397 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.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 LoadBalancerLoadBalancingRules. + */ +public class LoadBalancerLoadBalancingRulesInner { + /** The Retrofit service to perform REST calls. */ + private LoadBalancerLoadBalancingRulesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of LoadBalancerLoadBalancingRulesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LoadBalancerLoadBalancingRulesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(LoadBalancerLoadBalancingRulesService.class); + this.client = client; + } + + /** + * The interface defining all the services for LoadBalancerLoadBalancingRules to be + * used by Retrofit to perform actually REST calls. + */ + interface LoadBalancerLoadBalancingRulesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.LoadBalancerLoadBalancingRules list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/loadBalancingRules") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @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.network.v2018_06_01.LoadBalancerLoadBalancingRules get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/loadBalancingRules/{loadBalancingRuleName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("loadBalancingRuleName") String loadBalancingRuleName, @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.network.v2018_06_01.LoadBalancerLoadBalancingRules listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets all the load balancing rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LoadBalancingRuleInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String loadBalancerName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, loadBalancerName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the load balancing rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String loadBalancerName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, loadBalancerName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the load balancing rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LoadBalancingRuleInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String loadBalancerName) { + return listWithServiceResponseAsync(resourceGroupName, loadBalancerName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the load balancing rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LoadBalancingRuleInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String loadBalancerName) { + return listSinglePageAsync(resourceGroupName, loadBalancerName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the load balancing rules in a load balancer. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<LoadBalancingRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String loadBalancerName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.list(resourceGroupName, loadBalancerName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified load balancer load balancing rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param loadBalancingRuleName The name of the load balancing rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LoadBalancingRuleInner object if successful. + */ + public LoadBalancingRuleInner get(String resourceGroupName, String loadBalancerName, String loadBalancingRuleName) { + return getWithServiceResponseAsync(resourceGroupName, loadBalancerName, loadBalancingRuleName).toBlocking().single().body(); + } + + /** + * Gets the specified load balancer load balancing rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param loadBalancingRuleName The name of the load balancing rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String loadBalancerName, String loadBalancingRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, loadBalancerName, loadBalancingRuleName), serviceCallback); + } + + /** + * Gets the specified load balancer load balancing rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param loadBalancingRuleName The name of the load balancing rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LoadBalancingRuleInner object + */ + public Observable getAsync(String resourceGroupName, String loadBalancerName, String loadBalancingRuleName) { + return getWithServiceResponseAsync(resourceGroupName, loadBalancerName, loadBalancingRuleName).map(new Func1, LoadBalancingRuleInner>() { + @Override + public LoadBalancingRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified load balancer load balancing rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param loadBalancingRuleName The name of the load balancing rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LoadBalancingRuleInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, String loadBalancingRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (loadBalancingRuleName == null) { + throw new IllegalArgumentException("Parameter loadBalancingRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.get(resourceGroupName, loadBalancerName, loadBalancingRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the load balancing rules in a load balancer. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LoadBalancingRuleInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the load balancing rules in a load balancer. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the load balancing rules in a load balancer. + * + * @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<LoadBalancingRuleInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the load balancing rules in a load balancer. + * + * @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<LoadBalancingRuleInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the load balancing rules in a load balancer. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<LoadBalancingRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LoadBalancerNetworkInterfaceImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LoadBalancerNetworkInterfaceImpl.java new file mode 100644 index 000000000000..507a1ec5b5f3 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LoadBalancerNetworkInterfaceImpl.java @@ -0,0 +1,128 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.LoadBalancerNetworkInterface; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_06_01.NetworkInterfaceDnsSettings; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_06_01.VirtualMachineScaleSetNetworkInterfaceIPConfiguration; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.NetworkSecurityGroup; +import java.util.Map; +import com.microsoft.azure.SubResource; + +class LoadBalancerNetworkInterfaceImpl extends WrapperImpl implements LoadBalancerNetworkInterface { + private final NetworkManager manager; + + LoadBalancerNetworkInterfaceImpl(NetworkInterfaceInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + + + @Override + public NetworkInterfaceDnsSettings dnsSettings() { + return this.inner().dnsSettings(); + } + + @Override + public Boolean enableAcceleratedNetworking() { + return this.inner().enableAcceleratedNetworking(); + } + + @Override + public Boolean enableIPForwarding() { + return this.inner().enableIPForwarding(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public List ipConfigurations() { + List lst = new ArrayList(); + if (this.inner().ipConfigurations() != null) { + for (NetworkInterfaceIPConfigurationInner inner : this.inner().ipConfigurations()) { + lst.add( new VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String macAddress() { + return this.inner().macAddress(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public NetworkSecurityGroup networkSecurityGroup() { + NetworkSecurityGroupInner inner = this.inner().networkSecurityGroup(); + if (inner != null) { + return new NetworkSecurityGroupImpl(inner.name(), inner, manager()); + } else { + return null; + } + } + + @Override + public Boolean primary() { + return this.inner().primary(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public SubResource virtualMachine() { + return this.inner().virtualMachine(); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LoadBalancerNetworkInterfacesImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LoadBalancerNetworkInterfacesImpl.java new file mode 100644 index 000000000000..27310b7355ba --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LoadBalancerNetworkInterfacesImpl.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.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_06_01.LoadBalancerNetworkInterfaces; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_06_01.LoadBalancerNetworkInterface; + +class LoadBalancerNetworkInterfacesImpl extends WrapperImpl implements LoadBalancerNetworkInterfaces { + private final NetworkManager manager; + + LoadBalancerNetworkInterfacesImpl(NetworkManager manager) { + super(manager.inner().loadBalancerNetworkInterfaces()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + private LoadBalancerNetworkInterfaceImpl wrapModel(NetworkInterfaceInner inner) { + return new LoadBalancerNetworkInterfaceImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String loadBalancerName) { + LoadBalancerNetworkInterfacesInner client = this.inner(); + return client.listAsync(resourceGroupName, loadBalancerName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public LoadBalancerNetworkInterface call(NetworkInterfaceInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LoadBalancerNetworkInterfacesInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LoadBalancerNetworkInterfacesInner.java new file mode 100644 index 000000000000..24bb612b813c --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LoadBalancerNetworkInterfacesInner.java @@ -0,0 +1,301 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in LoadBalancerNetworkInterfaces. + */ +public class LoadBalancerNetworkInterfacesInner { + /** The Retrofit service to perform REST calls. */ + private LoadBalancerNetworkInterfacesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of LoadBalancerNetworkInterfacesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LoadBalancerNetworkInterfacesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(LoadBalancerNetworkInterfacesService.class); + this.client = client; + } + + /** + * The interface defining all the services for LoadBalancerNetworkInterfaces to be + * used by Retrofit to perform actually REST calls. + */ + interface LoadBalancerNetworkInterfacesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.LoadBalancerNetworkInterfaces list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/networkInterfaces") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @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.network.v2018_06_01.LoadBalancerNetworkInterfaces listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets associated load balancer network interfaces. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String loadBalancerName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, loadBalancerName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets associated load balancer network interfaces. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String loadBalancerName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, loadBalancerName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets associated load balancer network interfaces. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String loadBalancerName) { + return listWithServiceResponseAsync(resourceGroupName, loadBalancerName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets associated load balancer network interfaces. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String loadBalancerName) { + return listSinglePageAsync(resourceGroupName, loadBalancerName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets associated load balancer network interfaces. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String loadBalancerName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.list(resourceGroupName, loadBalancerName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets associated load balancer network interfaces. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets associated load balancer network interfaces. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets associated load balancer network interfaces. + * + * @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<NetworkInterfaceInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets associated load balancer network interfaces. + * + * @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<NetworkInterfaceInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets associated load balancer network interfaces. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LoadBalancerProbesImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LoadBalancerProbesImpl.java new file mode 100644 index 000000000000..19dfd2ad9498 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LoadBalancerProbesImpl.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.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_06_01.LoadBalancerProbes; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_06_01.Probe; + +class LoadBalancerProbesImpl extends WrapperImpl implements LoadBalancerProbes { + private final NetworkManager manager; + + LoadBalancerProbesImpl(NetworkManager manager) { + super(manager.inner().loadBalancerProbes()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + private ProbeImpl wrapModel(ProbeInner inner) { + return new ProbeImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String loadBalancerName) { + LoadBalancerProbesInner client = this.inner(); + return client.listAsync(resourceGroupName, loadBalancerName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Probe call(ProbeInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String loadBalancerName, String probeName) { + LoadBalancerProbesInner client = this.inner(); + return client.getAsync(resourceGroupName, loadBalancerName, probeName) + .map(new Func1() { + @Override + public Probe call(ProbeInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LoadBalancerProbesInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LoadBalancerProbesInner.java new file mode 100644 index 000000000000..7f2fbb69e955 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LoadBalancerProbesInner.java @@ -0,0 +1,397 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.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 LoadBalancerProbes. + */ +public class LoadBalancerProbesInner { + /** The Retrofit service to perform REST calls. */ + private LoadBalancerProbesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of LoadBalancerProbesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LoadBalancerProbesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(LoadBalancerProbesService.class); + this.client = client; + } + + /** + * The interface defining all the services for LoadBalancerProbes to be + * used by Retrofit to perform actually REST calls. + */ + interface LoadBalancerProbesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.LoadBalancerProbes list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @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.network.v2018_06_01.LoadBalancerProbes get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("probeName") String probeName, @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.network.v2018_06_01.LoadBalancerProbes listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets all the load balancer probes. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProbeInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String loadBalancerName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, loadBalancerName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the load balancer probes. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String loadBalancerName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, loadBalancerName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the load balancer probes. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProbeInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String loadBalancerName) { + return listWithServiceResponseAsync(resourceGroupName, loadBalancerName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the load balancer probes. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProbeInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String loadBalancerName) { + return listSinglePageAsync(resourceGroupName, loadBalancerName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the load balancer probes. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProbeInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String loadBalancerName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.list(resourceGroupName, loadBalancerName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets load balancer probe. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param probeName The name of the probe. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProbeInner object if successful. + */ + public ProbeInner get(String resourceGroupName, String loadBalancerName, String probeName) { + return getWithServiceResponseAsync(resourceGroupName, loadBalancerName, probeName).toBlocking().single().body(); + } + + /** + * Gets load balancer probe. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param probeName The name of the probe. + * @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 loadBalancerName, String probeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, loadBalancerName, probeName), serviceCallback); + } + + /** + * Gets load balancer probe. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param probeName The name of the probe. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProbeInner object + */ + public Observable getAsync(String resourceGroupName, String loadBalancerName, String probeName) { + return getWithServiceResponseAsync(resourceGroupName, loadBalancerName, probeName).map(new Func1, ProbeInner>() { + @Override + public ProbeInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets load balancer probe. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param probeName The name of the probe. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProbeInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, String probeName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (probeName == null) { + throw new IllegalArgumentException("Parameter probeName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.get(resourceGroupName, loadBalancerName, probeName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the load balancer probes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProbeInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the load balancer probes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the load balancer probes. + * + * @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<ProbeInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the load balancer probes. + * + * @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<ProbeInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the load balancer probes. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProbeInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LoadBalancersImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LoadBalancersImpl.java new file mode 100644 index 000000000000..7d68fa4b850a --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LoadBalancersImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_06_01.LoadBalancers; +import com.microsoft.azure.management.network.v2018_06_01.LoadBalancer; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class LoadBalancersImpl extends GroupableResourcesCoreImpl implements LoadBalancers { + protected LoadBalancersImpl(NetworkManager manager) { + super(manager.inner().loadBalancers(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + LoadBalancersInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + LoadBalancersInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + LoadBalancersInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + LoadBalancersInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public LoadBalancer call(LoadBalancerInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + LoadBalancersInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + LoadBalancersInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public LoadBalancer call(LoadBalancerInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public LoadBalancerImpl define(String name) { + return wrapModel(name); + } + + @Override + protected LoadBalancerImpl wrapModel(LoadBalancerInner inner) { + return new LoadBalancerImpl(inner.name(), inner, manager()); + } + + @Override + protected LoadBalancerImpl wrapModel(String name) { + return new LoadBalancerImpl(name, new LoadBalancerInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LoadBalancersInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LoadBalancersInner.java new file mode 100644 index 000000000000..a53646386396 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LoadBalancersInner.java @@ -0,0 +1,1355 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_06_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.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 LoadBalancers. + */ +public class LoadBalancersInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private LoadBalancersService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of LoadBalancersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LoadBalancersInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(LoadBalancersService.class); + this.client = client; + } + + /** + * The interface defining all the services for LoadBalancers to be + * used by Retrofit to perform actually REST calls. + */ + interface LoadBalancersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.LoadBalancers delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @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.network.v2018_06_01.LoadBalancers beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @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.network.v2018_06_01.LoadBalancers getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @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.network.v2018_06_01.LoadBalancers createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("subscriptionId") String subscriptionId, @Body LoadBalancerInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.LoadBalancers beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("subscriptionId") String subscriptionId, @Body LoadBalancerInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.LoadBalancers updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.LoadBalancers beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}") + Observable> beginUpdateTags(@Path("resourceGroupName") String resourceGroupName, @Path("loadBalancerName") String loadBalancerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.LoadBalancers list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/loadBalancers") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.LoadBalancers listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @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.network.v2018_06_01.LoadBalancers listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.LoadBalancers listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String loadBalancerName) { + deleteWithServiceResponseAsync(resourceGroupName, loadBalancerName).toBlocking().last().body(); + } + + /** + * Deletes the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @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 loadBalancerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, loadBalancerName), serviceCallback); + } + + /** + * Deletes the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String loadBalancerName) { + return deleteWithServiceResponseAsync(resourceGroupName, loadBalancerName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String loadBalancerName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + Observable> observable = service.delete(resourceGroupName, loadBalancerName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String loadBalancerName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, loadBalancerName).toBlocking().single().body(); + } + + /** + * Deletes the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String loadBalancerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, loadBalancerName), serviceCallback); + } + + /** + * Deletes the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String loadBalancerName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, loadBalancerName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String loadBalancerName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.beginDelete(resourceGroupName, loadBalancerName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LoadBalancerInner object if successful. + */ + public LoadBalancerInner getByResourceGroup(String resourceGroupName, String loadBalancerName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, loadBalancerName).toBlocking().single().body(); + } + + /** + * Gets the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String loadBalancerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, loadBalancerName), serviceCallback); + } + + /** + * Gets the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LoadBalancerInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String loadBalancerName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, loadBalancerName).map(new Func1, LoadBalancerInner>() { + @Override + public LoadBalancerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LoadBalancerInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String loadBalancerName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + final String expand = null; + return service.getByResourceGroup(resourceGroupName, loadBalancerName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LoadBalancerInner object if successful. + */ + public LoadBalancerInner getByResourceGroup(String resourceGroupName, String loadBalancerName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, loadBalancerName, expand).toBlocking().single().body(); + } + + /** + * Gets the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param expand Expands referenced resources. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String loadBalancerName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, loadBalancerName, expand), serviceCallback); + } + + /** + * Gets the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LoadBalancerInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String loadBalancerName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, loadBalancerName, expand).map(new Func1, LoadBalancerInner>() { + @Override + public LoadBalancerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LoadBalancerInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.getByResourceGroup(resourceGroupName, loadBalancerName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param parameters Parameters supplied to the create or update load balancer operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LoadBalancerInner object if successful. + */ + public LoadBalancerInner createOrUpdate(String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, loadBalancerName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param parameters Parameters supplied to the create or update load balancer operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, loadBalancerName, parameters), serviceCallback); + } + + /** + * Creates or updates a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param parameters Parameters supplied to the create or update load balancer operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, loadBalancerName, parameters).map(new Func1, LoadBalancerInner>() { + @Override + public LoadBalancerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param parameters Parameters supplied to the create or update load balancer operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, loadBalancerName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param parameters Parameters supplied to the create or update load balancer operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LoadBalancerInner object if successful. + */ + public LoadBalancerInner beginCreateOrUpdate(String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, loadBalancerName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param parameters Parameters supplied to the create or update load balancer operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, loadBalancerName, parameters), serviceCallback); + } + + /** + * Creates or updates a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param parameters Parameters supplied to the create or update load balancer operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LoadBalancerInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, loadBalancerName, parameters).map(new Func1, LoadBalancerInner>() { + @Override + public LoadBalancerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param parameters Parameters supplied to the create or update load balancer operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LoadBalancerInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + return service.beginCreateOrUpdate(resourceGroupName, loadBalancerName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LoadBalancerInner object if successful. + */ + public LoadBalancerInner updateTags(String resourceGroupName, String loadBalancerName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, loadBalancerName).toBlocking().last().body(); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @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 updateTagsAsync(String resourceGroupName, String loadBalancerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, loadBalancerName), serviceCallback); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String loadBalancerName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, loadBalancerName).map(new Func1, LoadBalancerInner>() { + @Override + public LoadBalancerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String loadBalancerName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + Observable> observable = service.updateTags(resourceGroupName, loadBalancerName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LoadBalancerInner object if successful. + */ + public LoadBalancerInner updateTags(String resourceGroupName, String loadBalancerName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, loadBalancerName, tags).toBlocking().last().body(); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String loadBalancerName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, loadBalancerName, tags), serviceCallback); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String loadBalancerName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, loadBalancerName, tags).map(new Func1, LoadBalancerInner>() { + @Override + public LoadBalancerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-06-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + Observable> observable = service.updateTags(resourceGroupName, loadBalancerName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LoadBalancerInner object if successful. + */ + public LoadBalancerInner beginUpdateTags(String resourceGroupName, String loadBalancerName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, loadBalancerName).toBlocking().single().body(); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @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 beginUpdateTagsAsync(String resourceGroupName, String loadBalancerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, loadBalancerName), serviceCallback); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LoadBalancerInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String loadBalancerName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, loadBalancerName).map(new Func1, LoadBalancerInner>() { + @Override + public LoadBalancerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LoadBalancerInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String loadBalancerName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.beginUpdateTags(resourceGroupName, loadBalancerName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LoadBalancerInner object if successful. + */ + public LoadBalancerInner beginUpdateTags(String resourceGroupName, String loadBalancerName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, loadBalancerName, tags).toBlocking().single().body(); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String loadBalancerName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, loadBalancerName, tags), serviceCallback); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LoadBalancerInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String loadBalancerName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, loadBalancerName, tags).map(new Func1, LoadBalancerInner>() { + @Override + public LoadBalancerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LoadBalancerInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (loadBalancerName == null) { + throw new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-06-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.beginUpdateTags(resourceGroupName, loadBalancerName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the load balancers in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LoadBalancerInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the load balancers in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the load balancers in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LoadBalancerInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the load balancers in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LoadBalancerInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the load balancers in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<LoadBalancerInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the load balancers in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LoadBalancerInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the load balancers in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the load balancers in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LoadBalancerInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the load balancers in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LoadBalancerInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the load balancers in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<LoadBalancerInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the load balancers in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LoadBalancerInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the load balancers in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the load balancers in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LoadBalancerInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the load balancers in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LoadBalancerInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the load balancers in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<LoadBalancerInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the load balancers in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LoadBalancerInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the load balancers in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the load balancers in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LoadBalancerInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the load balancers in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LoadBalancerInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the load balancers in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<LoadBalancerInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LoadBalancingRuleImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LoadBalancingRuleImpl.java new file mode 100644 index 000000000000..dcb189eab872 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LoadBalancingRuleImpl.java @@ -0,0 +1,115 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.LoadBalancingRule; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_06_01.LoadDistribution; +import com.microsoft.azure.management.network.v2018_06_01.TransportProtocol; + +class LoadBalancingRuleImpl extends IndexableRefreshableWrapperImpl implements LoadBalancingRule { + private final NetworkManager manager; + private String resourceGroupName; + private String loadBalancerName; + private String loadBalancingRuleName; + + LoadBalancingRuleImpl(LoadBalancingRuleInner inner, NetworkManager manager) { + super(null, inner); + this.manager = manager; + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.loadBalancerName = IdParsingUtils.getValueFromIdByName(inner.id(), "loadBalancers"); + this.loadBalancingRuleName = IdParsingUtils.getValueFromIdByName(inner.id(), "loadBalancingRules"); + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + LoadBalancerLoadBalancingRulesInner client = this.manager().inner().loadBalancerLoadBalancingRules(); + return client.getAsync(this.resourceGroupName, this.loadBalancerName, this.loadBalancingRuleName); + } + + + + @Override + public SubResource backendAddressPool() { + return this.inner().backendAddressPool(); + } + + @Override + public Integer backendPort() { + return this.inner().backendPort(); + } + + @Override + public Boolean disableOutboundSnat() { + return this.inner().disableOutboundSnat(); + } + + @Override + public Boolean enableFloatingIP() { + return this.inner().enableFloatingIP(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public SubResource frontendIPConfiguration() { + return this.inner().frontendIPConfiguration(); + } + + @Override + public int frontendPort() { + return this.inner().frontendPort(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Integer idleTimeoutInMinutes() { + return this.inner().idleTimeoutInMinutes(); + } + + @Override + public LoadDistribution loadDistribution() { + return this.inner().loadDistribution(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public SubResource probe() { + return this.inner().probe(); + } + + @Override + public TransportProtocol protocol() { + return this.inner().protocol(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LoadBalancingRuleInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LoadBalancingRuleInner.java new file mode 100644 index 000000000000..8c94708152c3 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LoadBalancingRuleInner.java @@ -0,0 +1,375 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_06_01.TransportProtocol; +import com.microsoft.azure.management.network.v2018_06_01.LoadDistribution; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * A load balancing rule for a load balancer. + */ +@JsonFlatten +public class LoadBalancingRuleInner extends SubResource { + /** + * A reference to frontend IP addresses. + */ + @JsonProperty(value = "properties.frontendIPConfiguration") + private SubResource frontendIPConfiguration; + + /** + * A reference to a pool of DIPs. Inbound traffic is randomly load balanced + * across IPs in the backend IPs. + */ + @JsonProperty(value = "properties.backendAddressPool") + private SubResource backendAddressPool; + + /** + * The reference of the load balancer probe used by the load balancing + * rule. + */ + @JsonProperty(value = "properties.probe") + private SubResource probe; + + /** + * Possible values include: 'Udp', 'Tcp', 'All'. + */ + @JsonProperty(value = "properties.protocol", required = true) + private TransportProtocol protocol; + + /** + * The load distribution policy for this rule. Possible values are + * 'Default', 'SourceIP', and 'SourceIPProtocol'. Possible values include: + * 'Default', 'SourceIP', 'SourceIPProtocol'. + */ + @JsonProperty(value = "properties.loadDistribution") + private LoadDistribution loadDistribution; + + /** + * The port for the external endpoint. Port numbers for each rule must be + * unique within the Load Balancer. Acceptable values are between 0 and + * 65534. Note that value 0 enables "Any Port". + */ + @JsonProperty(value = "properties.frontendPort", required = true) + private int frontendPort; + + /** + * The port used for internal connections on the endpoint. Acceptable + * values are between 0 and 65535. Note that value 0 enables "Any Port". + */ + @JsonProperty(value = "properties.backendPort") + private Integer backendPort; + + /** + * The timeout for the TCP idle connection. The value can be set between 4 + * and 30 minutes. The default value is 4 minutes. This element is only + * used when the protocol is set to TCP. + */ + @JsonProperty(value = "properties.idleTimeoutInMinutes") + private Integer idleTimeoutInMinutes; + + /** + * Configures a virtual machine's endpoint for the floating IP capability + * required to configure a SQL AlwaysOn Availability Group. This setting is + * required when using the SQL AlwaysOn Availability Groups in SQL server. + * This setting can't be changed after you create the endpoint. + */ + @JsonProperty(value = "properties.enableFloatingIP") + private Boolean enableFloatingIP; + + /** + * Configures SNAT for the VMs in the backend pool to use the publicIP + * address specified in the frontend of the load balancing rule. + */ + @JsonProperty(value = "properties.disableOutboundSnat") + private Boolean disableOutboundSnat; + + /** + * Gets the provisioning state of the PublicIP resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get a reference to frontend IP addresses. + * + * @return the frontendIPConfiguration value + */ + public SubResource frontendIPConfiguration() { + return this.frontendIPConfiguration; + } + + /** + * Set a reference to frontend IP addresses. + * + * @param frontendIPConfiguration the frontendIPConfiguration value to set + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withFrontendIPConfiguration(SubResource frontendIPConfiguration) { + this.frontendIPConfiguration = frontendIPConfiguration; + return this; + } + + /** + * Get a reference to a pool of DIPs. Inbound traffic is randomly load balanced across IPs in the backend IPs. + * + * @return the backendAddressPool value + */ + public SubResource backendAddressPool() { + return this.backendAddressPool; + } + + /** + * Set a reference to a pool of DIPs. Inbound traffic is randomly load balanced across IPs in the backend IPs. + * + * @param backendAddressPool the backendAddressPool value to set + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withBackendAddressPool(SubResource backendAddressPool) { + this.backendAddressPool = backendAddressPool; + return this; + } + + /** + * Get the reference of the load balancer probe used by the load balancing rule. + * + * @return the probe value + */ + public SubResource probe() { + return this.probe; + } + + /** + * Set the reference of the load balancer probe used by the load balancing rule. + * + * @param probe the probe value to set + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withProbe(SubResource probe) { + this.probe = probe; + return this; + } + + /** + * Get possible values include: 'Udp', 'Tcp', 'All'. + * + * @return the protocol value + */ + public TransportProtocol protocol() { + return this.protocol; + } + + /** + * Set possible values include: 'Udp', 'Tcp', 'All'. + * + * @param protocol the protocol value to set + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withProtocol(TransportProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the load distribution policy for this rule. Possible values are 'Default', 'SourceIP', and 'SourceIPProtocol'. Possible values include: 'Default', 'SourceIP', 'SourceIPProtocol'. + * + * @return the loadDistribution value + */ + public LoadDistribution loadDistribution() { + return this.loadDistribution; + } + + /** + * Set the load distribution policy for this rule. Possible values are 'Default', 'SourceIP', and 'SourceIPProtocol'. Possible values include: 'Default', 'SourceIP', 'SourceIPProtocol'. + * + * @param loadDistribution the loadDistribution value to set + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withLoadDistribution(LoadDistribution loadDistribution) { + this.loadDistribution = loadDistribution; + return this; + } + + /** + * Get the port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values are between 0 and 65534. Note that value 0 enables "Any Port". + * + * @return the frontendPort value + */ + public int frontendPort() { + return this.frontendPort; + } + + /** + * Set the port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values are between 0 and 65534. Note that value 0 enables "Any Port". + * + * @param frontendPort the frontendPort value to set + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withFrontendPort(int frontendPort) { + this.frontendPort = frontendPort; + return this; + } + + /** + * Get the port used for internal connections on the endpoint. Acceptable values are between 0 and 65535. Note that value 0 enables "Any Port". + * + * @return the backendPort value + */ + public Integer backendPort() { + return this.backendPort; + } + + /** + * Set the port used for internal connections on the endpoint. Acceptable values are between 0 and 65535. Note that value 0 enables "Any Port". + * + * @param backendPort the backendPort value to set + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withBackendPort(Integer backendPort) { + this.backendPort = backendPort; + return this; + } + + /** + * Get the timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. + * + * @return the idleTimeoutInMinutes value + */ + public Integer idleTimeoutInMinutes() { + return this.idleTimeoutInMinutes; + } + + /** + * Set the timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. + * + * @param idleTimeoutInMinutes the idleTimeoutInMinutes value to set + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { + this.idleTimeoutInMinutes = idleTimeoutInMinutes; + return this; + } + + /** + * Get configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint. + * + * @return the enableFloatingIP value + */ + public Boolean enableFloatingIP() { + return this.enableFloatingIP; + } + + /** + * Set configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint. + * + * @param enableFloatingIP the enableFloatingIP value to set + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withEnableFloatingIP(Boolean enableFloatingIP) { + this.enableFloatingIP = enableFloatingIP; + return this; + } + + /** + * Get configures SNAT for the VMs in the backend pool to use the publicIP address specified in the frontend of the load balancing rule. + * + * @return the disableOutboundSnat value + */ + public Boolean disableOutboundSnat() { + return this.disableOutboundSnat; + } + + /** + * Set configures SNAT for the VMs in the backend pool to use the publicIP address specified in the frontend of the load balancing rule. + * + * @param disableOutboundSnat the disableOutboundSnat value to set + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withDisableOutboundSnat(Boolean disableOutboundSnat) { + this.disableOutboundSnat = disableOutboundSnat; + return this; + } + + /** + * Get gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the LoadBalancingRuleInner object itself. + */ + public LoadBalancingRuleInner withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LocalNetworkGatewayImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LocalNetworkGatewayImpl.java new file mode 100644 index 000000000000..00bf4ba885b1 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LocalNetworkGatewayImpl.java @@ -0,0 +1,108 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_06_01.LocalNetworkGateway; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_06_01.AddressSpace; +import com.microsoft.azure.management.network.v2018_06_01.BgpSettings; + +class LocalNetworkGatewayImpl extends GroupableResourceCoreImpl implements LocalNetworkGateway, LocalNetworkGateway.Definition, LocalNetworkGateway.Update { + LocalNetworkGatewayImpl(String name, LocalNetworkGatewayInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + LocalNetworkGatewaysInner client = this.manager().inner().localNetworkGateways(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + LocalNetworkGatewaysInner client = this.manager().inner().localNetworkGateways(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + LocalNetworkGatewaysInner client = this.manager().inner().localNetworkGateways(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public BgpSettings bgpSettings() { + return this.inner().bgpSettings(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String gatewayIpAddress() { + return this.inner().gatewayIpAddress(); + } + + @Override + public AddressSpace localNetworkAddressSpace() { + return this.inner().localNetworkAddressSpace(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public LocalNetworkGatewayImpl withBgpSettings(BgpSettings bgpSettings) { + this.inner().withBgpSettings(bgpSettings); + return this; + } + + @Override + public LocalNetworkGatewayImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public LocalNetworkGatewayImpl withGatewayIpAddress(String gatewayIpAddress) { + this.inner().withGatewayIpAddress(gatewayIpAddress); + return this; + } + + @Override + public LocalNetworkGatewayImpl withLocalNetworkAddressSpace(AddressSpace localNetworkAddressSpace) { + this.inner().withLocalNetworkAddressSpace(localNetworkAddressSpace); + return this; + } + + @Override + public LocalNetworkGatewayImpl withResourceGuid(String resourceGuid) { + this.inner().withResourceGuid(resourceGuid); + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LocalNetworkGatewayInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LocalNetworkGatewayInner.java new file mode 100644 index 000000000000..6b7fce03a0e4 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LocalNetworkGatewayInner.java @@ -0,0 +1,196 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.AddressSpace; +import com.microsoft.azure.management.network.v2018_06_01.BgpSettings; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * A common class for general resource information. + */ +@JsonFlatten +@SkipParentValidation +public class LocalNetworkGatewayInner extends Resource { + /** + * Local network site address space. + */ + @JsonProperty(value = "properties.localNetworkAddressSpace") + private AddressSpace localNetworkAddressSpace; + + /** + * IP address of local network gateway. + */ + @JsonProperty(value = "properties.gatewayIpAddress") + private String gatewayIpAddress; + + /** + * Local network gateway's BGP speaker settings. + */ + @JsonProperty(value = "properties.bgpSettings") + private BgpSettings bgpSettings; + + /** + * The resource GUID property of the LocalNetworkGateway resource. + */ + @JsonProperty(value = "properties.resourceGuid") + private String resourceGuid; + + /** + * The provisioning state of the LocalNetworkGateway resource. Possible + * values are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get local network site address space. + * + * @return the localNetworkAddressSpace value + */ + public AddressSpace localNetworkAddressSpace() { + return this.localNetworkAddressSpace; + } + + /** + * Set local network site address space. + * + * @param localNetworkAddressSpace the localNetworkAddressSpace value to set + * @return the LocalNetworkGatewayInner object itself. + */ + public LocalNetworkGatewayInner withLocalNetworkAddressSpace(AddressSpace localNetworkAddressSpace) { + this.localNetworkAddressSpace = localNetworkAddressSpace; + return this; + } + + /** + * Get iP address of local network gateway. + * + * @return the gatewayIpAddress value + */ + public String gatewayIpAddress() { + return this.gatewayIpAddress; + } + + /** + * Set iP address of local network gateway. + * + * @param gatewayIpAddress the gatewayIpAddress value to set + * @return the LocalNetworkGatewayInner object itself. + */ + public LocalNetworkGatewayInner withGatewayIpAddress(String gatewayIpAddress) { + this.gatewayIpAddress = gatewayIpAddress; + return this; + } + + /** + * Get local network gateway's BGP speaker settings. + * + * @return the bgpSettings value + */ + public BgpSettings bgpSettings() { + return this.bgpSettings; + } + + /** + * Set local network gateway's BGP speaker settings. + * + * @param bgpSettings the bgpSettings value to set + * @return the LocalNetworkGatewayInner object itself. + */ + public LocalNetworkGatewayInner withBgpSettings(BgpSettings bgpSettings) { + this.bgpSettings = bgpSettings; + return this; + } + + /** + * Get the resource GUID property of the LocalNetworkGateway resource. + * + * @return the resourceGuid value + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Set the resource GUID property of the LocalNetworkGateway resource. + * + * @param resourceGuid the resourceGuid value to set + * @return the LocalNetworkGatewayInner object itself. + */ + public LocalNetworkGatewayInner withResourceGuid(String resourceGuid) { + this.resourceGuid = resourceGuid; + return this; + } + + /** + * Get the provisioning state of the LocalNetworkGateway resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the LocalNetworkGatewayInner object itself. + */ + public LocalNetworkGatewayInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the LocalNetworkGatewayInner object itself. + */ + public LocalNetworkGatewayInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LocalNetworkGatewaysImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LocalNetworkGatewaysImpl.java new file mode 100644 index 000000000000..194ec0763d7e --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LocalNetworkGatewaysImpl.java @@ -0,0 +1,114 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_06_01.LocalNetworkGateways; +import com.microsoft.azure.management.network.v2018_06_01.LocalNetworkGateway; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class LocalNetworkGatewaysImpl extends GroupableResourcesCoreImpl implements LocalNetworkGateways { + protected LocalNetworkGatewaysImpl(NetworkManager manager) { + super(manager.inner().localNetworkGateways(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + LocalNetworkGatewaysInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + LocalNetworkGatewaysInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + LocalNetworkGatewaysInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + LocalNetworkGatewaysInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public LocalNetworkGateway call(LocalNetworkGatewayInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public LocalNetworkGatewayImpl define(String name) { + return wrapModel(name); + } + + @Override + protected LocalNetworkGatewayImpl wrapModel(LocalNetworkGatewayInner inner) { + return new LocalNetworkGatewayImpl(inner.name(), inner, manager()); + } + + @Override + protected LocalNetworkGatewayImpl wrapModel(String name) { + return new LocalNetworkGatewayImpl(name, new LocalNetworkGatewayInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LocalNetworkGatewaysInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LocalNetworkGatewaysInner.java new file mode 100644 index 000000000000..b6df43d29479 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LocalNetworkGatewaysInner.java @@ -0,0 +1,1048 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_06_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.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 LocalNetworkGateways. + */ +public class LocalNetworkGatewaysInner implements InnerSupportsGet, InnerSupportsDelete { + /** The Retrofit service to perform REST calls. */ + private LocalNetworkGatewaysService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of LocalNetworkGatewaysInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LocalNetworkGatewaysInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(LocalNetworkGatewaysService.class); + this.client = client; + } + + /** + * The interface defining all the services for LocalNetworkGateways to be + * used by Retrofit to perform actually REST calls. + */ + interface LocalNetworkGatewaysService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.LocalNetworkGateways createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("localNetworkGatewayName") String localNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Body LocalNetworkGatewayInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.LocalNetworkGateways beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("localNetworkGatewayName") String localNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Body LocalNetworkGatewayInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.LocalNetworkGateways getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("localNetworkGatewayName") String localNetworkGatewayName, @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.network.v2018_06_01.LocalNetworkGateways delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("localNetworkGatewayName") String localNetworkGatewayName, @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.network.v2018_06_01.LocalNetworkGateways beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("localNetworkGatewayName") String localNetworkGatewayName, @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.network.v2018_06_01.LocalNetworkGateways updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("localNetworkGatewayName") String localNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.LocalNetworkGateways beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}") + Observable> beginUpdateTags(@Path("resourceGroupName") String resourceGroupName, @Path("localNetworkGatewayName") String localNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.LocalNetworkGateways listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @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.network.v2018_06_01.LocalNetworkGateways listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Creates or updates a local network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param parameters Parameters supplied to the create or update local network gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LocalNetworkGatewayInner object if successful. + */ + public LocalNetworkGatewayInner createOrUpdate(String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates a local network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param parameters Parameters supplied to the create or update local network gateway operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName, parameters), serviceCallback); + } + + /** + * Creates or updates a local network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param parameters Parameters supplied to the create or update local network gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName, parameters).map(new Func1, LocalNetworkGatewayInner>() { + @Override + public LocalNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a local network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param parameters Parameters supplied to the create or update local network gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (localNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter localNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, localNetworkGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a local network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param parameters Parameters supplied to the create or update local network gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LocalNetworkGatewayInner object if successful. + */ + public LocalNetworkGatewayInner beginCreateOrUpdate(String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates a local network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param parameters Parameters supplied to the create or update local network gateway operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName, parameters), serviceCallback); + } + + /** + * Creates or updates a local network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param parameters Parameters supplied to the create or update local network gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LocalNetworkGatewayInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName, parameters).map(new Func1, LocalNetworkGatewayInner>() { + @Override + public LocalNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a local network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param parameters Parameters supplied to the create or update local network gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LocalNetworkGatewayInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (localNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter localNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + return service.beginCreateOrUpdate(resourceGroupName, localNetworkGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified local network gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LocalNetworkGatewayInner object if successful. + */ + public LocalNetworkGatewayInner getByResourceGroup(String resourceGroupName, String localNetworkGatewayName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName).toBlocking().single().body(); + } + + /** + * Gets the specified local network gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String localNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName), serviceCallback); + } + + /** + * Gets the specified local network gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LocalNetworkGatewayInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String localNetworkGatewayName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName).map(new Func1, LocalNetworkGatewayInner>() { + @Override + public LocalNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified local network gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LocalNetworkGatewayInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String localNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (localNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter localNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.getByResourceGroup(resourceGroupName, localNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes the specified local network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String localNetworkGatewayName) { + deleteWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName).toBlocking().last().body(); + } + + /** + * Deletes the specified local network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @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 localNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName), serviceCallback); + } + + /** + * Deletes the specified local network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String localNetworkGatewayName) { + return deleteWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified local network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String localNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (localNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter localNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + Observable> observable = service.delete(resourceGroupName, localNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified local network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String localNetworkGatewayName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName).toBlocking().single().body(); + } + + /** + * Deletes the specified local network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String localNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName), serviceCallback); + } + + /** + * Deletes the specified local network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String localNetworkGatewayName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified local network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String localNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (localNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter localNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.beginDelete(resourceGroupName, localNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LocalNetworkGatewayInner object if successful. + */ + public LocalNetworkGatewayInner updateTags(String resourceGroupName, String localNetworkGatewayName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName).toBlocking().last().body(); + } + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @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 updateTagsAsync(String resourceGroupName, String localNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName), serviceCallback); + } + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String localNetworkGatewayName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName).map(new Func1, LocalNetworkGatewayInner>() { + @Override + public LocalNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String localNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (localNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter localNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + Observable> observable = service.updateTags(resourceGroupName, localNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LocalNetworkGatewayInner object if successful. + */ + public LocalNetworkGatewayInner updateTags(String resourceGroupName, String localNetworkGatewayName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName, tags).toBlocking().last().body(); + } + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String localNetworkGatewayName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName, tags), serviceCallback); + } + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String localNetworkGatewayName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName, tags).map(new Func1, LocalNetworkGatewayInner>() { + @Override + public LocalNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String localNetworkGatewayName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (localNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter localNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-06-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + Observable> observable = service.updateTags(resourceGroupName, localNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LocalNetworkGatewayInner object if successful. + */ + public LocalNetworkGatewayInner beginUpdateTags(String resourceGroupName, String localNetworkGatewayName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName).toBlocking().single().body(); + } + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @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 beginUpdateTagsAsync(String resourceGroupName, String localNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName), serviceCallback); + } + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LocalNetworkGatewayInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String localNetworkGatewayName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName).map(new Func1, LocalNetworkGatewayInner>() { + @Override + public LocalNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LocalNetworkGatewayInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String localNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (localNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter localNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.beginUpdateTags(resourceGroupName, localNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LocalNetworkGatewayInner object if successful. + */ + public LocalNetworkGatewayInner beginUpdateTags(String resourceGroupName, String localNetworkGatewayName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName, tags).toBlocking().single().body(); + } + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String localNetworkGatewayName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName, tags), serviceCallback); + } + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LocalNetworkGatewayInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String localNetworkGatewayName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName, tags).map(new Func1, LocalNetworkGatewayInner>() { + @Override + public LocalNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LocalNetworkGatewayInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String localNetworkGatewayName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (localNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter localNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-06-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.beginUpdateTags(resourceGroupName, localNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the local network gateways in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LocalNetworkGatewayInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the local network gateways in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the local network gateways in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LocalNetworkGatewayInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the local network gateways in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LocalNetworkGatewayInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the local network gateways in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<LocalNetworkGatewayInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the local network gateways in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LocalNetworkGatewayInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the local network gateways in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the local network gateways in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LocalNetworkGatewayInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the local network gateways in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LocalNetworkGatewayInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the local network gateways in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<LocalNetworkGatewayInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkInterfaceIPConfigurationInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkInterfaceIPConfigurationInner.java new file mode 100644 index 000000000000..8571f0b64cad --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkInterfaceIPConfigurationInner.java @@ -0,0 +1,369 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGatewayBackendAddressPool; +import com.microsoft.azure.management.network.v2018_06_01.IPAllocationMethod; +import com.microsoft.azure.management.network.v2018_06_01.IPVersion; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * IPConfiguration in a network interface. + */ +@JsonFlatten +public class NetworkInterfaceIPConfigurationInner extends SubResource { + /** + * The reference of ApplicationGatewayBackendAddressPool resource. + */ + @JsonProperty(value = "properties.applicationGatewayBackendAddressPools") + private List applicationGatewayBackendAddressPools; + + /** + * The reference of LoadBalancerBackendAddressPool resource. + */ + @JsonProperty(value = "properties.loadBalancerBackendAddressPools") + private List loadBalancerBackendAddressPools; + + /** + * A list of references of LoadBalancerInboundNatRules. + */ + @JsonProperty(value = "properties.loadBalancerInboundNatRules") + private List loadBalancerInboundNatRules; + + /** + * Private IP address of the IP configuration. + */ + @JsonProperty(value = "properties.privateIPAddress") + private String privateIPAddress; + + /** + * Defines how a private IP address is assigned. Possible values are: + * 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic'. + */ + @JsonProperty(value = "properties.privateIPAllocationMethod") + private IPAllocationMethod privateIPAllocationMethod; + + /** + * Available from Api-Version 2016-03-30 onwards, it represents whether the + * specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. + * Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', + * 'IPv6'. + */ + @JsonProperty(value = "properties.privateIPAddressVersion") + private IPVersion privateIPAddressVersion; + + /** + * Subnet bound to the IP configuration. + */ + @JsonProperty(value = "properties.subnet") + private SubnetInner subnet; + + /** + * Gets whether this is a primary customer address on the network + * interface. + */ + @JsonProperty(value = "properties.primary") + private Boolean primary; + + /** + * Public IP address bound to the IP configuration. + */ + @JsonProperty(value = "properties.publicIPAddress") + private PublicIPAddressInner publicIPAddress; + + /** + * Application security groups in which the IP configuration is included. + */ + @JsonProperty(value = "properties.applicationSecurityGroups") + private List applicationSecurityGroups; + + /** + * The provisioning state of the network interface IP configuration. + * Possible values are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get the reference of ApplicationGatewayBackendAddressPool resource. + * + * @return the applicationGatewayBackendAddressPools value + */ + public List applicationGatewayBackendAddressPools() { + return this.applicationGatewayBackendAddressPools; + } + + /** + * Set the reference of ApplicationGatewayBackendAddressPool resource. + * + * @param applicationGatewayBackendAddressPools the applicationGatewayBackendAddressPools value to set + * @return the NetworkInterfaceIPConfigurationInner object itself. + */ + public NetworkInterfaceIPConfigurationInner withApplicationGatewayBackendAddressPools(List applicationGatewayBackendAddressPools) { + this.applicationGatewayBackendAddressPools = applicationGatewayBackendAddressPools; + return this; + } + + /** + * Get the reference of LoadBalancerBackendAddressPool resource. + * + * @return the loadBalancerBackendAddressPools value + */ + public List loadBalancerBackendAddressPools() { + return this.loadBalancerBackendAddressPools; + } + + /** + * Set the reference of LoadBalancerBackendAddressPool resource. + * + * @param loadBalancerBackendAddressPools the loadBalancerBackendAddressPools value to set + * @return the NetworkInterfaceIPConfigurationInner object itself. + */ + public NetworkInterfaceIPConfigurationInner withLoadBalancerBackendAddressPools(List loadBalancerBackendAddressPools) { + this.loadBalancerBackendAddressPools = loadBalancerBackendAddressPools; + return this; + } + + /** + * Get a list of references of LoadBalancerInboundNatRules. + * + * @return the loadBalancerInboundNatRules value + */ + public List loadBalancerInboundNatRules() { + return this.loadBalancerInboundNatRules; + } + + /** + * Set a list of references of LoadBalancerInboundNatRules. + * + * @param loadBalancerInboundNatRules the loadBalancerInboundNatRules value to set + * @return the NetworkInterfaceIPConfigurationInner object itself. + */ + public NetworkInterfaceIPConfigurationInner withLoadBalancerInboundNatRules(List loadBalancerInboundNatRules) { + this.loadBalancerInboundNatRules = loadBalancerInboundNatRules; + return this; + } + + /** + * Get private IP address of the IP configuration. + * + * @return the privateIPAddress value + */ + public String privateIPAddress() { + return this.privateIPAddress; + } + + /** + * Set private IP address of the IP configuration. + * + * @param privateIPAddress the privateIPAddress value to set + * @return the NetworkInterfaceIPConfigurationInner object itself. + */ + public NetworkInterfaceIPConfigurationInner withPrivateIPAddress(String privateIPAddress) { + this.privateIPAddress = privateIPAddress; + return this; + } + + /** + * Get defines how a private IP address is assigned. Possible values are: 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic'. + * + * @return the privateIPAllocationMethod value + */ + public IPAllocationMethod privateIPAllocationMethod() { + return this.privateIPAllocationMethod; + } + + /** + * Set defines how a private IP address is assigned. Possible values are: 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic'. + * + * @param privateIPAllocationMethod the privateIPAllocationMethod value to set + * @return the NetworkInterfaceIPConfigurationInner object itself. + */ + public NetworkInterfaceIPConfigurationInner withPrivateIPAllocationMethod(IPAllocationMethod privateIPAllocationMethod) { + this.privateIPAllocationMethod = privateIPAllocationMethod; + return this; + } + + /** + * Get available from Api-Version 2016-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6'. + * + * @return the privateIPAddressVersion value + */ + public IPVersion privateIPAddressVersion() { + return this.privateIPAddressVersion; + } + + /** + * Set available from Api-Version 2016-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6'. + * + * @param privateIPAddressVersion the privateIPAddressVersion value to set + * @return the NetworkInterfaceIPConfigurationInner object itself. + */ + public NetworkInterfaceIPConfigurationInner withPrivateIPAddressVersion(IPVersion privateIPAddressVersion) { + this.privateIPAddressVersion = privateIPAddressVersion; + return this; + } + + /** + * Get subnet bound to the IP configuration. + * + * @return the subnet value + */ + public SubnetInner subnet() { + return this.subnet; + } + + /** + * Set subnet bound to the IP configuration. + * + * @param subnet the subnet value to set + * @return the NetworkInterfaceIPConfigurationInner object itself. + */ + public NetworkInterfaceIPConfigurationInner withSubnet(SubnetInner subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get gets whether this is a primary customer address on the network interface. + * + * @return the primary value + */ + public Boolean primary() { + return this.primary; + } + + /** + * Set gets whether this is a primary customer address on the network interface. + * + * @param primary the primary value to set + * @return the NetworkInterfaceIPConfigurationInner object itself. + */ + public NetworkInterfaceIPConfigurationInner withPrimary(Boolean primary) { + this.primary = primary; + return this; + } + + /** + * Get public IP address bound to the IP configuration. + * + * @return the publicIPAddress value + */ + public PublicIPAddressInner publicIPAddress() { + return this.publicIPAddress; + } + + /** + * Set public IP address bound to the IP configuration. + * + * @param publicIPAddress the publicIPAddress value to set + * @return the NetworkInterfaceIPConfigurationInner object itself. + */ + public NetworkInterfaceIPConfigurationInner withPublicIPAddress(PublicIPAddressInner publicIPAddress) { + this.publicIPAddress = publicIPAddress; + return this; + } + + /** + * Get application security groups in which the IP configuration is included. + * + * @return the applicationSecurityGroups value + */ + public List applicationSecurityGroups() { + return this.applicationSecurityGroups; + } + + /** + * Set application security groups in which the IP configuration is included. + * + * @param applicationSecurityGroups the applicationSecurityGroups value to set + * @return the NetworkInterfaceIPConfigurationInner object itself. + */ + public NetworkInterfaceIPConfigurationInner withApplicationSecurityGroups(List applicationSecurityGroups) { + this.applicationSecurityGroups = applicationSecurityGroups; + return this; + } + + /** + * Get the provisioning state of the network interface IP configuration. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the network interface IP configuration. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the NetworkInterfaceIPConfigurationInner object itself. + */ + public NetworkInterfaceIPConfigurationInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the NetworkInterfaceIPConfigurationInner object itself. + */ + public NetworkInterfaceIPConfigurationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the NetworkInterfaceIPConfigurationInner object itself. + */ + public NetworkInterfaceIPConfigurationInner withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkInterfaceIPConfigurationsImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkInterfaceIPConfigurationsImpl.java new file mode 100644 index 000000000000..06cde4018012 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkInterfaceIPConfigurationsImpl.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.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_06_01.NetworkInterfaceIPConfigurations; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_06_01.NetworkInterfaceNetworkInterfaceIPConfiguration; + +class NetworkInterfaceIPConfigurationsImpl extends WrapperImpl implements NetworkInterfaceIPConfigurations { + private final NetworkManager manager; + + NetworkInterfaceIPConfigurationsImpl(NetworkManager manager) { + super(manager.inner().networkInterfaceIPConfigurations()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + private NetworkInterfaceNetworkInterfaceIPConfigurationImpl wrapModel(NetworkInterfaceIPConfigurationInner inner) { + return new NetworkInterfaceNetworkInterfaceIPConfigurationImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String networkInterfaceName) { + NetworkInterfaceIPConfigurationsInner client = this.inner(); + return client.listAsync(resourceGroupName, networkInterfaceName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NetworkInterfaceNetworkInterfaceIPConfiguration call(NetworkInterfaceIPConfigurationInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String networkInterfaceName, String ipConfigurationName) { + NetworkInterfaceIPConfigurationsInner client = this.inner(); + return client.getAsync(resourceGroupName, networkInterfaceName, ipConfigurationName) + .map(new Func1() { + @Override + public NetworkInterfaceNetworkInterfaceIPConfiguration call(NetworkInterfaceIPConfigurationInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkInterfaceIPConfigurationsInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkInterfaceIPConfigurationsInner.java new file mode 100644 index 000000000000..a994baa5ae54 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkInterfaceIPConfigurationsInner.java @@ -0,0 +1,397 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.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 NetworkInterfaceIPConfigurations. + */ +public class NetworkInterfaceIPConfigurationsInner { + /** The Retrofit service to perform REST calls. */ + private NetworkInterfaceIPConfigurationsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of NetworkInterfaceIPConfigurationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public NetworkInterfaceIPConfigurationsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(NetworkInterfaceIPConfigurationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for NetworkInterfaceIPConfigurations to be + * used by Retrofit to perform actually REST calls. + */ + interface NetworkInterfaceIPConfigurationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.NetworkInterfaceIPConfigurations list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/ipConfigurations") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @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.network.v2018_06_01.NetworkInterfaceIPConfigurations get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/ipConfigurations/{ipConfigurationName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("ipConfigurationName") String ipConfigurationName, @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.network.v2018_06_01.NetworkInterfaceIPConfigurations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get all ip configurations in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceIPConfigurationInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String networkInterfaceName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, networkInterfaceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get all ip configurations in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String networkInterfaceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, networkInterfaceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get all ip configurations in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceIPConfigurationInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String networkInterfaceName) { + return listWithServiceResponseAsync(resourceGroupName, networkInterfaceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get all ip configurations in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceIPConfigurationInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String networkInterfaceName) { + return listSinglePageAsync(resourceGroupName, networkInterfaceName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get all ip configurations in a network interface. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceIPConfigurationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String networkInterfaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.list(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified network interface ip configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkInterfaceIPConfigurationInner object if successful. + */ + public NetworkInterfaceIPConfigurationInner get(String resourceGroupName, String networkInterfaceName, String ipConfigurationName) { + return getWithServiceResponseAsync(resourceGroupName, networkInterfaceName, ipConfigurationName).toBlocking().single().body(); + } + + /** + * Gets the specified network interface ip configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String networkInterfaceName, String ipConfigurationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, networkInterfaceName, ipConfigurationName), serviceCallback); + } + + /** + * Gets the specified network interface ip configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceIPConfigurationInner object + */ + public Observable getAsync(String resourceGroupName, String networkInterfaceName, String ipConfigurationName) { + return getWithServiceResponseAsync(resourceGroupName, networkInterfaceName, ipConfigurationName).map(new Func1, NetworkInterfaceIPConfigurationInner>() { + @Override + public NetworkInterfaceIPConfigurationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified network interface ip configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceIPConfigurationInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName, String ipConfigurationName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (ipConfigurationName == null) { + throw new IllegalArgumentException("Parameter ipConfigurationName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.get(resourceGroupName, networkInterfaceName, ipConfigurationName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get all ip configurations in a network interface. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceIPConfigurationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get all ip configurations in a network interface. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get all ip configurations in a network interface. + * + * @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<NetworkInterfaceIPConfigurationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get all ip configurations in a network interface. + * + * @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<NetworkInterfaceIPConfigurationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get all ip configurations in a network interface. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceIPConfigurationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkInterfaceImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkInterfaceImpl.java new file mode 100644 index 000000000000..aa298a390fc5 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkInterfaceImpl.java @@ -0,0 +1,184 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_06_01.NetworkInterface; +import rx.Observable; +import com.microsoft.azure.SubResource; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.NetworkInterfaceDnsSettings; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_06_01.VirtualMachineScaleSetNetworkInterfaceIPConfiguration; +import com.microsoft.azure.management.network.v2018_06_01.NetworkSecurityGroup; + +class NetworkInterfaceImpl extends GroupableResourceCoreImpl implements NetworkInterface, NetworkInterface.Definition, NetworkInterface.Update { + NetworkInterfaceImpl(String name, NetworkInterfaceInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + NetworkInterfacesInner client = this.manager().inner().networkInterfaces(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + NetworkInterfacesInner client = this.manager().inner().networkInterfaces(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + NetworkInterfacesInner client = this.manager().inner().networkInterfaces(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public NetworkInterfaceDnsSettings dnsSettings() { + return this.inner().dnsSettings(); + } + + @Override + public Boolean enableAcceleratedNetworking() { + return this.inner().enableAcceleratedNetworking(); + } + + @Override + public Boolean enableIPForwarding() { + return this.inner().enableIPForwarding(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public List ipConfigurations() { + List lst = new ArrayList(); + if (this.inner().ipConfigurations() != null) { + for (NetworkInterfaceIPConfigurationInner inner : this.inner().ipConfigurations()) { + lst.add( new VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String macAddress() { + return this.inner().macAddress(); + } + + @Override + public NetworkSecurityGroup networkSecurityGroup() { + NetworkSecurityGroupInner inner = this.inner().networkSecurityGroup(); + if (inner != null) { + return new NetworkSecurityGroupImpl(inner.name(), inner, manager()); + } else { + return null; + } + } + + @Override + public Boolean primary() { + return this.inner().primary(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public SubResource virtualMachine() { + return this.inner().virtualMachine(); + } + + @Override + public NetworkInterfaceImpl withDnsSettings(NetworkInterfaceDnsSettings dnsSettings) { + this.inner().withDnsSettings(dnsSettings); + return this; + } + + @Override + public NetworkInterfaceImpl withEnableAcceleratedNetworking(Boolean enableAcceleratedNetworking) { + this.inner().withEnableAcceleratedNetworking(enableAcceleratedNetworking); + return this; + } + + @Override + public NetworkInterfaceImpl withEnableIPForwarding(Boolean enableIPForwarding) { + this.inner().withEnableIPForwarding(enableIPForwarding); + return this; + } + + @Override + public NetworkInterfaceImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public NetworkInterfaceImpl withIpConfigurations(List ipConfigurations) { + this.inner().withIpConfigurations(ipConfigurations); + return this; + } + + @Override + public NetworkInterfaceImpl withMacAddress(String macAddress) { + this.inner().withMacAddress(macAddress); + return this; + } + + @Override + public NetworkInterfaceImpl withNetworkSecurityGroup(NetworkSecurityGroupInner networkSecurityGroup) { + this.inner().withNetworkSecurityGroup(networkSecurityGroup); + return this; + } + + @Override + public NetworkInterfaceImpl withPrimary(Boolean primary) { + this.inner().withPrimary(primary); + return this; + } + + @Override + public NetworkInterfaceImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public NetworkInterfaceImpl withResourceGuid(String resourceGuid) { + this.inner().withResourceGuid(resourceGuid); + return this; + } + + @Override + public NetworkInterfaceImpl withVirtualMachine(SubResource virtualMachine) { + this.inner().withVirtualMachine(virtualMachine); + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkInterfaceInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkInterfaceInner.java new file mode 100644 index 000000000000..9d08083d1cac --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkInterfaceInner.java @@ -0,0 +1,338 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.SubResource; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.NetworkInterfaceDnsSettings; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * A network interface in a resource group. + */ +@JsonFlatten +@SkipParentValidation +public class NetworkInterfaceInner extends Resource { + /** + * The reference of a virtual machine. + */ + @JsonProperty(value = "properties.virtualMachine") + private SubResource virtualMachine; + + /** + * The reference of the NetworkSecurityGroup resource. + */ + @JsonProperty(value = "properties.networkSecurityGroup") + private NetworkSecurityGroupInner networkSecurityGroup; + + /** + * A list of IPConfigurations of the network interface. + */ + @JsonProperty(value = "properties.ipConfigurations") + private List ipConfigurations; + + /** + * The DNS settings in network interface. + */ + @JsonProperty(value = "properties.dnsSettings") + private NetworkInterfaceDnsSettings dnsSettings; + + /** + * The MAC address of the network interface. + */ + @JsonProperty(value = "properties.macAddress") + private String macAddress; + + /** + * Gets whether this is a primary network interface on a virtual machine. + */ + @JsonProperty(value = "properties.primary") + private Boolean primary; + + /** + * If the network interface is accelerated networking enabled. + */ + @JsonProperty(value = "properties.enableAcceleratedNetworking") + private Boolean enableAcceleratedNetworking; + + /** + * Indicates whether IP forwarding is enabled on this network interface. + */ + @JsonProperty(value = "properties.enableIPForwarding") + private Boolean enableIPForwarding; + + /** + * The resource GUID property of the network interface resource. + */ + @JsonProperty(value = "properties.resourceGuid") + private String resourceGuid; + + /** + * The provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the reference of a virtual machine. + * + * @return the virtualMachine value + */ + public SubResource virtualMachine() { + return this.virtualMachine; + } + + /** + * Set the reference of a virtual machine. + * + * @param virtualMachine the virtualMachine value to set + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withVirtualMachine(SubResource virtualMachine) { + this.virtualMachine = virtualMachine; + return this; + } + + /** + * Get the reference of the NetworkSecurityGroup resource. + * + * @return the networkSecurityGroup value + */ + public NetworkSecurityGroupInner networkSecurityGroup() { + return this.networkSecurityGroup; + } + + /** + * Set the reference of the NetworkSecurityGroup resource. + * + * @param networkSecurityGroup the networkSecurityGroup value to set + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withNetworkSecurityGroup(NetworkSecurityGroupInner networkSecurityGroup) { + this.networkSecurityGroup = networkSecurityGroup; + return this; + } + + /** + * Get a list of IPConfigurations of the network interface. + * + * @return the ipConfigurations value + */ + public List ipConfigurations() { + return this.ipConfigurations; + } + + /** + * Set a list of IPConfigurations of the network interface. + * + * @param ipConfigurations the ipConfigurations value to set + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withIpConfigurations(List ipConfigurations) { + this.ipConfigurations = ipConfigurations; + return this; + } + + /** + * Get the DNS settings in network interface. + * + * @return the dnsSettings value + */ + public NetworkInterfaceDnsSettings dnsSettings() { + return this.dnsSettings; + } + + /** + * Set the DNS settings in network interface. + * + * @param dnsSettings the dnsSettings value to set + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withDnsSettings(NetworkInterfaceDnsSettings dnsSettings) { + this.dnsSettings = dnsSettings; + return this; + } + + /** + * Get the MAC address of the network interface. + * + * @return the macAddress value + */ + public String macAddress() { + return this.macAddress; + } + + /** + * Set the MAC address of the network interface. + * + * @param macAddress the macAddress value to set + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withMacAddress(String macAddress) { + this.macAddress = macAddress; + return this; + } + + /** + * Get gets whether this is a primary network interface on a virtual machine. + * + * @return the primary value + */ + public Boolean primary() { + return this.primary; + } + + /** + * Set gets whether this is a primary network interface on a virtual machine. + * + * @param primary the primary value to set + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withPrimary(Boolean primary) { + this.primary = primary; + return this; + } + + /** + * Get if the network interface is accelerated networking enabled. + * + * @return the enableAcceleratedNetworking value + */ + public Boolean enableAcceleratedNetworking() { + return this.enableAcceleratedNetworking; + } + + /** + * Set if the network interface is accelerated networking enabled. + * + * @param enableAcceleratedNetworking the enableAcceleratedNetworking value to set + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withEnableAcceleratedNetworking(Boolean enableAcceleratedNetworking) { + this.enableAcceleratedNetworking = enableAcceleratedNetworking; + return this; + } + + /** + * Get indicates whether IP forwarding is enabled on this network interface. + * + * @return the enableIPForwarding value + */ + public Boolean enableIPForwarding() { + return this.enableIPForwarding; + } + + /** + * Set indicates whether IP forwarding is enabled on this network interface. + * + * @param enableIPForwarding the enableIPForwarding value to set + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withEnableIPForwarding(Boolean enableIPForwarding) { + this.enableIPForwarding = enableIPForwarding; + return this; + } + + /** + * Get the resource GUID property of the network interface resource. + * + * @return the resourceGuid value + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Set the resource GUID property of the network interface resource. + * + * @param resourceGuid the resourceGuid value to set + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withResourceGuid(String resourceGuid) { + this.resourceGuid = resourceGuid; + return this; + } + + /** + * Get the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkInterfaceLoadBalancerImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkInterfaceLoadBalancerImpl.java new file mode 100644 index 000000000000..4784e2e88299 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkInterfaceLoadBalancerImpl.java @@ -0,0 +1,151 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.NetworkInterfaceLoadBalancer; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_06_01.BackendAddressPool; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.FrontendIPConfiguration; +import com.microsoft.azure.management.network.v2018_06_01.InboundNatPool; +import com.microsoft.azure.management.network.v2018_06_01.InboundNatRule; +import com.microsoft.azure.management.network.v2018_06_01.LoadBalancingRule; +import com.microsoft.azure.management.network.v2018_06_01.OutboundNatRule; +import com.microsoft.azure.management.network.v2018_06_01.Probe; +import com.microsoft.azure.management.network.v2018_06_01.LoadBalancerSku; +import java.util.Map; + +class NetworkInterfaceLoadBalancerImpl extends WrapperImpl implements NetworkInterfaceLoadBalancer { + private final NetworkManager manager; + + NetworkInterfaceLoadBalancerImpl(LoadBalancerInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + + + @Override + public List backendAddressPools() { + List lst = new ArrayList(); + if (this.inner().backendAddressPools() != null) { + for (BackendAddressPoolInner inner : this.inner().backendAddressPools()) { + lst.add( new BackendAddressPoolImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public List frontendIPConfigurations() { + List lst = new ArrayList(); + if (this.inner().frontendIPConfigurations() != null) { + for (FrontendIPConfigurationInner inner : this.inner().frontendIPConfigurations()) { + lst.add( new FrontendIPConfigurationImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public List inboundNatPools() { + return this.inner().inboundNatPools(); + } + + @Override + public List inboundNatRules() { + List lst = new ArrayList(); + if (this.inner().inboundNatRules() != null) { + for (InboundNatRuleInner inner : this.inner().inboundNatRules()) { + lst.add( new InboundNatRuleImpl(inner, manager())); + } + } + return lst; + } + + @Override + public List loadBalancingRules() { + List lst = new ArrayList(); + if (this.inner().loadBalancingRules() != null) { + for (LoadBalancingRuleInner inner : this.inner().loadBalancingRules()) { + lst.add( new LoadBalancingRuleImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List outboundNatRules() { + return this.inner().outboundNatRules(); + } + + @Override + public List probes() { + List lst = new ArrayList(); + if (this.inner().probes() != null) { + for (ProbeInner inner : this.inner().probes()) { + lst.add( new ProbeImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public LoadBalancerSku sku() { + return this.inner().sku(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkInterfaceLoadBalancersImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkInterfaceLoadBalancersImpl.java new file mode 100644 index 000000000000..24603da833df --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkInterfaceLoadBalancersImpl.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.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_06_01.NetworkInterfaceLoadBalancers; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_06_01.NetworkInterfaceLoadBalancer; + +class NetworkInterfaceLoadBalancersImpl extends WrapperImpl implements NetworkInterfaceLoadBalancers { + private final NetworkManager manager; + + NetworkInterfaceLoadBalancersImpl(NetworkManager manager) { + super(manager.inner().networkInterfaceLoadBalancers()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + private NetworkInterfaceLoadBalancerImpl wrapModel(LoadBalancerInner inner) { + return new NetworkInterfaceLoadBalancerImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String networkInterfaceName) { + NetworkInterfaceLoadBalancersInner client = this.inner(); + return client.listAsync(resourceGroupName, networkInterfaceName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NetworkInterfaceLoadBalancer call(LoadBalancerInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkInterfaceLoadBalancersInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkInterfaceLoadBalancersInner.java new file mode 100644 index 000000000000..74ef384429d2 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkInterfaceLoadBalancersInner.java @@ -0,0 +1,301 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in NetworkInterfaceLoadBalancers. + */ +public class NetworkInterfaceLoadBalancersInner { + /** The Retrofit service to perform REST calls. */ + private NetworkInterfaceLoadBalancersService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of NetworkInterfaceLoadBalancersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public NetworkInterfaceLoadBalancersInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(NetworkInterfaceLoadBalancersService.class); + this.client = client; + } + + /** + * The interface defining all the services for NetworkInterfaceLoadBalancers to be + * used by Retrofit to perform actually REST calls. + */ + interface NetworkInterfaceLoadBalancersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.NetworkInterfaceLoadBalancers list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/loadBalancers") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @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.network.v2018_06_01.NetworkInterfaceLoadBalancers listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List all load balancers in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LoadBalancerInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String networkInterfaceName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, networkInterfaceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all load balancers in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String networkInterfaceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, networkInterfaceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all load balancers in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LoadBalancerInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String networkInterfaceName) { + return listWithServiceResponseAsync(resourceGroupName, networkInterfaceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all load balancers in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LoadBalancerInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String networkInterfaceName) { + return listSinglePageAsync(resourceGroupName, networkInterfaceName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all load balancers in a network interface. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<LoadBalancerInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String networkInterfaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.list(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List all load balancers in a network interface. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LoadBalancerInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all load balancers in a network interface. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all load balancers in a network interface. + * + * @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<LoadBalancerInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all load balancers in a network interface. + * + * @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<LoadBalancerInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all load balancers in a network interface. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<LoadBalancerInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkInterfaceNetworkInterfaceIPConfigurationImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkInterfaceNetworkInterfaceIPConfigurationImpl.java new file mode 100644 index 000000000000..e06a5072de88 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkInterfaceNetworkInterfaceIPConfigurationImpl.java @@ -0,0 +1,150 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.NetworkInterfaceNetworkInterfaceIPConfiguration; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGatewayBackendAddressPool; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationSecurityGroup; +import com.microsoft.azure.management.network.v2018_06_01.BackendAddressPool; +import com.microsoft.azure.management.network.v2018_06_01.InboundNatRule; +import com.microsoft.azure.management.network.v2018_06_01.IPVersion; +import com.microsoft.azure.management.network.v2018_06_01.IPAllocationMethod; +import com.microsoft.azure.management.network.v2018_06_01.PublicIPAddress; +import com.microsoft.azure.management.network.v2018_06_01.Subnet; + +class NetworkInterfaceNetworkInterfaceIPConfigurationImpl extends IndexableRefreshableWrapperImpl implements NetworkInterfaceNetworkInterfaceIPConfiguration { + private final NetworkManager manager; + private String resourceGroupName; + private String networkInterfaceName; + private String ipConfigurationName; + + NetworkInterfaceNetworkInterfaceIPConfigurationImpl(NetworkInterfaceIPConfigurationInner inner, NetworkManager manager) { + super(null, inner); + this.manager = manager; + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.networkInterfaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "networkInterfaces"); + this.ipConfigurationName = IdParsingUtils.getValueFromIdByName(inner.id(), "ipConfigurations"); + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + NetworkInterfaceIPConfigurationsInner client = this.manager().inner().networkInterfaceIPConfigurations(); + return client.getAsync(this.resourceGroupName, this.networkInterfaceName, this.ipConfigurationName); + } + + + + @Override + public List applicationGatewayBackendAddressPools() { + return this.inner().applicationGatewayBackendAddressPools(); + } + + @Override + public List applicationSecurityGroups() { + List lst = new ArrayList(); + if (this.inner().applicationSecurityGroups() != null) { + for (ApplicationSecurityGroupInner inner : this.inner().applicationSecurityGroups()) { + lst.add( new ApplicationSecurityGroupImpl(inner.name(), inner, manager())); + } + } + return lst; + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public List loadBalancerBackendAddressPools() { + List lst = new ArrayList(); + if (this.inner().loadBalancerBackendAddressPools() != null) { + for (BackendAddressPoolInner inner : this.inner().loadBalancerBackendAddressPools()) { + lst.add( new BackendAddressPoolImpl(inner, manager())); + } + } + return lst; + } + + @Override + public List loadBalancerInboundNatRules() { + List lst = new ArrayList(); + if (this.inner().loadBalancerInboundNatRules() != null) { + for (InboundNatRuleInner inner : this.inner().loadBalancerInboundNatRules()) { + lst.add( new InboundNatRuleImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Boolean primary() { + return this.inner().primary(); + } + + @Override + public String privateIPAddress() { + return this.inner().privateIPAddress(); + } + + @Override + public IPVersion privateIPAddressVersion() { + return this.inner().privateIPAddressVersion(); + } + + @Override + public IPAllocationMethod privateIPAllocationMethod() { + return this.inner().privateIPAllocationMethod(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public PublicIPAddress publicIPAddress() { + PublicIPAddressInner inner = this.inner().publicIPAddress(); + if (inner != null) { + return new PublicIPAddressImpl(inner.name(), inner, manager()); + } else { + return null; + } + } + + @Override + public Subnet subnet() { + SubnetInner inner = this.inner().subnet(); + if (inner != null) { + return new SubnetImpl(inner, manager()); + } else { + return null; + } + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkInterfacesImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkInterfacesImpl.java new file mode 100644 index 000000000000..117d26cbe5f1 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkInterfacesImpl.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. + * abc + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_06_01.NetworkInterfaces; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.network.v2018_06_01.NetworkInterface; +import com.microsoft.azure.Page; +import rx.Completable; +import com.microsoft.azure.management.network.v2018_06_01.EffectiveRouteListResult; +import com.microsoft.azure.management.network.v2018_06_01.EffectiveNetworkSecurityGroupListResult; +import com.microsoft.azure.management.network.v2018_06_01.LoadBalancerNetworkInterface; +import com.microsoft.azure.management.network.v2018_06_01.VirtualMachineScaleSetNetworkInterfaceIPConfiguration; + +class NetworkInterfacesImpl extends WrapperImpl implements NetworkInterfaces { + private final NetworkManager manager; + + NetworkInterfacesImpl(NetworkManager manager) { + super(manager.inner().networkInterfaces()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public NetworkInterfaceImpl defineNetworkInterface(String name) { + return wrapNetworkInterfaceModel(name); + } + + private NetworkInterfaceImpl wrapNetworkInterfaceModel(String name) { + return new NetworkInterfaceImpl(name, new NetworkInterfaceInner(), this.manager()); + } + + private NetworkInterfaceImpl wrapNetworkInterfaceModel(NetworkInterfaceInner inner) { + return new NetworkInterfaceImpl(inner.name(), inner, manager()); + } + + private VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl wrapVirtualMachineScaleSetNetworkInterfaceIPConfigurationModel(NetworkInterfaceIPConfigurationInner inner) { + return new VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl(inner, manager()); + } + + private Observable getNetworkInterfaceInnerUsingNetworkInterfacesInnerAsync(String resourceGroupName, String name) { + NetworkInterfacesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + private Observable getNetworkInterfaceIPConfigurationInnerUsingNetworkInterfacesInnerAsync(String id) { + String resourceGroupName = IdParsingUtils.getValueFromIdByName(id, "resourceGroups"); + String virtualMachineScaleSetName = IdParsingUtils.getValueFromIdByName(id, "virtualMachineScaleSets"); + String virtualmachineIndex = IdParsingUtils.getValueFromIdByName(id, "virtualMachines"); + String networkInterfaceName = IdParsingUtils.getValueFromIdByName(id, "networkInterfaces"); + String ipConfigurationName = IdParsingUtils.getValueFromIdByName(id, "ipConfigurations"); + NetworkInterfacesInner client = this.inner(); + return client.getVirtualMachineScaleSetIpConfigurationAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName); + } + + @Override + public Observable getByResourceGroupAsync(String resourceGroupName, String name) { + return this.getNetworkInterfaceInnerUsingNetworkInterfacesInnerAsync(resourceGroupName, name).map(new Func1 () { + @Override + public NetworkInterface call(NetworkInterfaceInner inner) { + return wrapNetworkInterfaceModel(inner); + } + }); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + NetworkInterfacesInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NetworkInterface call(NetworkInterfaceInner inner) { + return wrapNetworkInterfaceModel(inner); + } + }); + } + + @Override + public Observable listAsync() { + NetworkInterfacesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NetworkInterface call(NetworkInterfaceInner inner) { + return wrapNetworkInterfaceModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String name) { + return this.inner().deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable getEffectiveRouteTableAsync(String resourceGroupName, String networkInterfaceName) { + NetworkInterfacesInner client = this.inner(); + return client.getEffectiveRouteTableAsync(resourceGroupName, networkInterfaceName) + .map(new Func1() { + @Override + public EffectiveRouteListResult call(EffectiveRouteListResultInner inner) { + return new EffectiveRouteListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listEffectiveNetworkSecurityGroupsAsync(String resourceGroupName, String networkInterfaceName) { + NetworkInterfacesInner client = this.inner(); + return client.listEffectiveNetworkSecurityGroupsAsync(resourceGroupName, networkInterfaceName) + .map(new Func1() { + @Override + public EffectiveNetworkSecurityGroupListResult call(EffectiveNetworkSecurityGroupListResultInner inner) { + return new EffectiveNetworkSecurityGroupListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listVirtualMachineScaleSetVMNetworkInterfacesAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex) { + NetworkInterfacesInner client = this.inner(); + return client.listVirtualMachineScaleSetVMNetworkInterfacesAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public LoadBalancerNetworkInterface call(NetworkInterfaceInner inner) { + return new LoadBalancerNetworkInterfaceImpl(inner, manager()); + } + }); + } + + @Override + public Observable listVirtualMachineScaleSetNetworkInterfacesAsync(final String resourceGroupName, final String virtualMachineScaleSetName) { + NetworkInterfacesInner client = this.inner(); + return client.listVirtualMachineScaleSetNetworkInterfacesAsync(resourceGroupName, virtualMachineScaleSetName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public LoadBalancerNetworkInterface call(NetworkInterfaceInner inner) { + return new LoadBalancerNetworkInterfaceImpl(inner, manager()); + } + }); + } + + @Override + public Observable getVirtualMachineScaleSetNetworkInterfaceAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName) { + NetworkInterfacesInner client = this.inner(); + return client.getVirtualMachineScaleSetNetworkInterfaceAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName) + .map(new Func1() { + @Override + public LoadBalancerNetworkInterface call(NetworkInterfaceInner inner) { + return new LoadBalancerNetworkInterfaceImpl(inner, manager()); + } + }); + } + + @Override + public Observable getVirtualMachineScaleSetIpConfigurationAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName) { + NetworkInterfacesInner client = this.inner(); + return client.getVirtualMachineScaleSetIpConfigurationAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName) + .map(new Func1() { + @Override + public VirtualMachineScaleSetNetworkInterfaceIPConfiguration call(NetworkInterfaceIPConfigurationInner inner) { + return wrapVirtualMachineScaleSetNetworkInterfaceIPConfigurationModel(inner); + } + }); + } + + @Override + public Observable listVirtualMachineScaleSetIpConfigurationsAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName) { + NetworkInterfacesInner client = this.inner(); + return client.listVirtualMachineScaleSetIpConfigurationsAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VirtualMachineScaleSetNetworkInterfaceIPConfiguration call(NetworkInterfaceIPConfigurationInner inner) { + return wrapVirtualMachineScaleSetNetworkInterfaceIPConfigurationModel(inner); + } + }); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkInterfacesInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkInterfacesInner.java new file mode 100644 index 000000000000..7aaeece02232 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkInterfacesInner.java @@ -0,0 +1,2966 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_06_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in NetworkInterfaces. + */ +public class NetworkInterfacesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private NetworkInterfacesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of NetworkInterfacesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public NetworkInterfacesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(NetworkInterfacesService.class); + this.client = client; + } + + /** + * The interface defining all the services for NetworkInterfaces to be + * used by Retrofit to perform actually REST calls. + */ + interface NetworkInterfacesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.NetworkInterfaces delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @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.network.v2018_06_01.NetworkInterfaces beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @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.network.v2018_06_01.NetworkInterfaces getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @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.network.v2018_06_01.NetworkInterfaces createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("subscriptionId") String subscriptionId, @Body NetworkInterfaceInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.NetworkInterfaces beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("subscriptionId") String subscriptionId, @Body NetworkInterfaceInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.NetworkInterfaces updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.NetworkInterfaces beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}") + Observable> beginUpdateTags(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.NetworkInterfaces list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/networkInterfaces") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.NetworkInterfaces listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @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.network.v2018_06_01.NetworkInterfaces getEffectiveRouteTable" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveRouteTable") + Observable> getEffectiveRouteTable(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @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.network.v2018_06_01.NetworkInterfaces beginGetEffectiveRouteTable" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveRouteTable") + Observable> beginGetEffectiveRouteTable(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @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.network.v2018_06_01.NetworkInterfaces listEffectiveNetworkSecurityGroups" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveNetworkSecurityGroups") + Observable> listEffectiveNetworkSecurityGroups(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @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.network.v2018_06_01.NetworkInterfaces beginListEffectiveNetworkSecurityGroups" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveNetworkSecurityGroups") + Observable> beginListEffectiveNetworkSecurityGroups(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @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.network.v2018_06_01.NetworkInterfaces listVirtualMachineScaleSetVMNetworkInterfaces" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces") + Observable> listVirtualMachineScaleSetVMNetworkInterfaces(@Path("resourceGroupName") String resourceGroupName, @Path("virtualMachineScaleSetName") String virtualMachineScaleSetName, @Path("virtualmachineIndex") String virtualmachineIndex, @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.network.v2018_06_01.NetworkInterfaces listVirtualMachineScaleSetNetworkInterfaces" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/networkInterfaces") + Observable> listVirtualMachineScaleSetNetworkInterfaces(@Path("resourceGroupName") String resourceGroupName, @Path("virtualMachineScaleSetName") String virtualMachineScaleSetName, @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.network.v2018_06_01.NetworkInterfaces getVirtualMachineScaleSetNetworkInterface" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}") + Observable> getVirtualMachineScaleSetNetworkInterface(@Path("resourceGroupName") String resourceGroupName, @Path("virtualMachineScaleSetName") String virtualMachineScaleSetName, @Path("virtualmachineIndex") String virtualmachineIndex, @Path("networkInterfaceName") String networkInterfaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @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.network.v2018_06_01.NetworkInterfaces listVirtualMachineScaleSetIpConfigurations" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipConfigurations") + Observable> listVirtualMachineScaleSetIpConfigurations(@Path("resourceGroupName") String resourceGroupName, @Path("virtualMachineScaleSetName") String virtualMachineScaleSetName, @Path("virtualmachineIndex") String virtualmachineIndex, @Path("networkInterfaceName") String networkInterfaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @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.network.v2018_06_01.NetworkInterfaces getVirtualMachineScaleSetIpConfiguration" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipConfigurations/{ipConfigurationName}") + Observable> getVirtualMachineScaleSetIpConfiguration(@Path("resourceGroupName") String resourceGroupName, @Path("virtualMachineScaleSetName") String virtualMachineScaleSetName, @Path("virtualmachineIndex") String virtualmachineIndex, @Path("networkInterfaceName") String networkInterfaceName, @Path("ipConfigurationName") String ipConfigurationName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @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.network.v2018_06_01.NetworkInterfaces listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.NetworkInterfaces listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.NetworkInterfaces listVirtualMachineScaleSetVMNetworkInterfacesNext" }) + @GET + Observable> listVirtualMachineScaleSetVMNetworkInterfacesNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.NetworkInterfaces listVirtualMachineScaleSetNetworkInterfacesNext" }) + @GET + Observable> listVirtualMachineScaleSetNetworkInterfacesNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.NetworkInterfaces listVirtualMachineScaleSetIpConfigurationsNext" }) + @GET + Observable> listVirtualMachineScaleSetIpConfigurationsNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String networkInterfaceName) { + deleteWithServiceResponseAsync(resourceGroupName, networkInterfaceName).toBlocking().last().body(); + } + + /** + * Deletes the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @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 networkInterfaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, networkInterfaceName), serviceCallback); + } + + /** + * Deletes the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String networkInterfaceName) { + return deleteWithServiceResponseAsync(resourceGroupName, networkInterfaceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + Observable> observable = service.delete(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String networkInterfaceName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, networkInterfaceName).toBlocking().single().body(); + } + + /** + * Deletes the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String networkInterfaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, networkInterfaceName), serviceCallback); + } + + /** + * Deletes the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String networkInterfaceName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, networkInterfaceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.beginDelete(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets information about the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkInterfaceInner object if successful. + */ + public NetworkInterfaceInner getByResourceGroup(String resourceGroupName, String networkInterfaceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkInterfaceName).toBlocking().single().body(); + } + + /** + * Gets information about the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String networkInterfaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkInterfaceName), serviceCallback); + } + + /** + * Gets information about the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String networkInterfaceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkInterfaceName).map(new Func1, NetworkInterfaceInner>() { + @Override + public NetworkInterfaceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets information about the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + final String expand = null; + return service.getByResourceGroup(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets information about the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkInterfaceInner object if successful. + */ + public NetworkInterfaceInner getByResourceGroup(String resourceGroupName, String networkInterfaceName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkInterfaceName, expand).toBlocking().single().body(); + } + + /** + * Gets information about the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String networkInterfaceName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkInterfaceName, expand), serviceCallback); + } + + /** + * Gets information about the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String networkInterfaceName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkInterfaceName, expand).map(new Func1, NetworkInterfaceInner>() { + @Override + public NetworkInterfaceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets information about the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.getByResourceGroup(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param parameters Parameters supplied to the create or update network interface operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkInterfaceInner object if successful. + */ + public NetworkInterfaceInner createOrUpdate(String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkInterfaceName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param parameters Parameters supplied to the create or update network interface operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, networkInterfaceName, parameters), serviceCallback); + } + + /** + * Creates or updates a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param parameters Parameters supplied to the create or update network interface operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkInterfaceName, parameters).map(new Func1, NetworkInterfaceInner>() { + @Override + public NetworkInterfaceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param parameters Parameters supplied to the create or update network interface operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param parameters Parameters supplied to the create or update network interface operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkInterfaceInner object if successful. + */ + public NetworkInterfaceInner beginCreateOrUpdate(String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkInterfaceName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param parameters Parameters supplied to the create or update network interface operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkInterfaceName, parameters), serviceCallback); + } + + /** + * Creates or updates a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param parameters Parameters supplied to the create or update network interface operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkInterfaceName, parameters).map(new Func1, NetworkInterfaceInner>() { + @Override + public NetworkInterfaceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param parameters Parameters supplied to the create or update network interface operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + return service.beginCreateOrUpdate(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkInterfaceInner object if successful. + */ + public NetworkInterfaceInner updateTags(String resourceGroupName, String networkInterfaceName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, networkInterfaceName).toBlocking().last().body(); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @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 updateTagsAsync(String resourceGroupName, String networkInterfaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, networkInterfaceName), serviceCallback); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String networkInterfaceName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, networkInterfaceName).map(new Func1, NetworkInterfaceInner>() { + @Override + public NetworkInterfaceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + Observable> observable = service.updateTags(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkInterfaceInner object if successful. + */ + public NetworkInterfaceInner updateTags(String resourceGroupName, String networkInterfaceName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, networkInterfaceName, tags).toBlocking().last().body(); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String networkInterfaceName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, networkInterfaceName, tags), serviceCallback); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String networkInterfaceName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, networkInterfaceName, tags).map(new Func1, NetworkInterfaceInner>() { + @Override + public NetworkInterfaceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-06-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + Observable> observable = service.updateTags(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkInterfaceInner object if successful. + */ + public NetworkInterfaceInner beginUpdateTags(String resourceGroupName, String networkInterfaceName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, networkInterfaceName).toBlocking().single().body(); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @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 beginUpdateTagsAsync(String resourceGroupName, String networkInterfaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, networkInterfaceName), serviceCallback); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String networkInterfaceName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, networkInterfaceName).map(new Func1, NetworkInterfaceInner>() { + @Override + public NetworkInterfaceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.beginUpdateTags(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkInterfaceInner object if successful. + */ + public NetworkInterfaceInner beginUpdateTags(String resourceGroupName, String networkInterfaceName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, networkInterfaceName, tags).toBlocking().single().body(); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String networkInterfaceName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, networkInterfaceName, tags), serviceCallback); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String networkInterfaceName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, networkInterfaceName, tags).map(new Func1, NetworkInterfaceInner>() { + @Override + public NetworkInterfaceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-06-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.beginUpdateTags(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all network interfaces in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all network interfaces in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all network interfaces in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all network interfaces in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all network interfaces in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all network interfaces in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all network interfaces in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all network interfaces in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all network interfaces in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all network interfaces in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all route tables applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EffectiveRouteListResultInner object if successful. + */ + public EffectiveRouteListResultInner getEffectiveRouteTable(String resourceGroupName, String networkInterfaceName) { + return getEffectiveRouteTableWithServiceResponseAsync(resourceGroupName, networkInterfaceName).toBlocking().last().body(); + } + + /** + * Gets all route tables applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @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 getEffectiveRouteTableAsync(String resourceGroupName, String networkInterfaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getEffectiveRouteTableWithServiceResponseAsync(resourceGroupName, networkInterfaceName), serviceCallback); + } + + /** + * Gets all route tables applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable getEffectiveRouteTableAsync(String resourceGroupName, String networkInterfaceName) { + return getEffectiveRouteTableWithServiceResponseAsync(resourceGroupName, networkInterfaceName).map(new Func1, EffectiveRouteListResultInner>() { + @Override + public EffectiveRouteListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets all route tables applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> getEffectiveRouteTableWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + Observable> observable = service.getEffectiveRouteTable(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Gets all route tables applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EffectiveRouteListResultInner object if successful. + */ + public EffectiveRouteListResultInner beginGetEffectiveRouteTable(String resourceGroupName, String networkInterfaceName) { + return beginGetEffectiveRouteTableWithServiceResponseAsync(resourceGroupName, networkInterfaceName).toBlocking().single().body(); + } + + /** + * Gets all route tables applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @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 beginGetEffectiveRouteTableAsync(String resourceGroupName, String networkInterfaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetEffectiveRouteTableWithServiceResponseAsync(resourceGroupName, networkInterfaceName), serviceCallback); + } + + /** + * Gets all route tables applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EffectiveRouteListResultInner object + */ + public Observable beginGetEffectiveRouteTableAsync(String resourceGroupName, String networkInterfaceName) { + return beginGetEffectiveRouteTableWithServiceResponseAsync(resourceGroupName, networkInterfaceName).map(new Func1, EffectiveRouteListResultInner>() { + @Override + public EffectiveRouteListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets all route tables applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EffectiveRouteListResultInner object + */ + public Observable> beginGetEffectiveRouteTableWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.beginGetEffectiveRouteTable(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGetEffectiveRouteTableDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGetEffectiveRouteTableDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all network security groups applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EffectiveNetworkSecurityGroupListResultInner object if successful. + */ + public EffectiveNetworkSecurityGroupListResultInner listEffectiveNetworkSecurityGroups(String resourceGroupName, String networkInterfaceName) { + return listEffectiveNetworkSecurityGroupsWithServiceResponseAsync(resourceGroupName, networkInterfaceName).toBlocking().last().body(); + } + + /** + * Gets all network security groups applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @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 listEffectiveNetworkSecurityGroupsAsync(String resourceGroupName, String networkInterfaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listEffectiveNetworkSecurityGroupsWithServiceResponseAsync(resourceGroupName, networkInterfaceName), serviceCallback); + } + + /** + * Gets all network security groups applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable listEffectiveNetworkSecurityGroupsAsync(String resourceGroupName, String networkInterfaceName) { + return listEffectiveNetworkSecurityGroupsWithServiceResponseAsync(resourceGroupName, networkInterfaceName).map(new Func1, EffectiveNetworkSecurityGroupListResultInner>() { + @Override + public EffectiveNetworkSecurityGroupListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets all network security groups applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> listEffectiveNetworkSecurityGroupsWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + Observable> observable = service.listEffectiveNetworkSecurityGroups(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Gets all network security groups applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EffectiveNetworkSecurityGroupListResultInner object if successful. + */ + public EffectiveNetworkSecurityGroupListResultInner beginListEffectiveNetworkSecurityGroups(String resourceGroupName, String networkInterfaceName) { + return beginListEffectiveNetworkSecurityGroupsWithServiceResponseAsync(resourceGroupName, networkInterfaceName).toBlocking().single().body(); + } + + /** + * Gets all network security groups applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @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 beginListEffectiveNetworkSecurityGroupsAsync(String resourceGroupName, String networkInterfaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginListEffectiveNetworkSecurityGroupsWithServiceResponseAsync(resourceGroupName, networkInterfaceName), serviceCallback); + } + + /** + * Gets all network security groups applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EffectiveNetworkSecurityGroupListResultInner object + */ + public Observable beginListEffectiveNetworkSecurityGroupsAsync(String resourceGroupName, String networkInterfaceName) { + return beginListEffectiveNetworkSecurityGroupsWithServiceResponseAsync(resourceGroupName, networkInterfaceName).map(new Func1, EffectiveNetworkSecurityGroupListResultInner>() { + @Override + public EffectiveNetworkSecurityGroupListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets all network security groups applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EffectiveNetworkSecurityGroupListResultInner object + */ + public Observable> beginListEffectiveNetworkSecurityGroupsWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.beginListEffectiveNetworkSecurityGroups(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginListEffectiveNetworkSecurityGroupsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginListEffectiveNetworkSecurityGroupsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceInner> object if successful. + */ + public PagedList listVirtualMachineScaleSetVMNetworkInterfaces(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex) { + ServiceResponse> response = listVirtualMachineScaleSetVMNetworkInterfacesSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listVirtualMachineScaleSetVMNetworkInterfacesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @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> listVirtualMachineScaleSetVMNetworkInterfacesAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listVirtualMachineScaleSetVMNetworkInterfacesSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listVirtualMachineScaleSetVMNetworkInterfacesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable> listVirtualMachineScaleSetVMNetworkInterfacesAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex) { + return listVirtualMachineScaleSetVMNetworkInterfacesWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable>> listVirtualMachineScaleSetVMNetworkInterfacesWithServiceResponseAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex) { + return listVirtualMachineScaleSetVMNetworkInterfacesSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex) + .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(listVirtualMachineScaleSetVMNetworkInterfacesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param virtualMachineScaleSetName The name of the virtual machine scale set. + ServiceResponse> * @param virtualmachineIndex The virtual machine index. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listVirtualMachineScaleSetVMNetworkInterfacesSinglePageAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualMachineScaleSetName == null) { + throw new IllegalArgumentException("Parameter virtualMachineScaleSetName is required and cannot be null."); + } + if (virtualmachineIndex == null) { + throw new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-03-30"; + return service.listVirtualMachineScaleSetVMNetworkInterfaces(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listVirtualMachineScaleSetVMNetworkInterfacesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listVirtualMachineScaleSetVMNetworkInterfacesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all network interfaces in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceInner> object if successful. + */ + public PagedList listVirtualMachineScaleSetNetworkInterfaces(final String resourceGroupName, final String virtualMachineScaleSetName) { + ServiceResponse> response = listVirtualMachineScaleSetNetworkInterfacesSinglePageAsync(resourceGroupName, virtualMachineScaleSetName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listVirtualMachineScaleSetNetworkInterfacesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all network interfaces in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @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> listVirtualMachineScaleSetNetworkInterfacesAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listVirtualMachineScaleSetNetworkInterfacesSinglePageAsync(resourceGroupName, virtualMachineScaleSetName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listVirtualMachineScaleSetNetworkInterfacesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all network interfaces in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable> listVirtualMachineScaleSetNetworkInterfacesAsync(final String resourceGroupName, final String virtualMachineScaleSetName) { + return listVirtualMachineScaleSetNetworkInterfacesWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all network interfaces in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable>> listVirtualMachineScaleSetNetworkInterfacesWithServiceResponseAsync(final String resourceGroupName, final String virtualMachineScaleSetName) { + return listVirtualMachineScaleSetNetworkInterfacesSinglePageAsync(resourceGroupName, virtualMachineScaleSetName) + .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(listVirtualMachineScaleSetNetworkInterfacesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all network interfaces in a virtual machine scale set. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listVirtualMachineScaleSetNetworkInterfacesSinglePageAsync(final String resourceGroupName, final String virtualMachineScaleSetName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualMachineScaleSetName == null) { + throw new IllegalArgumentException("Parameter virtualMachineScaleSetName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-03-30"; + return service.listVirtualMachineScaleSetNetworkInterfaces(resourceGroupName, virtualMachineScaleSetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listVirtualMachineScaleSetNetworkInterfacesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listVirtualMachineScaleSetNetworkInterfacesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get the specified network interface in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkInterfaceInner object if successful. + */ + public NetworkInterfaceInner getVirtualMachineScaleSetNetworkInterface(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName) { + return getVirtualMachineScaleSetNetworkInterfaceWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName).toBlocking().single().body(); + } + + /** + * Get the specified network interface in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @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 getVirtualMachineScaleSetNetworkInterfaceAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getVirtualMachineScaleSetNetworkInterfaceWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName), serviceCallback); + } + + /** + * Get the specified network interface in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceInner object + */ + public Observable getVirtualMachineScaleSetNetworkInterfaceAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName) { + return getVirtualMachineScaleSetNetworkInterfaceWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName).map(new Func1, NetworkInterfaceInner>() { + @Override + public NetworkInterfaceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the specified network interface in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceInner object + */ + public Observable> getVirtualMachineScaleSetNetworkInterfaceWithServiceResponseAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualMachineScaleSetName == null) { + throw new IllegalArgumentException("Parameter virtualMachineScaleSetName is required and cannot be null."); + } + if (virtualmachineIndex == null) { + throw new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-03-30"; + final String expand = null; + return service.getVirtualMachineScaleSetNetworkInterface(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getVirtualMachineScaleSetNetworkInterfaceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get the specified network interface in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkInterfaceInner object if successful. + */ + public NetworkInterfaceInner getVirtualMachineScaleSetNetworkInterface(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String expand) { + return getVirtualMachineScaleSetNetworkInterfaceWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand).toBlocking().single().body(); + } + + /** + * Get the specified network interface in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @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 getVirtualMachineScaleSetNetworkInterfaceAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getVirtualMachineScaleSetNetworkInterfaceWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand), serviceCallback); + } + + /** + * Get the specified network interface in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceInner object + */ + public Observable getVirtualMachineScaleSetNetworkInterfaceAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String expand) { + return getVirtualMachineScaleSetNetworkInterfaceWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand).map(new Func1, NetworkInterfaceInner>() { + @Override + public NetworkInterfaceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the specified network interface in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceInner object + */ + public Observable> getVirtualMachineScaleSetNetworkInterfaceWithServiceResponseAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualMachineScaleSetName == null) { + throw new IllegalArgumentException("Parameter virtualMachineScaleSetName is required and cannot be null."); + } + if (virtualmachineIndex == null) { + throw new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-03-30"; + return service.getVirtualMachineScaleSetNetworkInterface(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getVirtualMachineScaleSetNetworkInterfaceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getVirtualMachineScaleSetNetworkInterfaceDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceIPConfigurationInner> object if successful. + */ + public PagedList listVirtualMachineScaleSetIpConfigurations(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName) { + ServiceResponse> response = listVirtualMachineScaleSetIpConfigurationsSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listVirtualMachineScaleSetIpConfigurationsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @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> listVirtualMachineScaleSetIpConfigurationsAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listVirtualMachineScaleSetIpConfigurationsSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listVirtualMachineScaleSetIpConfigurationsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceIPConfigurationInner> object + */ + public Observable> listVirtualMachineScaleSetIpConfigurationsAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName) { + return listVirtualMachineScaleSetIpConfigurationsWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceIPConfigurationInner> object + */ + public Observable>> listVirtualMachineScaleSetIpConfigurationsWithServiceResponseAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName) { + return listVirtualMachineScaleSetIpConfigurationsSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName) + .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(listVirtualMachineScaleSetIpConfigurationsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceIPConfigurationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listVirtualMachineScaleSetIpConfigurationsSinglePageAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualMachineScaleSetName == null) { + throw new IllegalArgumentException("Parameter virtualMachineScaleSetName is required and cannot be null."); + } + if (virtualmachineIndex == null) { + throw new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-03-30"; + final String expand = null; + return service.listVirtualMachineScaleSetIpConfigurations(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listVirtualMachineScaleSetIpConfigurationsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceIPConfigurationInner> object if successful. + */ + public PagedList listVirtualMachineScaleSetIpConfigurations(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName, final String expand) { + ServiceResponse> response = listVirtualMachineScaleSetIpConfigurationsSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listVirtualMachineScaleSetIpConfigurationsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @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> listVirtualMachineScaleSetIpConfigurationsAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName, final String expand, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listVirtualMachineScaleSetIpConfigurationsSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listVirtualMachineScaleSetIpConfigurationsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceIPConfigurationInner> object + */ + public Observable> listVirtualMachineScaleSetIpConfigurationsAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName, final String expand) { + return listVirtualMachineScaleSetIpConfigurationsWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceIPConfigurationInner> object + */ + public Observable>> listVirtualMachineScaleSetIpConfigurationsWithServiceResponseAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName, final String expand) { + return listVirtualMachineScaleSetIpConfigurationsSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand) + .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(listVirtualMachineScaleSetIpConfigurationsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param virtualMachineScaleSetName The name of the virtual machine scale set. + ServiceResponse> * @param virtualmachineIndex The virtual machine index. + ServiceResponse> * @param networkInterfaceName The name of the network interface. + ServiceResponse> * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceIPConfigurationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listVirtualMachineScaleSetIpConfigurationsSinglePageAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName, final String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualMachineScaleSetName == null) { + throw new IllegalArgumentException("Parameter virtualMachineScaleSetName is required and cannot be null."); + } + if (virtualmachineIndex == null) { + throw new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-03-30"; + return service.listVirtualMachineScaleSetIpConfigurations(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listVirtualMachineScaleSetIpConfigurationsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listVirtualMachineScaleSetIpConfigurationsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkInterfaceIPConfigurationInner object if successful. + */ + public NetworkInterfaceIPConfigurationInner getVirtualMachineScaleSetIpConfiguration(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName) { + return getVirtualMachineScaleSetIpConfigurationWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName).toBlocking().single().body(); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getVirtualMachineScaleSetIpConfigurationAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getVirtualMachineScaleSetIpConfigurationWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName), serviceCallback); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceIPConfigurationInner object + */ + public Observable getVirtualMachineScaleSetIpConfigurationAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName) { + return getVirtualMachineScaleSetIpConfigurationWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName).map(new Func1, NetworkInterfaceIPConfigurationInner>() { + @Override + public NetworkInterfaceIPConfigurationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceIPConfigurationInner object + */ + public Observable> getVirtualMachineScaleSetIpConfigurationWithServiceResponseAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualMachineScaleSetName == null) { + throw new IllegalArgumentException("Parameter virtualMachineScaleSetName is required and cannot be null."); + } + if (virtualmachineIndex == null) { + throw new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (ipConfigurationName == null) { + throw new IllegalArgumentException("Parameter ipConfigurationName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-03-30"; + final String expand = null; + return service.getVirtualMachineScaleSetIpConfiguration(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getVirtualMachineScaleSetIpConfigurationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkInterfaceIPConfigurationInner object if successful. + */ + public NetworkInterfaceIPConfigurationInner getVirtualMachineScaleSetIpConfiguration(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, String expand) { + return getVirtualMachineScaleSetIpConfigurationWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, expand).toBlocking().single().body(); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration. + * @param expand Expands referenced resources. + * @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 getVirtualMachineScaleSetIpConfigurationAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getVirtualMachineScaleSetIpConfigurationWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, expand), serviceCallback); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceIPConfigurationInner object + */ + public Observable getVirtualMachineScaleSetIpConfigurationAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, String expand) { + return getVirtualMachineScaleSetIpConfigurationWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, expand).map(new Func1, NetworkInterfaceIPConfigurationInner>() { + @Override + public NetworkInterfaceIPConfigurationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkInterfaceIPConfigurationInner object + */ + public Observable> getVirtualMachineScaleSetIpConfigurationWithServiceResponseAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualMachineScaleSetName == null) { + throw new IllegalArgumentException("Parameter virtualMachineScaleSetName is required and cannot be null."); + } + if (virtualmachineIndex == null) { + throw new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (ipConfigurationName == null) { + throw new IllegalArgumentException("Parameter ipConfigurationName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-03-30"; + return service.getVirtualMachineScaleSetIpConfiguration(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getVirtualMachineScaleSetIpConfigurationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getVirtualMachineScaleSetIpConfigurationDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all network interfaces in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all network interfaces in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all network interfaces in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all network interfaces in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all network interfaces in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all network interfaces in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all network interfaces in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all network interfaces in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all network interfaces in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all network interfaces in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceInner> object if successful. + */ + public PagedList listVirtualMachineScaleSetVMNetworkInterfacesNext(final String nextPageLink) { + ServiceResponse> response = listVirtualMachineScaleSetVMNetworkInterfacesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listVirtualMachineScaleSetVMNetworkInterfacesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. + * + * @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> listVirtualMachineScaleSetVMNetworkInterfacesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listVirtualMachineScaleSetVMNetworkInterfacesNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listVirtualMachineScaleSetVMNetworkInterfacesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. + * + * @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<NetworkInterfaceInner> object + */ + public Observable> listVirtualMachineScaleSetVMNetworkInterfacesNextAsync(final String nextPageLink) { + return listVirtualMachineScaleSetVMNetworkInterfacesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. + * + * @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<NetworkInterfaceInner> object + */ + public Observable>> listVirtualMachineScaleSetVMNetworkInterfacesNextWithServiceResponseAsync(final String nextPageLink) { + return listVirtualMachineScaleSetVMNetworkInterfacesNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listVirtualMachineScaleSetVMNetworkInterfacesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listVirtualMachineScaleSetVMNetworkInterfacesNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listVirtualMachineScaleSetVMNetworkInterfacesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listVirtualMachineScaleSetVMNetworkInterfacesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listVirtualMachineScaleSetVMNetworkInterfacesNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all network interfaces in a virtual machine scale set. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceInner> object if successful. + */ + public PagedList listVirtualMachineScaleSetNetworkInterfacesNext(final String nextPageLink) { + ServiceResponse> response = listVirtualMachineScaleSetNetworkInterfacesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listVirtualMachineScaleSetNetworkInterfacesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all network interfaces in a virtual machine scale set. + * + * @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> listVirtualMachineScaleSetNetworkInterfacesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listVirtualMachineScaleSetNetworkInterfacesNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listVirtualMachineScaleSetNetworkInterfacesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all network interfaces in a virtual machine scale set. + * + * @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<NetworkInterfaceInner> object + */ + public Observable> listVirtualMachineScaleSetNetworkInterfacesNextAsync(final String nextPageLink) { + return listVirtualMachineScaleSetNetworkInterfacesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all network interfaces in a virtual machine scale set. + * + * @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<NetworkInterfaceInner> object + */ + public Observable>> listVirtualMachineScaleSetNetworkInterfacesNextWithServiceResponseAsync(final String nextPageLink) { + return listVirtualMachineScaleSetNetworkInterfacesNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listVirtualMachineScaleSetNetworkInterfacesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all network interfaces in a virtual machine scale set. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listVirtualMachineScaleSetNetworkInterfacesNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listVirtualMachineScaleSetNetworkInterfacesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listVirtualMachineScaleSetNetworkInterfacesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listVirtualMachineScaleSetNetworkInterfacesNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkInterfaceIPConfigurationInner> object if successful. + */ + public PagedList listVirtualMachineScaleSetIpConfigurationsNext(final String nextPageLink) { + ServiceResponse> response = listVirtualMachineScaleSetIpConfigurationsNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listVirtualMachineScaleSetIpConfigurationsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @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> listVirtualMachineScaleSetIpConfigurationsNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listVirtualMachineScaleSetIpConfigurationsNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listVirtualMachineScaleSetIpConfigurationsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @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<NetworkInterfaceIPConfigurationInner> object + */ + public Observable> listVirtualMachineScaleSetIpConfigurationsNextAsync(final String nextPageLink) { + return listVirtualMachineScaleSetIpConfigurationsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @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<NetworkInterfaceIPConfigurationInner> object + */ + public Observable>> listVirtualMachineScaleSetIpConfigurationsNextWithServiceResponseAsync(final String nextPageLink) { + return listVirtualMachineScaleSetIpConfigurationsNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listVirtualMachineScaleSetIpConfigurationsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkInterfaceIPConfigurationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listVirtualMachineScaleSetIpConfigurationsNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listVirtualMachineScaleSetIpConfigurationsNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listVirtualMachineScaleSetIpConfigurationsNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listVirtualMachineScaleSetIpConfigurationsNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkManagementClientImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkManagementClientImpl.java new file mode 100644 index 000000000000..75ddaa93bcd6 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkManagementClientImpl.java @@ -0,0 +1,973 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * Initializes a new instance of the NetworkManagementClientImpl class. + */ +public class NetworkManagementClientImpl extends AzureServiceClient { + /** The Retrofit service to perform REST calls. */ + private NetworkManagementClientService service; + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. */ + private String subscriptionId; + + /** + * Gets The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public NetworkManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** Gets or sets the preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public NetworkManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public NetworkManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public NetworkManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The AzureFirewallsInner object to access its operations. + */ + private AzureFirewallsInner azureFirewalls; + + /** + * Gets the AzureFirewallsInner object to access its operations. + * @return the AzureFirewallsInner object. + */ + public AzureFirewallsInner azureFirewalls() { + return this.azureFirewalls; + } + + /** + * The ApplicationGatewaysInner object to access its operations. + */ + private ApplicationGatewaysInner applicationGateways; + + /** + * Gets the ApplicationGatewaysInner object to access its operations. + * @return the ApplicationGatewaysInner object. + */ + public ApplicationGatewaysInner applicationGateways() { + return this.applicationGateways; + } + + /** + * The ApplicationSecurityGroupsInner object to access its operations. + */ + private ApplicationSecurityGroupsInner applicationSecurityGroups; + + /** + * Gets the ApplicationSecurityGroupsInner object to access its operations. + * @return the ApplicationSecurityGroupsInner object. + */ + public ApplicationSecurityGroupsInner applicationSecurityGroups() { + return this.applicationSecurityGroups; + } + + /** + * The DdosProtectionPlansInner object to access its operations. + */ + private DdosProtectionPlansInner ddosProtectionPlans; + + /** + * Gets the DdosProtectionPlansInner object to access its operations. + * @return the DdosProtectionPlansInner object. + */ + public DdosProtectionPlansInner ddosProtectionPlans() { + return this.ddosProtectionPlans; + } + + /** + * The AvailableEndpointServicesInner object to access its operations. + */ + private AvailableEndpointServicesInner availableEndpointServices; + + /** + * Gets the AvailableEndpointServicesInner object to access its operations. + * @return the AvailableEndpointServicesInner object. + */ + public AvailableEndpointServicesInner availableEndpointServices() { + return this.availableEndpointServices; + } + + /** + * The ExpressRouteCircuitAuthorizationsInner object to access its operations. + */ + private ExpressRouteCircuitAuthorizationsInner expressRouteCircuitAuthorizations; + + /** + * Gets the ExpressRouteCircuitAuthorizationsInner object to access its operations. + * @return the ExpressRouteCircuitAuthorizationsInner object. + */ + public ExpressRouteCircuitAuthorizationsInner expressRouteCircuitAuthorizations() { + return this.expressRouteCircuitAuthorizations; + } + + /** + * The ExpressRouteCircuitPeeringsInner object to access its operations. + */ + private ExpressRouteCircuitPeeringsInner expressRouteCircuitPeerings; + + /** + * Gets the ExpressRouteCircuitPeeringsInner object to access its operations. + * @return the ExpressRouteCircuitPeeringsInner object. + */ + public ExpressRouteCircuitPeeringsInner expressRouteCircuitPeerings() { + return this.expressRouteCircuitPeerings; + } + + /** + * The ExpressRouteCircuitConnectionsInner object to access its operations. + */ + private ExpressRouteCircuitConnectionsInner expressRouteCircuitConnections; + + /** + * Gets the ExpressRouteCircuitConnectionsInner object to access its operations. + * @return the ExpressRouteCircuitConnectionsInner object. + */ + public ExpressRouteCircuitConnectionsInner expressRouteCircuitConnections() { + return this.expressRouteCircuitConnections; + } + + /** + * The ExpressRouteCircuitsInner object to access its operations. + */ + private ExpressRouteCircuitsInner expressRouteCircuits; + + /** + * Gets the ExpressRouteCircuitsInner object to access its operations. + * @return the ExpressRouteCircuitsInner object. + */ + public ExpressRouteCircuitsInner expressRouteCircuits() { + return this.expressRouteCircuits; + } + + /** + * The ExpressRouteServiceProvidersInner object to access its operations. + */ + private ExpressRouteServiceProvidersInner expressRouteServiceProviders; + + /** + * Gets the ExpressRouteServiceProvidersInner object to access its operations. + * @return the ExpressRouteServiceProvidersInner object. + */ + public ExpressRouteServiceProvidersInner expressRouteServiceProviders() { + return this.expressRouteServiceProviders; + } + + /** + * The ExpressRouteCrossConnectionsInner object to access its operations. + */ + private ExpressRouteCrossConnectionsInner expressRouteCrossConnections; + + /** + * Gets the ExpressRouteCrossConnectionsInner object to access its operations. + * @return the ExpressRouteCrossConnectionsInner object. + */ + public ExpressRouteCrossConnectionsInner expressRouteCrossConnections() { + return this.expressRouteCrossConnections; + } + + /** + * The ExpressRouteCrossConnectionPeeringsInner object to access its operations. + */ + private ExpressRouteCrossConnectionPeeringsInner expressRouteCrossConnectionPeerings; + + /** + * Gets the ExpressRouteCrossConnectionPeeringsInner object to access its operations. + * @return the ExpressRouteCrossConnectionPeeringsInner object. + */ + public ExpressRouteCrossConnectionPeeringsInner expressRouteCrossConnectionPeerings() { + return this.expressRouteCrossConnectionPeerings; + } + + /** + * The LoadBalancersInner object to access its operations. + */ + private LoadBalancersInner loadBalancers; + + /** + * Gets the LoadBalancersInner object to access its operations. + * @return the LoadBalancersInner object. + */ + public LoadBalancersInner loadBalancers() { + return this.loadBalancers; + } + + /** + * The LoadBalancerBackendAddressPoolsInner object to access its operations. + */ + private LoadBalancerBackendAddressPoolsInner loadBalancerBackendAddressPools; + + /** + * Gets the LoadBalancerBackendAddressPoolsInner object to access its operations. + * @return the LoadBalancerBackendAddressPoolsInner object. + */ + public LoadBalancerBackendAddressPoolsInner loadBalancerBackendAddressPools() { + return this.loadBalancerBackendAddressPools; + } + + /** + * The LoadBalancerFrontendIPConfigurationsInner object to access its operations. + */ + private LoadBalancerFrontendIPConfigurationsInner loadBalancerFrontendIPConfigurations; + + /** + * Gets the LoadBalancerFrontendIPConfigurationsInner object to access its operations. + * @return the LoadBalancerFrontendIPConfigurationsInner object. + */ + public LoadBalancerFrontendIPConfigurationsInner loadBalancerFrontendIPConfigurations() { + return this.loadBalancerFrontendIPConfigurations; + } + + /** + * The InboundNatRulesInner object to access its operations. + */ + private InboundNatRulesInner inboundNatRules; + + /** + * Gets the InboundNatRulesInner object to access its operations. + * @return the InboundNatRulesInner object. + */ + public InboundNatRulesInner inboundNatRules() { + return this.inboundNatRules; + } + + /** + * The LoadBalancerLoadBalancingRulesInner object to access its operations. + */ + private LoadBalancerLoadBalancingRulesInner loadBalancerLoadBalancingRules; + + /** + * Gets the LoadBalancerLoadBalancingRulesInner object to access its operations. + * @return the LoadBalancerLoadBalancingRulesInner object. + */ + public LoadBalancerLoadBalancingRulesInner loadBalancerLoadBalancingRules() { + return this.loadBalancerLoadBalancingRules; + } + + /** + * The LoadBalancerNetworkInterfacesInner object to access its operations. + */ + private LoadBalancerNetworkInterfacesInner loadBalancerNetworkInterfaces; + + /** + * Gets the LoadBalancerNetworkInterfacesInner object to access its operations. + * @return the LoadBalancerNetworkInterfacesInner object. + */ + public LoadBalancerNetworkInterfacesInner loadBalancerNetworkInterfaces() { + return this.loadBalancerNetworkInterfaces; + } + + /** + * The LoadBalancerProbesInner object to access its operations. + */ + private LoadBalancerProbesInner loadBalancerProbes; + + /** + * Gets the LoadBalancerProbesInner object to access its operations. + * @return the LoadBalancerProbesInner object. + */ + public LoadBalancerProbesInner loadBalancerProbes() { + return this.loadBalancerProbes; + } + + /** + * The NetworkInterfacesInner object to access its operations. + */ + private NetworkInterfacesInner networkInterfaces; + + /** + * Gets the NetworkInterfacesInner object to access its operations. + * @return the NetworkInterfacesInner object. + */ + public NetworkInterfacesInner networkInterfaces() { + return this.networkInterfaces; + } + + /** + * The NetworkInterfaceIPConfigurationsInner object to access its operations. + */ + private NetworkInterfaceIPConfigurationsInner networkInterfaceIPConfigurations; + + /** + * Gets the NetworkInterfaceIPConfigurationsInner object to access its operations. + * @return the NetworkInterfaceIPConfigurationsInner object. + */ + public NetworkInterfaceIPConfigurationsInner networkInterfaceIPConfigurations() { + return this.networkInterfaceIPConfigurations; + } + + /** + * The NetworkInterfaceLoadBalancersInner object to access its operations. + */ + private NetworkInterfaceLoadBalancersInner networkInterfaceLoadBalancers; + + /** + * Gets the NetworkInterfaceLoadBalancersInner object to access its operations. + * @return the NetworkInterfaceLoadBalancersInner object. + */ + public NetworkInterfaceLoadBalancersInner networkInterfaceLoadBalancers() { + return this.networkInterfaceLoadBalancers; + } + + /** + * The NetworkSecurityGroupsInner object to access its operations. + */ + private NetworkSecurityGroupsInner networkSecurityGroups; + + /** + * Gets the NetworkSecurityGroupsInner object to access its operations. + * @return the NetworkSecurityGroupsInner object. + */ + public NetworkSecurityGroupsInner networkSecurityGroups() { + return this.networkSecurityGroups; + } + + /** + * The SecurityRulesInner object to access its operations. + */ + private SecurityRulesInner securityRules; + + /** + * Gets the SecurityRulesInner object to access its operations. + * @return the SecurityRulesInner object. + */ + public SecurityRulesInner securityRules() { + return this.securityRules; + } + + /** + * The DefaultSecurityRulesInner object to access its operations. + */ + private DefaultSecurityRulesInner defaultSecurityRules; + + /** + * Gets the DefaultSecurityRulesInner object to access its operations. + * @return the DefaultSecurityRulesInner object. + */ + public DefaultSecurityRulesInner defaultSecurityRules() { + return this.defaultSecurityRules; + } + + /** + * The NetworkWatchersInner object to access its operations. + */ + private NetworkWatchersInner networkWatchers; + + /** + * Gets the NetworkWatchersInner object to access its operations. + * @return the NetworkWatchersInner object. + */ + public NetworkWatchersInner networkWatchers() { + return this.networkWatchers; + } + + /** + * The PacketCapturesInner object to access its operations. + */ + private PacketCapturesInner packetCaptures; + + /** + * Gets the PacketCapturesInner object to access its operations. + * @return the PacketCapturesInner object. + */ + public PacketCapturesInner packetCaptures() { + return this.packetCaptures; + } + + /** + * The ConnectionMonitorsInner object to access its operations. + */ + private ConnectionMonitorsInner connectionMonitors; + + /** + * Gets the ConnectionMonitorsInner object to access its operations. + * @return the ConnectionMonitorsInner object. + */ + public ConnectionMonitorsInner connectionMonitors() { + return this.connectionMonitors; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * The PublicIPAddressesInner object to access its operations. + */ + private PublicIPAddressesInner publicIPAddresses; + + /** + * Gets the PublicIPAddressesInner object to access its operations. + * @return the PublicIPAddressesInner object. + */ + public PublicIPAddressesInner publicIPAddresses() { + return this.publicIPAddresses; + } + + /** + * The RouteFiltersInner object to access its operations. + */ + private RouteFiltersInner routeFilters; + + /** + * Gets the RouteFiltersInner object to access its operations. + * @return the RouteFiltersInner object. + */ + public RouteFiltersInner routeFilters() { + return this.routeFilters; + } + + /** + * The RouteFilterRulesInner object to access its operations. + */ + private RouteFilterRulesInner routeFilterRules; + + /** + * Gets the RouteFilterRulesInner object to access its operations. + * @return the RouteFilterRulesInner object. + */ + public RouteFilterRulesInner routeFilterRules() { + return this.routeFilterRules; + } + + /** + * The RouteTablesInner object to access its operations. + */ + private RouteTablesInner routeTables; + + /** + * Gets the RouteTablesInner object to access its operations. + * @return the RouteTablesInner object. + */ + public RouteTablesInner routeTables() { + return this.routeTables; + } + + /** + * The RoutesInner object to access its operations. + */ + private RoutesInner routes; + + /** + * Gets the RoutesInner object to access its operations. + * @return the RoutesInner object. + */ + public RoutesInner routes() { + return this.routes; + } + + /** + * The BgpServiceCommunitiesInner object to access its operations. + */ + private BgpServiceCommunitiesInner bgpServiceCommunities; + + /** + * Gets the BgpServiceCommunitiesInner object to access its operations. + * @return the BgpServiceCommunitiesInner object. + */ + public BgpServiceCommunitiesInner bgpServiceCommunities() { + return this.bgpServiceCommunities; + } + + /** + * The UsagesInner object to access its operations. + */ + private UsagesInner usages; + + /** + * Gets the UsagesInner object to access its operations. + * @return the UsagesInner object. + */ + public UsagesInner usages() { + return this.usages; + } + + /** + * The VirtualNetworksInner object to access its operations. + */ + private VirtualNetworksInner virtualNetworks; + + /** + * Gets the VirtualNetworksInner object to access its operations. + * @return the VirtualNetworksInner object. + */ + public VirtualNetworksInner virtualNetworks() { + return this.virtualNetworks; + } + + /** + * The SubnetsInner object to access its operations. + */ + private SubnetsInner subnets; + + /** + * Gets the SubnetsInner object to access its operations. + * @return the SubnetsInner object. + */ + public SubnetsInner subnets() { + return this.subnets; + } + + /** + * The VirtualNetworkPeeringsInner object to access its operations. + */ + private VirtualNetworkPeeringsInner virtualNetworkPeerings; + + /** + * Gets the VirtualNetworkPeeringsInner object to access its operations. + * @return the VirtualNetworkPeeringsInner object. + */ + public VirtualNetworkPeeringsInner virtualNetworkPeerings() { + return this.virtualNetworkPeerings; + } + + /** + * The VirtualNetworkGatewaysInner object to access its operations. + */ + private VirtualNetworkGatewaysInner virtualNetworkGateways; + + /** + * Gets the VirtualNetworkGatewaysInner object to access its operations. + * @return the VirtualNetworkGatewaysInner object. + */ + public VirtualNetworkGatewaysInner virtualNetworkGateways() { + return this.virtualNetworkGateways; + } + + /** + * The VirtualNetworkGatewayConnectionsInner object to access its operations. + */ + private VirtualNetworkGatewayConnectionsInner virtualNetworkGatewayConnections; + + /** + * Gets the VirtualNetworkGatewayConnectionsInner object to access its operations. + * @return the VirtualNetworkGatewayConnectionsInner object. + */ + public VirtualNetworkGatewayConnectionsInner virtualNetworkGatewayConnections() { + return this.virtualNetworkGatewayConnections; + } + + /** + * The LocalNetworkGatewaysInner object to access its operations. + */ + private LocalNetworkGatewaysInner localNetworkGateways; + + /** + * Gets the LocalNetworkGatewaysInner object to access its operations. + * @return the LocalNetworkGatewaysInner object. + */ + public LocalNetworkGatewaysInner localNetworkGateways() { + return this.localNetworkGateways; + } + + /** + * The VirtualWANsInner object to access its operations. + */ + private VirtualWANsInner virtualWANs; + + /** + * Gets the VirtualWANsInner object to access its operations. + * @return the VirtualWANsInner object. + */ + public VirtualWANsInner virtualWANs() { + return this.virtualWANs; + } + + /** + * The VpnSitesInner object to access its operations. + */ + private VpnSitesInner vpnSites; + + /** + * Gets the VpnSitesInner object to access its operations. + * @return the VpnSitesInner object. + */ + public VpnSitesInner vpnSites() { + return this.vpnSites; + } + + /** + * The VpnSitesConfigurationsInner object to access its operations. + */ + private VpnSitesConfigurationsInner vpnSitesConfigurations; + + /** + * Gets the VpnSitesConfigurationsInner object to access its operations. + * @return the VpnSitesConfigurationsInner object. + */ + public VpnSitesConfigurationsInner vpnSitesConfigurations() { + return this.vpnSitesConfigurations; + } + + /** + * The VirtualHubsInner object to access its operations. + */ + private VirtualHubsInner virtualHubs; + + /** + * Gets the VirtualHubsInner object to access its operations. + * @return the VirtualHubsInner object. + */ + public VirtualHubsInner virtualHubs() { + return this.virtualHubs; + } + + /** + * The HubVirtualNetworkConnectionsInner object to access its operations. + */ + private HubVirtualNetworkConnectionsInner hubVirtualNetworkConnections; + + /** + * Gets the HubVirtualNetworkConnectionsInner object to access its operations. + * @return the HubVirtualNetworkConnectionsInner object. + */ + public HubVirtualNetworkConnectionsInner hubVirtualNetworkConnections() { + return this.hubVirtualNetworkConnections; + } + + /** + * The VpnGatewaysInner object to access its operations. + */ + private VpnGatewaysInner vpnGateways; + + /** + * Gets the VpnGatewaysInner object to access its operations. + * @return the VpnGatewaysInner object. + */ + public VpnGatewaysInner vpnGateways() { + return this.vpnGateways; + } + + /** + * The VpnConnectionsInner object to access its operations. + */ + private VpnConnectionsInner vpnConnections; + + /** + * Gets the VpnConnectionsInner object to access its operations. + * @return the VpnConnectionsInner object. + */ + public VpnConnectionsInner vpnConnections() { + return this.vpnConnections; + } + + /** + * Initializes an instance of NetworkManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public NetworkManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of NetworkManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public NetworkManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of NetworkManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public NetworkManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.azureFirewalls = new AzureFirewallsInner(restClient().retrofit(), this); + this.applicationGateways = new ApplicationGatewaysInner(restClient().retrofit(), this); + this.applicationSecurityGroups = new ApplicationSecurityGroupsInner(restClient().retrofit(), this); + this.ddosProtectionPlans = new DdosProtectionPlansInner(restClient().retrofit(), this); + this.availableEndpointServices = new AvailableEndpointServicesInner(restClient().retrofit(), this); + this.expressRouteCircuitAuthorizations = new ExpressRouteCircuitAuthorizationsInner(restClient().retrofit(), this); + this.expressRouteCircuitPeerings = new ExpressRouteCircuitPeeringsInner(restClient().retrofit(), this); + this.expressRouteCircuitConnections = new ExpressRouteCircuitConnectionsInner(restClient().retrofit(), this); + this.expressRouteCircuits = new ExpressRouteCircuitsInner(restClient().retrofit(), this); + this.expressRouteServiceProviders = new ExpressRouteServiceProvidersInner(restClient().retrofit(), this); + this.expressRouteCrossConnections = new ExpressRouteCrossConnectionsInner(restClient().retrofit(), this); + this.expressRouteCrossConnectionPeerings = new ExpressRouteCrossConnectionPeeringsInner(restClient().retrofit(), this); + this.loadBalancers = new LoadBalancersInner(restClient().retrofit(), this); + this.loadBalancerBackendAddressPools = new LoadBalancerBackendAddressPoolsInner(restClient().retrofit(), this); + this.loadBalancerFrontendIPConfigurations = new LoadBalancerFrontendIPConfigurationsInner(restClient().retrofit(), this); + this.inboundNatRules = new InboundNatRulesInner(restClient().retrofit(), this); + this.loadBalancerLoadBalancingRules = new LoadBalancerLoadBalancingRulesInner(restClient().retrofit(), this); + this.loadBalancerNetworkInterfaces = new LoadBalancerNetworkInterfacesInner(restClient().retrofit(), this); + this.loadBalancerProbes = new LoadBalancerProbesInner(restClient().retrofit(), this); + this.networkInterfaces = new NetworkInterfacesInner(restClient().retrofit(), this); + this.networkInterfaceIPConfigurations = new NetworkInterfaceIPConfigurationsInner(restClient().retrofit(), this); + this.networkInterfaceLoadBalancers = new NetworkInterfaceLoadBalancersInner(restClient().retrofit(), this); + this.networkSecurityGroups = new NetworkSecurityGroupsInner(restClient().retrofit(), this); + this.securityRules = new SecurityRulesInner(restClient().retrofit(), this); + this.defaultSecurityRules = new DefaultSecurityRulesInner(restClient().retrofit(), this); + this.networkWatchers = new NetworkWatchersInner(restClient().retrofit(), this); + this.packetCaptures = new PacketCapturesInner(restClient().retrofit(), this); + this.connectionMonitors = new ConnectionMonitorsInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.publicIPAddresses = new PublicIPAddressesInner(restClient().retrofit(), this); + this.routeFilters = new RouteFiltersInner(restClient().retrofit(), this); + this.routeFilterRules = new RouteFilterRulesInner(restClient().retrofit(), this); + this.routeTables = new RouteTablesInner(restClient().retrofit(), this); + this.routes = new RoutesInner(restClient().retrofit(), this); + this.bgpServiceCommunities = new BgpServiceCommunitiesInner(restClient().retrofit(), this); + this.usages = new UsagesInner(restClient().retrofit(), this); + this.virtualNetworks = new VirtualNetworksInner(restClient().retrofit(), this); + this.subnets = new SubnetsInner(restClient().retrofit(), this); + this.virtualNetworkPeerings = new VirtualNetworkPeeringsInner(restClient().retrofit(), this); + this.virtualNetworkGateways = new VirtualNetworkGatewaysInner(restClient().retrofit(), this); + this.virtualNetworkGatewayConnections = new VirtualNetworkGatewayConnectionsInner(restClient().retrofit(), this); + this.localNetworkGateways = new LocalNetworkGatewaysInner(restClient().retrofit(), this); + this.virtualWANs = new VirtualWANsInner(restClient().retrofit(), this); + this.vpnSites = new VpnSitesInner(restClient().retrofit(), this); + this.vpnSitesConfigurations = new VpnSitesConfigurationsInner(restClient().retrofit(), this); + this.virtualHubs = new VirtualHubsInner(restClient().retrofit(), this); + this.hubVirtualNetworkConnections = new HubVirtualNetworkConnectionsInner(restClient().retrofit(), this); + this.vpnGateways = new VpnGatewaysInner(restClient().retrofit(), this); + this.vpnConnections = new VpnConnectionsInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + initializeService(); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s)", super.userAgent(), "NetworkManagementClient"); + } + + private void initializeService() { + service = restClient().retrofit().create(NetworkManagementClientService.class); + } + + /** + * The interface defining all the services for NetworkManagementClient to be + * used by Retrofit to perform actually REST calls. + */ + interface NetworkManagementClientService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.NetworkManagementClient checkDnsNameAvailability" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/CheckDnsNameAvailability") + Observable> checkDnsNameAvailability(@Path("location") String location, @Path("subscriptionId") String subscriptionId, @Query("domainNameLabel") String domainNameLabel, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Checks whether a domain name in the cloudapp.azure.com zone is available for use. + * + * @param location The location of the domain name. + * @param domainNameLabel The domain name to be verified. It must conform to the following regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DnsNameAvailabilityResultInner object if successful. + */ + public DnsNameAvailabilityResultInner checkDnsNameAvailability(String location, String domainNameLabel) { + return checkDnsNameAvailabilityWithServiceResponseAsync(location, domainNameLabel).toBlocking().single().body(); + } + + /** + * Checks whether a domain name in the cloudapp.azure.com zone is available for use. + * + * @param location The location of the domain name. + * @param domainNameLabel The domain name to be verified. It must conform to the following regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. + * @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 checkDnsNameAvailabilityAsync(String location, String domainNameLabel, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkDnsNameAvailabilityWithServiceResponseAsync(location, domainNameLabel), serviceCallback); + } + + /** + * Checks whether a domain name in the cloudapp.azure.com zone is available for use. + * + * @param location The location of the domain name. + * @param domainNameLabel The domain name to be verified. It must conform to the following regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DnsNameAvailabilityResultInner object + */ + public Observable checkDnsNameAvailabilityAsync(String location, String domainNameLabel) { + return checkDnsNameAvailabilityWithServiceResponseAsync(location, domainNameLabel).map(new Func1, DnsNameAvailabilityResultInner>() { + @Override + public DnsNameAvailabilityResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Checks whether a domain name in the cloudapp.azure.com zone is available for use. + * + * @param location The location of the domain name. + * @param domainNameLabel The domain name to be verified. It must conform to the following regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DnsNameAvailabilityResultInner object + */ + public Observable> checkDnsNameAvailabilityWithServiceResponseAsync(String location, String domainNameLabel) { + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.subscriptionId() is required and cannot be null."); + } + if (domainNameLabel == null) { + throw new IllegalArgumentException("Parameter domainNameLabel is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.checkDnsNameAvailability(location, this.subscriptionId(), domainNameLabel, apiVersion, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkDnsNameAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkDnsNameAvailabilityDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkManager.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkManager.java new file mode 100644 index 000000000000..77268bb997ea --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkManager.java @@ -0,0 +1,675 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.network.v2018_06_01.AzureFirewalls; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGateways; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationSecurityGroups; +import com.microsoft.azure.management.network.v2018_06_01.DdosProtectionPlans; +import com.microsoft.azure.management.network.v2018_06_01.AvailableEndpointServices; +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCircuitAuthorizations; +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCircuitPeerings; +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCircuitConnections; +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCircuits; +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteServiceProviders; +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCrossConnections; +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCrossConnectionPeerings; +import com.microsoft.azure.management.network.v2018_06_01.LoadBalancers; +import com.microsoft.azure.management.network.v2018_06_01.LoadBalancerBackendAddressPools; +import com.microsoft.azure.management.network.v2018_06_01.LoadBalancerFrontendIPConfigurations; +import com.microsoft.azure.management.network.v2018_06_01.InboundNatRules; +import com.microsoft.azure.management.network.v2018_06_01.LoadBalancerLoadBalancingRules; +import com.microsoft.azure.management.network.v2018_06_01.LoadBalancerNetworkInterfaces; +import com.microsoft.azure.management.network.v2018_06_01.LoadBalancerProbes; +import com.microsoft.azure.management.network.v2018_06_01.NetworkInterfaces; +import com.microsoft.azure.management.network.v2018_06_01.NetworkInterfaceIPConfigurations; +import com.microsoft.azure.management.network.v2018_06_01.NetworkInterfaceLoadBalancers; +import com.microsoft.azure.management.network.v2018_06_01.NetworkSecurityGroups; +import com.microsoft.azure.management.network.v2018_06_01.SecurityRules; +import com.microsoft.azure.management.network.v2018_06_01.DefaultSecurityRules; +import com.microsoft.azure.management.network.v2018_06_01.NetworkWatchers; +import com.microsoft.azure.management.network.v2018_06_01.PacketCaptures; +import com.microsoft.azure.management.network.v2018_06_01.ConnectionMonitors; +import com.microsoft.azure.management.network.v2018_06_01.Operations; +import com.microsoft.azure.management.network.v2018_06_01.PublicIPAddresses; +import com.microsoft.azure.management.network.v2018_06_01.RouteFilters; +import com.microsoft.azure.management.network.v2018_06_01.RouteFilterRules; +import com.microsoft.azure.management.network.v2018_06_01.RouteTables; +import com.microsoft.azure.management.network.v2018_06_01.Routes; +import com.microsoft.azure.management.network.v2018_06_01.BgpServiceCommunities; +import com.microsoft.azure.management.network.v2018_06_01.Usages; +import com.microsoft.azure.management.network.v2018_06_01.VirtualNetworks; +import com.microsoft.azure.management.network.v2018_06_01.Subnets; +import com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkPeerings; +import com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkGateways; +import com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkGatewayConnections; +import com.microsoft.azure.management.network.v2018_06_01.LocalNetworkGateways; +import com.microsoft.azure.management.network.v2018_06_01.VirtualWANs; +import com.microsoft.azure.management.network.v2018_06_01.VpnSites; +import com.microsoft.azure.management.network.v2018_06_01.VpnSitesConfigurations; +import com.microsoft.azure.management.network.v2018_06_01.VirtualHubs; +import com.microsoft.azure.management.network.v2018_06_01.HubVirtualNetworkConnections; +import com.microsoft.azure.management.network.v2018_06_01.VpnGateways; +import com.microsoft.azure.management.network.v2018_06_01.VpnConnections; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure Network resource management. + */ +public final class NetworkManager extends ManagerCore { + private AzureFirewalls azureFirewalls; + private ApplicationGateways applicationGateways; + private ApplicationSecurityGroups applicationSecurityGroups; + private DdosProtectionPlans ddosProtectionPlans; + private AvailableEndpointServices availableEndpointServices; + private ExpressRouteCircuitAuthorizations expressRouteCircuitAuthorizations; + private ExpressRouteCircuitPeerings expressRouteCircuitPeerings; + private ExpressRouteCircuitConnections expressRouteCircuitConnections; + private ExpressRouteCircuits expressRouteCircuits; + private ExpressRouteServiceProviders expressRouteServiceProviders; + private ExpressRouteCrossConnections expressRouteCrossConnections; + private ExpressRouteCrossConnectionPeerings expressRouteCrossConnectionPeerings; + private LoadBalancers loadBalancers; + private LoadBalancerBackendAddressPools loadBalancerBackendAddressPools; + private LoadBalancerFrontendIPConfigurations loadBalancerFrontendIPConfigurations; + private InboundNatRules inboundNatRules; + private LoadBalancerLoadBalancingRules loadBalancerLoadBalancingRules; + private LoadBalancerNetworkInterfaces loadBalancerNetworkInterfaces; + private LoadBalancerProbes loadBalancerProbes; + private NetworkInterfaces networkInterfaces; + private NetworkInterfaceIPConfigurations networkInterfaceIPConfigurations; + private NetworkInterfaceLoadBalancers networkInterfaceLoadBalancers; + private NetworkSecurityGroups networkSecurityGroups; + private SecurityRules securityRules; + private DefaultSecurityRules defaultSecurityRules; + private NetworkWatchers networkWatchers; + private PacketCaptures packetCaptures; + private ConnectionMonitors connectionMonitors; + private Operations operations; + private PublicIPAddresses publicIPAddresses; + private RouteFilters routeFilters; + private RouteFilterRules routeFilterRules; + private RouteTables routeTables; + private Routes routes; + private BgpServiceCommunities bgpServiceCommunities; + private Usages usages; + private VirtualNetworks virtualNetworks; + private Subnets subnets; + private VirtualNetworkPeerings virtualNetworkPeerings; + private VirtualNetworkGateways virtualNetworkGateways; + private VirtualNetworkGatewayConnections virtualNetworkGatewayConnections; + private LocalNetworkGateways localNetworkGateways; + private VirtualWANs virtualWANs; + private VpnSites vpnSites; + private VpnSitesConfigurations vpnSitesConfigurations; + private VirtualHubs virtualHubs; + private HubVirtualNetworkConnections hubVirtualNetworkConnections; + private VpnGateways vpnGateways; + private VpnConnections vpnConnections; + /** + * Get a Configurable instance that can be used to create NetworkManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new NetworkManager.ConfigurableImpl(); + } + /** + * Creates an instance of NetworkManager that exposes Network resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the NetworkManager + */ + public static NetworkManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new NetworkManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of NetworkManager that exposes Network resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the NetworkManager + */ + public static NetworkManager authenticate(RestClient restClient, String subscriptionId) { + return new NetworkManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of NetworkManager that exposes Network management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing Network management API entry points that work across subscriptions + */ + NetworkManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage AzureFirewalls. + */ + public AzureFirewalls azureFirewalls() { + if (this.azureFirewalls == null) { + this.azureFirewalls = new AzureFirewallsImpl(this); + } + return this.azureFirewalls; + } + + /** + * @return Entry point to manage ApplicationGateways. + */ + public ApplicationGateways applicationGateways() { + if (this.applicationGateways == null) { + this.applicationGateways = new ApplicationGatewaysImpl(this); + } + return this.applicationGateways; + } + + /** + * @return Entry point to manage ApplicationSecurityGroups. + */ + public ApplicationSecurityGroups applicationSecurityGroups() { + if (this.applicationSecurityGroups == null) { + this.applicationSecurityGroups = new ApplicationSecurityGroupsImpl(this); + } + return this.applicationSecurityGroups; + } + + /** + * @return Entry point to manage DdosProtectionPlans. + */ + public DdosProtectionPlans ddosProtectionPlans() { + if (this.ddosProtectionPlans == null) { + this.ddosProtectionPlans = new DdosProtectionPlansImpl(this); + } + return this.ddosProtectionPlans; + } + + /** + * @return Entry point to manage AvailableEndpointServices. + */ + public AvailableEndpointServices availableEndpointServices() { + if (this.availableEndpointServices == null) { + this.availableEndpointServices = new AvailableEndpointServicesImpl(this); + } + return this.availableEndpointServices; + } + + /** + * @return Entry point to manage ExpressRouteCircuitAuthorizations. + */ + public ExpressRouteCircuitAuthorizations expressRouteCircuitAuthorizations() { + if (this.expressRouteCircuitAuthorizations == null) { + this.expressRouteCircuitAuthorizations = new ExpressRouteCircuitAuthorizationsImpl(this); + } + return this.expressRouteCircuitAuthorizations; + } + + /** + * @return Entry point to manage ExpressRouteCircuitPeerings. + */ + public ExpressRouteCircuitPeerings expressRouteCircuitPeerings() { + if (this.expressRouteCircuitPeerings == null) { + this.expressRouteCircuitPeerings = new ExpressRouteCircuitPeeringsImpl(this); + } + return this.expressRouteCircuitPeerings; + } + + /** + * @return Entry point to manage ExpressRouteCircuitConnections. + */ + public ExpressRouteCircuitConnections expressRouteCircuitConnections() { + if (this.expressRouteCircuitConnections == null) { + this.expressRouteCircuitConnections = new ExpressRouteCircuitConnectionsImpl(this); + } + return this.expressRouteCircuitConnections; + } + + /** + * @return Entry point to manage ExpressRouteCircuits. + */ + public ExpressRouteCircuits expressRouteCircuits() { + if (this.expressRouteCircuits == null) { + this.expressRouteCircuits = new ExpressRouteCircuitsImpl(this); + } + return this.expressRouteCircuits; + } + + /** + * @return Entry point to manage ExpressRouteServiceProviders. + */ + public ExpressRouteServiceProviders expressRouteServiceProviders() { + if (this.expressRouteServiceProviders == null) { + this.expressRouteServiceProviders = new ExpressRouteServiceProvidersImpl(this); + } + return this.expressRouteServiceProviders; + } + + /** + * @return Entry point to manage ExpressRouteCrossConnections. + */ + public ExpressRouteCrossConnections expressRouteCrossConnections() { + if (this.expressRouteCrossConnections == null) { + this.expressRouteCrossConnections = new ExpressRouteCrossConnectionsImpl(this); + } + return this.expressRouteCrossConnections; + } + + /** + * @return Entry point to manage ExpressRouteCrossConnectionPeerings. + */ + public ExpressRouteCrossConnectionPeerings expressRouteCrossConnectionPeerings() { + if (this.expressRouteCrossConnectionPeerings == null) { + this.expressRouteCrossConnectionPeerings = new ExpressRouteCrossConnectionPeeringsImpl(this); + } + return this.expressRouteCrossConnectionPeerings; + } + + /** + * @return Entry point to manage LoadBalancers. + */ + public LoadBalancers loadBalancers() { + if (this.loadBalancers == null) { + this.loadBalancers = new LoadBalancersImpl(this); + } + return this.loadBalancers; + } + + /** + * @return Entry point to manage LoadBalancerBackendAddressPools. + */ + public LoadBalancerBackendAddressPools loadBalancerBackendAddressPools() { + if (this.loadBalancerBackendAddressPools == null) { + this.loadBalancerBackendAddressPools = new LoadBalancerBackendAddressPoolsImpl(this); + } + return this.loadBalancerBackendAddressPools; + } + + /** + * @return Entry point to manage LoadBalancerFrontendIPConfigurations. + */ + public LoadBalancerFrontendIPConfigurations loadBalancerFrontendIPConfigurations() { + if (this.loadBalancerFrontendIPConfigurations == null) { + this.loadBalancerFrontendIPConfigurations = new LoadBalancerFrontendIPConfigurationsImpl(this); + } + return this.loadBalancerFrontendIPConfigurations; + } + + /** + * @return Entry point to manage InboundNatRules. + */ + public InboundNatRules inboundNatRules() { + if (this.inboundNatRules == null) { + this.inboundNatRules = new InboundNatRulesImpl(this); + } + return this.inboundNatRules; + } + + /** + * @return Entry point to manage LoadBalancerLoadBalancingRules. + */ + public LoadBalancerLoadBalancingRules loadBalancerLoadBalancingRules() { + if (this.loadBalancerLoadBalancingRules == null) { + this.loadBalancerLoadBalancingRules = new LoadBalancerLoadBalancingRulesImpl(this); + } + return this.loadBalancerLoadBalancingRules; + } + + /** + * @return Entry point to manage LoadBalancerNetworkInterfaces. + */ + public LoadBalancerNetworkInterfaces loadBalancerNetworkInterfaces() { + if (this.loadBalancerNetworkInterfaces == null) { + this.loadBalancerNetworkInterfaces = new LoadBalancerNetworkInterfacesImpl(this); + } + return this.loadBalancerNetworkInterfaces; + } + + /** + * @return Entry point to manage LoadBalancerProbes. + */ + public LoadBalancerProbes loadBalancerProbes() { + if (this.loadBalancerProbes == null) { + this.loadBalancerProbes = new LoadBalancerProbesImpl(this); + } + return this.loadBalancerProbes; + } + + /** + * @return Entry point to manage NetworkInterfaces. + */ + public NetworkInterfaces networkInterfaces() { + if (this.networkInterfaces == null) { + this.networkInterfaces = new NetworkInterfacesImpl(this); + } + return this.networkInterfaces; + } + + /** + * @return Entry point to manage NetworkInterfaceIPConfigurations. + */ + public NetworkInterfaceIPConfigurations networkInterfaceIPConfigurations() { + if (this.networkInterfaceIPConfigurations == null) { + this.networkInterfaceIPConfigurations = new NetworkInterfaceIPConfigurationsImpl(this); + } + return this.networkInterfaceIPConfigurations; + } + + /** + * @return Entry point to manage NetworkInterfaceLoadBalancers. + */ + public NetworkInterfaceLoadBalancers networkInterfaceLoadBalancers() { + if (this.networkInterfaceLoadBalancers == null) { + this.networkInterfaceLoadBalancers = new NetworkInterfaceLoadBalancersImpl(this); + } + return this.networkInterfaceLoadBalancers; + } + + /** + * @return Entry point to manage NetworkSecurityGroups. + */ + public NetworkSecurityGroups networkSecurityGroups() { + if (this.networkSecurityGroups == null) { + this.networkSecurityGroups = new NetworkSecurityGroupsImpl(this); + } + return this.networkSecurityGroups; + } + + /** + * @return Entry point to manage SecurityRules. + */ + public SecurityRules securityRules() { + if (this.securityRules == null) { + this.securityRules = new SecurityRulesImpl(this); + } + return this.securityRules; + } + + /** + * @return Entry point to manage DefaultSecurityRules. + */ + public DefaultSecurityRules defaultSecurityRules() { + if (this.defaultSecurityRules == null) { + this.defaultSecurityRules = new DefaultSecurityRulesImpl(this); + } + return this.defaultSecurityRules; + } + + /** + * @return Entry point to manage NetworkWatchers. + */ + public NetworkWatchers networkWatchers() { + if (this.networkWatchers == null) { + this.networkWatchers = new NetworkWatchersImpl(this); + } + return this.networkWatchers; + } + + /** + * @return Entry point to manage PacketCaptures. + */ + public PacketCaptures packetCaptures() { + if (this.packetCaptures == null) { + this.packetCaptures = new PacketCapturesImpl(this); + } + return this.packetCaptures; + } + + /** + * @return Entry point to manage ConnectionMonitors. + */ + public ConnectionMonitors connectionMonitors() { + if (this.connectionMonitors == null) { + this.connectionMonitors = new ConnectionMonitorsImpl(this); + } + return this.connectionMonitors; + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * @return Entry point to manage PublicIPAddresses. + */ + public PublicIPAddresses publicIPAddresses() { + if (this.publicIPAddresses == null) { + this.publicIPAddresses = new PublicIPAddressesImpl(this); + } + return this.publicIPAddresses; + } + + /** + * @return Entry point to manage RouteFilters. + */ + public RouteFilters routeFilters() { + if (this.routeFilters == null) { + this.routeFilters = new RouteFiltersImpl(this); + } + return this.routeFilters; + } + + /** + * @return Entry point to manage RouteFilterRules. + */ + public RouteFilterRules routeFilterRules() { + if (this.routeFilterRules == null) { + this.routeFilterRules = new RouteFilterRulesImpl(this); + } + return this.routeFilterRules; + } + + /** + * @return Entry point to manage RouteTables. + */ + public RouteTables routeTables() { + if (this.routeTables == null) { + this.routeTables = new RouteTablesImpl(this); + } + return this.routeTables; + } + + /** + * @return Entry point to manage Routes. + */ + public Routes routes() { + if (this.routes == null) { + this.routes = new RoutesImpl(this); + } + return this.routes; + } + + /** + * @return Entry point to manage BgpServiceCommunities. + */ + public BgpServiceCommunities bgpServiceCommunities() { + if (this.bgpServiceCommunities == null) { + this.bgpServiceCommunities = new BgpServiceCommunitiesImpl(this); + } + return this.bgpServiceCommunities; + } + + /** + * @return Entry point to manage Usages. + */ + public Usages usages() { + if (this.usages == null) { + this.usages = new UsagesImpl(this); + } + return this.usages; + } + + /** + * @return Entry point to manage VirtualNetworks. + */ + public VirtualNetworks virtualNetworks() { + if (this.virtualNetworks == null) { + this.virtualNetworks = new VirtualNetworksImpl(this); + } + return this.virtualNetworks; + } + + /** + * @return Entry point to manage Subnets. + */ + public Subnets subnets() { + if (this.subnets == null) { + this.subnets = new SubnetsImpl(this); + } + return this.subnets; + } + + /** + * @return Entry point to manage VirtualNetworkPeerings. + */ + public VirtualNetworkPeerings virtualNetworkPeerings() { + if (this.virtualNetworkPeerings == null) { + this.virtualNetworkPeerings = new VirtualNetworkPeeringsImpl(this); + } + return this.virtualNetworkPeerings; + } + + /** + * @return Entry point to manage VirtualNetworkGateways. + */ + public VirtualNetworkGateways virtualNetworkGateways() { + if (this.virtualNetworkGateways == null) { + this.virtualNetworkGateways = new VirtualNetworkGatewaysImpl(this); + } + return this.virtualNetworkGateways; + } + + /** + * @return Entry point to manage VirtualNetworkGatewayConnections. + */ + public VirtualNetworkGatewayConnections virtualNetworkGatewayConnections() { + if (this.virtualNetworkGatewayConnections == null) { + this.virtualNetworkGatewayConnections = new VirtualNetworkGatewayConnectionsImpl(this); + } + return this.virtualNetworkGatewayConnections; + } + + /** + * @return Entry point to manage LocalNetworkGateways. + */ + public LocalNetworkGateways localNetworkGateways() { + if (this.localNetworkGateways == null) { + this.localNetworkGateways = new LocalNetworkGatewaysImpl(this); + } + return this.localNetworkGateways; + } + + /** + * @return Entry point to manage VirtualWANs. + */ + public VirtualWANs virtualWANs() { + if (this.virtualWANs == null) { + this.virtualWANs = new VirtualWANsImpl(this); + } + return this.virtualWANs; + } + + /** + * @return Entry point to manage VpnSites. + */ + public VpnSites vpnSites() { + if (this.vpnSites == null) { + this.vpnSites = new VpnSitesImpl(this); + } + return this.vpnSites; + } + + /** + * @return Entry point to manage VpnSitesConfigurations. + */ + public VpnSitesConfigurations vpnSitesConfigurations() { + if (this.vpnSitesConfigurations == null) { + this.vpnSitesConfigurations = new VpnSitesConfigurationsImpl(this); + } + return this.vpnSitesConfigurations; + } + + /** + * @return Entry point to manage VirtualHubs. + */ + public VirtualHubs virtualHubs() { + if (this.virtualHubs == null) { + this.virtualHubs = new VirtualHubsImpl(this); + } + return this.virtualHubs; + } + + /** + * @return Entry point to manage HubVirtualNetworkConnections. + */ + public HubVirtualNetworkConnections hubVirtualNetworkConnections() { + if (this.hubVirtualNetworkConnections == null) { + this.hubVirtualNetworkConnections = new HubVirtualNetworkConnectionsImpl(this); + } + return this.hubVirtualNetworkConnections; + } + + /** + * @return Entry point to manage VpnGateways. + */ + public VpnGateways vpnGateways() { + if (this.vpnGateways == null) { + this.vpnGateways = new VpnGatewaysImpl(this); + } + return this.vpnGateways; + } + + /** + * @return Entry point to manage VpnConnections. + */ + public VpnConnections vpnConnections() { + if (this.vpnConnections == null) { + this.vpnConnections = new VpnConnectionsImpl(this); + } + return this.vpnConnections; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public NetworkManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return NetworkManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private NetworkManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new NetworkManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkSecurityGroupImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkSecurityGroupImpl.java new file mode 100644 index 000000000000..e935ac71d757 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkSecurityGroupImpl.java @@ -0,0 +1,140 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_06_01.NetworkSecurityGroup; +import rx.Observable; +import java.util.List; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_06_01.NetworkSecurityGroupSecurityRule; +import com.microsoft.azure.management.network.v2018_06_01.NetworkInterface; +import com.microsoft.azure.management.network.v2018_06_01.Subnet; + +class NetworkSecurityGroupImpl extends GroupableResourceCoreImpl implements NetworkSecurityGroup, NetworkSecurityGroup.Definition, NetworkSecurityGroup.Update { + NetworkSecurityGroupImpl(String name, NetworkSecurityGroupInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + NetworkSecurityGroupsInner client = this.manager().inner().networkSecurityGroups(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + NetworkSecurityGroupsInner client = this.manager().inner().networkSecurityGroups(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + NetworkSecurityGroupsInner client = this.manager().inner().networkSecurityGroups(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public List defaultSecurityRules() { + List lst = new ArrayList(); + if (this.inner().defaultSecurityRules() != null) { + for (SecurityRuleInner inner : this.inner().defaultSecurityRules()) { + lst.add( new NetworkSecurityGroupSecurityRuleImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public List networkInterfaces() { + List lst = new ArrayList(); + if (this.inner().networkInterfaces() != null) { + for (NetworkInterfaceInner inner : this.inner().networkInterfaces()) { + lst.add( new NetworkInterfaceImpl(inner.name(), inner, manager())); + } + } + return lst; + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public List securityRules() { + List lst = new ArrayList(); + if (this.inner().securityRules() != null) { + for (SecurityRuleInner inner : this.inner().securityRules()) { + lst.add( new NetworkSecurityGroupSecurityRuleImpl(inner, manager())); + } + } + return lst; + } + + @Override + public List subnets() { + List lst = new ArrayList(); + if (this.inner().subnets() != null) { + for (SubnetInner inner : this.inner().subnets()) { + lst.add( new SubnetImpl(inner, manager())); + } + } + return lst; + } + + @Override + public NetworkSecurityGroupImpl withDefaultSecurityRules(List defaultSecurityRules) { + this.inner().withDefaultSecurityRules(defaultSecurityRules); + return this; + } + + @Override + public NetworkSecurityGroupImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public NetworkSecurityGroupImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public NetworkSecurityGroupImpl withResourceGuid(String resourceGuid) { + this.inner().withResourceGuid(resourceGuid); + return this; + } + + @Override + public NetworkSecurityGroupImpl withSecurityRules(List securityRules) { + this.inner().withSecurityRules(securityRules); + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkSecurityGroupInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkSecurityGroupInner.java new file mode 100644 index 000000000000..a19a235517b0 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkSecurityGroupInner.java @@ -0,0 +1,210 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * NetworkSecurityGroup resource. + */ +@JsonFlatten +@SkipParentValidation +public class NetworkSecurityGroupInner extends Resource { + /** + * A collection of security rules of the network security group. + */ + @JsonProperty(value = "properties.securityRules") + private List securityRules; + + /** + * The default security rules of network security group. + */ + @JsonProperty(value = "properties.defaultSecurityRules") + private List defaultSecurityRules; + + /** + * A collection of references to network interfaces. + */ + @JsonProperty(value = "properties.networkInterfaces", access = JsonProperty.Access.WRITE_ONLY) + private List networkInterfaces; + + /** + * A collection of references to subnets. + */ + @JsonProperty(value = "properties.subnets", access = JsonProperty.Access.WRITE_ONLY) + private List subnets; + + /** + * The resource GUID property of the network security group resource. + */ + @JsonProperty(value = "properties.resourceGuid") + private String resourceGuid; + + /** + * The provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get a collection of security rules of the network security group. + * + * @return the securityRules value + */ + public List securityRules() { + return this.securityRules; + } + + /** + * Set a collection of security rules of the network security group. + * + * @param securityRules the securityRules value to set + * @return the NetworkSecurityGroupInner object itself. + */ + public NetworkSecurityGroupInner withSecurityRules(List securityRules) { + this.securityRules = securityRules; + return this; + } + + /** + * Get the default security rules of network security group. + * + * @return the defaultSecurityRules value + */ + public List defaultSecurityRules() { + return this.defaultSecurityRules; + } + + /** + * Set the default security rules of network security group. + * + * @param defaultSecurityRules the defaultSecurityRules value to set + * @return the NetworkSecurityGroupInner object itself. + */ + public NetworkSecurityGroupInner withDefaultSecurityRules(List defaultSecurityRules) { + this.defaultSecurityRules = defaultSecurityRules; + return this; + } + + /** + * Get a collection of references to network interfaces. + * + * @return the networkInterfaces value + */ + public List networkInterfaces() { + return this.networkInterfaces; + } + + /** + * Get a collection of references to subnets. + * + * @return the subnets value + */ + public List subnets() { + return this.subnets; + } + + /** + * Get the resource GUID property of the network security group resource. + * + * @return the resourceGuid value + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Set the resource GUID property of the network security group resource. + * + * @param resourceGuid the resourceGuid value to set + * @return the NetworkSecurityGroupInner object itself. + */ + public NetworkSecurityGroupInner withResourceGuid(String resourceGuid) { + this.resourceGuid = resourceGuid; + return this; + } + + /** + * Get the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the NetworkSecurityGroupInner object itself. + */ + public NetworkSecurityGroupInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the NetworkSecurityGroupInner object itself. + */ + public NetworkSecurityGroupInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the NetworkSecurityGroupInner object itself. + */ + public NetworkSecurityGroupInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkSecurityGroupSecurityRuleImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkSecurityGroupSecurityRuleImpl.java new file mode 100644 index 000000000000..d6b3b2937da2 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkSecurityGroupSecurityRuleImpl.java @@ -0,0 +1,306 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.NetworkSecurityGroupSecurityRule; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_06_01.SecurityRuleProtocol; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.SecurityRuleAccess; +import com.microsoft.azure.management.network.v2018_06_01.SecurityRuleDirection; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationSecurityGroup; + +class NetworkSecurityGroupSecurityRuleImpl extends CreatableUpdatableImpl implements NetworkSecurityGroupSecurityRule, NetworkSecurityGroupSecurityRule.Definition, NetworkSecurityGroupSecurityRule.Update { + private final NetworkManager manager; + private String resourceGroupName; + private String networkSecurityGroupName; + private String securityRuleName; + + NetworkSecurityGroupSecurityRuleImpl(String name, NetworkManager manager) { + super(name, new SecurityRuleInner()); + this.manager = manager; + // Set resource name + this.securityRuleName = name; + // + } + + NetworkSecurityGroupSecurityRuleImpl(SecurityRuleInner inner, NetworkManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.securityRuleName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.networkSecurityGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "networkSecurityGroups"); + this.securityRuleName = IdParsingUtils.getValueFromIdByName(inner.id(), "securityRules"); + // + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + SecurityRulesInner client = this.manager().inner().securityRules(); + return client.createOrUpdateAsync(this.resourceGroupName, this.networkSecurityGroupName, this.securityRuleName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + SecurityRulesInner client = this.manager().inner().securityRules(); + return client.createOrUpdateAsync(this.resourceGroupName, this.networkSecurityGroupName, this.securityRuleName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + SecurityRulesInner client = this.manager().inner().securityRules(); + return client.getAsync(this.resourceGroupName, this.networkSecurityGroupName, this.securityRuleName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public SecurityRuleAccess access() { + return this.inner().access(); + } + + @Override + public String description() { + return this.inner().description(); + } + + @Override + public String destinationAddressPrefix() { + return this.inner().destinationAddressPrefix(); + } + + @Override + public List destinationAddressPrefixes() { + return this.inner().destinationAddressPrefixes(); + } + + @Override + public List destinationApplicationSecurityGroups() { + List lst = new ArrayList(); + if (this.inner().destinationApplicationSecurityGroups() != null) { + for (ApplicationSecurityGroupInner inner : this.inner().destinationApplicationSecurityGroups()) { + lst.add( new ApplicationSecurityGroupImpl(inner.name(), inner, manager())); + } + } + return lst; + } + + @Override + public String destinationPortRange() { + return this.inner().destinationPortRange(); + } + + @Override + public List destinationPortRanges() { + return this.inner().destinationPortRanges(); + } + + @Override + public SecurityRuleDirection direction() { + return this.inner().direction(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Integer priority() { + return this.inner().priority(); + } + + @Override + public SecurityRuleProtocol protocol() { + return this.inner().protocol(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String sourceAddressPrefix() { + return this.inner().sourceAddressPrefix(); + } + + @Override + public List sourceAddressPrefixes() { + return this.inner().sourceAddressPrefixes(); + } + + @Override + public List sourceApplicationSecurityGroups() { + List lst = new ArrayList(); + if (this.inner().sourceApplicationSecurityGroups() != null) { + for (ApplicationSecurityGroupInner inner : this.inner().sourceApplicationSecurityGroups()) { + lst.add( new ApplicationSecurityGroupImpl(inner.name(), inner, manager())); + } + } + return lst; + } + + @Override + public String sourcePortRange() { + return this.inner().sourcePortRange(); + } + + @Override + public List sourcePortRanges() { + return this.inner().sourcePortRanges(); + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withExistingNetworkSecurityGroup(String resourceGroupName, String networkSecurityGroupName) { + this.resourceGroupName = resourceGroupName; + this.networkSecurityGroupName = networkSecurityGroupName; + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withAccess(SecurityRuleAccess access) { + this.inner().withAccess(access); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withDirection(SecurityRuleDirection direction) { + this.inner().withDirection(direction); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withProtocol(SecurityRuleProtocol protocol) { + this.inner().withProtocol(protocol); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withDescription(String description) { + this.inner().withDescription(description); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withDestinationAddressPrefix(String destinationAddressPrefix) { + this.inner().withDestinationAddressPrefix(destinationAddressPrefix); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withDestinationAddressPrefixes(List destinationAddressPrefixes) { + this.inner().withDestinationAddressPrefixes(destinationAddressPrefixes); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withDestinationApplicationSecurityGroups(List destinationApplicationSecurityGroups) { + this.inner().withDestinationApplicationSecurityGroups(destinationApplicationSecurityGroups); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withDestinationPortRange(String destinationPortRange) { + this.inner().withDestinationPortRange(destinationPortRange); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withDestinationPortRanges(List destinationPortRanges) { + this.inner().withDestinationPortRanges(destinationPortRanges); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withId(String id) { + this.inner().withId(id); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withName(String name) { + this.inner().withName(name); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withPriority(Integer priority) { + this.inner().withPriority(priority); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withSourceAddressPrefix(String sourceAddressPrefix) { + this.inner().withSourceAddressPrefix(sourceAddressPrefix); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withSourceAddressPrefixes(List sourceAddressPrefixes) { + this.inner().withSourceAddressPrefixes(sourceAddressPrefixes); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withSourceApplicationSecurityGroups(List sourceApplicationSecurityGroups) { + this.inner().withSourceApplicationSecurityGroups(sourceApplicationSecurityGroups); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withSourcePortRange(String sourcePortRange) { + this.inner().withSourcePortRange(sourcePortRange); + return this; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl withSourcePortRanges(List sourcePortRanges) { + this.inner().withSourcePortRanges(sourcePortRanges); + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkSecurityGroupSecurityRuleModelImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkSecurityGroupSecurityRuleModelImpl.java new file mode 100644 index 000000000000..e180f7987663 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkSecurityGroupSecurityRuleModelImpl.java @@ -0,0 +1,155 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.NetworkSecurityGroupSecurityRuleModel; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_06_01.SecurityRuleAccess; +import java.util.List; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationSecurityGroup; +import com.microsoft.azure.management.network.v2018_06_01.SecurityRuleDirection; +import com.microsoft.azure.management.network.v2018_06_01.SecurityRuleProtocol; + +class NetworkSecurityGroupSecurityRuleModelImpl extends IndexableRefreshableWrapperImpl implements NetworkSecurityGroupSecurityRuleModel { + private final NetworkManager manager; + private String resourceGroupName; + private String networkSecurityGroupName; + private String defaultSecurityRuleName; + + NetworkSecurityGroupSecurityRuleModelImpl(SecurityRuleInner inner, NetworkManager manager) { + super(null, inner); + this.manager = manager; + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.networkSecurityGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "networkSecurityGroups"); + this.defaultSecurityRuleName = IdParsingUtils.getValueFromIdByName(inner.id(), "defaultSecurityRules"); + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + DefaultSecurityRulesInner client = this.manager().inner().defaultSecurityRules(); + return client.getAsync(this.resourceGroupName, this.networkSecurityGroupName, this.defaultSecurityRuleName); + } + + + + @Override + public SecurityRuleAccess access() { + return this.inner().access(); + } + + @Override + public String description() { + return this.inner().description(); + } + + @Override + public String destinationAddressPrefix() { + return this.inner().destinationAddressPrefix(); + } + + @Override + public List destinationAddressPrefixes() { + return this.inner().destinationAddressPrefixes(); + } + + @Override + public List destinationApplicationSecurityGroups() { + List lst = new ArrayList(); + if (this.inner().destinationApplicationSecurityGroups() != null) { + for (ApplicationSecurityGroupInner inner : this.inner().destinationApplicationSecurityGroups()) { + lst.add( new ApplicationSecurityGroupImpl(inner.name(), inner, manager())); + } + } + return lst; + } + + @Override + public String destinationPortRange() { + return this.inner().destinationPortRange(); + } + + @Override + public List destinationPortRanges() { + return this.inner().destinationPortRanges(); + } + + @Override + public SecurityRuleDirection direction() { + return this.inner().direction(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Integer priority() { + return this.inner().priority(); + } + + @Override + public SecurityRuleProtocol protocol() { + return this.inner().protocol(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String sourceAddressPrefix() { + return this.inner().sourceAddressPrefix(); + } + + @Override + public List sourceAddressPrefixes() { + return this.inner().sourceAddressPrefixes(); + } + + @Override + public List sourceApplicationSecurityGroups() { + List lst = new ArrayList(); + if (this.inner().sourceApplicationSecurityGroups() != null) { + for (ApplicationSecurityGroupInner inner : this.inner().sourceApplicationSecurityGroups()) { + lst.add( new ApplicationSecurityGroupImpl(inner.name(), inner, manager())); + } + } + return lst; + } + + @Override + public String sourcePortRange() { + return this.inner().sourcePortRange(); + } + + @Override + public List sourcePortRanges() { + return this.inner().sourcePortRanges(); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkSecurityGroupsImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkSecurityGroupsImpl.java new file mode 100644 index 000000000000..467c84464714 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkSecurityGroupsImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_06_01.NetworkSecurityGroups; +import com.microsoft.azure.management.network.v2018_06_01.NetworkSecurityGroup; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class NetworkSecurityGroupsImpl extends GroupableResourcesCoreImpl implements NetworkSecurityGroups { + protected NetworkSecurityGroupsImpl(NetworkManager manager) { + super(manager.inner().networkSecurityGroups(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + NetworkSecurityGroupsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + NetworkSecurityGroupsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + NetworkSecurityGroupsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + NetworkSecurityGroupsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NetworkSecurityGroup call(NetworkSecurityGroupInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + NetworkSecurityGroupsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + NetworkSecurityGroupsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NetworkSecurityGroup call(NetworkSecurityGroupInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public NetworkSecurityGroupImpl define(String name) { + return wrapModel(name); + } + + @Override + protected NetworkSecurityGroupImpl wrapModel(NetworkSecurityGroupInner inner) { + return new NetworkSecurityGroupImpl(inner.name(), inner, manager()); + } + + @Override + protected NetworkSecurityGroupImpl wrapModel(String name) { + return new NetworkSecurityGroupImpl(name, new NetworkSecurityGroupInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkSecurityGroupsInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkSecurityGroupsInner.java new file mode 100644 index 000000000000..d8496a1467e4 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkSecurityGroupsInner.java @@ -0,0 +1,1355 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_06_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.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 NetworkSecurityGroups. + */ +public class NetworkSecurityGroupsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private NetworkSecurityGroupsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of NetworkSecurityGroupsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public NetworkSecurityGroupsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(NetworkSecurityGroupsService.class); + this.client = client; + } + + /** + * The interface defining all the services for NetworkSecurityGroups to be + * used by Retrofit to perform actually REST calls. + */ + interface NetworkSecurityGroupsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.NetworkSecurityGroups delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("networkSecurityGroupName") String networkSecurityGroupName, @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.network.v2018_06_01.NetworkSecurityGroups beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("networkSecurityGroupName") String networkSecurityGroupName, @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.network.v2018_06_01.NetworkSecurityGroups getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("networkSecurityGroupName") String networkSecurityGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @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.network.v2018_06_01.NetworkSecurityGroups createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("networkSecurityGroupName") String networkSecurityGroupName, @Path("subscriptionId") String subscriptionId, @Body NetworkSecurityGroupInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.NetworkSecurityGroups beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("networkSecurityGroupName") String networkSecurityGroupName, @Path("subscriptionId") String subscriptionId, @Body NetworkSecurityGroupInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.NetworkSecurityGroups updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("networkSecurityGroupName") String networkSecurityGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.NetworkSecurityGroups beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}") + Observable> beginUpdateTags(@Path("resourceGroupName") String resourceGroupName, @Path("networkSecurityGroupName") String networkSecurityGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.NetworkSecurityGroups list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityGroups") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.NetworkSecurityGroups listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @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.network.v2018_06_01.NetworkSecurityGroups listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.NetworkSecurityGroups listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String networkSecurityGroupName) { + deleteWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName).toBlocking().last().body(); + } + + /** + * Deletes the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @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 networkSecurityGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName), serviceCallback); + } + + /** + * Deletes the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String networkSecurityGroupName) { + return deleteWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + Observable> observable = service.delete(resourceGroupName, networkSecurityGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String networkSecurityGroupName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName).toBlocking().single().body(); + } + + /** + * Deletes the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String networkSecurityGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName), serviceCallback); + } + + /** + * Deletes the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String networkSecurityGroupName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.beginDelete(resourceGroupName, networkSecurityGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkSecurityGroupInner object if successful. + */ + public NetworkSecurityGroupInner getByResourceGroup(String resourceGroupName, String networkSecurityGroupName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName).toBlocking().single().body(); + } + + /** + * Gets the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String networkSecurityGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName), serviceCallback); + } + + /** + * Gets the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkSecurityGroupInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String networkSecurityGroupName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName).map(new Func1, NetworkSecurityGroupInner>() { + @Override + public NetworkSecurityGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkSecurityGroupInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + final String expand = null; + return service.getByResourceGroup(resourceGroupName, networkSecurityGroupName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkSecurityGroupInner object if successful. + */ + public NetworkSecurityGroupInner getByResourceGroup(String resourceGroupName, String networkSecurityGroupName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, expand).toBlocking().single().body(); + } + + /** + * Gets the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param expand Expands referenced resources. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String networkSecurityGroupName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, expand), serviceCallback); + } + + /** + * Gets the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkSecurityGroupInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String networkSecurityGroupName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, expand).map(new Func1, NetworkSecurityGroupInner>() { + @Override + public NetworkSecurityGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkSecurityGroupInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.getByResourceGroup(resourceGroupName, networkSecurityGroupName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a network security group in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param parameters Parameters supplied to the create or update network security group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkSecurityGroupInner object if successful. + */ + public NetworkSecurityGroupInner createOrUpdate(String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates a network security group in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param parameters Parameters supplied to the create or update network security group operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, parameters), serviceCallback); + } + + /** + * Creates or updates a network security group in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param parameters Parameters supplied to the create or update network security group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, parameters).map(new Func1, NetworkSecurityGroupInner>() { + @Override + public NetworkSecurityGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a network security group in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param parameters Parameters supplied to the create or update network security group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, networkSecurityGroupName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a network security group in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param parameters Parameters supplied to the create or update network security group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkSecurityGroupInner object if successful. + */ + public NetworkSecurityGroupInner beginCreateOrUpdate(String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates a network security group in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param parameters Parameters supplied to the create or update network security group operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, parameters), serviceCallback); + } + + /** + * Creates or updates a network security group in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param parameters Parameters supplied to the create or update network security group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkSecurityGroupInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, parameters).map(new Func1, NetworkSecurityGroupInner>() { + @Override + public NetworkSecurityGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a network security group in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param parameters Parameters supplied to the create or update network security group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkSecurityGroupInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + return service.beginCreateOrUpdate(resourceGroupName, networkSecurityGroupName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkSecurityGroupInner object if successful. + */ + public NetworkSecurityGroupInner updateTags(String resourceGroupName, String networkSecurityGroupName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName).toBlocking().last().body(); + } + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @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 updateTagsAsync(String resourceGroupName, String networkSecurityGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName), serviceCallback); + } + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String networkSecurityGroupName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName).map(new Func1, NetworkSecurityGroupInner>() { + @Override + public NetworkSecurityGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + Observable> observable = service.updateTags(resourceGroupName, networkSecurityGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkSecurityGroupInner object if successful. + */ + public NetworkSecurityGroupInner updateTags(String resourceGroupName, String networkSecurityGroupName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, tags).toBlocking().last().body(); + } + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String networkSecurityGroupName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, tags), serviceCallback); + } + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String networkSecurityGroupName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, tags).map(new Func1, NetworkSecurityGroupInner>() { + @Override + public NetworkSecurityGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-06-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + Observable> observable = service.updateTags(resourceGroupName, networkSecurityGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkSecurityGroupInner object if successful. + */ + public NetworkSecurityGroupInner beginUpdateTags(String resourceGroupName, String networkSecurityGroupName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName).toBlocking().single().body(); + } + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @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 beginUpdateTagsAsync(String resourceGroupName, String networkSecurityGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName), serviceCallback); + } + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkSecurityGroupInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String networkSecurityGroupName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName).map(new Func1, NetworkSecurityGroupInner>() { + @Override + public NetworkSecurityGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkSecurityGroupInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.beginUpdateTags(resourceGroupName, networkSecurityGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkSecurityGroupInner object if successful. + */ + public NetworkSecurityGroupInner beginUpdateTags(String resourceGroupName, String networkSecurityGroupName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, tags).toBlocking().single().body(); + } + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String networkSecurityGroupName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, tags), serviceCallback); + } + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkSecurityGroupInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String networkSecurityGroupName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, tags).map(new Func1, NetworkSecurityGroupInner>() { + @Override + public NetworkSecurityGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkSecurityGroupInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-06-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.beginUpdateTags(resourceGroupName, networkSecurityGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all network security groups in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkSecurityGroupInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all network security groups in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all network security groups in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkSecurityGroupInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all network security groups in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkSecurityGroupInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all network security groups in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkSecurityGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all network security groups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkSecurityGroupInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all network security groups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all network security groups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkSecurityGroupInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all network security groups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkSecurityGroupInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all network security groups in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkSecurityGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all network security groups in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkSecurityGroupInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all network security groups in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all network security groups in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkSecurityGroupInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all network security groups in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkSecurityGroupInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all network security groups in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkSecurityGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all network security groups in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<NetworkSecurityGroupInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all network security groups in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all network security groups in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkSecurityGroupInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all network security groups in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkSecurityGroupInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all network security groups in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkSecurityGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkWatcherImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkWatcherImpl.java new file mode 100644 index 000000000000..473f5bf4ce44 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkWatcherImpl.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_06_01.NetworkWatcher; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_06_01.ProvisioningState; + +class NetworkWatcherImpl extends GroupableResourceCoreImpl implements NetworkWatcher, NetworkWatcher.Definition, NetworkWatcher.Update { + NetworkWatcherImpl(String name, NetworkWatcherInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + NetworkWatchersInner client = this.manager().inner().networkWatchers(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + NetworkWatchersInner client = this.manager().inner().networkWatchers(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + NetworkWatchersInner client = this.manager().inner().networkWatchers(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public NetworkWatcherImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkWatcherInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkWatcherInner.java new file mode 100644 index 000000000000..cd8cf200a29f --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkWatcherInner.java @@ -0,0 +1,91 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Network watcher in a resource group. + */ +@JsonFlatten +@SkipParentValidation +public class NetworkWatcherInner extends Resource { + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * The provisioning state of the resource. Possible values include: + * 'Succeeded', 'Updating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the NetworkWatcherInner object itself. + */ + public NetworkWatcherInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the NetworkWatcherInner object itself. + */ + public NetworkWatcherInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkWatchersImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkWatchersImpl.java new file mode 100644 index 000000000000..9e02b34355a7 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkWatchersImpl.java @@ -0,0 +1,286 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_06_01.NetworkWatchers; +import com.microsoft.azure.management.network.v2018_06_01.NetworkWatcher; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_06_01.Topology; +import com.microsoft.azure.management.network.v2018_06_01.VerificationIPFlowResult; +import com.microsoft.azure.management.network.v2018_06_01.NextHopResult; +import com.microsoft.azure.management.network.v2018_06_01.SecurityGroupViewResult; +import com.microsoft.azure.management.network.v2018_06_01.TroubleshootingResult; +import com.microsoft.azure.management.network.v2018_06_01.FlowLogInformation; +import com.microsoft.azure.management.network.v2018_06_01.ConnectivityInformation; +import com.microsoft.azure.management.network.v2018_06_01.AzureReachabilityReport; +import com.microsoft.azure.management.network.v2018_06_01.AvailableProvidersList; +import com.microsoft.azure.management.network.v2018_06_01.TopologyParameters; +import com.microsoft.azure.management.network.v2018_06_01.VerificationIPFlowParameters; +import com.microsoft.azure.management.network.v2018_06_01.NextHopParameters; +import com.microsoft.azure.management.network.v2018_06_01.TroubleshootingParameters; +import com.microsoft.azure.management.network.v2018_06_01.ConnectivityParameters; +import com.microsoft.azure.management.network.v2018_06_01.AzureReachabilityReportParameters; +import com.microsoft.azure.management.network.v2018_06_01.AvailableProvidersListParameters; + +class NetworkWatchersImpl extends GroupableResourcesCoreImpl implements NetworkWatchers { + protected NetworkWatchersImpl(NetworkManager manager) { + super(manager.inner().networkWatchers(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + NetworkWatchersInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + NetworkWatchersInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + NetworkWatchersInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + NetworkWatchersInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(Page innerPage) { + return Observable.from(innerPage.items()); + } + }) + .map(new Func1() { + @Override + public NetworkWatcher call(NetworkWatcherInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + NetworkWatchersInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + NetworkWatchersInner client = this.inner(); + return client.listAsync() + .flatMap(new Func1, Observable>() { + @Override + public Observable call(Page innerPage) { + return Observable.from(innerPage.items()); + } + }) + .map(new Func1() { + @Override + public NetworkWatcher call(NetworkWatcherInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public NetworkWatcherImpl define(String name) { + return wrapModel(name); + } + + @Override + public Observable getTopologyAsync(String resourceGroupName, String networkWatcherName, TopologyParameters parameters) { + NetworkWatchersInner client = this.inner(); + return client.getTopologyAsync(resourceGroupName, networkWatcherName, parameters) + .map(new Func1() { + @Override + public Topology call(TopologyInner inner) { + return new TopologyImpl(inner, manager()); + } + }); + } + + @Override + public Observable verifyIPFlowAsync(String resourceGroupName, String networkWatcherName, VerificationIPFlowParameters parameters) { + NetworkWatchersInner client = this.inner(); + return client.verifyIPFlowAsync(resourceGroupName, networkWatcherName, parameters) + .map(new Func1() { + @Override + public VerificationIPFlowResult call(VerificationIPFlowResultInner inner) { + return new VerificationIPFlowResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable getNextHopAsync(String resourceGroupName, String networkWatcherName, NextHopParameters parameters) { + NetworkWatchersInner client = this.inner(); + return client.getNextHopAsync(resourceGroupName, networkWatcherName, parameters) + .map(new Func1() { + @Override + public NextHopResult call(NextHopResultInner inner) { + return new NextHopResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable getVMSecurityRulesAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + NetworkWatchersInner client = this.inner(); + return client.getVMSecurityRulesAsync(resourceGroupName, networkWatcherName, targetResourceId) + .map(new Func1() { + @Override + public SecurityGroupViewResult call(SecurityGroupViewResultInner inner) { + return new SecurityGroupViewResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable getTroubleshootingAsync(String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters) { + NetworkWatchersInner client = this.inner(); + return client.getTroubleshootingAsync(resourceGroupName, networkWatcherName, parameters) + .map(new Func1() { + @Override + public TroubleshootingResult call(TroubleshootingResultInner inner) { + return new TroubleshootingResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable getTroubleshootingResultAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + NetworkWatchersInner client = this.inner(); + return client.getTroubleshootingResultAsync(resourceGroupName, networkWatcherName, targetResourceId) + .map(new Func1() { + @Override + public TroubleshootingResult call(TroubleshootingResultInner inner) { + return new TroubleshootingResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable setFlowLogConfigurationAsync(String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters) { + NetworkWatchersInner client = this.inner(); + return client.setFlowLogConfigurationAsync(resourceGroupName, networkWatcherName, parameters) + .map(new Func1() { + @Override + public FlowLogInformation call(FlowLogInformationInner inner) { + return new FlowLogInformationImpl(inner, manager()); + } + }); + } + + @Override + public Observable getFlowLogStatusAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + NetworkWatchersInner client = this.inner(); + return client.getFlowLogStatusAsync(resourceGroupName, networkWatcherName, targetResourceId) + .map(new Func1() { + @Override + public FlowLogInformation call(FlowLogInformationInner inner) { + return new FlowLogInformationImpl(inner, manager()); + } + }); + } + + @Override + public Observable checkConnectivityAsync(String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters) { + NetworkWatchersInner client = this.inner(); + return client.checkConnectivityAsync(resourceGroupName, networkWatcherName, parameters) + .map(new Func1() { + @Override + public ConnectivityInformation call(ConnectivityInformationInner inner) { + return new ConnectivityInformationImpl(inner, manager()); + } + }); + } + + @Override + public Observable getAzureReachabilityReportAsync(String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters) { + NetworkWatchersInner client = this.inner(); + return client.getAzureReachabilityReportAsync(resourceGroupName, networkWatcherName, parameters) + .map(new Func1() { + @Override + public AzureReachabilityReport call(AzureReachabilityReportInner inner) { + return new AzureReachabilityReportImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAvailableProvidersAsync(String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters) { + NetworkWatchersInner client = this.inner(); + return client.listAvailableProvidersAsync(resourceGroupName, networkWatcherName, parameters) + .map(new Func1() { + @Override + public AvailableProvidersList call(AvailableProvidersListInner inner) { + return new AvailableProvidersListImpl(inner, manager()); + } + }); + } + + @Override + protected NetworkWatcherImpl wrapModel(NetworkWatcherInner inner) { + return new NetworkWatcherImpl(inner.name(), inner, manager()); + } + + @Override + protected NetworkWatcherImpl wrapModel(String name) { + return new NetworkWatcherImpl(name, new NetworkWatcherInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkWatchersInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkWatchersInner.java new file mode 100644 index 000000000000..55944e5794da --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkWatchersInner.java @@ -0,0 +1,2633 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.network.v2018_06_01.AvailableProvidersListParameters; +import com.microsoft.azure.management.network.v2018_06_01.AzureReachabilityReportParameters; +import com.microsoft.azure.management.network.v2018_06_01.ConnectivityParameters; +import com.microsoft.azure.management.network.v2018_06_01.FlowLogStatusParameters; +import com.microsoft.azure.management.network.v2018_06_01.NextHopParameters; +import com.microsoft.azure.management.network.v2018_06_01.QueryTroubleshootingParameters; +import com.microsoft.azure.management.network.v2018_06_01.SecurityGroupViewParameters; +import com.microsoft.azure.management.network.v2018_06_01.TagsObject; +import com.microsoft.azure.management.network.v2018_06_01.TopologyParameters; +import com.microsoft.azure.management.network.v2018_06_01.TroubleshootingParameters; +import com.microsoft.azure.management.network.v2018_06_01.VerificationIPFlowParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in NetworkWatchers. + */ +public class NetworkWatchersInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private NetworkWatchersService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of NetworkWatchersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public NetworkWatchersInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(NetworkWatchersService.class); + this.client = client; + } + + /** + * The interface defining all the services for NetworkWatchers to be + * used by Retrofit to perform actually REST calls. + */ + interface NetworkWatchersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.NetworkWatchers createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body NetworkWatcherInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.NetworkWatchers getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @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.network.v2018_06_01.NetworkWatchers delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @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.network.v2018_06_01.NetworkWatchers beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @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.network.v2018_06_01.NetworkWatchers updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.NetworkWatchers listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @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.network.v2018_06_01.NetworkWatchers list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/networkWatchers") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.NetworkWatchers getTopology" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/topology") + Observable> getTopology(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body TopologyParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.NetworkWatchers verifyIPFlow" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/ipFlowVerify") + Observable> verifyIPFlow(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body VerificationIPFlowParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.NetworkWatchers beginVerifyIPFlow" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/ipFlowVerify") + Observable> beginVerifyIPFlow(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body VerificationIPFlowParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.NetworkWatchers getNextHop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/nextHop") + Observable> getNextHop(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body NextHopParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.NetworkWatchers beginGetNextHop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/nextHop") + Observable> beginGetNextHop(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body NextHopParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.NetworkWatchers getVMSecurityRules" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/securityGroupView") + Observable> getVMSecurityRules(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body SecurityGroupViewParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.NetworkWatchers beginGetVMSecurityRules" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/securityGroupView") + Observable> beginGetVMSecurityRules(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body SecurityGroupViewParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.NetworkWatchers getTroubleshooting" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/troubleshoot") + Observable> getTroubleshooting(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body TroubleshootingParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.NetworkWatchers beginGetTroubleshooting" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/troubleshoot") + Observable> beginGetTroubleshooting(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body TroubleshootingParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.NetworkWatchers getTroubleshootingResult" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryTroubleshootResult") + Observable> getTroubleshootingResult(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body QueryTroubleshootingParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.NetworkWatchers beginGetTroubleshootingResult" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryTroubleshootResult") + Observable> beginGetTroubleshootingResult(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body QueryTroubleshootingParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.NetworkWatchers setFlowLogConfiguration" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/configureFlowLog") + Observable> setFlowLogConfiguration(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body FlowLogInformationInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.NetworkWatchers beginSetFlowLogConfiguration" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/configureFlowLog") + Observable> beginSetFlowLogConfiguration(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body FlowLogInformationInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.NetworkWatchers getFlowLogStatus" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryFlowLogStatus") + Observable> getFlowLogStatus(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body FlowLogStatusParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.NetworkWatchers beginGetFlowLogStatus" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryFlowLogStatus") + Observable> beginGetFlowLogStatus(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body FlowLogStatusParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.NetworkWatchers checkConnectivity" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectivityCheck") + Observable> checkConnectivity(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body ConnectivityParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.NetworkWatchers beginCheckConnectivity" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectivityCheck") + Observable> beginCheckConnectivity(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body ConnectivityParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.NetworkWatchers getAzureReachabilityReport" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/azureReachabilityReport") + Observable> getAzureReachabilityReport(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body AzureReachabilityReportParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.NetworkWatchers beginGetAzureReachabilityReport" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/azureReachabilityReport") + Observable> beginGetAzureReachabilityReport(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body AzureReachabilityReportParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.NetworkWatchers listAvailableProviders" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/availableProvidersList") + Observable> listAvailableProviders(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body AvailableProvidersListParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.NetworkWatchers beginListAvailableProviders" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/availableProvidersList") + Observable> beginListAvailableProviders(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body AvailableProvidersListParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Creates or updates a network watcher in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the network watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkWatcherInner object if successful. + */ + public NetworkWatcherInner createOrUpdate(String resourceGroupName, String networkWatcherName, NetworkWatcherInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates a network watcher in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the network watcher resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String networkWatcherName, NetworkWatcherInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * Creates or updates a network watcher in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the network watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkWatcherInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String networkWatcherName, NetworkWatcherInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, NetworkWatcherInner>() { + @Override + public NetworkWatcherInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a network watcher in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the network watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkWatcherInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, NetworkWatcherInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + return service.createOrUpdate(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified network watcher by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkWatcherInner object if successful. + */ + public NetworkWatcherInner getByResourceGroup(String resourceGroupName, String networkWatcherName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkWatcherName).toBlocking().single().body(); + } + + /** + * Gets the specified network watcher by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String networkWatcherName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkWatcherName), serviceCallback); + } + + /** + * Gets the specified network watcher by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkWatcherInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String networkWatcherName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkWatcherName).map(new Func1, NetworkWatcherInner>() { + @Override + public NetworkWatcherInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified network watcher by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkWatcherInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String networkWatcherName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.getByResourceGroup(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes the specified network watcher resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String networkWatcherName) { + deleteWithServiceResponseAsync(resourceGroupName, networkWatcherName).toBlocking().last().body(); + } + + /** + * Deletes the specified network watcher resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @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 networkWatcherName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, networkWatcherName), serviceCallback); + } + + /** + * Deletes the specified network watcher resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String networkWatcherName) { + return deleteWithServiceResponseAsync(resourceGroupName, networkWatcherName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified network watcher resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String networkWatcherName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + Observable> observable = service.delete(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified network watcher resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String networkWatcherName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, networkWatcherName).toBlocking().single().body(); + } + + /** + * Deletes the specified network watcher resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String networkWatcherName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, networkWatcherName), serviceCallback); + } + + /** + * Deletes the specified network watcher resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String networkWatcherName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, networkWatcherName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified network watcher resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String networkWatcherName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.beginDelete(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates a network watcher tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkWatcherInner object if successful. + */ + public NetworkWatcherInner updateTags(String resourceGroupName, String networkWatcherName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, networkWatcherName).toBlocking().single().body(); + } + + /** + * Updates a network watcher tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @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 updateTagsAsync(String resourceGroupName, String networkWatcherName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, networkWatcherName), serviceCallback); + } + + /** + * Updates a network watcher tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkWatcherInner object + */ + public Observable updateTagsAsync(String resourceGroupName, String networkWatcherName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, networkWatcherName).map(new Func1, NetworkWatcherInner>() { + @Override + public NetworkWatcherInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a network watcher tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkWatcherInner object + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String networkWatcherName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.updateTags(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates a network watcher tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkWatcherInner object if successful. + */ + public NetworkWatcherInner updateTags(String resourceGroupName, String networkWatcherName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, networkWatcherName, tags).toBlocking().single().body(); + } + + /** + * Updates a network watcher tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String networkWatcherName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, networkWatcherName, tags), serviceCallback); + } + + /** + * Updates a network watcher tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkWatcherInner object + */ + public Observable updateTagsAsync(String resourceGroupName, String networkWatcherName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, networkWatcherName, tags).map(new Func1, NetworkWatcherInner>() { + @Override + public NetworkWatcherInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a network watcher tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkWatcherInner object + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-06-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.updateTags(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all network watchers by resource group. + * + * @param resourceGroupName The name of the resource group. + * @return the PagedList object if successful. + */ + public PagedList listByResourceGroup(String resourceGroupName) { + PageImpl1 page = new PageImpl1<>(); + page.setItems(listByResourceGroupWithServiceResponseAsync(resourceGroupName).toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList(page) { + @Override + public Page nextPage(String nextPageLink) { + return null; + } + }; + } + + /** + * Gets all network watchers by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(String resourceGroupName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listByResourceGroupWithServiceResponseAsync(resourceGroupName), serviceCallback); + } + + /** + * Gets all network watchers by resource group. + * + * @param resourceGroupName The name of the resource group. + * @return the observable to the List<NetworkWatcherInner> object + */ + public Observable> listByResourceGroupAsync(String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName).map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + PageImpl1 page = new PageImpl1<>(); + page.setItems(response.body()); + return page; + } + }); + } + + /** + * Gets all network watchers by resource group. + * + * @param resourceGroupName The name of the resource group. + * @return the observable to the List<NetworkWatcherInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all network watchers by subscription. + * + * @return the PagedList object if successful. + */ + public PagedList list() { + PageImpl1 page = new PageImpl1<>(); + page.setItems(listWithServiceResponseAsync().toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList(page) { + @Override + public Page nextPage(String nextPageLink) { + return null; + } + }; + } + + /** + * Gets all network watchers by subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * Gets all network watchers by subscription. + * + * @return the observable to the List<NetworkWatcherInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync().map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + PageImpl1 page = new PageImpl1<>(); + page.setItems(response.body()); + return page; + } + }); + } + + /** + * Gets all network watchers by subscription. + * + * @return the observable to the List<NetworkWatcherInner> object + */ + public Observable>> listWithServiceResponseAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the current network topology by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the representation of topology. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TopologyInner object if successful. + */ + public TopologyInner getTopology(String resourceGroupName, String networkWatcherName, TopologyParameters parameters) { + return getTopologyWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().single().body(); + } + + /** + * Gets the current network topology by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the representation of topology. + * @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 getTopologyAsync(String resourceGroupName, String networkWatcherName, TopologyParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getTopologyWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * Gets the current network topology by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the representation of topology. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TopologyInner object + */ + public Observable getTopologyAsync(String resourceGroupName, String networkWatcherName, TopologyParameters parameters) { + return getTopologyWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, TopologyInner>() { + @Override + public TopologyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the current network topology by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the representation of topology. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TopologyInner object + */ + public Observable> getTopologyWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, TopologyParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + return service.getTopology(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getTopologyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getTopologyDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Verify IP flow from the specified VM to a location given the currently configured NSG rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the IP flow to be verified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VerificationIPFlowResultInner object if successful. + */ + public VerificationIPFlowResultInner verifyIPFlow(String resourceGroupName, String networkWatcherName, VerificationIPFlowParameters parameters) { + return verifyIPFlowWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().last().body(); + } + + /** + * Verify IP flow from the specified VM to a location given the currently configured NSG rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the IP flow to be verified. + * @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 verifyIPFlowAsync(String resourceGroupName, String networkWatcherName, VerificationIPFlowParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(verifyIPFlowWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * Verify IP flow from the specified VM to a location given the currently configured NSG rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the IP flow to be verified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable verifyIPFlowAsync(String resourceGroupName, String networkWatcherName, VerificationIPFlowParameters parameters) { + return verifyIPFlowWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, VerificationIPFlowResultInner>() { + @Override + public VerificationIPFlowResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Verify IP flow from the specified VM to a location given the currently configured NSG rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the IP flow to be verified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> verifyIPFlowWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, VerificationIPFlowParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + Observable> observable = service.verifyIPFlow(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Verify IP flow from the specified VM to a location given the currently configured NSG rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the IP flow to be verified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VerificationIPFlowResultInner object if successful. + */ + public VerificationIPFlowResultInner beginVerifyIPFlow(String resourceGroupName, String networkWatcherName, VerificationIPFlowParameters parameters) { + return beginVerifyIPFlowWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().single().body(); + } + + /** + * Verify IP flow from the specified VM to a location given the currently configured NSG rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the IP flow to be verified. + * @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 beginVerifyIPFlowAsync(String resourceGroupName, String networkWatcherName, VerificationIPFlowParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginVerifyIPFlowWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * Verify IP flow from the specified VM to a location given the currently configured NSG rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the IP flow to be verified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VerificationIPFlowResultInner object + */ + public Observable beginVerifyIPFlowAsync(String resourceGroupName, String networkWatcherName, VerificationIPFlowParameters parameters) { + return beginVerifyIPFlowWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, VerificationIPFlowResultInner>() { + @Override + public VerificationIPFlowResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Verify IP flow from the specified VM to a location given the currently configured NSG rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the IP flow to be verified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VerificationIPFlowResultInner object + */ + public Observable> beginVerifyIPFlowWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, VerificationIPFlowParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + return service.beginVerifyIPFlow(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginVerifyIPFlowDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginVerifyIPFlowDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the next hop from the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the source and destination endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NextHopResultInner object if successful. + */ + public NextHopResultInner getNextHop(String resourceGroupName, String networkWatcherName, NextHopParameters parameters) { + return getNextHopWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().last().body(); + } + + /** + * Gets the next hop from the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the source and destination endpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getNextHopAsync(String resourceGroupName, String networkWatcherName, NextHopParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getNextHopWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * Gets the next hop from the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the source and destination endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable getNextHopAsync(String resourceGroupName, String networkWatcherName, NextHopParameters parameters) { + return getNextHopWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, NextHopResultInner>() { + @Override + public NextHopResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the next hop from the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the source and destination endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> getNextHopWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, NextHopParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + Observable> observable = service.getNextHop(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Gets the next hop from the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the source and destination endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NextHopResultInner object if successful. + */ + public NextHopResultInner beginGetNextHop(String resourceGroupName, String networkWatcherName, NextHopParameters parameters) { + return beginGetNextHopWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().single().body(); + } + + /** + * Gets the next hop from the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the source and destination endpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginGetNextHopAsync(String resourceGroupName, String networkWatcherName, NextHopParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetNextHopWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * Gets the next hop from the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the source and destination endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NextHopResultInner object + */ + public Observable beginGetNextHopAsync(String resourceGroupName, String networkWatcherName, NextHopParameters parameters) { + return beginGetNextHopWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, NextHopResultInner>() { + @Override + public NextHopResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the next hop from the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the source and destination endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NextHopResultInner object + */ + public Observable> beginGetNextHopWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, NextHopParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + return service.beginGetNextHop(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGetNextHopDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGetNextHopDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the configured and effective security group rules on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param targetResourceId ID of the target VM. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SecurityGroupViewResultInner object if successful. + */ + public SecurityGroupViewResultInner getVMSecurityRules(String resourceGroupName, String networkWatcherName, String targetResourceId) { + return getVMSecurityRulesWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).toBlocking().last().body(); + } + + /** + * Gets the configured and effective security group rules on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param targetResourceId ID of the target VM. + * @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 getVMSecurityRulesAsync(String resourceGroupName, String networkWatcherName, String targetResourceId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getVMSecurityRulesWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId), serviceCallback); + } + + /** + * Gets the configured and effective security group rules on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param targetResourceId ID of the target VM. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable getVMSecurityRulesAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + return getVMSecurityRulesWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).map(new Func1, SecurityGroupViewResultInner>() { + @Override + public SecurityGroupViewResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the configured and effective security group rules on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param targetResourceId ID of the target VM. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> getVMSecurityRulesWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName 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 (targetResourceId == null) { + throw new IllegalArgumentException("Parameter targetResourceId is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + SecurityGroupViewParameters parameters = new SecurityGroupViewParameters(); + parameters.withTargetResourceId(targetResourceId); + Observable> observable = service.getVMSecurityRules(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Gets the configured and effective security group rules on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param targetResourceId ID of the target VM. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SecurityGroupViewResultInner object if successful. + */ + public SecurityGroupViewResultInner beginGetVMSecurityRules(String resourceGroupName, String networkWatcherName, String targetResourceId) { + return beginGetVMSecurityRulesWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).toBlocking().single().body(); + } + + /** + * Gets the configured and effective security group rules on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param targetResourceId ID of the target VM. + * @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 beginGetVMSecurityRulesAsync(String resourceGroupName, String networkWatcherName, String targetResourceId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetVMSecurityRulesWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId), serviceCallback); + } + + /** + * Gets the configured and effective security group rules on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param targetResourceId ID of the target VM. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecurityGroupViewResultInner object + */ + public Observable beginGetVMSecurityRulesAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + return beginGetVMSecurityRulesWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).map(new Func1, SecurityGroupViewResultInner>() { + @Override + public SecurityGroupViewResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the configured and effective security group rules on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param targetResourceId ID of the target VM. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecurityGroupViewResultInner object + */ + public Observable> beginGetVMSecurityRulesWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName 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 (targetResourceId == null) { + throw new IllegalArgumentException("Parameter targetResourceId is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + SecurityGroupViewParameters parameters = new SecurityGroupViewParameters(); + parameters.withTargetResourceId(targetResourceId); + return service.beginGetVMSecurityRules(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGetVMSecurityRulesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGetVMSecurityRulesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Initiate troubleshooting on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to troubleshoot. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TroubleshootingResultInner object if successful. + */ + public TroubleshootingResultInner getTroubleshooting(String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters) { + return getTroubleshootingWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().last().body(); + } + + /** + * Initiate troubleshooting on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to troubleshoot. + * @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 getTroubleshootingAsync(String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getTroubleshootingWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * Initiate troubleshooting on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to troubleshoot. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable getTroubleshootingAsync(String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters) { + return getTroubleshootingWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, TroubleshootingResultInner>() { + @Override + public TroubleshootingResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Initiate troubleshooting on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to troubleshoot. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> getTroubleshootingWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + Observable> observable = service.getTroubleshooting(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Initiate troubleshooting on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to troubleshoot. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TroubleshootingResultInner object if successful. + */ + public TroubleshootingResultInner beginGetTroubleshooting(String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters) { + return beginGetTroubleshootingWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().single().body(); + } + + /** + * Initiate troubleshooting on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to troubleshoot. + * @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 beginGetTroubleshootingAsync(String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetTroubleshootingWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * Initiate troubleshooting on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to troubleshoot. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TroubleshootingResultInner object + */ + public Observable beginGetTroubleshootingAsync(String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters) { + return beginGetTroubleshootingWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, TroubleshootingResultInner>() { + @Override + public TroubleshootingResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Initiate troubleshooting on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to troubleshoot. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TroubleshootingResultInner object + */ + public Observable> beginGetTroubleshootingWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + return service.beginGetTroubleshooting(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGetTroubleshootingDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGetTroubleshootingDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get the last completed troubleshooting result on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param targetResourceId The target resource ID to query the troubleshooting result. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TroubleshootingResultInner object if successful. + */ + public TroubleshootingResultInner getTroubleshootingResult(String resourceGroupName, String networkWatcherName, String targetResourceId) { + return getTroubleshootingResultWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).toBlocking().last().body(); + } + + /** + * Get the last completed troubleshooting result on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param targetResourceId The target resource ID to query the troubleshooting result. + * @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 getTroubleshootingResultAsync(String resourceGroupName, String networkWatcherName, String targetResourceId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getTroubleshootingResultWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId), serviceCallback); + } + + /** + * Get the last completed troubleshooting result on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param targetResourceId The target resource ID to query the troubleshooting result. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable getTroubleshootingResultAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + return getTroubleshootingResultWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).map(new Func1, TroubleshootingResultInner>() { + @Override + public TroubleshootingResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the last completed troubleshooting result on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param targetResourceId The target resource ID to query the troubleshooting result. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> getTroubleshootingResultWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName 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 (targetResourceId == null) { + throw new IllegalArgumentException("Parameter targetResourceId is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + QueryTroubleshootingParameters parameters = new QueryTroubleshootingParameters(); + parameters.withTargetResourceId(targetResourceId); + Observable> observable = service.getTroubleshootingResult(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Get the last completed troubleshooting result on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param targetResourceId The target resource ID to query the troubleshooting result. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TroubleshootingResultInner object if successful. + */ + public TroubleshootingResultInner beginGetTroubleshootingResult(String resourceGroupName, String networkWatcherName, String targetResourceId) { + return beginGetTroubleshootingResultWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).toBlocking().single().body(); + } + + /** + * Get the last completed troubleshooting result on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param targetResourceId The target resource ID to query the troubleshooting result. + * @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 beginGetTroubleshootingResultAsync(String resourceGroupName, String networkWatcherName, String targetResourceId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetTroubleshootingResultWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId), serviceCallback); + } + + /** + * Get the last completed troubleshooting result on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param targetResourceId The target resource ID to query the troubleshooting result. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TroubleshootingResultInner object + */ + public Observable beginGetTroubleshootingResultAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + return beginGetTroubleshootingResultWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).map(new Func1, TroubleshootingResultInner>() { + @Override + public TroubleshootingResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the last completed troubleshooting result on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param targetResourceId The target resource ID to query the troubleshooting result. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TroubleshootingResultInner object + */ + public Observable> beginGetTroubleshootingResultWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName 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 (targetResourceId == null) { + throw new IllegalArgumentException("Parameter targetResourceId is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + QueryTroubleshootingParameters parameters = new QueryTroubleshootingParameters(); + parameters.withTargetResourceId(targetResourceId); + return service.beginGetTroubleshootingResult(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGetTroubleshootingResultDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGetTroubleshootingResultDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Configures flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the configuration of flow log. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the FlowLogInformationInner object if successful. + */ + public FlowLogInformationInner setFlowLogConfiguration(String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters) { + return setFlowLogConfigurationWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().last().body(); + } + + /** + * Configures flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the configuration of flow log. + * @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 setFlowLogConfigurationAsync(String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(setFlowLogConfigurationWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * Configures flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the configuration of flow log. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable setFlowLogConfigurationAsync(String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters) { + return setFlowLogConfigurationWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, FlowLogInformationInner>() { + @Override + public FlowLogInformationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Configures flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the configuration of flow log. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> setFlowLogConfigurationWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + Observable> observable = service.setFlowLogConfiguration(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Configures flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the configuration of flow log. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the FlowLogInformationInner object if successful. + */ + public FlowLogInformationInner beginSetFlowLogConfiguration(String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters) { + return beginSetFlowLogConfigurationWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().single().body(); + } + + /** + * Configures flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the configuration of flow log. + * @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 beginSetFlowLogConfigurationAsync(String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginSetFlowLogConfigurationWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * Configures flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the configuration of flow log. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FlowLogInformationInner object + */ + public Observable beginSetFlowLogConfigurationAsync(String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters) { + return beginSetFlowLogConfigurationWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, FlowLogInformationInner>() { + @Override + public FlowLogInformationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Configures flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the configuration of flow log. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FlowLogInformationInner object + */ + public Observable> beginSetFlowLogConfigurationWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + return service.beginSetFlowLogConfiguration(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginSetFlowLogConfigurationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginSetFlowLogConfigurationDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Queries status of flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param targetResourceId The target resource where getting the flow log and traffic analytics (optional) status. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the FlowLogInformationInner object if successful. + */ + public FlowLogInformationInner getFlowLogStatus(String resourceGroupName, String networkWatcherName, String targetResourceId) { + return getFlowLogStatusWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).toBlocking().last().body(); + } + + /** + * Queries status of flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param targetResourceId The target resource where getting the flow log and traffic analytics (optional) status. + * @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 getFlowLogStatusAsync(String resourceGroupName, String networkWatcherName, String targetResourceId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getFlowLogStatusWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId), serviceCallback); + } + + /** + * Queries status of flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param targetResourceId The target resource where getting the flow log and traffic analytics (optional) status. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable getFlowLogStatusAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + return getFlowLogStatusWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).map(new Func1, FlowLogInformationInner>() { + @Override + public FlowLogInformationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Queries status of flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param targetResourceId The target resource where getting the flow log and traffic analytics (optional) status. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> getFlowLogStatusWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName 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 (targetResourceId == null) { + throw new IllegalArgumentException("Parameter targetResourceId is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + FlowLogStatusParameters parameters = new FlowLogStatusParameters(); + parameters.withTargetResourceId(targetResourceId); + Observable> observable = service.getFlowLogStatus(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Queries status of flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param targetResourceId The target resource where getting the flow log and traffic analytics (optional) status. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the FlowLogInformationInner object if successful. + */ + public FlowLogInformationInner beginGetFlowLogStatus(String resourceGroupName, String networkWatcherName, String targetResourceId) { + return beginGetFlowLogStatusWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).toBlocking().single().body(); + } + + /** + * Queries status of flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param targetResourceId The target resource where getting the flow log and traffic analytics (optional) status. + * @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 beginGetFlowLogStatusAsync(String resourceGroupName, String networkWatcherName, String targetResourceId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetFlowLogStatusWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId), serviceCallback); + } + + /** + * Queries status of flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param targetResourceId The target resource where getting the flow log and traffic analytics (optional) status. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FlowLogInformationInner object + */ + public Observable beginGetFlowLogStatusAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + return beginGetFlowLogStatusWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).map(new Func1, FlowLogInformationInner>() { + @Override + public FlowLogInformationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Queries status of flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param targetResourceId The target resource where getting the flow log and traffic analytics (optional) status. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FlowLogInformationInner object + */ + public Observable> beginGetFlowLogStatusWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName 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 (targetResourceId == null) { + throw new IllegalArgumentException("Parameter targetResourceId is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + FlowLogStatusParameters parameters = new FlowLogStatusParameters(); + parameters.withTargetResourceId(targetResourceId); + return service.beginGetFlowLogStatus(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGetFlowLogStatusDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGetFlowLogStatusDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine how the connectivity check will be performed. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ConnectivityInformationInner object if successful. + */ + public ConnectivityInformationInner checkConnectivity(String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters) { + return checkConnectivityWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().last().body(); + } + + /** + * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine how the connectivity check will be performed. + * @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 checkConnectivityAsync(String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkConnectivityWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine how the connectivity check will be performed. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable checkConnectivityAsync(String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters) { + return checkConnectivityWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, ConnectivityInformationInner>() { + @Override + public ConnectivityInformationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine how the connectivity check will be performed. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> checkConnectivityWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + Observable> observable = service.checkConnectivity(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine how the connectivity check will be performed. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ConnectivityInformationInner object if successful. + */ + public ConnectivityInformationInner beginCheckConnectivity(String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters) { + return beginCheckConnectivityWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().single().body(); + } + + /** + * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine how the connectivity check will be performed. + * @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 beginCheckConnectivityAsync(String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCheckConnectivityWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine how the connectivity check will be performed. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConnectivityInformationInner object + */ + public Observable beginCheckConnectivityAsync(String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters) { + return beginCheckConnectivityWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, ConnectivityInformationInner>() { + @Override + public ConnectivityInformationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine how the connectivity check will be performed. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConnectivityInformationInner object + */ + public Observable> beginCheckConnectivityWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + return service.beginCheckConnectivity(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCheckConnectivityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCheckConnectivityDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the relative latency score for internet service providers from a specified location to Azure regions. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine Azure reachability report configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AzureReachabilityReportInner object if successful. + */ + public AzureReachabilityReportInner getAzureReachabilityReport(String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters) { + return getAzureReachabilityReportWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().last().body(); + } + + /** + * Gets the relative latency score for internet service providers from a specified location to Azure regions. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine Azure reachability report configuration. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAzureReachabilityReportAsync(String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getAzureReachabilityReportWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * Gets the relative latency score for internet service providers from a specified location to Azure regions. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine Azure reachability report configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable getAzureReachabilityReportAsync(String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters) { + return getAzureReachabilityReportWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, AzureReachabilityReportInner>() { + @Override + public AzureReachabilityReportInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the relative latency score for internet service providers from a specified location to Azure regions. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine Azure reachability report configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> getAzureReachabilityReportWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + Observable> observable = service.getAzureReachabilityReport(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Gets the relative latency score for internet service providers from a specified location to Azure regions. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine Azure reachability report configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AzureReachabilityReportInner object if successful. + */ + public AzureReachabilityReportInner beginGetAzureReachabilityReport(String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters) { + return beginGetAzureReachabilityReportWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().single().body(); + } + + /** + * Gets the relative latency score for internet service providers from a specified location to Azure regions. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine Azure reachability report configuration. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginGetAzureReachabilityReportAsync(String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetAzureReachabilityReportWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * Gets the relative latency score for internet service providers from a specified location to Azure regions. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine Azure reachability report configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AzureReachabilityReportInner object + */ + public Observable beginGetAzureReachabilityReportAsync(String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters) { + return beginGetAzureReachabilityReportWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, AzureReachabilityReportInner>() { + @Override + public AzureReachabilityReportInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the relative latency score for internet service providers from a specified location to Azure regions. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine Azure reachability report configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AzureReachabilityReportInner object + */ + public Observable> beginGetAzureReachabilityReportWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + return service.beginGetAzureReachabilityReport(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGetAzureReachabilityReportDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGetAzureReachabilityReportDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all available internet service providers for a specified Azure region. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that scope the list of available providers. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AvailableProvidersListInner object if successful. + */ + public AvailableProvidersListInner listAvailableProviders(String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters) { + return listAvailableProvidersWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().last().body(); + } + + /** + * Lists all available internet service providers for a specified Azure region. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that scope the list of available providers. + * @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 listAvailableProvidersAsync(String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listAvailableProvidersWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * Lists all available internet service providers for a specified Azure region. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that scope the list of available providers. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable listAvailableProvidersAsync(String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters) { + return listAvailableProvidersWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, AvailableProvidersListInner>() { + @Override + public AvailableProvidersListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists all available internet service providers for a specified Azure region. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that scope the list of available providers. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> listAvailableProvidersWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + Observable> observable = service.listAvailableProviders(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Lists all available internet service providers for a specified Azure region. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that scope the list of available providers. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AvailableProvidersListInner object if successful. + */ + public AvailableProvidersListInner beginListAvailableProviders(String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters) { + return beginListAvailableProvidersWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().single().body(); + } + + /** + * Lists all available internet service providers for a specified Azure region. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that scope the list of available providers. + * @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 beginListAvailableProvidersAsync(String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginListAvailableProvidersWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters), serviceCallback); + } + + /** + * Lists all available internet service providers for a specified Azure region. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that scope the list of available providers. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AvailableProvidersListInner object + */ + public Observable beginListAvailableProvidersAsync(String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters) { + return beginListAvailableProvidersWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1, AvailableProvidersListInner>() { + @Override + public AvailableProvidersListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists all available internet service providers for a specified Azure region. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that scope the list of available providers. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AvailableProvidersListInner object + */ + public Observable> beginListAvailableProvidersWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + return service.beginListAvailableProviders(resourceGroupName, networkWatcherName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginListAvailableProvidersDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginListAvailableProvidersDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NextHopResultImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NextHopResultImpl.java new file mode 100644 index 000000000000..9632002b982f --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NextHopResultImpl.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.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.NextHopResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_06_01.NextHopType; + +class NextHopResultImpl extends WrapperImpl implements NextHopResult { + private final NetworkManager manager; + NextHopResultImpl(NextHopResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public String nextHopIpAddress() { + return this.inner().nextHopIpAddress(); + } + + @Override + public NextHopType nextHopType() { + return this.inner().nextHopType(); + } + + @Override + public String routeTableId() { + return this.inner().routeTableId(); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NextHopResultInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NextHopResultInner.java new file mode 100644 index 000000000000..7af2d0f92777 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NextHopResultInner.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.NextHopType; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The information about next hop from the specified VM. + */ +public class NextHopResultInner { + /** + * Next hop type. Possible values include: 'Internet', 'VirtualAppliance', + * 'VirtualNetworkGateway', 'VnetLocal', 'HyperNetGateway', 'None'. + */ + @JsonProperty(value = "nextHopType") + private NextHopType nextHopType; + + /** + * Next hop IP Address. + */ + @JsonProperty(value = "nextHopIpAddress") + private String nextHopIpAddress; + + /** + * The resource identifier for the route table associated with the route + * being returned. If the route being returned does not correspond to any + * user created routes then this field will be the string 'System Route'. + */ + @JsonProperty(value = "routeTableId") + private String routeTableId; + + /** + * Get next hop type. Possible values include: 'Internet', 'VirtualAppliance', 'VirtualNetworkGateway', 'VnetLocal', 'HyperNetGateway', 'None'. + * + * @return the nextHopType value + */ + public NextHopType nextHopType() { + return this.nextHopType; + } + + /** + * Set next hop type. Possible values include: 'Internet', 'VirtualAppliance', 'VirtualNetworkGateway', 'VnetLocal', 'HyperNetGateway', 'None'. + * + * @param nextHopType the nextHopType value to set + * @return the NextHopResultInner object itself. + */ + public NextHopResultInner withNextHopType(NextHopType nextHopType) { + this.nextHopType = nextHopType; + return this; + } + + /** + * Get next hop IP Address. + * + * @return the nextHopIpAddress value + */ + public String nextHopIpAddress() { + return this.nextHopIpAddress; + } + + /** + * Set next hop IP Address. + * + * @param nextHopIpAddress the nextHopIpAddress value to set + * @return the NextHopResultInner object itself. + */ + public NextHopResultInner withNextHopIpAddress(String nextHopIpAddress) { + this.nextHopIpAddress = nextHopIpAddress; + return this; + } + + /** + * Get the resource identifier for the route table associated with the route being returned. If the route being returned does not correspond to any user created routes then this field will be the string 'System Route'. + * + * @return the routeTableId value + */ + public String routeTableId() { + return this.routeTableId; + } + + /** + * Set the resource identifier for the route table associated with the route being returned. If the route being returned does not correspond to any user created routes then this field will be the string 'System Route'. + * + * @param routeTableId the routeTableId value to set + * @return the NextHopResultInner object itself. + */ + public NextHopResultInner withRouteTableId(String routeTableId) { + this.routeTableId = routeTableId; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/OperationImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/OperationImpl.java new file mode 100644 index 000000000000..36c9f6af3c23 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/OperationImpl.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.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.Operation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_06_01.OperationDisplay; +import com.microsoft.azure.management.network.v2018_06_01.OperationPropertiesFormatServiceSpecification; + +class OperationImpl extends WrapperImpl implements Operation { + private final NetworkManager manager; + OperationImpl(OperationInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public OperationDisplay display() { + return this.inner().display(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String origin() { + return this.inner().origin(); + } + + @Override + public OperationPropertiesFormatServiceSpecification serviceSpecification() { + return this.inner().serviceSpecification(); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/OperationInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/OperationInner.java new file mode 100644 index 000000000000..d3360c334976 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/OperationInner.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.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.OperationDisplay; +import com.microsoft.azure.management.network.v2018_06_01.OperationPropertiesFormatServiceSpecification; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Network REST API operation definition. + */ +@JsonFlatten +public class OperationInner { + /** + * Operation name: {provider}/{resource}/{operation}. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Display metadata associated with the operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /** + * Origin of the operation. + */ + @JsonProperty(value = "origin") + private String origin; + + /** + * Specification of the service. + */ + @JsonProperty(value = "properties.serviceSpecification") + private OperationPropertiesFormatServiceSpecification serviceSpecification; + + /** + * Get operation name: {provider}/{resource}/{operation}. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set operation name: {provider}/{resource}/{operation}. + * + * @param name the name value to set + * @return the OperationInner object itself. + */ + public OperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get display metadata associated with the operation. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set display metadata associated with the operation. + * + * @param display the display value to set + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get origin of the operation. + * + * @return the origin value + */ + public String origin() { + return this.origin; + } + + /** + * Set origin of the operation. + * + * @param origin the origin value to set + * @return the OperationInner object itself. + */ + public OperationInner withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get specification of the service. + * + * @return the serviceSpecification value + */ + public OperationPropertiesFormatServiceSpecification serviceSpecification() { + return this.serviceSpecification; + } + + /** + * Set specification of the service. + * + * @param serviceSpecification the serviceSpecification value to set + * @return the OperationInner object itself. + */ + public OperationInner withServiceSpecification(OperationPropertiesFormatServiceSpecification serviceSpecification) { + this.serviceSpecification = serviceSpecification; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/OperationsImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/OperationsImpl.java new file mode 100644 index 000000000000..1798d7a0f0f7 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/OperationsImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_06_01.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_06_01.Operation; + +class OperationsImpl extends WrapperImpl implements Operations { + private final NetworkManager manager; + + OperationsImpl(NetworkManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Operation call(OperationInner inner) { + return new OperationImpl(inner, manager()); + } + }); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/OperationsInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/OperationsInner.java new file mode 100644 index 000000000000..b652173c952c --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/OperationsInner.java @@ -0,0 +1,281 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.Operations list" }) + @GET("providers/Microsoft.Network/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the available Network Rest API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available Network Rest API operations. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available Network Rest API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available Network Rest API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the available Network Rest API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + final String apiVersion = "2018-06-01"; + return service.list(apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all of the available Network Rest API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available Network Rest API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available Network Rest API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available Network Rest API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the available Network Rest API operations. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/PacketCaptureInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/PacketCaptureInner.java new file mode 100644 index 000000000000..ff2c6f392029 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/PacketCaptureInner.java @@ -0,0 +1,178 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.PacketCaptureStorageLocation; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.PacketCaptureFilter; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Parameters that define the create packet capture operation. + */ +@JsonFlatten +public class PacketCaptureInner { + /** + * The ID of the targeted resource, only VM is currently supported. + */ + @JsonProperty(value = "properties.target", required = true) + private String target; + + /** + * Number of bytes captured per packet, the remaining bytes are truncated. + */ + @JsonProperty(value = "properties.bytesToCapturePerPacket") + private Integer bytesToCapturePerPacket; + + /** + * Maximum size of the capture output. + */ + @JsonProperty(value = "properties.totalBytesPerSession") + private Integer totalBytesPerSession; + + /** + * Maximum duration of the capture session in seconds. + */ + @JsonProperty(value = "properties.timeLimitInSeconds") + private Integer timeLimitInSeconds; + + /** + * The storageLocation property. + */ + @JsonProperty(value = "properties.storageLocation", required = true) + private PacketCaptureStorageLocation storageLocation; + + /** + * The filters property. + */ + @JsonProperty(value = "properties.filters") + private List filters; + + /** + * Get the ID of the targeted resource, only VM is currently supported. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Set the ID of the targeted resource, only VM is currently supported. + * + * @param target the target value to set + * @return the PacketCaptureInner object itself. + */ + public PacketCaptureInner withTarget(String target) { + this.target = target; + return this; + } + + /** + * Get number of bytes captured per packet, the remaining bytes are truncated. + * + * @return the bytesToCapturePerPacket value + */ + public Integer bytesToCapturePerPacket() { + return this.bytesToCapturePerPacket; + } + + /** + * Set number of bytes captured per packet, the remaining bytes are truncated. + * + * @param bytesToCapturePerPacket the bytesToCapturePerPacket value to set + * @return the PacketCaptureInner object itself. + */ + public PacketCaptureInner withBytesToCapturePerPacket(Integer bytesToCapturePerPacket) { + this.bytesToCapturePerPacket = bytesToCapturePerPacket; + return this; + } + + /** + * Get maximum size of the capture output. + * + * @return the totalBytesPerSession value + */ + public Integer totalBytesPerSession() { + return this.totalBytesPerSession; + } + + /** + * Set maximum size of the capture output. + * + * @param totalBytesPerSession the totalBytesPerSession value to set + * @return the PacketCaptureInner object itself. + */ + public PacketCaptureInner withTotalBytesPerSession(Integer totalBytesPerSession) { + this.totalBytesPerSession = totalBytesPerSession; + return this; + } + + /** + * Get maximum duration of the capture session in seconds. + * + * @return the timeLimitInSeconds value + */ + public Integer timeLimitInSeconds() { + return this.timeLimitInSeconds; + } + + /** + * Set maximum duration of the capture session in seconds. + * + * @param timeLimitInSeconds the timeLimitInSeconds value to set + * @return the PacketCaptureInner object itself. + */ + public PacketCaptureInner withTimeLimitInSeconds(Integer timeLimitInSeconds) { + this.timeLimitInSeconds = timeLimitInSeconds; + return this; + } + + /** + * Get the storageLocation value. + * + * @return the storageLocation value + */ + public PacketCaptureStorageLocation storageLocation() { + return this.storageLocation; + } + + /** + * Set the storageLocation value. + * + * @param storageLocation the storageLocation value to set + * @return the PacketCaptureInner object itself. + */ + public PacketCaptureInner withStorageLocation(PacketCaptureStorageLocation storageLocation) { + this.storageLocation = storageLocation; + return this; + } + + /** + * Get the filters value. + * + * @return the filters value + */ + public List filters() { + return this.filters; + } + + /** + * Set the filters value. + * + * @param filters the filters value to set + * @return the PacketCaptureInner object itself. + */ + public PacketCaptureInner withFilters(List filters) { + this.filters = filters; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/PacketCaptureQueryStatusResultImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/PacketCaptureQueryStatusResultImpl.java new file mode 100644 index 000000000000..0baa0166d72e --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/PacketCaptureQueryStatusResultImpl.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.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.PacketCaptureQueryStatusResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.PcError; +import com.microsoft.azure.management.network.v2018_06_01.PcStatus; + +class PacketCaptureQueryStatusResultImpl extends WrapperImpl implements PacketCaptureQueryStatusResult { + private final NetworkManager manager; + PacketCaptureQueryStatusResultImpl(PacketCaptureQueryStatusResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public DateTime captureStartTime() { + return this.inner().captureStartTime(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List packetCaptureError() { + return this.inner().packetCaptureError(); + } + + @Override + public PcStatus packetCaptureStatus() { + return this.inner().packetCaptureStatus(); + } + + @Override + public String stopReason() { + return this.inner().stopReason(); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/PacketCaptureQueryStatusResultInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/PacketCaptureQueryStatusResultInner.java new file mode 100644 index 000000000000..e4b5cc5e5462 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/PacketCaptureQueryStatusResultInner.java @@ -0,0 +1,178 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import org.joda.time.DateTime; +import com.microsoft.azure.management.network.v2018_06_01.PcStatus; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.PcError; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Status of packet capture session. + */ +public class PacketCaptureQueryStatusResultInner { + /** + * The name of the packet capture resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The ID of the packet capture resource. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The start time of the packet capture session. + */ + @JsonProperty(value = "captureStartTime") + private DateTime captureStartTime; + + /** + * The status of the packet capture session. Possible values include: + * 'NotStarted', 'Running', 'Stopped', 'Error', 'Unknown'. + */ + @JsonProperty(value = "packetCaptureStatus") + private PcStatus packetCaptureStatus; + + /** + * The reason the current packet capture session was stopped. + */ + @JsonProperty(value = "stopReason") + private String stopReason; + + /** + * List of errors of packet capture session. + */ + @JsonProperty(value = "packetCaptureError") + private List packetCaptureError; + + /** + * Get the name of the packet capture resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the packet capture resource. + * + * @param name the name value to set + * @return the PacketCaptureQueryStatusResultInner object itself. + */ + public PacketCaptureQueryStatusResultInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the ID of the packet capture resource. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the ID of the packet capture resource. + * + * @param id the id value to set + * @return the PacketCaptureQueryStatusResultInner object itself. + */ + public PacketCaptureQueryStatusResultInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the start time of the packet capture session. + * + * @return the captureStartTime value + */ + public DateTime captureStartTime() { + return this.captureStartTime; + } + + /** + * Set the start time of the packet capture session. + * + * @param captureStartTime the captureStartTime value to set + * @return the PacketCaptureQueryStatusResultInner object itself. + */ + public PacketCaptureQueryStatusResultInner withCaptureStartTime(DateTime captureStartTime) { + this.captureStartTime = captureStartTime; + return this; + } + + /** + * Get the status of the packet capture session. Possible values include: 'NotStarted', 'Running', 'Stopped', 'Error', 'Unknown'. + * + * @return the packetCaptureStatus value + */ + public PcStatus packetCaptureStatus() { + return this.packetCaptureStatus; + } + + /** + * Set the status of the packet capture session. Possible values include: 'NotStarted', 'Running', 'Stopped', 'Error', 'Unknown'. + * + * @param packetCaptureStatus the packetCaptureStatus value to set + * @return the PacketCaptureQueryStatusResultInner object itself. + */ + public PacketCaptureQueryStatusResultInner withPacketCaptureStatus(PcStatus packetCaptureStatus) { + this.packetCaptureStatus = packetCaptureStatus; + return this; + } + + /** + * Get the reason the current packet capture session was stopped. + * + * @return the stopReason value + */ + public String stopReason() { + return this.stopReason; + } + + /** + * Set the reason the current packet capture session was stopped. + * + * @param stopReason the stopReason value to set + * @return the PacketCaptureQueryStatusResultInner object itself. + */ + public PacketCaptureQueryStatusResultInner withStopReason(String stopReason) { + this.stopReason = stopReason; + return this; + } + + /** + * Get list of errors of packet capture session. + * + * @return the packetCaptureError value + */ + public List packetCaptureError() { + return this.packetCaptureError; + } + + /** + * Set list of errors of packet capture session. + * + * @param packetCaptureError the packetCaptureError value to set + * @return the PacketCaptureQueryStatusResultInner object itself. + */ + public PacketCaptureQueryStatusResultInner withPacketCaptureError(List packetCaptureError) { + this.packetCaptureError = packetCaptureError; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/PacketCaptureResultImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/PacketCaptureResultImpl.java new file mode 100644 index 000000000000..260fed446c67 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/PacketCaptureResultImpl.java @@ -0,0 +1,190 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.PacketCaptureResult; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_06_01.PacketCaptureStorageLocation; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.PacketCaptureFilter; +import com.microsoft.azure.management.network.v2018_06_01.ProvisioningState; +import rx.functions.Func1; + +class PacketCaptureResultImpl extends CreatableUpdatableImpl implements PacketCaptureResult, PacketCaptureResult.Definition, PacketCaptureResult.Update { + private final NetworkManager manager; + private String resourceGroupName; + private String networkWatcherName; + private String packetCaptureName; + private PacketCaptureInner createOrUpdateParameter; + + PacketCaptureResultImpl(String name, NetworkManager manager) { + super(name, new PacketCaptureResultInner()); + this.manager = manager; + // Set resource name + this.packetCaptureName = name; + // + this.createOrUpdateParameter = new PacketCaptureInner(); + } + + PacketCaptureResultImpl(PacketCaptureResultInner inner, NetworkManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.packetCaptureName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.networkWatcherName = IdParsingUtils.getValueFromIdByName(inner.id(), "networkWatchers"); + this.packetCaptureName = IdParsingUtils.getValueFromIdByName(inner.id(), "packetCaptures"); + // + this.createOrUpdateParameter = new PacketCaptureInner(); + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + PacketCapturesInner client = this.manager().inner().packetCaptures(); + return client.createAsync(this.resourceGroupName, this.networkWatcherName, this.packetCaptureName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public PacketCaptureResultInner call(PacketCaptureResultInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + PacketCapturesInner client = this.manager().inner().packetCaptures(); + return client.createAsync(this.resourceGroupName, this.networkWatcherName, this.packetCaptureName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public PacketCaptureResultInner call(PacketCaptureResultInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + PacketCapturesInner client = this.manager().inner().packetCaptures(); + return client.getAsync(this.resourceGroupName, this.networkWatcherName, this.packetCaptureName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createOrUpdateParameter = new PacketCaptureInner(); + } + + @Override + public Integer bytesToCapturePerPacket() { + return this.inner().bytesToCapturePerPacket(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public List filters() { + return this.inner().filters(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public PacketCaptureStorageLocation storageLocation() { + return this.inner().storageLocation(); + } + + @Override + public String target() { + return this.inner().target(); + } + + @Override + public Integer timeLimitInSeconds() { + return this.inner().timeLimitInSeconds(); + } + + @Override + public Integer totalBytesPerSession() { + return this.inner().totalBytesPerSession(); + } + + @Override + public PacketCaptureResultImpl withExistingNetworkWatcher(String resourceGroupName, String networkWatcherName) { + this.resourceGroupName = resourceGroupName; + this.networkWatcherName = networkWatcherName; + return this; + } + + @Override + public PacketCaptureResultImpl withStorageLocation(PacketCaptureStorageLocation storageLocation) { + this.createOrUpdateParameter.withStorageLocation(storageLocation); + return this; + } + + @Override + public PacketCaptureResultImpl withTarget(String target) { + this.createOrUpdateParameter.withTarget(target); + return this; + } + + @Override + public PacketCaptureResultImpl withBytesToCapturePerPacket(Integer bytesToCapturePerPacket) { + this.createOrUpdateParameter.withBytesToCapturePerPacket(bytesToCapturePerPacket); + return this; + } + + @Override + public PacketCaptureResultImpl withFilters(List filters) { + this.createOrUpdateParameter.withFilters(filters); + return this; + } + + @Override + public PacketCaptureResultImpl withTimeLimitInSeconds(Integer timeLimitInSeconds) { + this.createOrUpdateParameter.withTimeLimitInSeconds(timeLimitInSeconds); + return this; + } + + @Override + public PacketCaptureResultImpl withTotalBytesPerSession(Integer totalBytesPerSession) { + this.createOrUpdateParameter.withTotalBytesPerSession(totalBytesPerSession); + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/PacketCaptureResultInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/PacketCaptureResultInner.java new file mode 100644 index 000000000000..9e1d7fb4042b --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/PacketCaptureResultInner.java @@ -0,0 +1,262 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.PacketCaptureStorageLocation; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.PacketCaptureFilter; +import com.microsoft.azure.management.network.v2018_06_01.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Information about packet capture session. + */ +@JsonFlatten +public class PacketCaptureResultInner { + /** + * Name of the packet capture session. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * ID of the packet capture operation. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * The etag property. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * The ID of the targeted resource, only VM is currently supported. + */ + @JsonProperty(value = "properties.target", required = true) + private String target; + + /** + * Number of bytes captured per packet, the remaining bytes are truncated. + */ + @JsonProperty(value = "properties.bytesToCapturePerPacket") + private Integer bytesToCapturePerPacket; + + /** + * Maximum size of the capture output. + */ + @JsonProperty(value = "properties.totalBytesPerSession") + private Integer totalBytesPerSession; + + /** + * Maximum duration of the capture session in seconds. + */ + @JsonProperty(value = "properties.timeLimitInSeconds") + private Integer timeLimitInSeconds; + + /** + * The storageLocation property. + */ + @JsonProperty(value = "properties.storageLocation", required = true) + private PacketCaptureStorageLocation storageLocation; + + /** + * The filters property. + */ + @JsonProperty(value = "properties.filters") + private List filters; + + /** + * The provisioning state of the packet capture session. Possible values + * include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningState provisioningState; + + /** + * Get name of the packet capture session. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get iD of the packet capture operation. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get the etag value. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag value. + * + * @param etag the etag value to set + * @return the PacketCaptureResultInner object itself. + */ + public PacketCaptureResultInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get the ID of the targeted resource, only VM is currently supported. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Set the ID of the targeted resource, only VM is currently supported. + * + * @param target the target value to set + * @return the PacketCaptureResultInner object itself. + */ + public PacketCaptureResultInner withTarget(String target) { + this.target = target; + return this; + } + + /** + * Get number of bytes captured per packet, the remaining bytes are truncated. + * + * @return the bytesToCapturePerPacket value + */ + public Integer bytesToCapturePerPacket() { + return this.bytesToCapturePerPacket; + } + + /** + * Set number of bytes captured per packet, the remaining bytes are truncated. + * + * @param bytesToCapturePerPacket the bytesToCapturePerPacket value to set + * @return the PacketCaptureResultInner object itself. + */ + public PacketCaptureResultInner withBytesToCapturePerPacket(Integer bytesToCapturePerPacket) { + this.bytesToCapturePerPacket = bytesToCapturePerPacket; + return this; + } + + /** + * Get maximum size of the capture output. + * + * @return the totalBytesPerSession value + */ + public Integer totalBytesPerSession() { + return this.totalBytesPerSession; + } + + /** + * Set maximum size of the capture output. + * + * @param totalBytesPerSession the totalBytesPerSession value to set + * @return the PacketCaptureResultInner object itself. + */ + public PacketCaptureResultInner withTotalBytesPerSession(Integer totalBytesPerSession) { + this.totalBytesPerSession = totalBytesPerSession; + return this; + } + + /** + * Get maximum duration of the capture session in seconds. + * + * @return the timeLimitInSeconds value + */ + public Integer timeLimitInSeconds() { + return this.timeLimitInSeconds; + } + + /** + * Set maximum duration of the capture session in seconds. + * + * @param timeLimitInSeconds the timeLimitInSeconds value to set + * @return the PacketCaptureResultInner object itself. + */ + public PacketCaptureResultInner withTimeLimitInSeconds(Integer timeLimitInSeconds) { + this.timeLimitInSeconds = timeLimitInSeconds; + return this; + } + + /** + * Get the storageLocation value. + * + * @return the storageLocation value + */ + public PacketCaptureStorageLocation storageLocation() { + return this.storageLocation; + } + + /** + * Set the storageLocation value. + * + * @param storageLocation the storageLocation value to set + * @return the PacketCaptureResultInner object itself. + */ + public PacketCaptureResultInner withStorageLocation(PacketCaptureStorageLocation storageLocation) { + this.storageLocation = storageLocation; + return this; + } + + /** + * Get the filters value. + * + * @return the filters value + */ + public List filters() { + return this.filters; + } + + /** + * Set the filters value. + * + * @param filters the filters value to set + * @return the PacketCaptureResultInner object itself. + */ + public PacketCaptureResultInner withFilters(List filters) { + this.filters = filters; + return this; + } + + /** + * Get the provisioning state of the packet capture session. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the packet capture session. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the PacketCaptureResultInner object itself. + */ + public PacketCaptureResultInner withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/PacketCapturesImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/PacketCapturesImpl.java new file mode 100644 index 000000000000..f4fe16b87b50 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/PacketCapturesImpl.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_06_01.PacketCaptures; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.PacketCaptureQueryStatusResult; +import com.microsoft.azure.management.network.v2018_06_01.PacketCaptureResult; + +class PacketCapturesImpl extends WrapperImpl implements PacketCaptures { + private final NetworkManager manager; + + PacketCapturesImpl(NetworkManager manager) { + super(manager.inner().packetCaptures()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public PacketCaptureResultImpl define(String name) { + return wrapModel(name); + } + + private PacketCaptureResultImpl wrapModel(PacketCaptureResultInner inner) { + return new PacketCaptureResultImpl(inner, manager()); + } + + private PacketCaptureResultImpl wrapModel(String name) { + return new PacketCaptureResultImpl(name, this.manager()); + } + + @Override + public Completable stopAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + PacketCapturesInner client = this.inner(); + return client.stopAsync(resourceGroupName, networkWatcherName, packetCaptureName).toCompletable(); + } + + @Override + public Observable getStatusAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + PacketCapturesInner client = this.inner(); + return client.getStatusAsync(resourceGroupName, networkWatcherName, packetCaptureName) + .map(new Func1() { + @Override + public PacketCaptureQueryStatusResult call(PacketCaptureQueryStatusResultInner inner) { + return new PacketCaptureQueryStatusResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync(String resourceGroupName, String networkWatcherName) { + PacketCapturesInner client = this.inner(); + return client.listAsync(resourceGroupName, networkWatcherName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public PacketCaptureResult call(PacketCaptureResultInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + PacketCapturesInner client = this.inner(); + return client.getAsync(resourceGroupName, networkWatcherName, packetCaptureName) + .map(new Func1() { + @Override + public PacketCaptureResult call(PacketCaptureResultInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + PacketCapturesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, networkWatcherName, packetCaptureName).toCompletable(); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/PacketCapturesInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/PacketCapturesInner.java new file mode 100644 index 000000000000..4f02bd28df55 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/PacketCapturesInner.java @@ -0,0 +1,957 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in PacketCaptures. + */ +public class PacketCapturesInner { + /** The Retrofit service to perform REST calls. */ + private PacketCapturesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of PacketCapturesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PacketCapturesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(PacketCapturesService.class); + this.client = client; + } + + /** + * The interface defining all the services for PacketCaptures to be + * used by Retrofit to perform actually REST calls. + */ + interface PacketCapturesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.PacketCaptures create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}") + Observable> create(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("packetCaptureName") String packetCaptureName, @Path("subscriptionId") String subscriptionId, @Body PacketCaptureInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.PacketCaptures beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}") + Observable> beginCreate(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("packetCaptureName") String packetCaptureName, @Path("subscriptionId") String subscriptionId, @Body PacketCaptureInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.PacketCaptures get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("packetCaptureName") String packetCaptureName, @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.network.v2018_06_01.PacketCaptures delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("packetCaptureName") String packetCaptureName, @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.network.v2018_06_01.PacketCaptures beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("packetCaptureName") String packetCaptureName, @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.network.v2018_06_01.PacketCaptures stop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/stop") + Observable> stop(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("packetCaptureName") String packetCaptureName, @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.network.v2018_06_01.PacketCaptures beginStop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/stop") + Observable> beginStop(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("packetCaptureName") String packetCaptureName, @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.network.v2018_06_01.PacketCaptures getStatus" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/queryStatus") + Observable> getStatus(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("packetCaptureName") String packetCaptureName, @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.network.v2018_06_01.PacketCaptures beginGetStatus" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/queryStatus") + Observable> beginGetStatus(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("packetCaptureName") String packetCaptureName, @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.network.v2018_06_01.PacketCaptures list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Create and start a packet capture on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param parameters Parameters that define the create packet capture operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PacketCaptureResultInner object if successful. + */ + public PacketCaptureResultInner create(String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCaptureInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName, parameters).toBlocking().last().body(); + } + + /** + * Create and start a packet capture on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param parameters Parameters that define the create packet capture operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCaptureInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName, parameters), serviceCallback); + } + + /** + * Create and start a packet capture on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param parameters Parameters that define the create packet capture operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCaptureInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName, parameters).map(new Func1, PacketCaptureResultInner>() { + @Override + public PacketCaptureResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create and start a packet capture on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param parameters Parameters that define the create packet capture operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCaptureInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (packetCaptureName == null) { + throw new IllegalArgumentException("Parameter packetCaptureName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + Observable> observable = service.create(resourceGroupName, networkWatcherName, packetCaptureName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create and start a packet capture on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param parameters Parameters that define the create packet capture operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PacketCaptureResultInner object if successful. + */ + public PacketCaptureResultInner beginCreate(String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCaptureInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName, parameters).toBlocking().single().body(); + } + + /** + * Create and start a packet capture on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param parameters Parameters that define the create packet capture operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCaptureInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName, parameters), serviceCallback); + } + + /** + * Create and start a packet capture on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param parameters Parameters that define the create packet capture operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PacketCaptureResultInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCaptureInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName, parameters).map(new Func1, PacketCaptureResultInner>() { + @Override + public PacketCaptureResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create and start a packet capture on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param parameters Parameters that define the create packet capture operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PacketCaptureResultInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCaptureInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (packetCaptureName == null) { + throw new IllegalArgumentException("Parameter packetCaptureName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + return service.beginCreate(resourceGroupName, networkWatcherName, packetCaptureName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a packet capture session by name. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PacketCaptureResultInner object if successful. + */ + public PacketCaptureResultInner get(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + return getWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName).toBlocking().single().body(); + } + + /** + * Gets a packet capture session by name. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @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 networkWatcherName, String packetCaptureName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName), serviceCallback); + } + + /** + * Gets a packet capture session by name. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PacketCaptureResultInner object + */ + public Observable getAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + return getWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName).map(new Func1, PacketCaptureResultInner>() { + @Override + public PacketCaptureResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a packet capture session by name. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PacketCaptureResultInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (packetCaptureName == null) { + throw new IllegalArgumentException("Parameter packetCaptureName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.get(resourceGroupName, networkWatcherName, packetCaptureName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes the specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + deleteWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName).toBlocking().last().body(); + } + + /** + * Deletes the specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @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 networkWatcherName, String packetCaptureName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName), serviceCallback); + } + + /** + * Deletes the specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + return deleteWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (packetCaptureName == null) { + throw new IllegalArgumentException("Parameter packetCaptureName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + Observable> observable = service.delete(resourceGroupName, networkWatcherName, packetCaptureName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName).toBlocking().single().body(); + } + + /** + * Deletes the specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName), serviceCallback); + } + + /** + * Deletes the specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (packetCaptureName == null) { + throw new IllegalArgumentException("Parameter packetCaptureName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.beginDelete(resourceGroupName, networkWatcherName, packetCaptureName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Stops a specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void stop(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + stopWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName).toBlocking().last().body(); + } + + /** + * Stops a specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @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 stopAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(stopWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName), serviceCallback); + } + + /** + * Stops a specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable stopAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + return stopWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Stops a specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> stopWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (packetCaptureName == null) { + throw new IllegalArgumentException("Parameter packetCaptureName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + Observable> observable = service.stop(resourceGroupName, networkWatcherName, packetCaptureName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Stops a specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginStop(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + beginStopWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName).toBlocking().single().body(); + } + + /** + * Stops a specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @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 beginStopAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginStopWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName), serviceCallback); + } + + /** + * Stops a specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginStopAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + return beginStopWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Stops a specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginStopWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (packetCaptureName == null) { + throw new IllegalArgumentException("Parameter packetCaptureName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.beginStop(resourceGroupName, networkWatcherName, packetCaptureName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginStopDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginStopDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Query the status of a running packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @param packetCaptureName The name given to the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PacketCaptureQueryStatusResultInner object if successful. + */ + public PacketCaptureQueryStatusResultInner getStatus(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + return getStatusWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName).toBlocking().last().body(); + } + + /** + * Query the status of a running packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @param packetCaptureName The name given to the packet capture session. + * @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 getStatusAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getStatusWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName), serviceCallback); + } + + /** + * Query the status of a running packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @param packetCaptureName The name given to the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable getStatusAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + return getStatusWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName).map(new Func1, PacketCaptureQueryStatusResultInner>() { + @Override + public PacketCaptureQueryStatusResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Query the status of a running packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @param packetCaptureName The name given to the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> getStatusWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (packetCaptureName == null) { + throw new IllegalArgumentException("Parameter packetCaptureName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + Observable> observable = service.getStatus(resourceGroupName, networkWatcherName, packetCaptureName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Query the status of a running packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @param packetCaptureName The name given to the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PacketCaptureQueryStatusResultInner object if successful. + */ + public PacketCaptureQueryStatusResultInner beginGetStatus(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + return beginGetStatusWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName).toBlocking().single().body(); + } + + /** + * Query the status of a running packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @param packetCaptureName The name given to the packet capture session. + * @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 beginGetStatusAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetStatusWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName), serviceCallback); + } + + /** + * Query the status of a running packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @param packetCaptureName The name given to the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PacketCaptureQueryStatusResultInner object + */ + public Observable beginGetStatusAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + return beginGetStatusWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName).map(new Func1, PacketCaptureQueryStatusResultInner>() { + @Override + public PacketCaptureQueryStatusResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Query the status of a running packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @param packetCaptureName The name given to the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PacketCaptureQueryStatusResultInner object + */ + public Observable> beginGetStatusWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (packetCaptureName == null) { + throw new IllegalArgumentException("Parameter packetCaptureName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.beginGetStatus(resourceGroupName, networkWatcherName, packetCaptureName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGetStatusDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGetStatusDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all packet capture sessions within the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<PacketCaptureResultInner> object if successful. + */ + public List list(String resourceGroupName, String networkWatcherName) { + return listWithServiceResponseAsync(resourceGroupName, networkWatcherName).toBlocking().single().body(); + } + + /** + * Lists all packet capture sessions within the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(String resourceGroupName, String networkWatcherName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, networkWatcherName), serviceCallback); + } + + /** + * Lists all packet capture sessions within the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<PacketCaptureResultInner> object + */ + public Observable> listAsync(String resourceGroupName, String networkWatcherName) { + return listWithServiceResponseAsync(resourceGroupName, networkWatcherName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all packet capture sessions within the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<PacketCaptureResultInner> object + */ + public Observable>> listWithServiceResponseAsync(String resourceGroupName, String networkWatcherName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.list(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/PageImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/PageImpl.java new file mode 100644 index 000000000000..6ededb4f6976 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/PageImpl1.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/PageImpl1.java new file mode 100644 index 000000000000..220afb32ec83 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/PageImpl1.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl1 implements Page { + /** + * The link to the next page. + */ + @JsonProperty("") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl1 setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl1 setItems(List items) { + this.items = items; + return this; + } +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ProbeImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ProbeImpl.java new file mode 100644 index 000000000000..9b748f318df1 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ProbeImpl.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.Probe; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_06_01.ProbeProtocol; + +class ProbeImpl extends IndexableRefreshableWrapperImpl implements Probe { + private final NetworkManager manager; + private String resourceGroupName; + private String loadBalancerName; + private String probeName; + + ProbeImpl(ProbeInner inner, NetworkManager manager) { + super(null, inner); + this.manager = manager; + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.loadBalancerName = IdParsingUtils.getValueFromIdByName(inner.id(), "loadBalancers"); + this.probeName = IdParsingUtils.getValueFromIdByName(inner.id(), "probes"); + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + LoadBalancerProbesInner client = this.manager().inner().loadBalancerProbes(); + return client.getAsync(this.resourceGroupName, this.loadBalancerName, this.probeName); + } + + + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Integer intervalInSeconds() { + return this.inner().intervalInSeconds(); + } + + @Override + public List loadBalancingRules() { + return this.inner().loadBalancingRules(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Integer numberOfProbes() { + return this.inner().numberOfProbes(); + } + + @Override + public int port() { + return this.inner().port(); + } + + @Override + public ProbeProtocol protocol() { + return this.inner().protocol(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String requestPath() { + return this.inner().requestPath(); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ProbeInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ProbeInner.java new file mode 100644 index 000000000000..7115c637da6d --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ProbeInner.java @@ -0,0 +1,261 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_06_01.ProbeProtocol; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * A load balancer probe. + */ +@JsonFlatten +public class ProbeInner extends SubResource { + /** + * The load balancer rules that use this probe. + */ + @JsonProperty(value = "properties.loadBalancingRules", access = JsonProperty.Access.WRITE_ONLY) + private List loadBalancingRules; + + /** + * The protocol of the end point. Possible values are: 'Http', 'Tcp', or + * 'Https'. If 'Tcp' is specified, a received ACK is required for the probe + * to be successful. If 'Http' or 'Https' is specified, a 200 OK response + * from the specifies URI is required for the probe to be successful. + * Possible values include: 'Http', 'Tcp', 'Https'. + */ + @JsonProperty(value = "properties.protocol", required = true) + private ProbeProtocol protocol; + + /** + * The port for communicating the probe. Possible values range from 1 to + * 65535, inclusive. + */ + @JsonProperty(value = "properties.port", required = true) + private int port; + + /** + * The interval, in seconds, for how frequently to probe the endpoint for + * health status. Typically, the interval is slightly less than half the + * allocated timeout period (in seconds) which allows two full probes + * before taking the instance out of rotation. The default value is 15, the + * minimum value is 5. + */ + @JsonProperty(value = "properties.intervalInSeconds") + private Integer intervalInSeconds; + + /** + * The number of probes where if no response, will result in stopping + * further traffic from being delivered to the endpoint. This values allows + * endpoints to be taken out of rotation faster or slower than the typical + * times used in Azure. + */ + @JsonProperty(value = "properties.numberOfProbes") + private Integer numberOfProbes; + + /** + * The URI used for requesting health status from the VM. Path is required + * if a protocol is set to http. Otherwise, it is not allowed. There is no + * default value. + */ + @JsonProperty(value = "properties.requestPath") + private String requestPath; + + /** + * Gets the provisioning state of the public IP resource. Possible values + * are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Gets name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get the load balancer rules that use this probe. + * + * @return the loadBalancingRules value + */ + public List loadBalancingRules() { + return this.loadBalancingRules; + } + + /** + * Get the protocol of the end point. Possible values are: 'Http', 'Tcp', or 'Https'. If 'Tcp' is specified, a received ACK is required for the probe to be successful. If 'Http' or 'Https' is specified, a 200 OK response from the specifies URI is required for the probe to be successful. Possible values include: 'Http', 'Tcp', 'Https'. + * + * @return the protocol value + */ + public ProbeProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol of the end point. Possible values are: 'Http', 'Tcp', or 'Https'. If 'Tcp' is specified, a received ACK is required for the probe to be successful. If 'Http' or 'Https' is specified, a 200 OK response from the specifies URI is required for the probe to be successful. Possible values include: 'Http', 'Tcp', 'Https'. + * + * @param protocol the protocol value to set + * @return the ProbeInner object itself. + */ + public ProbeInner withProtocol(ProbeProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the port for communicating the probe. Possible values range from 1 to 65535, inclusive. + * + * @return the port value + */ + public int port() { + return this.port; + } + + /** + * Set the port for communicating the probe. Possible values range from 1 to 65535, inclusive. + * + * @param port the port value to set + * @return the ProbeInner object itself. + */ + public ProbeInner withPort(int port) { + this.port = port; + return this; + } + + /** + * Get the interval, in seconds, for how frequently to probe the endpoint for health status. Typically, the interval is slightly less than half the allocated timeout period (in seconds) which allows two full probes before taking the instance out of rotation. The default value is 15, the minimum value is 5. + * + * @return the intervalInSeconds value + */ + public Integer intervalInSeconds() { + return this.intervalInSeconds; + } + + /** + * Set the interval, in seconds, for how frequently to probe the endpoint for health status. Typically, the interval is slightly less than half the allocated timeout period (in seconds) which allows two full probes before taking the instance out of rotation. The default value is 15, the minimum value is 5. + * + * @param intervalInSeconds the intervalInSeconds value to set + * @return the ProbeInner object itself. + */ + public ProbeInner withIntervalInSeconds(Integer intervalInSeconds) { + this.intervalInSeconds = intervalInSeconds; + return this; + } + + /** + * Get the number of probes where if no response, will result in stopping further traffic from being delivered to the endpoint. This values allows endpoints to be taken out of rotation faster or slower than the typical times used in Azure. + * + * @return the numberOfProbes value + */ + public Integer numberOfProbes() { + return this.numberOfProbes; + } + + /** + * Set the number of probes where if no response, will result in stopping further traffic from being delivered to the endpoint. This values allows endpoints to be taken out of rotation faster or slower than the typical times used in Azure. + * + * @param numberOfProbes the numberOfProbes value to set + * @return the ProbeInner object itself. + */ + public ProbeInner withNumberOfProbes(Integer numberOfProbes) { + this.numberOfProbes = numberOfProbes; + return this; + } + + /** + * Get the URI used for requesting health status from the VM. Path is required if a protocol is set to http. Otherwise, it is not allowed. There is no default value. + * + * @return the requestPath value + */ + public String requestPath() { + return this.requestPath; + } + + /** + * Set the URI used for requesting health status from the VM. Path is required if a protocol is set to http. Otherwise, it is not allowed. There is no default value. + * + * @param requestPath the requestPath value to set + * @return the ProbeInner object itself. + */ + public ProbeInner withRequestPath(String requestPath) { + this.requestPath = requestPath; + return this; + } + + /** + * Get gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the ProbeInner object itself. + */ + public ProbeInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get gets name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set gets name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the ProbeInner object itself. + */ + public ProbeInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the ProbeInner object itself. + */ + public ProbeInner withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/PublicIPAddressImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/PublicIPAddressImpl.java new file mode 100644 index 000000000000..2d6bd192331c --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/PublicIPAddressImpl.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.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_06_01.PublicIPAddress; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_06_01.PublicIPAddressSku; +import com.microsoft.azure.management.network.v2018_06_01.IPAllocationMethod; +import com.microsoft.azure.management.network.v2018_06_01.IPVersion; +import com.microsoft.azure.management.network.v2018_06_01.IPConfiguration; +import com.microsoft.azure.management.network.v2018_06_01.PublicIPAddressDnsSettings; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.IpTag; + +class PublicIPAddressImpl extends GroupableResourceCoreImpl implements PublicIPAddress, PublicIPAddress.Definition, PublicIPAddress.Update { + PublicIPAddressImpl(String name, PublicIPAddressInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + PublicIPAddressesInner client = this.manager().inner().publicIPAddresses(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + PublicIPAddressesInner client = this.manager().inner().publicIPAddresses(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + PublicIPAddressesInner client = this.manager().inner().publicIPAddresses(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public PublicIPAddressDnsSettings dnsSettings() { + return this.inner().dnsSettings(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public Integer idleTimeoutInMinutes() { + return this.inner().idleTimeoutInMinutes(); + } + + @Override + public String ipAddress() { + return this.inner().ipAddress(); + } + + @Override + public IPConfiguration ipConfiguration() { + return this.inner().ipConfiguration(); + } + + @Override + public List ipTags() { + return this.inner().ipTags(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public IPVersion publicIPAddressVersion() { + return this.inner().publicIPAddressVersion(); + } + + @Override + public IPAllocationMethod publicIPAllocationMethod() { + return this.inner().publicIPAllocationMethod(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public PublicIPAddressSku sku() { + return this.inner().sku(); + } + + @Override + public List zones() { + return this.inner().zones(); + } + + @Override + public PublicIPAddressImpl withDnsSettings(PublicIPAddressDnsSettings dnsSettings) { + this.inner().withDnsSettings(dnsSettings); + return this; + } + + @Override + public PublicIPAddressImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public PublicIPAddressImpl withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { + this.inner().withIdleTimeoutInMinutes(idleTimeoutInMinutes); + return this; + } + + @Override + public PublicIPAddressImpl withIpAddress(String ipAddress) { + this.inner().withIpAddress(ipAddress); + return this; + } + + @Override + public PublicIPAddressImpl withIpTags(List ipTags) { + this.inner().withIpTags(ipTags); + return this; + } + + @Override + public PublicIPAddressImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public PublicIPAddressImpl withPublicIPAddressVersion(IPVersion publicIPAddressVersion) { + this.inner().withPublicIPAddressVersion(publicIPAddressVersion); + return this; + } + + @Override + public PublicIPAddressImpl withPublicIPAllocationMethod(IPAllocationMethod publicIPAllocationMethod) { + this.inner().withPublicIPAllocationMethod(publicIPAllocationMethod); + return this; + } + + @Override + public PublicIPAddressImpl withResourceGuid(String resourceGuid) { + this.inner().withResourceGuid(resourceGuid); + return this; + } + + @Override + public PublicIPAddressImpl withSku(PublicIPAddressSku sku) { + this.inner().withSku(sku); + return this; + } + + @Override + public PublicIPAddressImpl withZones(List zones) { + this.inner().withZones(zones); + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/PublicIPAddressInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/PublicIPAddressInner.java new file mode 100644 index 000000000000..73f7414ff058 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/PublicIPAddressInner.java @@ -0,0 +1,360 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.PublicIPAddressSku; +import com.microsoft.azure.management.network.v2018_06_01.IPAllocationMethod; +import com.microsoft.azure.management.network.v2018_06_01.IPVersion; +import com.microsoft.azure.management.network.v2018_06_01.IPConfiguration; +import com.microsoft.azure.management.network.v2018_06_01.PublicIPAddressDnsSettings; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.IpTag; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Public IP address resource. + */ +@JsonFlatten +@SkipParentValidation +public class PublicIPAddressInner extends Resource { + /** + * The public IP address SKU. + */ + @JsonProperty(value = "sku") + private PublicIPAddressSku sku; + + /** + * The public IP allocation method. Possible values are: 'Static' and + * 'Dynamic'. Possible values include: 'Static', 'Dynamic'. + */ + @JsonProperty(value = "properties.publicIPAllocationMethod") + private IPAllocationMethod publicIPAllocationMethod; + + /** + * The public IP address version. Possible values are: 'IPv4' and 'IPv6'. + * Possible values include: 'IPv4', 'IPv6'. + */ + @JsonProperty(value = "properties.publicIPAddressVersion") + private IPVersion publicIPAddressVersion; + + /** + * The IP configuration associated with the public IP address. + */ + @JsonProperty(value = "properties.ipConfiguration", access = JsonProperty.Access.WRITE_ONLY) + private IPConfiguration ipConfiguration; + + /** + * The FQDN of the DNS record associated with the public IP address. + */ + @JsonProperty(value = "properties.dnsSettings") + private PublicIPAddressDnsSettings dnsSettings; + + /** + * The list of tags associated with the public IP address. + */ + @JsonProperty(value = "properties.ipTags") + private List ipTags; + + /** + * The IP address associated with the public IP address resource. + */ + @JsonProperty(value = "properties.ipAddress") + private String ipAddress; + + /** + * The idle timeout of the public IP address. + */ + @JsonProperty(value = "properties.idleTimeoutInMinutes") + private Integer idleTimeoutInMinutes; + + /** + * The resource GUID property of the public IP resource. + */ + @JsonProperty(value = "properties.resourceGuid") + private String resourceGuid; + + /** + * The provisioning state of the PublicIP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * A list of availability zones denoting the IP allocated for the resource + * needs to come from. + */ + @JsonProperty(value = "zones") + private List zones; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the public IP address SKU. + * + * @return the sku value + */ + public PublicIPAddressSku sku() { + return this.sku; + } + + /** + * Set the public IP address SKU. + * + * @param sku the sku value to set + * @return the PublicIPAddressInner object itself. + */ + public PublicIPAddressInner withSku(PublicIPAddressSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the public IP allocation method. Possible values are: 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic'. + * + * @return the publicIPAllocationMethod value + */ + public IPAllocationMethod publicIPAllocationMethod() { + return this.publicIPAllocationMethod; + } + + /** + * Set the public IP allocation method. Possible values are: 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic'. + * + * @param publicIPAllocationMethod the publicIPAllocationMethod value to set + * @return the PublicIPAddressInner object itself. + */ + public PublicIPAddressInner withPublicIPAllocationMethod(IPAllocationMethod publicIPAllocationMethod) { + this.publicIPAllocationMethod = publicIPAllocationMethod; + return this; + } + + /** + * Get the public IP address version. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6'. + * + * @return the publicIPAddressVersion value + */ + public IPVersion publicIPAddressVersion() { + return this.publicIPAddressVersion; + } + + /** + * Set the public IP address version. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6'. + * + * @param publicIPAddressVersion the publicIPAddressVersion value to set + * @return the PublicIPAddressInner object itself. + */ + public PublicIPAddressInner withPublicIPAddressVersion(IPVersion publicIPAddressVersion) { + this.publicIPAddressVersion = publicIPAddressVersion; + return this; + } + + /** + * Get the IP configuration associated with the public IP address. + * + * @return the ipConfiguration value + */ + public IPConfiguration ipConfiguration() { + return this.ipConfiguration; + } + + /** + * Get the FQDN of the DNS record associated with the public IP address. + * + * @return the dnsSettings value + */ + public PublicIPAddressDnsSettings dnsSettings() { + return this.dnsSettings; + } + + /** + * Set the FQDN of the DNS record associated with the public IP address. + * + * @param dnsSettings the dnsSettings value to set + * @return the PublicIPAddressInner object itself. + */ + public PublicIPAddressInner withDnsSettings(PublicIPAddressDnsSettings dnsSettings) { + this.dnsSettings = dnsSettings; + return this; + } + + /** + * Get the list of tags associated with the public IP address. + * + * @return the ipTags value + */ + public List ipTags() { + return this.ipTags; + } + + /** + * Set the list of tags associated with the public IP address. + * + * @param ipTags the ipTags value to set + * @return the PublicIPAddressInner object itself. + */ + public PublicIPAddressInner withIpTags(List ipTags) { + this.ipTags = ipTags; + return this; + } + + /** + * Get the IP address associated with the public IP address resource. + * + * @return the ipAddress value + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Set the IP address associated with the public IP address resource. + * + * @param ipAddress the ipAddress value to set + * @return the PublicIPAddressInner object itself. + */ + public PublicIPAddressInner withIpAddress(String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + * Get the idle timeout of the public IP address. + * + * @return the idleTimeoutInMinutes value + */ + public Integer idleTimeoutInMinutes() { + return this.idleTimeoutInMinutes; + } + + /** + * Set the idle timeout of the public IP address. + * + * @param idleTimeoutInMinutes the idleTimeoutInMinutes value to set + * @return the PublicIPAddressInner object itself. + */ + public PublicIPAddressInner withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { + this.idleTimeoutInMinutes = idleTimeoutInMinutes; + return this; + } + + /** + * Get the resource GUID property of the public IP resource. + * + * @return the resourceGuid value + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Set the resource GUID property of the public IP resource. + * + * @param resourceGuid the resourceGuid value to set + * @return the PublicIPAddressInner object itself. + */ + public PublicIPAddressInner withResourceGuid(String resourceGuid) { + this.resourceGuid = resourceGuid; + return this; + } + + /** + * Get the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the PublicIPAddressInner object itself. + */ + public PublicIPAddressInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the PublicIPAddressInner object itself. + */ + public PublicIPAddressInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get a list of availability zones denoting the IP allocated for the resource needs to come from. + * + * @return the zones value + */ + public List zones() { + return this.zones; + } + + /** + * Set a list of availability zones denoting the IP allocated for the resource needs to come from. + * + * @param zones the zones value to set + * @return the PublicIPAddressInner object itself. + */ + public PublicIPAddressInner withZones(List zones) { + this.zones = zones; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the PublicIPAddressInner object itself. + */ + public PublicIPAddressInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/PublicIPAddressesImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/PublicIPAddressesImpl.java new file mode 100644 index 000000000000..0e32844f2460 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/PublicIPAddressesImpl.java @@ -0,0 +1,186 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_06_01.PublicIPAddresses; +import com.microsoft.azure.management.network.v2018_06_01.PublicIPAddress; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class PublicIPAddressesImpl extends GroupableResourcesCoreImpl implements PublicIPAddresses { + protected PublicIPAddressesImpl(NetworkManager manager) { + super(manager.inner().publicIPAddresses(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + PublicIPAddressesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + PublicIPAddressesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + PublicIPAddressesInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + PublicIPAddressesInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public PublicIPAddress call(PublicIPAddressInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + PublicIPAddressesInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + PublicIPAddressesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public PublicIPAddress call(PublicIPAddressInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PublicIPAddressImpl define(String name) { + return wrapModel(name); + } + + @Override + public Observable listVirtualMachineScaleSetPublicIPAddressesAsync(final String resourceGroupName, final String virtualMachineScaleSetName) { + PublicIPAddressesInner client = this.inner(); + return client.listVirtualMachineScaleSetPublicIPAddressesAsync(resourceGroupName, virtualMachineScaleSetName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public PublicIPAddress call(PublicIPAddressInner inner) { + return new PublicIPAddressImpl(inner.name(), inner, manager()); + } + }); + } + + @Override + public Observable listVirtualMachineScaleSetVMPublicIPAddressesAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName, final String ipConfigurationName) { + PublicIPAddressesInner client = this.inner(); + return client.listVirtualMachineScaleSetVMPublicIPAddressesAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public PublicIPAddress call(PublicIPAddressInner inner) { + return new PublicIPAddressImpl(inner.name(), inner, manager()); + } + }); + } + + @Override + public Observable getVirtualMachineScaleSetPublicIPAddressAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, String publicIpAddressName) { + PublicIPAddressesInner client = this.inner(); + return client.getVirtualMachineScaleSetPublicIPAddressAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, publicIpAddressName) + .map(new Func1() { + @Override + public PublicIPAddress call(PublicIPAddressInner inner) { + return new PublicIPAddressImpl(inner.name(), inner, manager()); + } + }); + } + + @Override + protected PublicIPAddressImpl wrapModel(PublicIPAddressInner inner) { + return new PublicIPAddressImpl(inner.name(), inner, manager()); + } + + @Override + protected PublicIPAddressImpl wrapModel(String name) { + return new PublicIPAddressImpl(name, new PublicIPAddressInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/PublicIPAddressesInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/PublicIPAddressesInner.java new file mode 100644 index 000000000000..32fdc8ebe142 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/PublicIPAddressesInner.java @@ -0,0 +1,2085 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_06_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.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 PublicIPAddresses. + */ +public class PublicIPAddressesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private PublicIPAddressesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of PublicIPAddressesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PublicIPAddressesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(PublicIPAddressesService.class); + this.client = client; + } + + /** + * The interface defining all the services for PublicIPAddresses to be + * used by Retrofit to perform actually REST calls. + */ + interface PublicIPAddressesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.PublicIPAddresses delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("publicIpAddressName") String publicIpAddressName, @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.network.v2018_06_01.PublicIPAddresses beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("publicIpAddressName") String publicIpAddressName, @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.network.v2018_06_01.PublicIPAddresses getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("publicIpAddressName") String publicIpAddressName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @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.network.v2018_06_01.PublicIPAddresses createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("publicIpAddressName") String publicIpAddressName, @Path("subscriptionId") String subscriptionId, @Body PublicIPAddressInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.PublicIPAddresses beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("publicIpAddressName") String publicIpAddressName, @Path("subscriptionId") String subscriptionId, @Body PublicIPAddressInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.PublicIPAddresses updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("publicIpAddressName") String publicIpAddressName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.PublicIPAddresses beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}") + Observable> beginUpdateTags(@Path("resourceGroupName") String resourceGroupName, @Path("publicIpAddressName") String publicIpAddressName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.PublicIPAddresses list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPAddresses") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.PublicIPAddresses listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @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.network.v2018_06_01.PublicIPAddresses listVirtualMachineScaleSetPublicIPAddresses" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/publicipaddresses") + Observable> listVirtualMachineScaleSetPublicIPAddresses(@Path("resourceGroupName") String resourceGroupName, @Path("virtualMachineScaleSetName") String virtualMachineScaleSetName, @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.network.v2018_06_01.PublicIPAddresses listVirtualMachineScaleSetVMPublicIPAddresses" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses") + Observable> listVirtualMachineScaleSetVMPublicIPAddresses(@Path("resourceGroupName") String resourceGroupName, @Path("virtualMachineScaleSetName") String virtualMachineScaleSetName, @Path("virtualmachineIndex") String virtualmachineIndex, @Path("networkInterfaceName") String networkInterfaceName, @Path("ipConfigurationName") String ipConfigurationName, @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.network.v2018_06_01.PublicIPAddresses getVirtualMachineScaleSetPublicIPAddress" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses/{publicIpAddressName}") + Observable> getVirtualMachineScaleSetPublicIPAddress(@Path("resourceGroupName") String resourceGroupName, @Path("virtualMachineScaleSetName") String virtualMachineScaleSetName, @Path("virtualmachineIndex") String virtualmachineIndex, @Path("networkInterfaceName") String networkInterfaceName, @Path("ipConfigurationName") String ipConfigurationName, @Path("publicIpAddressName") String publicIpAddressName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @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.network.v2018_06_01.PublicIPAddresses listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.PublicIPAddresses listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.PublicIPAddresses listVirtualMachineScaleSetPublicIPAddressesNext" }) + @GET + Observable> listVirtualMachineScaleSetPublicIPAddressesNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.PublicIPAddresses listVirtualMachineScaleSetVMPublicIPAddressesNext" }) + @GET + Observable> listVirtualMachineScaleSetVMPublicIPAddressesNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String publicIpAddressName) { + deleteWithServiceResponseAsync(resourceGroupName, publicIpAddressName).toBlocking().last().body(); + } + + /** + * Deletes the specified public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String publicIpAddressName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, publicIpAddressName), serviceCallback); + } + + /** + * Deletes the specified public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String publicIpAddressName) { + return deleteWithServiceResponseAsync(resourceGroupName, publicIpAddressName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String publicIpAddressName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpAddressName == null) { + throw new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + Observable> observable = service.delete(resourceGroupName, publicIpAddressName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String publicIpAddressName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, publicIpAddressName).toBlocking().single().body(); + } + + /** + * Deletes the specified public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String publicIpAddressName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, publicIpAddressName), serviceCallback); + } + + /** + * Deletes the specified public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String publicIpAddressName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, publicIpAddressName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String publicIpAddressName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpAddressName == null) { + throw new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.beginDelete(resourceGroupName, publicIpAddressName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified public IP address in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPAddressInner object if successful. + */ + public PublicIPAddressInner getByResourceGroup(String resourceGroupName, String publicIpAddressName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, publicIpAddressName).toBlocking().single().body(); + } + + /** + * Gets the specified public IP address in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String publicIpAddressName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, publicIpAddressName), serviceCallback); + } + + /** + * Gets the specified public IP address in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPAddressInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String publicIpAddressName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, publicIpAddressName).map(new Func1, PublicIPAddressInner>() { + @Override + public PublicIPAddressInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified public IP address in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPAddressInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String publicIpAddressName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpAddressName == null) { + throw new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + final String expand = null; + return service.getByResourceGroup(resourceGroupName, publicIpAddressName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the specified public IP address in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPAddressInner object if successful. + */ + public PublicIPAddressInner getByResourceGroup(String resourceGroupName, String publicIpAddressName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, publicIpAddressName, expand).toBlocking().single().body(); + } + + /** + * Gets the specified public IP address in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @param expand Expands referenced resources. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String publicIpAddressName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, publicIpAddressName, expand), serviceCallback); + } + + /** + * Gets the specified public IP address in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPAddressInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String publicIpAddressName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, publicIpAddressName, expand).map(new Func1, PublicIPAddressInner>() { + @Override + public PublicIPAddressInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified public IP address in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPAddressInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String publicIpAddressName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpAddressName == null) { + throw new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.getByResourceGroup(resourceGroupName, publicIpAddressName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a static or dynamic public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param parameters Parameters supplied to the create or update public IP address operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPAddressInner object if successful. + */ + public PublicIPAddressInner createOrUpdate(String resourceGroupName, String publicIpAddressName, PublicIPAddressInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, publicIpAddressName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates a static or dynamic public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param parameters Parameters supplied to the create or update public IP address operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String publicIpAddressName, PublicIPAddressInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, publicIpAddressName, parameters), serviceCallback); + } + + /** + * Creates or updates a static or dynamic public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param parameters Parameters supplied to the create or update public IP address operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String publicIpAddressName, PublicIPAddressInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, publicIpAddressName, parameters).map(new Func1, PublicIPAddressInner>() { + @Override + public PublicIPAddressInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a static or dynamic public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param parameters Parameters supplied to the create or update public IP address operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String publicIpAddressName, PublicIPAddressInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpAddressName == null) { + throw new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, publicIpAddressName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a static or dynamic public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param parameters Parameters supplied to the create or update public IP address operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPAddressInner object if successful. + */ + public PublicIPAddressInner beginCreateOrUpdate(String resourceGroupName, String publicIpAddressName, PublicIPAddressInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, publicIpAddressName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates a static or dynamic public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param parameters Parameters supplied to the create or update public IP address operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String publicIpAddressName, PublicIPAddressInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, publicIpAddressName, parameters), serviceCallback); + } + + /** + * Creates or updates a static or dynamic public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param parameters Parameters supplied to the create or update public IP address operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPAddressInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String publicIpAddressName, PublicIPAddressInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, publicIpAddressName, parameters).map(new Func1, PublicIPAddressInner>() { + @Override + public PublicIPAddressInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a static or dynamic public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param parameters Parameters supplied to the create or update public IP address operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPAddressInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String publicIpAddressName, PublicIPAddressInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpAddressName == null) { + throw new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + return service.beginCreateOrUpdate(resourceGroupName, publicIpAddressName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPAddressInner object if successful. + */ + public PublicIPAddressInner updateTags(String resourceGroupName, String publicIpAddressName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, publicIpAddressName).toBlocking().last().body(); + } + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @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 updateTagsAsync(String resourceGroupName, String publicIpAddressName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, publicIpAddressName), serviceCallback); + } + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String publicIpAddressName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, publicIpAddressName).map(new Func1, PublicIPAddressInner>() { + @Override + public PublicIPAddressInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String publicIpAddressName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpAddressName == null) { + throw new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + Observable> observable = service.updateTags(resourceGroupName, publicIpAddressName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPAddressInner object if successful. + */ + public PublicIPAddressInner updateTags(String resourceGroupName, String publicIpAddressName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, publicIpAddressName, tags).toBlocking().last().body(); + } + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String publicIpAddressName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, publicIpAddressName, tags), serviceCallback); + } + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String publicIpAddressName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, publicIpAddressName, tags).map(new Func1, PublicIPAddressInner>() { + @Override + public PublicIPAddressInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String publicIpAddressName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpAddressName == null) { + throw new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-06-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + Observable> observable = service.updateTags(resourceGroupName, publicIpAddressName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPAddressInner object if successful. + */ + public PublicIPAddressInner beginUpdateTags(String resourceGroupName, String publicIpAddressName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, publicIpAddressName).toBlocking().single().body(); + } + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @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 beginUpdateTagsAsync(String resourceGroupName, String publicIpAddressName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, publicIpAddressName), serviceCallback); + } + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPAddressInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String publicIpAddressName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, publicIpAddressName).map(new Func1, PublicIPAddressInner>() { + @Override + public PublicIPAddressInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPAddressInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String publicIpAddressName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpAddressName == null) { + throw new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.beginUpdateTags(resourceGroupName, publicIpAddressName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPAddressInner object if successful. + */ + public PublicIPAddressInner beginUpdateTags(String resourceGroupName, String publicIpAddressName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, publicIpAddressName, tags).toBlocking().single().body(); + } + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String publicIpAddressName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, publicIpAddressName, tags), serviceCallback); + } + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPAddressInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String publicIpAddressName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, publicIpAddressName, tags).map(new Func1, PublicIPAddressInner>() { + @Override + public PublicIPAddressInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPAddressInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String publicIpAddressName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (publicIpAddressName == null) { + throw new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-06-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.beginUpdateTags(resourceGroupName, publicIpAddressName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the public IP addresses in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PublicIPAddressInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the public IP addresses in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the public IP addresses in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the public IP addresses in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the public IP addresses in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PublicIPAddressInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all public IP addresses in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PublicIPAddressInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all public IP addresses in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all public IP addresses in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all public IP addresses in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all public IP addresses in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PublicIPAddressInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets information about all public IP addresses on a virtual machine scale set level. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PublicIPAddressInner> object if successful. + */ + public PagedList listVirtualMachineScaleSetPublicIPAddresses(final String resourceGroupName, final String virtualMachineScaleSetName) { + ServiceResponse> response = listVirtualMachineScaleSetPublicIPAddressesSinglePageAsync(resourceGroupName, virtualMachineScaleSetName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listVirtualMachineScaleSetPublicIPAddressesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets information about all public IP addresses on a virtual machine scale set level. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @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> listVirtualMachineScaleSetPublicIPAddressesAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listVirtualMachineScaleSetPublicIPAddressesSinglePageAsync(resourceGroupName, virtualMachineScaleSetName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listVirtualMachineScaleSetPublicIPAddressesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets information about all public IP addresses on a virtual machine scale set level. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable> listVirtualMachineScaleSetPublicIPAddressesAsync(final String resourceGroupName, final String virtualMachineScaleSetName) { + return listVirtualMachineScaleSetPublicIPAddressesWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets information about all public IP addresses on a virtual machine scale set level. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable>> listVirtualMachineScaleSetPublicIPAddressesWithServiceResponseAsync(final String resourceGroupName, final String virtualMachineScaleSetName) { + return listVirtualMachineScaleSetPublicIPAddressesSinglePageAsync(resourceGroupName, virtualMachineScaleSetName) + .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(listVirtualMachineScaleSetPublicIPAddressesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets information about all public IP addresses on a virtual machine scale set level. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PublicIPAddressInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listVirtualMachineScaleSetPublicIPAddressesSinglePageAsync(final String resourceGroupName, final String virtualMachineScaleSetName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualMachineScaleSetName == null) { + throw new IllegalArgumentException("Parameter virtualMachineScaleSetName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-03-30"; + return service.listVirtualMachineScaleSetPublicIPAddresses(resourceGroupName, virtualMachineScaleSetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listVirtualMachineScaleSetPublicIPAddressesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listVirtualMachineScaleSetPublicIPAddressesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The network interface name. + * @param ipConfigurationName The IP configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PublicIPAddressInner> object if successful. + */ + public PagedList listVirtualMachineScaleSetVMPublicIPAddresses(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName, final String ipConfigurationName) { + ServiceResponse> response = listVirtualMachineScaleSetVMPublicIPAddressesSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listVirtualMachineScaleSetVMPublicIPAddressesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The network interface name. + * @param ipConfigurationName The IP configuration name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listVirtualMachineScaleSetVMPublicIPAddressesAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName, final String ipConfigurationName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listVirtualMachineScaleSetVMPublicIPAddressesSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listVirtualMachineScaleSetVMPublicIPAddressesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The network interface name. + * @param ipConfigurationName The IP configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable> listVirtualMachineScaleSetVMPublicIPAddressesAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName, final String ipConfigurationName) { + return listVirtualMachineScaleSetVMPublicIPAddressesWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The network interface name. + * @param ipConfigurationName The IP configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable>> listVirtualMachineScaleSetVMPublicIPAddressesWithServiceResponseAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName, final String ipConfigurationName) { + return listVirtualMachineScaleSetVMPublicIPAddressesSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName) + .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(listVirtualMachineScaleSetVMPublicIPAddressesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param virtualMachineScaleSetName The name of the virtual machine scale set. + ServiceResponse> * @param virtualmachineIndex The virtual machine index. + ServiceResponse> * @param networkInterfaceName The network interface name. + ServiceResponse> * @param ipConfigurationName The IP configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PublicIPAddressInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listVirtualMachineScaleSetVMPublicIPAddressesSinglePageAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName, final String ipConfigurationName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualMachineScaleSetName == null) { + throw new IllegalArgumentException("Parameter virtualMachineScaleSetName is required and cannot be null."); + } + if (virtualmachineIndex == null) { + throw new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (ipConfigurationName == null) { + throw new IllegalArgumentException("Parameter ipConfigurationName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-03-30"; + return service.listVirtualMachineScaleSetVMPublicIPAddresses(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listVirtualMachineScaleSetVMPublicIPAddressesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listVirtualMachineScaleSetVMPublicIPAddressesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get the specified public IP address in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPAddressInner object if successful. + */ + public PublicIPAddressInner getVirtualMachineScaleSetPublicIPAddress(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, String publicIpAddressName) { + return getVirtualMachineScaleSetPublicIPAddressWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, publicIpAddressName).toBlocking().single().body(); + } + + /** + * Get the specified public IP address in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @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 getVirtualMachineScaleSetPublicIPAddressAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, String publicIpAddressName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getVirtualMachineScaleSetPublicIPAddressWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, publicIpAddressName), serviceCallback); + } + + /** + * Get the specified public IP address in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPAddressInner object + */ + public Observable getVirtualMachineScaleSetPublicIPAddressAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, String publicIpAddressName) { + return getVirtualMachineScaleSetPublicIPAddressWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, publicIpAddressName).map(new Func1, PublicIPAddressInner>() { + @Override + public PublicIPAddressInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the specified public IP address in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPAddressInner object + */ + public Observable> getVirtualMachineScaleSetPublicIPAddressWithServiceResponseAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, String publicIpAddressName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualMachineScaleSetName == null) { + throw new IllegalArgumentException("Parameter virtualMachineScaleSetName is required and cannot be null."); + } + if (virtualmachineIndex == null) { + throw new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (ipConfigurationName == null) { + throw new IllegalArgumentException("Parameter ipConfigurationName is required and cannot be null."); + } + if (publicIpAddressName == null) { + throw new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-03-30"; + final String expand = null; + return service.getVirtualMachineScaleSetPublicIPAddress(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, publicIpAddressName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getVirtualMachineScaleSetPublicIPAddressDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get the specified public IP address in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PublicIPAddressInner object if successful. + */ + public PublicIPAddressInner getVirtualMachineScaleSetPublicIPAddress(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, String publicIpAddressName, String expand) { + return getVirtualMachineScaleSetPublicIPAddressWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, publicIpAddressName, expand).toBlocking().single().body(); + } + + /** + * Get the specified public IP address in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @param expand Expands referenced resources. + * @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 getVirtualMachineScaleSetPublicIPAddressAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, String publicIpAddressName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getVirtualMachineScaleSetPublicIPAddressWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, publicIpAddressName, expand), serviceCallback); + } + + /** + * Get the specified public IP address in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPAddressInner object + */ + public Observable getVirtualMachineScaleSetPublicIPAddressAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, String publicIpAddressName, String expand) { + return getVirtualMachineScaleSetPublicIPAddressWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, publicIpAddressName, expand).map(new Func1, PublicIPAddressInner>() { + @Override + public PublicIPAddressInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the specified public IP address in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PublicIPAddressInner object + */ + public Observable> getVirtualMachineScaleSetPublicIPAddressWithServiceResponseAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, String publicIpAddressName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualMachineScaleSetName == null) { + throw new IllegalArgumentException("Parameter virtualMachineScaleSetName is required and cannot be null."); + } + if (virtualmachineIndex == null) { + throw new IllegalArgumentException("Parameter virtualmachineIndex is required and cannot be null."); + } + if (networkInterfaceName == null) { + throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."); + } + if (ipConfigurationName == null) { + throw new IllegalArgumentException("Parameter ipConfigurationName is required and cannot be null."); + } + if (publicIpAddressName == null) { + throw new IllegalArgumentException("Parameter publicIpAddressName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-03-30"; + return service.getVirtualMachineScaleSetPublicIPAddress(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, publicIpAddressName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getVirtualMachineScaleSetPublicIPAddressDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getVirtualMachineScaleSetPublicIPAddressDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the public IP addresses in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PublicIPAddressInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the public IP addresses in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the public IP addresses in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the public IP addresses in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the public IP addresses in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PublicIPAddressInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all public IP addresses in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PublicIPAddressInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all public IP addresses in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all public IP addresses in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all public IP addresses in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all public IP addresses in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PublicIPAddressInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets information about all public IP addresses on a virtual machine scale set level. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PublicIPAddressInner> object if successful. + */ + public PagedList listVirtualMachineScaleSetPublicIPAddressesNext(final String nextPageLink) { + ServiceResponse> response = listVirtualMachineScaleSetPublicIPAddressesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listVirtualMachineScaleSetPublicIPAddressesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets information about all public IP addresses on a virtual machine scale set level. + * + * @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> listVirtualMachineScaleSetPublicIPAddressesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listVirtualMachineScaleSetPublicIPAddressesNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listVirtualMachineScaleSetPublicIPAddressesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets information about all public IP addresses on a virtual machine scale set level. + * + * @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<PublicIPAddressInner> object + */ + public Observable> listVirtualMachineScaleSetPublicIPAddressesNextAsync(final String nextPageLink) { + return listVirtualMachineScaleSetPublicIPAddressesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets information about all public IP addresses on a virtual machine scale set level. + * + * @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<PublicIPAddressInner> object + */ + public Observable>> listVirtualMachineScaleSetPublicIPAddressesNextWithServiceResponseAsync(final String nextPageLink) { + return listVirtualMachineScaleSetPublicIPAddressesNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listVirtualMachineScaleSetPublicIPAddressesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets information about all public IP addresses on a virtual machine scale set level. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PublicIPAddressInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listVirtualMachineScaleSetPublicIPAddressesNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listVirtualMachineScaleSetPublicIPAddressesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listVirtualMachineScaleSetPublicIPAddressesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listVirtualMachineScaleSetPublicIPAddressesNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PublicIPAddressInner> object if successful. + */ + public PagedList listVirtualMachineScaleSetVMPublicIPAddressesNext(final String nextPageLink) { + ServiceResponse> response = listVirtualMachineScaleSetVMPublicIPAddressesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listVirtualMachineScaleSetVMPublicIPAddressesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. + * + * @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> listVirtualMachineScaleSetVMPublicIPAddressesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listVirtualMachineScaleSetVMPublicIPAddressesNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listVirtualMachineScaleSetVMPublicIPAddressesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. + * + * @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<PublicIPAddressInner> object + */ + public Observable> listVirtualMachineScaleSetVMPublicIPAddressesNextAsync(final String nextPageLink) { + return listVirtualMachineScaleSetVMPublicIPAddressesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. + * + * @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<PublicIPAddressInner> object + */ + public Observable>> listVirtualMachineScaleSetVMPublicIPAddressesNextWithServiceResponseAsync(final String nextPageLink) { + return listVirtualMachineScaleSetVMPublicIPAddressesNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listVirtualMachineScaleSetVMPublicIPAddressesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PublicIPAddressInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listVirtualMachineScaleSetVMPublicIPAddressesNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listVirtualMachineScaleSetVMPublicIPAddressesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listVirtualMachineScaleSetVMPublicIPAddressesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listVirtualMachineScaleSetVMPublicIPAddressesNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/RouteFilterImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/RouteFilterImpl.java new file mode 100644 index 000000000000..9b41fa078e22 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/RouteFilterImpl.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_06_01.RouteFilter; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_06_01.PatchRouteFilter; +import java.util.List; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_06_01.ExpressRouteCircuitPeering; +import com.microsoft.azure.management.network.v2018_06_01.RouteFilterRule; +import rx.functions.Func1; + +class RouteFilterImpl extends GroupableResourceCoreImpl implements RouteFilter, RouteFilter.Definition, RouteFilter.Update { + private PatchRouteFilter updateParameter; + RouteFilterImpl(String name, RouteFilterInner inner, NetworkManager manager) { + super(name, inner, manager); + this.updateParameter = new PatchRouteFilter(); + } + + @Override + public Observable createResourceAsync() { + RouteFiltersInner client = this.manager().inner().routeFilters(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(new Func1() { + @Override + public RouteFilterInner call(RouteFilterInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + RouteFiltersInner client = this.manager().inner().routeFilters(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.updateParameter) + .map(new Func1() { + @Override + public RouteFilterInner call(RouteFilterInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + RouteFiltersInner client = this.manager().inner().routeFilters(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new PatchRouteFilter(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public List peerings() { + List lst = new ArrayList(); + if (this.inner().peerings() != null) { + for (ExpressRouteCircuitPeeringInner inner : this.inner().peerings()) { + lst.add( new ExpressRouteCircuitPeeringImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public List rules() { + List lst = new ArrayList(); + if (this.inner().rules() != null) { + for (RouteFilterRuleInner inner : this.inner().rules()) { + lst.add( new RouteFilterRuleImpl(inner, manager())); + } + } + return lst; + } + + @Override + public RouteFilterImpl withPeerings(List peerings) { + if (isInCreateMode()) { + this.inner().withPeerings(peerings); + } else { + this.updateParameter.withPeerings(peerings); + } + return this; + } + + @Override + public RouteFilterImpl withRules(List rules) { + if (isInCreateMode()) { + this.inner().withRules(rules); + } else { + this.updateParameter.withRules(rules); + } + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/RouteFilterInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/RouteFilterInner.java new file mode 100644 index 000000000000..1440ca442f45 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/RouteFilterInner.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.network.v2018_06_01.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Route Filter Resource. + */ +@JsonFlatten +@SkipParentValidation +public class RouteFilterInner extends Resource { + /** + * Collection of RouteFilterRules contained within a route filter. + */ + @JsonProperty(value = "properties.rules") + private List rules; + + /** + * A collection of references to express route circuit peerings. + */ + @JsonProperty(value = "properties.peerings") + private List peerings; + + /** + * The provisioning state of the resource. Possible values are: 'Updating', + * 'Deleting', 'Succeeded' and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get collection of RouteFilterRules contained within a route filter. + * + * @return the rules value + */ + public List rules() { + return this.rules; + } + + /** + * Set collection of RouteFilterRules contained within a route filter. + * + * @param rules the rules value to set + * @return the RouteFilterInner object itself. + */ + public RouteFilterInner withRules(List rules) { + this.rules = rules; + return this; + } + + /** + * Get a collection of references to express route circuit peerings. + * + * @return the peerings value + */ + public List peerings() { + return this.peerings; + } + + /** + * Set a collection of references to express route circuit peerings. + * + * @param peerings the peerings value to set + * @return the RouteFilterInner object itself. + */ + public RouteFilterInner withPeerings(List peerings) { + this.peerings = peerings; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the RouteFilterInner object itself. + */ + public RouteFilterInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/RouteFilterRuleImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/RouteFilterRuleImpl.java new file mode 100644 index 000000000000..9e803d9fac4d --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/RouteFilterRuleImpl.java @@ -0,0 +1,183 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.RouteFilterRule; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_06_01.PatchRouteFilterRule; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.Access; +import rx.functions.Func1; + +class RouteFilterRuleImpl extends CreatableUpdatableImpl implements RouteFilterRule, RouteFilterRule.Definition, RouteFilterRule.Update { + private final NetworkManager manager; + private String resourceGroupName; + private String routeFilterName; + private String ruleName; + private PatchRouteFilterRule updateParameter; + + RouteFilterRuleImpl(String name, NetworkManager manager) { + super(name, new RouteFilterRuleInner()); + this.manager = manager; + // Set resource name + this.ruleName = name; + // + this.updateParameter = new PatchRouteFilterRule(); + } + + RouteFilterRuleImpl(RouteFilterRuleInner inner, NetworkManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.ruleName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.routeFilterName = IdParsingUtils.getValueFromIdByName(inner.id(), "routeFilters"); + this.ruleName = IdParsingUtils.getValueFromIdByName(inner.id(), "routeFilterRules"); + // + this.updateParameter = new PatchRouteFilterRule(); + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + RouteFilterRulesInner client = this.manager().inner().routeFilterRules(); + return client.createOrUpdateAsync(this.resourceGroupName, this.routeFilterName, this.ruleName, this.inner()) + .map(new Func1() { + @Override + public RouteFilterRuleInner call(RouteFilterRuleInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + RouteFilterRulesInner client = this.manager().inner().routeFilterRules(); + return client.updateAsync(this.resourceGroupName, this.routeFilterName, this.ruleName, this.updateParameter) + .map(new Func1() { + @Override + public RouteFilterRuleInner call(RouteFilterRuleInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + RouteFilterRulesInner client = this.manager().inner().routeFilterRules(); + return client.getAsync(this.resourceGroupName, this.routeFilterName, this.ruleName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new PatchRouteFilterRule(); + } + + @Override + public Access access() { + return this.inner().access(); + } + + @Override + public List communities() { + return this.inner().communities(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String routeFilterRuleType() { + return this.inner().routeFilterRuleType(); + } + + @Override + public RouteFilterRuleImpl withExistingRouteFilter(String resourceGroupName, String routeFilterName) { + this.resourceGroupName = resourceGroupName; + this.routeFilterName = routeFilterName; + return this; + } + + @Override + public RouteFilterRuleImpl withAccess(Access access) { + this.inner().withAccess(access); + return this; + } + + @Override + public RouteFilterRuleImpl withCommunities(List communities) { + this.inner().withCommunities(communities); + return this; + } + + @Override + public RouteFilterRuleImpl withRouteFilterRuleType(String routeFilterRuleType) { + this.inner().withRouteFilterRuleType(routeFilterRuleType); + return this; + } + + @Override + public RouteFilterRuleImpl withLocation(String location) { + this.inner().withLocation(location); + return this; + } + + @Override + public RouteFilterRuleImpl withName(String name) { + this.inner().withName(name); + return this; + } + + @Override + public RouteFilterRuleImpl withId(String id) { + if (isInCreateMode()) { + this.inner().withId(id); + } else { + this.updateParameter.withId(id); + } + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/RouteFilterRuleInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/RouteFilterRuleInner.java new file mode 100644 index 000000000000..8c4fdbb22882 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/RouteFilterRuleInner.java @@ -0,0 +1,195 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.Access; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Route Filter Rule Resource. + */ +@JsonFlatten +public class RouteFilterRuleInner extends SubResource { + /** + * The access type of the rule. Valid values are: 'Allow', 'Deny'. Possible + * values include: 'Allow', 'Deny'. + */ + @JsonProperty(value = "properties.access", required = true) + private Access access; + + /** + * The rule type of the rule. Valid value is: 'Community'. + */ + @JsonProperty(value = "properties.routeFilterRuleType", required = true) + private String routeFilterRuleType; + + /** + * The collection for bgp community values to filter on. e.g. + * ['12076:5010','12076:5020']. + */ + @JsonProperty(value = "properties.communities", required = true) + private List communities; + + /** + * The provisioning state of the resource. Possible values are: 'Updating', + * 'Deleting', 'Succeeded' and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Resource location. + */ + @JsonProperty(value = "location") + private String location; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Creates an instance of RouteFilterRuleInner class. + * @param access the access type of the rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny'. + * @param communities the collection for bgp community values to filter on. e.g. ['12076:5010','12076:5020']. + */ + public RouteFilterRuleInner() { + routeFilterRuleType = "Community"; + } + + /** + * Get the access type of the rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny'. + * + * @return the access value + */ + public Access access() { + return this.access; + } + + /** + * Set the access type of the rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny'. + * + * @param access the access value to set + * @return the RouteFilterRuleInner object itself. + */ + public RouteFilterRuleInner withAccess(Access access) { + this.access = access; + return this; + } + + /** + * Get the rule type of the rule. Valid value is: 'Community'. + * + * @return the routeFilterRuleType value + */ + public String routeFilterRuleType() { + return this.routeFilterRuleType; + } + + /** + * Set the rule type of the rule. Valid value is: 'Community'. + * + * @param routeFilterRuleType the routeFilterRuleType value to set + * @return the RouteFilterRuleInner object itself. + */ + public RouteFilterRuleInner withRouteFilterRuleType(String routeFilterRuleType) { + this.routeFilterRuleType = routeFilterRuleType; + return this; + } + + /** + * Get the collection for bgp community values to filter on. e.g. ['12076:5010','12076:5020']. + * + * @return the communities value + */ + public List communities() { + return this.communities; + } + + /** + * Set the collection for bgp community values to filter on. e.g. ['12076:5010','12076:5020']. + * + * @param communities the communities value to set + * @return the RouteFilterRuleInner object itself. + */ + public RouteFilterRuleInner withCommunities(List communities) { + this.communities = communities; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the RouteFilterRuleInner object itself. + */ + public RouteFilterRuleInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get resource location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set resource location. + * + * @param location the location value to set + * @return the RouteFilterRuleInner object itself. + */ + public RouteFilterRuleInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/RouteFilterRulesImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/RouteFilterRulesImpl.java new file mode 100644 index 000000000000..acf99f208c71 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/RouteFilterRulesImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_06_01.RouteFilterRules; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_06_01.RouteFilterRule; + +class RouteFilterRulesImpl extends WrapperImpl implements RouteFilterRules { + private final NetworkManager manager; + + RouteFilterRulesImpl(NetworkManager manager) { + super(manager.inner().routeFilterRules()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public RouteFilterRuleImpl define(String name) { + return wrapModel(name); + } + + private RouteFilterRuleImpl wrapModel(RouteFilterRuleInner inner) { + return new RouteFilterRuleImpl(inner, manager()); + } + + private RouteFilterRuleImpl wrapModel(String name) { + return new RouteFilterRuleImpl(name, this.manager()); + } + + @Override + public Observable listByRouteFilterAsync(final String resourceGroupName, final String routeFilterName) { + RouteFilterRulesInner client = this.inner(); + return client.listByRouteFilterAsync(resourceGroupName, routeFilterName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public RouteFilterRule call(RouteFilterRuleInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String routeFilterName, String ruleName) { + RouteFilterRulesInner client = this.inner(); + return client.getAsync(resourceGroupName, routeFilterName, ruleName) + .map(new Func1() { + @Override + public RouteFilterRule call(RouteFilterRuleInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String routeFilterName, String ruleName) { + RouteFilterRulesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, routeFilterName, ruleName).toCompletable(); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/RouteFilterRulesInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/RouteFilterRulesInner.java new file mode 100644 index 000000000000..6e03e80f66c3 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/RouteFilterRulesInner.java @@ -0,0 +1,955 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_06_01.PatchRouteFilterRule; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +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 RouteFilterRules. + */ +public class RouteFilterRulesInner { + /** The Retrofit service to perform REST calls. */ + private RouteFilterRulesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of RouteFilterRulesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public RouteFilterRulesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(RouteFilterRulesService.class); + this.client = client; + } + + /** + * The interface defining all the services for RouteFilterRules to be + * used by Retrofit to perform actually REST calls. + */ + interface RouteFilterRulesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.RouteFilterRules delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("routeFilterName") String routeFilterName, @Path("ruleName") String ruleName, @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.network.v2018_06_01.RouteFilterRules beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("routeFilterName") String routeFilterName, @Path("ruleName") String ruleName, @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.network.v2018_06_01.RouteFilterRules get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("routeFilterName") String routeFilterName, @Path("ruleName") String ruleName, @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.network.v2018_06_01.RouteFilterRules createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("routeFilterName") String routeFilterName, @Path("ruleName") String ruleName, @Path("subscriptionId") String subscriptionId, @Body RouteFilterRuleInner routeFilterRuleParameters, @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.network.v2018_06_01.RouteFilterRules beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("routeFilterName") String routeFilterName, @Path("ruleName") String ruleName, @Path("subscriptionId") String subscriptionId, @Body RouteFilterRuleInner routeFilterRuleParameters, @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.network.v2018_06_01.RouteFilterRules update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("routeFilterName") String routeFilterName, @Path("ruleName") String ruleName, @Path("subscriptionId") String subscriptionId, @Body PatchRouteFilterRule routeFilterRuleParameters, @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.network.v2018_06_01.RouteFilterRules beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}") + Observable> beginUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("routeFilterName") String routeFilterName, @Path("ruleName") String ruleName, @Path("subscriptionId") String subscriptionId, @Body PatchRouteFilterRule routeFilterRuleParameters, @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.network.v2018_06_01.RouteFilterRules listByRouteFilter" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules") + Observable> listByRouteFilter(@Path("resourceGroupName") String resourceGroupName, @Path("routeFilterName") String routeFilterName, @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.network.v2018_06_01.RouteFilterRules listByRouteFilterNext" }) + @GET + Observable> listByRouteFilterNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String routeFilterName, String ruleName) { + deleteWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName).toBlocking().last().body(); + } + + /** + * Deletes the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String routeFilterName, String ruleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName), serviceCallback); + } + + /** + * Deletes the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String routeFilterName, String ruleName) { + return deleteWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String routeFilterName, String ruleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName is required and cannot be null."); + } + if (ruleName == null) { + throw new IllegalArgumentException("Parameter ruleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + Observable> observable = service.delete(resourceGroupName, routeFilterName, ruleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String routeFilterName, String ruleName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName).toBlocking().single().body(); + } + + /** + * Deletes the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String routeFilterName, String ruleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName), serviceCallback); + } + + /** + * Deletes the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String routeFilterName, String ruleName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String routeFilterName, String ruleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName is required and cannot be null."); + } + if (ruleName == null) { + throw new IllegalArgumentException("Parameter ruleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.beginDelete(resourceGroupName, routeFilterName, ruleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteFilterRuleInner object if successful. + */ + public RouteFilterRuleInner get(String resourceGroupName, String routeFilterName, String ruleName) { + return getWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName).toBlocking().single().body(); + } + + /** + * Gets the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String routeFilterName, String ruleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName), serviceCallback); + } + + /** + * Gets the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteFilterRuleInner object + */ + public Observable getAsync(String resourceGroupName, String routeFilterName, String ruleName) { + return getWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName).map(new Func1, RouteFilterRuleInner>() { + @Override + public RouteFilterRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteFilterRuleInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String routeFilterName, String ruleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName is required and cannot be null."); + } + if (ruleName == null) { + throw new IllegalArgumentException("Parameter ruleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.get(resourceGroupName, routeFilterName, ruleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteFilterRuleInner object if successful. + */ + public RouteFilterRuleInner createOrUpdate(String resourceGroupName, String routeFilterName, String ruleName, RouteFilterRuleInner routeFilterRuleParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters).toBlocking().last().body(); + } + + /** + * Creates or updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String routeFilterName, String ruleName, RouteFilterRuleInner routeFilterRuleParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters), serviceCallback); + } + + /** + * Creates or updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String routeFilterName, String ruleName, RouteFilterRuleInner routeFilterRuleParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters).map(new Func1, RouteFilterRuleInner>() { + @Override + public RouteFilterRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String routeFilterName, String ruleName, RouteFilterRuleInner routeFilterRuleParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName is required and cannot be null."); + } + if (ruleName == null) { + throw new IllegalArgumentException("Parameter ruleName 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 (routeFilterRuleParameters == null) { + throw new IllegalArgumentException("Parameter routeFilterRuleParameters is required and cannot be null."); + } + Validator.validate(routeFilterRuleParameters); + final String apiVersion = "2018-06-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, routeFilterName, ruleName, this.client.subscriptionId(), routeFilterRuleParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteFilterRuleInner object if successful. + */ + public RouteFilterRuleInner beginCreateOrUpdate(String resourceGroupName, String routeFilterName, String ruleName, RouteFilterRuleInner routeFilterRuleParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters).toBlocking().single().body(); + } + + /** + * Creates or updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String routeFilterName, String ruleName, RouteFilterRuleInner routeFilterRuleParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters), serviceCallback); + } + + /** + * Creates or updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteFilterRuleInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String routeFilterName, String ruleName, RouteFilterRuleInner routeFilterRuleParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters).map(new Func1, RouteFilterRuleInner>() { + @Override + public RouteFilterRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteFilterRuleInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String routeFilterName, String ruleName, RouteFilterRuleInner routeFilterRuleParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName is required and cannot be null."); + } + if (ruleName == null) { + throw new IllegalArgumentException("Parameter ruleName 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 (routeFilterRuleParameters == null) { + throw new IllegalArgumentException("Parameter routeFilterRuleParameters is required and cannot be null."); + } + Validator.validate(routeFilterRuleParameters); + final String apiVersion = "2018-06-01"; + return service.beginCreateOrUpdate(resourceGroupName, routeFilterName, ruleName, this.client.subscriptionId(), routeFilterRuleParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the update route filter rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteFilterRuleInner object if successful. + */ + public RouteFilterRuleInner update(String resourceGroupName, String routeFilterName, String ruleName, PatchRouteFilterRule routeFilterRuleParameters) { + return updateWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters).toBlocking().last().body(); + } + + /** + * Updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the update route filter rule operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String routeFilterName, String ruleName, PatchRouteFilterRule routeFilterRuleParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters), serviceCallback); + } + + /** + * Updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the update route filter rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String routeFilterName, String ruleName, PatchRouteFilterRule routeFilterRuleParameters) { + return updateWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters).map(new Func1, RouteFilterRuleInner>() { + @Override + public RouteFilterRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the update route filter rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String routeFilterName, String ruleName, PatchRouteFilterRule routeFilterRuleParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName is required and cannot be null."); + } + if (ruleName == null) { + throw new IllegalArgumentException("Parameter ruleName 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 (routeFilterRuleParameters == null) { + throw new IllegalArgumentException("Parameter routeFilterRuleParameters is required and cannot be null."); + } + Validator.validate(routeFilterRuleParameters); + final String apiVersion = "2018-06-01"; + Observable> observable = service.update(resourceGroupName, routeFilterName, ruleName, this.client.subscriptionId(), routeFilterRuleParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the update route filter rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteFilterRuleInner object if successful. + */ + public RouteFilterRuleInner beginUpdate(String resourceGroupName, String routeFilterName, String ruleName, PatchRouteFilterRule routeFilterRuleParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters).toBlocking().single().body(); + } + + /** + * Updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the update route filter rule operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String routeFilterName, String ruleName, PatchRouteFilterRule routeFilterRuleParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters), serviceCallback); + } + + /** + * Updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the update route filter rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteFilterRuleInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String routeFilterName, String ruleName, PatchRouteFilterRule routeFilterRuleParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters).map(new Func1, RouteFilterRuleInner>() { + @Override + public RouteFilterRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the update route filter rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteFilterRuleInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String routeFilterName, String ruleName, PatchRouteFilterRule routeFilterRuleParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName is required and cannot be null."); + } + if (ruleName == null) { + throw new IllegalArgumentException("Parameter ruleName 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 (routeFilterRuleParameters == null) { + throw new IllegalArgumentException("Parameter routeFilterRuleParameters is required and cannot be null."); + } + Validator.validate(routeFilterRuleParameters); + final String apiVersion = "2018-06-01"; + return service.beginUpdate(resourceGroupName, routeFilterName, ruleName, this.client.subscriptionId(), routeFilterRuleParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all RouteFilterRules in a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RouteFilterRuleInner> object if successful. + */ + public PagedList listByRouteFilter(final String resourceGroupName, final String routeFilterName) { + ServiceResponse> response = listByRouteFilterSinglePageAsync(resourceGroupName, routeFilterName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByRouteFilterNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all RouteFilterRules in a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @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> listByRouteFilterAsync(final String resourceGroupName, final String routeFilterName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByRouteFilterSinglePageAsync(resourceGroupName, routeFilterName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByRouteFilterNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all RouteFilterRules in a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteFilterRuleInner> object + */ + public Observable> listByRouteFilterAsync(final String resourceGroupName, final String routeFilterName) { + return listByRouteFilterWithServiceResponseAsync(resourceGroupName, routeFilterName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all RouteFilterRules in a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteFilterRuleInner> object + */ + public Observable>> listByRouteFilterWithServiceResponseAsync(final String resourceGroupName, final String routeFilterName) { + return listByRouteFilterSinglePageAsync(resourceGroupName, routeFilterName) + .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(listByRouteFilterNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all RouteFilterRules in a route filter. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RouteFilterRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByRouteFilterSinglePageAsync(final String resourceGroupName, final String routeFilterName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.listByRouteFilter(resourceGroupName, routeFilterName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByRouteFilterDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByRouteFilterDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all RouteFilterRules in a route filter. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RouteFilterRuleInner> object if successful. + */ + public PagedList listByRouteFilterNext(final String nextPageLink) { + ServiceResponse> response = listByRouteFilterNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByRouteFilterNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all RouteFilterRules in a route filter. + * + * @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> listByRouteFilterNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByRouteFilterNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByRouteFilterNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all RouteFilterRules in a route filter. + * + * @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<RouteFilterRuleInner> object + */ + public Observable> listByRouteFilterNextAsync(final String nextPageLink) { + return listByRouteFilterNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all RouteFilterRules in a route filter. + * + * @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<RouteFilterRuleInner> object + */ + public Observable>> listByRouteFilterNextWithServiceResponseAsync(final String nextPageLink) { + return listByRouteFilterNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByRouteFilterNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all RouteFilterRules in a route filter. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RouteFilterRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByRouteFilterNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByRouteFilterNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByRouteFilterNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByRouteFilterNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/RouteFiltersImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/RouteFiltersImpl.java new file mode 100644 index 000000000000..77d19ffd0a4f --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/RouteFiltersImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_06_01.RouteFilters; +import com.microsoft.azure.management.network.v2018_06_01.RouteFilter; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class RouteFiltersImpl extends GroupableResourcesCoreImpl implements RouteFilters { + protected RouteFiltersImpl(NetworkManager manager) { + super(manager.inner().routeFilters(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + RouteFiltersInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + RouteFiltersInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + RouteFiltersInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + RouteFiltersInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public RouteFilter call(RouteFilterInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + RouteFiltersInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + RouteFiltersInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public RouteFilter call(RouteFilterInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public RouteFilterImpl define(String name) { + return wrapModel(name); + } + + @Override + protected RouteFilterImpl wrapModel(RouteFilterInner inner) { + return new RouteFilterImpl(inner.name(), inner, manager()); + } + + @Override + protected RouteFilterImpl wrapModel(String name) { + return new RouteFilterImpl(name, new RouteFilterInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/RouteFiltersInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/RouteFiltersInner.java new file mode 100644 index 000000000000..415664d95d87 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/RouteFiltersInner.java @@ -0,0 +1,1207 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_06_01.PatchRouteFilter; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +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 RouteFilters. + */ +public class RouteFiltersInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private RouteFiltersService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of RouteFiltersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public RouteFiltersInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(RouteFiltersService.class); + this.client = client; + } + + /** + * The interface defining all the services for RouteFilters to be + * used by Retrofit to perform actually REST calls. + */ + interface RouteFiltersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.RouteFilters delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("routeFilterName") String routeFilterName, @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.network.v2018_06_01.RouteFilters beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("routeFilterName") String routeFilterName, @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.network.v2018_06_01.RouteFilters getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("routeFilterName") String routeFilterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @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.network.v2018_06_01.RouteFilters createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("routeFilterName") String routeFilterName, @Path("subscriptionId") String subscriptionId, @Body RouteFilterInner routeFilterParameters, @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.network.v2018_06_01.RouteFilters beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("routeFilterName") String routeFilterName, @Path("subscriptionId") String subscriptionId, @Body RouteFilterInner routeFilterParameters, @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.network.v2018_06_01.RouteFilters update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("routeFilterName") String routeFilterName, @Path("subscriptionId") String subscriptionId, @Body PatchRouteFilter routeFilterParameters, @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.network.v2018_06_01.RouteFilters beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}") + Observable> beginUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("routeFilterName") String routeFilterName, @Path("subscriptionId") String subscriptionId, @Body PatchRouteFilter routeFilterParameters, @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.network.v2018_06_01.RouteFilters listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @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.network.v2018_06_01.RouteFilters list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/routeFilters") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.RouteFilters listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.RouteFilters listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String routeFilterName) { + deleteWithServiceResponseAsync(resourceGroupName, routeFilterName).toBlocking().last().body(); + } + + /** + * Deletes the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @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 routeFilterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, routeFilterName), serviceCallback); + } + + /** + * Deletes the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String routeFilterName) { + return deleteWithServiceResponseAsync(resourceGroupName, routeFilterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String routeFilterName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + Observable> observable = service.delete(resourceGroupName, routeFilterName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String routeFilterName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, routeFilterName).toBlocking().single().body(); + } + + /** + * Deletes the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String routeFilterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, routeFilterName), serviceCallback); + } + + /** + * Deletes the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String routeFilterName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, routeFilterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String routeFilterName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.beginDelete(resourceGroupName, routeFilterName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteFilterInner object if successful. + */ + public RouteFilterInner getByResourceGroup(String resourceGroupName, String routeFilterName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, routeFilterName).toBlocking().single().body(); + } + + /** + * Gets the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String routeFilterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, routeFilterName), serviceCallback); + } + + /** + * Gets the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteFilterInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String routeFilterName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, routeFilterName).map(new Func1, RouteFilterInner>() { + @Override + public RouteFilterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteFilterInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String routeFilterName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + final String expand = null; + return service.getByResourceGroup(resourceGroupName, routeFilterName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param expand Expands referenced express route bgp peering resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteFilterInner object if successful. + */ + public RouteFilterInner getByResourceGroup(String resourceGroupName, String routeFilterName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, routeFilterName, expand).toBlocking().single().body(); + } + + /** + * Gets the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param expand Expands referenced express route bgp peering resources. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String routeFilterName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, routeFilterName, expand), serviceCallback); + } + + /** + * Gets the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param expand Expands referenced express route bgp peering resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteFilterInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String routeFilterName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, routeFilterName, expand).map(new Func1, RouteFilterInner>() { + @Override + public RouteFilterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param expand Expands referenced express route bgp peering resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteFilterInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String routeFilterName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.getByResourceGroup(resourceGroupName, routeFilterName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the create or update route filter operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteFilterInner object if successful. + */ + public RouteFilterInner createOrUpdate(String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, routeFilterParameters).toBlocking().last().body(); + } + + /** + * Creates or updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the create or update route filter operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, routeFilterParameters), serviceCallback); + } + + /** + * Creates or updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the create or update route filter operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, routeFilterParameters).map(new Func1, RouteFilterInner>() { + @Override + public RouteFilterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the create or update route filter operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName 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 (routeFilterParameters == null) { + throw new IllegalArgumentException("Parameter routeFilterParameters is required and cannot be null."); + } + Validator.validate(routeFilterParameters); + final String apiVersion = "2018-06-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, routeFilterName, this.client.subscriptionId(), routeFilterParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the create or update route filter operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteFilterInner object if successful. + */ + public RouteFilterInner beginCreateOrUpdate(String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, routeFilterParameters).toBlocking().single().body(); + } + + /** + * Creates or updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the create or update route filter operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, routeFilterParameters), serviceCallback); + } + + /** + * Creates or updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the create or update route filter operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteFilterInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, routeFilterParameters).map(new Func1, RouteFilterInner>() { + @Override + public RouteFilterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the create or update route filter operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteFilterInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName 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 (routeFilterParameters == null) { + throw new IllegalArgumentException("Parameter routeFilterParameters is required and cannot be null."); + } + Validator.validate(routeFilterParameters); + final String apiVersion = "2018-06-01"; + return service.beginCreateOrUpdate(resourceGroupName, routeFilterName, this.client.subscriptionId(), routeFilterParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the update route filter operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteFilterInner object if successful. + */ + public RouteFilterInner update(String resourceGroupName, String routeFilterName, PatchRouteFilter routeFilterParameters) { + return updateWithServiceResponseAsync(resourceGroupName, routeFilterName, routeFilterParameters).toBlocking().last().body(); + } + + /** + * Updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the update route filter operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String routeFilterName, PatchRouteFilter routeFilterParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, routeFilterName, routeFilterParameters), serviceCallback); + } + + /** + * Updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the update route filter operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String routeFilterName, PatchRouteFilter routeFilterParameters) { + return updateWithServiceResponseAsync(resourceGroupName, routeFilterName, routeFilterParameters).map(new Func1, RouteFilterInner>() { + @Override + public RouteFilterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the update route filter operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String routeFilterName, PatchRouteFilter routeFilterParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName 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 (routeFilterParameters == null) { + throw new IllegalArgumentException("Parameter routeFilterParameters is required and cannot be null."); + } + Validator.validate(routeFilterParameters); + final String apiVersion = "2018-06-01"; + Observable> observable = service.update(resourceGroupName, routeFilterName, this.client.subscriptionId(), routeFilterParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the update route filter operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteFilterInner object if successful. + */ + public RouteFilterInner beginUpdate(String resourceGroupName, String routeFilterName, PatchRouteFilter routeFilterParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, routeFilterParameters).toBlocking().single().body(); + } + + /** + * Updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the update route filter operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String routeFilterName, PatchRouteFilter routeFilterParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, routeFilterParameters), serviceCallback); + } + + /** + * Updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the update route filter operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteFilterInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String routeFilterName, PatchRouteFilter routeFilterParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, routeFilterParameters).map(new Func1, RouteFilterInner>() { + @Override + public RouteFilterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the update route filter operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteFilterInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String routeFilterName, PatchRouteFilter routeFilterParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeFilterName == null) { + throw new IllegalArgumentException("Parameter routeFilterName 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 (routeFilterParameters == null) { + throw new IllegalArgumentException("Parameter routeFilterParameters is required and cannot be null."); + } + Validator.validate(routeFilterParameters); + final String apiVersion = "2018-06-01"; + return service.beginUpdate(resourceGroupName, routeFilterName, this.client.subscriptionId(), routeFilterParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all route filters in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RouteFilterInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all route filters in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all route filters in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteFilterInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all route filters in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteFilterInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all route filters in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RouteFilterInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all route filters in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RouteFilterInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all route filters in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all route filters in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteFilterInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all route filters in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteFilterInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all route filters in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RouteFilterInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all route filters in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RouteFilterInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all route filters in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all route filters in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteFilterInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all route filters in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteFilterInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all route filters in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RouteFilterInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all route filters in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RouteFilterInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all route filters in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all route filters in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteFilterInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all route filters in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteFilterInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all route filters in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RouteFilterInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/RouteImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/RouteImpl.java new file mode 100644 index 000000000000..c482ceb40432 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/RouteImpl.java @@ -0,0 +1,157 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.Route; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_06_01.RouteNextHopType; + +class RouteImpl extends CreatableUpdatableImpl implements Route, Route.Definition, Route.Update { + private final NetworkManager manager; + private String resourceGroupName; + private String routeTableName; + private String routeName; + + RouteImpl(String name, NetworkManager manager) { + super(name, new RouteInner()); + this.manager = manager; + // Set resource name + this.routeName = name; + // + } + + RouteImpl(RouteInner inner, NetworkManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.routeName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.routeTableName = IdParsingUtils.getValueFromIdByName(inner.id(), "routeTables"); + this.routeName = IdParsingUtils.getValueFromIdByName(inner.id(), "routes"); + // + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + RoutesInner client = this.manager().inner().routes(); + return client.createOrUpdateAsync(this.resourceGroupName, this.routeTableName, this.routeName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + RoutesInner client = this.manager().inner().routes(); + return client.createOrUpdateAsync(this.resourceGroupName, this.routeTableName, this.routeName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + RoutesInner client = this.manager().inner().routes(); + return client.getAsync(this.resourceGroupName, this.routeTableName, this.routeName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String addressPrefix() { + return this.inner().addressPrefix(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String nextHopIpAddress() { + return this.inner().nextHopIpAddress(); + } + + @Override + public RouteNextHopType nextHopType() { + return this.inner().nextHopType(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public RouteImpl withExistingRouteTable(String resourceGroupName, String routeTableName) { + this.resourceGroupName = resourceGroupName; + this.routeTableName = routeTableName; + return this; + } + + @Override + public RouteImpl withNextHopType(RouteNextHopType nextHopType) { + this.inner().withNextHopType(nextHopType); + return this; + } + + @Override + public RouteImpl withAddressPrefix(String addressPrefix) { + this.inner().withAddressPrefix(addressPrefix); + return this; + } + + @Override + public RouteImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public RouteImpl withId(String id) { + this.inner().withId(id); + return this; + } + + @Override + public RouteImpl withName(String name) { + this.inner().withName(name); + return this; + } + + @Override + public RouteImpl withNextHopIpAddress(String nextHopIpAddress) { + this.inner().withNextHopIpAddress(nextHopIpAddress); + return this; + } + + @Override + public RouteImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/RouteInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/RouteInner.java new file mode 100644 index 000000000000..2667b70c2ae5 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/RouteInner.java @@ -0,0 +1,183 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.RouteNextHopType; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Route resource. + */ +@JsonFlatten +public class RouteInner extends SubResource { + /** + * The destination CIDR to which the route applies. + */ + @JsonProperty(value = "properties.addressPrefix") + private String addressPrefix; + + /** + * The type of Azure hop the packet should be sent to. Possible values are: + * 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', + * and 'None'. Possible values include: 'VirtualNetworkGateway', + * 'VnetLocal', 'Internet', 'VirtualAppliance', 'None'. + */ + @JsonProperty(value = "properties.nextHopType", required = true) + private RouteNextHopType nextHopType; + + /** + * The IP address packets should be forwarded to. Next hop values are only + * allowed in routes where the next hop type is VirtualAppliance. + */ + @JsonProperty(value = "properties.nextHopIpAddress") + private String nextHopIpAddress; + + /** + * The provisioning state of the resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get the destination CIDR to which the route applies. + * + * @return the addressPrefix value + */ + public String addressPrefix() { + return this.addressPrefix; + } + + /** + * Set the destination CIDR to which the route applies. + * + * @param addressPrefix the addressPrefix value to set + * @return the RouteInner object itself. + */ + public RouteInner withAddressPrefix(String addressPrefix) { + this.addressPrefix = addressPrefix; + return this; + } + + /** + * Get the type of Azure hop the packet should be sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'. Possible values include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', 'None'. + * + * @return the nextHopType value + */ + public RouteNextHopType nextHopType() { + return this.nextHopType; + } + + /** + * Set the type of Azure hop the packet should be sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'. Possible values include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', 'None'. + * + * @param nextHopType the nextHopType value to set + * @return the RouteInner object itself. + */ + public RouteInner withNextHopType(RouteNextHopType nextHopType) { + this.nextHopType = nextHopType; + return this; + } + + /** + * Get the IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance. + * + * @return the nextHopIpAddress value + */ + public String nextHopIpAddress() { + return this.nextHopIpAddress; + } + + /** + * Set the IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance. + * + * @param nextHopIpAddress the nextHopIpAddress value to set + * @return the RouteInner object itself. + */ + public RouteInner withNextHopIpAddress(String nextHopIpAddress) { + this.nextHopIpAddress = nextHopIpAddress; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the RouteInner object itself. + */ + public RouteInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the RouteInner object itself. + */ + public RouteInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the RouteInner object itself. + */ + public RouteInner withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/RouteTableImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/RouteTableImpl.java new file mode 100644 index 000000000000..3e5eb2a5fd09 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/RouteTableImpl.java @@ -0,0 +1,111 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_06_01.RouteTable; +import rx.Observable; +import java.util.List; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_06_01.Route; +import com.microsoft.azure.management.network.v2018_06_01.Subnet; + +class RouteTableImpl extends GroupableResourceCoreImpl implements RouteTable, RouteTable.Definition, RouteTable.Update { + RouteTableImpl(String name, RouteTableInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + RouteTablesInner client = this.manager().inner().routeTables(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + RouteTablesInner client = this.manager().inner().routeTables(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + RouteTablesInner client = this.manager().inner().routeTables(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public Boolean disableBgpRoutePropagation() { + return this.inner().disableBgpRoutePropagation(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public List routes() { + List lst = new ArrayList(); + if (this.inner().routes() != null) { + for (RouteInner inner : this.inner().routes()) { + lst.add( new RouteImpl(inner, manager())); + } + } + return lst; + } + + @Override + public List subnets() { + List lst = new ArrayList(); + if (this.inner().subnets() != null) { + for (SubnetInner inner : this.inner().subnets()) { + lst.add( new SubnetImpl(inner, manager())); + } + } + return lst; + } + + @Override + public RouteTableImpl withDisableBgpRoutePropagation(Boolean disableBgpRoutePropagation) { + this.inner().withDisableBgpRoutePropagation(disableBgpRoutePropagation); + return this; + } + + @Override + public RouteTableImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public RouteTableImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public RouteTableImpl withRoutes(List routes) { + this.inner().withRoutes(routes); + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/RouteTableInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/RouteTableInner.java new file mode 100644 index 000000000000..4bf310cc38a9 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/RouteTableInner.java @@ -0,0 +1,171 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Route table resource. + */ +@JsonFlatten +@SkipParentValidation +public class RouteTableInner extends Resource { + /** + * Collection of routes contained within a route table. + */ + @JsonProperty(value = "properties.routes") + private List routes; + + /** + * A collection of references to subnets. + */ + @JsonProperty(value = "properties.subnets", access = JsonProperty.Access.WRITE_ONLY) + private List subnets; + + /** + * Gets or sets whether to disable the routes learned by BGP on that route + * table. True means disable. + */ + @JsonProperty(value = "properties.disableBgpRoutePropagation") + private Boolean disableBgpRoutePropagation; + + /** + * The provisioning state of the resource. Possible values are: 'Updating', + * 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get collection of routes contained within a route table. + * + * @return the routes value + */ + public List routes() { + return this.routes; + } + + /** + * Set collection of routes contained within a route table. + * + * @param routes the routes value to set + * @return the RouteTableInner object itself. + */ + public RouteTableInner withRoutes(List routes) { + this.routes = routes; + return this; + } + + /** + * Get a collection of references to subnets. + * + * @return the subnets value + */ + public List subnets() { + return this.subnets; + } + + /** + * Get gets or sets whether to disable the routes learned by BGP on that route table. True means disable. + * + * @return the disableBgpRoutePropagation value + */ + public Boolean disableBgpRoutePropagation() { + return this.disableBgpRoutePropagation; + } + + /** + * Set gets or sets whether to disable the routes learned by BGP on that route table. True means disable. + * + * @param disableBgpRoutePropagation the disableBgpRoutePropagation value to set + * @return the RouteTableInner object itself. + */ + public RouteTableInner withDisableBgpRoutePropagation(Boolean disableBgpRoutePropagation) { + this.disableBgpRoutePropagation = disableBgpRoutePropagation; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the RouteTableInner object itself. + */ + public RouteTableInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set gets a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the RouteTableInner object itself. + */ + public RouteTableInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the RouteTableInner object itself. + */ + public RouteTableInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/RouteTablesImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/RouteTablesImpl.java new file mode 100644 index 000000000000..777cf18b398f --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/RouteTablesImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_06_01.RouteTables; +import com.microsoft.azure.management.network.v2018_06_01.RouteTable; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class RouteTablesImpl extends GroupableResourcesCoreImpl implements RouteTables { + protected RouteTablesImpl(NetworkManager manager) { + super(manager.inner().routeTables(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + RouteTablesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + RouteTablesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + RouteTablesInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + RouteTablesInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public RouteTable call(RouteTableInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + RouteTablesInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + RouteTablesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public RouteTable call(RouteTableInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public RouteTableImpl define(String name) { + return wrapModel(name); + } + + @Override + protected RouteTableImpl wrapModel(RouteTableInner inner) { + return new RouteTableImpl(inner.name(), inner, manager()); + } + + @Override + protected RouteTableImpl wrapModel(String name) { + return new RouteTableImpl(name, new RouteTableInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/RouteTablesInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/RouteTablesInner.java new file mode 100644 index 000000000000..5b8681dbaec4 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/RouteTablesInner.java @@ -0,0 +1,1355 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_06_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.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 RouteTables. + */ +public class RouteTablesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private RouteTablesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of RouteTablesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public RouteTablesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(RouteTablesService.class); + this.client = client; + } + + /** + * The interface defining all the services for RouteTables to be + * used by Retrofit to perform actually REST calls. + */ + interface RouteTablesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.RouteTables delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("routeTableName") String routeTableName, @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.network.v2018_06_01.RouteTables beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("routeTableName") String routeTableName, @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.network.v2018_06_01.RouteTables getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("routeTableName") String routeTableName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @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.network.v2018_06_01.RouteTables createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("routeTableName") String routeTableName, @Path("subscriptionId") String subscriptionId, @Body RouteTableInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.RouteTables beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("routeTableName") String routeTableName, @Path("subscriptionId") String subscriptionId, @Body RouteTableInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.RouteTables updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("routeTableName") String routeTableName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.RouteTables beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}") + Observable> beginUpdateTags(@Path("resourceGroupName") String resourceGroupName, @Path("routeTableName") String routeTableName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.RouteTables listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @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.network.v2018_06_01.RouteTables list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/routeTables") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.RouteTables listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.RouteTables listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String routeTableName) { + deleteWithServiceResponseAsync(resourceGroupName, routeTableName).toBlocking().last().body(); + } + + /** + * Deletes the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @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 routeTableName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, routeTableName), serviceCallback); + } + + /** + * Deletes the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String routeTableName) { + return deleteWithServiceResponseAsync(resourceGroupName, routeTableName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String routeTableName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + Observable> observable = service.delete(resourceGroupName, routeTableName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String routeTableName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, routeTableName).toBlocking().single().body(); + } + + /** + * Deletes the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String routeTableName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, routeTableName), serviceCallback); + } + + /** + * Deletes the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String routeTableName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, routeTableName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String routeTableName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.beginDelete(resourceGroupName, routeTableName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteTableInner object if successful. + */ + public RouteTableInner getByResourceGroup(String resourceGroupName, String routeTableName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, routeTableName).toBlocking().single().body(); + } + + /** + * Gets the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String routeTableName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, routeTableName), serviceCallback); + } + + /** + * Gets the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteTableInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String routeTableName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, routeTableName).map(new Func1, RouteTableInner>() { + @Override + public RouteTableInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteTableInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String routeTableName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + final String expand = null; + return service.getByResourceGroup(resourceGroupName, routeTableName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteTableInner object if successful. + */ + public RouteTableInner getByResourceGroup(String resourceGroupName, String routeTableName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, routeTableName, expand).toBlocking().single().body(); + } + + /** + * Gets the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param expand Expands referenced resources. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String routeTableName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, routeTableName, expand), serviceCallback); + } + + /** + * Gets the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteTableInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String routeTableName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, routeTableName, expand).map(new Func1, RouteTableInner>() { + @Override + public RouteTableInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteTableInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String routeTableName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.getByResourceGroup(resourceGroupName, routeTableName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Create or updates a route table in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param parameters Parameters supplied to the create or update route table operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteTableInner object if successful. + */ + public RouteTableInner createOrUpdate(String resourceGroupName, String routeTableName, RouteTableInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, parameters).toBlocking().last().body(); + } + + /** + * Create or updates a route table in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param parameters Parameters supplied to the create or update route table operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String routeTableName, RouteTableInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, parameters), serviceCallback); + } + + /** + * Create or updates a route table in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param parameters Parameters supplied to the create or update route table operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String routeTableName, RouteTableInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, parameters).map(new Func1, RouteTableInner>() { + @Override + public RouteTableInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or updates a route table in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param parameters Parameters supplied to the create or update route table operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String routeTableName, RouteTableInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, routeTableName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or updates a route table in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param parameters Parameters supplied to the create or update route table operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteTableInner object if successful. + */ + public RouteTableInner beginCreateOrUpdate(String resourceGroupName, String routeTableName, RouteTableInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, parameters).toBlocking().single().body(); + } + + /** + * Create or updates a route table in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param parameters Parameters supplied to the create or update route table operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String routeTableName, RouteTableInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, parameters), serviceCallback); + } + + /** + * Create or updates a route table in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param parameters Parameters supplied to the create or update route table operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteTableInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String routeTableName, RouteTableInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, parameters).map(new Func1, RouteTableInner>() { + @Override + public RouteTableInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or updates a route table in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param parameters Parameters supplied to the create or update route table operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteTableInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String routeTableName, RouteTableInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + return service.beginCreateOrUpdate(resourceGroupName, routeTableName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteTableInner object if successful. + */ + public RouteTableInner updateTags(String resourceGroupName, String routeTableName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, routeTableName).toBlocking().last().body(); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @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 updateTagsAsync(String resourceGroupName, String routeTableName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, routeTableName), serviceCallback); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String routeTableName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, routeTableName).map(new Func1, RouteTableInner>() { + @Override + public RouteTableInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String routeTableName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + Observable> observable = service.updateTags(resourceGroupName, routeTableName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteTableInner object if successful. + */ + public RouteTableInner updateTags(String resourceGroupName, String routeTableName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, routeTableName, tags).toBlocking().last().body(); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String routeTableName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, routeTableName, tags), serviceCallback); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String routeTableName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, routeTableName, tags).map(new Func1, RouteTableInner>() { + @Override + public RouteTableInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String routeTableName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-06-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + Observable> observable = service.updateTags(resourceGroupName, routeTableName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteTableInner object if successful. + */ + public RouteTableInner beginUpdateTags(String resourceGroupName, String routeTableName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, routeTableName).toBlocking().single().body(); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @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 beginUpdateTagsAsync(String resourceGroupName, String routeTableName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, routeTableName), serviceCallback); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteTableInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String routeTableName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, routeTableName).map(new Func1, RouteTableInner>() { + @Override + public RouteTableInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteTableInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String routeTableName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.beginUpdateTags(resourceGroupName, routeTableName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteTableInner object if successful. + */ + public RouteTableInner beginUpdateTags(String resourceGroupName, String routeTableName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, routeTableName, tags).toBlocking().single().body(); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String routeTableName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, routeTableName, tags), serviceCallback); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteTableInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String routeTableName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, routeTableName, tags).map(new Func1, RouteTableInner>() { + @Override + public RouteTableInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteTableInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String routeTableName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-06-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.beginUpdateTags(resourceGroupName, routeTableName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all route tables in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RouteTableInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all route tables in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all route tables in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteTableInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all route tables in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteTableInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all route tables in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RouteTableInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all route tables in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RouteTableInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all route tables in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all route tables in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteTableInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all route tables in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteTableInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all route tables in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RouteTableInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all route tables in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RouteTableInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all route tables in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all route tables in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteTableInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all route tables in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteTableInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all route tables in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RouteTableInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all route tables in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RouteTableInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all route tables in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all route tables in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteTableInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all route tables in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteTableInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all route tables in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RouteTableInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/RoutesImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/RoutesImpl.java new file mode 100644 index 000000000000..b357364fadc8 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/RoutesImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_06_01.Routes; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_06_01.Route; + +class RoutesImpl extends WrapperImpl implements Routes { + private final NetworkManager manager; + + RoutesImpl(NetworkManager manager) { + super(manager.inner().routes()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public RouteImpl define(String name) { + return wrapModel(name); + } + + private RouteImpl wrapModel(RouteInner inner) { + return new RouteImpl(inner, manager()); + } + + private RouteImpl wrapModel(String name) { + return new RouteImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String routeTableName) { + RoutesInner client = this.inner(); + return client.listAsync(resourceGroupName, routeTableName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Route call(RouteInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String routeTableName, String routeName) { + RoutesInner client = this.inner(); + return client.getAsync(resourceGroupName, routeTableName, routeName) + .map(new Func1() { + @Override + public Route call(RouteInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String routeTableName, String routeName) { + RoutesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, routeTableName, routeName).toCompletable(); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/RoutesInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/RoutesInner.java new file mode 100644 index 000000000000..3cadf1592ed2 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/RoutesInner.java @@ -0,0 +1,764 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.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 Routes. + */ +public class RoutesInner { + /** The Retrofit service to perform REST calls. */ + private RoutesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of RoutesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public RoutesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(RoutesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Routes to be + * used by Retrofit to perform actually REST calls. + */ + interface RoutesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.Routes delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("routeTableName") String routeTableName, @Path("routeName") String routeName, @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.network.v2018_06_01.Routes beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("routeTableName") String routeTableName, @Path("routeName") String routeName, @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.network.v2018_06_01.Routes get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("routeTableName") String routeTableName, @Path("routeName") String routeName, @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.network.v2018_06_01.Routes createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("routeTableName") String routeTableName, @Path("routeName") String routeName, @Path("subscriptionId") String subscriptionId, @Body RouteInner routeParameters, @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.network.v2018_06_01.Routes beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("routeTableName") String routeTableName, @Path("routeName") String routeName, @Path("subscriptionId") String subscriptionId, @Body RouteInner routeParameters, @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.network.v2018_06_01.Routes list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("routeTableName") String routeTableName, @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.network.v2018_06_01.Routes listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String routeTableName, String routeName) { + deleteWithServiceResponseAsync(resourceGroupName, routeTableName, routeName).toBlocking().last().body(); + } + + /** + * Deletes the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @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 routeTableName, String routeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, routeTableName, routeName), serviceCallback); + } + + /** + * Deletes the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String routeTableName, String routeName) { + return deleteWithServiceResponseAsync(resourceGroupName, routeTableName, routeName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String routeTableName, String routeName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (routeName == null) { + throw new IllegalArgumentException("Parameter routeName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + Observable> observable = service.delete(resourceGroupName, routeTableName, routeName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String routeTableName, String routeName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, routeTableName, routeName).toBlocking().single().body(); + } + + /** + * Deletes the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String routeTableName, String routeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, routeTableName, routeName), serviceCallback); + } + + /** + * Deletes the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String routeTableName, String routeName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, routeTableName, routeName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String routeTableName, String routeName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (routeName == null) { + throw new IllegalArgumentException("Parameter routeName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.beginDelete(resourceGroupName, routeTableName, routeName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteInner object if successful. + */ + public RouteInner get(String resourceGroupName, String routeTableName, String routeName) { + return getWithServiceResponseAsync(resourceGroupName, routeTableName, routeName).toBlocking().single().body(); + } + + /** + * Gets the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @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 routeTableName, String routeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, routeTableName, routeName), serviceCallback); + } + + /** + * Gets the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteInner object + */ + public Observable getAsync(String resourceGroupName, String routeTableName, String routeName) { + return getWithServiceResponseAsync(resourceGroupName, routeTableName, routeName).map(new Func1, RouteInner>() { + @Override + public RouteInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String routeTableName, String routeName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (routeName == null) { + throw new IllegalArgumentException("Parameter routeName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.get(resourceGroupName, routeTableName, routeName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a route in the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param routeParameters Parameters supplied to the create or update route operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteInner object if successful. + */ + public RouteInner createOrUpdate(String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, routeName, routeParameters).toBlocking().last().body(); + } + + /** + * Creates or updates a route in the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param routeParameters Parameters supplied to the create or update route operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, routeName, routeParameters), serviceCallback); + } + + /** + * Creates or updates a route in the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param routeParameters Parameters supplied to the create or update route operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, routeName, routeParameters).map(new Func1, RouteInner>() { + @Override + public RouteInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a route in the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param routeParameters Parameters supplied to the create or update route operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (routeName == null) { + throw new IllegalArgumentException("Parameter routeName 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 (routeParameters == null) { + throw new IllegalArgumentException("Parameter routeParameters is required and cannot be null."); + } + Validator.validate(routeParameters); + final String apiVersion = "2018-06-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, routeTableName, routeName, this.client.subscriptionId(), routeParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a route in the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param routeParameters Parameters supplied to the create or update route operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RouteInner object if successful. + */ + public RouteInner beginCreateOrUpdate(String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, routeName, routeParameters).toBlocking().single().body(); + } + + /** + * Creates or updates a route in the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param routeParameters Parameters supplied to the create or update route operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, routeName, routeParameters), serviceCallback); + } + + /** + * Creates or updates a route in the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param routeParameters Parameters supplied to the create or update route operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, routeName, routeParameters).map(new Func1, RouteInner>() { + @Override + public RouteInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a route in the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param routeParameters Parameters supplied to the create or update route operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RouteInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (routeName == null) { + throw new IllegalArgumentException("Parameter routeName 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 (routeParameters == null) { + throw new IllegalArgumentException("Parameter routeParameters is required and cannot be null."); + } + Validator.validate(routeParameters); + final String apiVersion = "2018-06-01"; + return service.beginCreateOrUpdate(resourceGroupName, routeTableName, routeName, this.client.subscriptionId(), routeParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all routes in a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RouteInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String routeTableName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, routeTableName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all routes in a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String routeTableName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, routeTableName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all routes in a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String routeTableName) { + return listWithServiceResponseAsync(resourceGroupName, routeTableName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all routes in a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RouteInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String routeTableName) { + return listSinglePageAsync(resourceGroupName, routeTableName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all routes in a route table. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RouteInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String routeTableName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (routeTableName == null) { + throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.list(resourceGroupName, routeTableName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all routes in a route table. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RouteInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all routes in a route table. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all routes in a route table. + * + * @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<RouteInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all routes in a route table. + * + * @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<RouteInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all routes in a route table. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RouteInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/SecurityGroupViewResultImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/SecurityGroupViewResultImpl.java new file mode 100644 index 000000000000..0e260a9327a5 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/SecurityGroupViewResultImpl.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.SecurityGroupViewResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.SecurityGroupNetworkInterface; + +class SecurityGroupViewResultImpl extends WrapperImpl implements SecurityGroupViewResult { + private final NetworkManager manager; + SecurityGroupViewResultImpl(SecurityGroupViewResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public List networkInterfaces() { + return this.inner().networkInterfaces(); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/SecurityGroupViewResultInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/SecurityGroupViewResultInner.java new file mode 100644 index 000000000000..66bcd4ccc85c --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/SecurityGroupViewResultInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.SecurityGroupNetworkInterface; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The information about security rules applied to the specified VM. + */ +public class SecurityGroupViewResultInner { + /** + * List of network interfaces on the specified VM. + */ + @JsonProperty(value = "networkInterfaces") + private List networkInterfaces; + + /** + * Get list of network interfaces on the specified VM. + * + * @return the networkInterfaces value + */ + public List networkInterfaces() { + return this.networkInterfaces; + } + + /** + * Set list of network interfaces on the specified VM. + * + * @param networkInterfaces the networkInterfaces value to set + * @return the SecurityGroupViewResultInner object itself. + */ + public SecurityGroupViewResultInner withNetworkInterfaces(List networkInterfaces) { + this.networkInterfaces = networkInterfaces; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/SecurityRuleInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/SecurityRuleInner.java new file mode 100644 index 000000000000..85d6b6991cae --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/SecurityRuleInner.java @@ -0,0 +1,508 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.SecurityRuleProtocol; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.SecurityRuleAccess; +import com.microsoft.azure.management.network.v2018_06_01.SecurityRuleDirection; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Network security rule. + */ +@JsonFlatten +public class SecurityRuleInner extends SubResource { + /** + * A description for this rule. Restricted to 140 chars. + */ + @JsonProperty(value = "properties.description") + private String description; + + /** + * Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', + * and '*'. Possible values include: 'Tcp', 'Udp', '*'. + */ + @JsonProperty(value = "properties.protocol", required = true) + private SecurityRuleProtocol protocol; + + /** + * The source port or range. Integer or range between 0 and 65535. Asterix + * '*' can also be used to match all ports. + */ + @JsonProperty(value = "properties.sourcePortRange") + private String sourcePortRange; + + /** + * The destination port or range. Integer or range between 0 and 65535. + * Asterix '*' can also be used to match all ports. + */ + @JsonProperty(value = "properties.destinationPortRange") + private String destinationPortRange; + + /** + * The CIDR or source IP range. Asterix '*' can also be used to match all + * source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' + * and 'Internet' can also be used. If this is an ingress rule, specifies + * where network traffic originates from. + */ + @JsonProperty(value = "properties.sourceAddressPrefix") + private String sourceAddressPrefix; + + /** + * The CIDR or source IP ranges. + */ + @JsonProperty(value = "properties.sourceAddressPrefixes") + private List sourceAddressPrefixes; + + /** + * The application security group specified as source. + */ + @JsonProperty(value = "properties.sourceApplicationSecurityGroups") + private List sourceApplicationSecurityGroups; + + /** + * The destination address prefix. CIDR or destination IP range. Asterix + * '*' can also be used to match all source IPs. Default tags such as + * 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. + */ + @JsonProperty(value = "properties.destinationAddressPrefix") + private String destinationAddressPrefix; + + /** + * The destination address prefixes. CIDR or destination IP ranges. + */ + @JsonProperty(value = "properties.destinationAddressPrefixes") + private List destinationAddressPrefixes; + + /** + * The application security group specified as destination. + */ + @JsonProperty(value = "properties.destinationApplicationSecurityGroups") + private List destinationApplicationSecurityGroups; + + /** + * The source port ranges. + */ + @JsonProperty(value = "properties.sourcePortRanges") + private List sourcePortRanges; + + /** + * The destination port ranges. + */ + @JsonProperty(value = "properties.destinationPortRanges") + private List destinationPortRanges; + + /** + * The network traffic is allowed or denied. Possible values are: 'Allow' + * and 'Deny'. Possible values include: 'Allow', 'Deny'. + */ + @JsonProperty(value = "properties.access", required = true) + private SecurityRuleAccess access; + + /** + * The priority of the rule. The value can be between 100 and 4096. The + * priority number must be unique for each rule in the collection. The + * lower the priority number, the higher the priority of the rule. + */ + @JsonProperty(value = "properties.priority") + private Integer priority; + + /** + * The direction of the rule. The direction specifies if rule will be + * evaluated on incoming or outcoming traffic. Possible values are: + * 'Inbound' and 'Outbound'. Possible values include: 'Inbound', + * 'Outbound'. + */ + @JsonProperty(value = "properties.direction", required = true) + private SecurityRuleDirection direction; + + /** + * The provisioning state of the public IP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get a description for this rule. Restricted to 140 chars. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set a description for this rule. Restricted to 140 chars. + * + * @param description the description value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'. Possible values include: 'Tcp', 'Udp', '*'. + * + * @return the protocol value + */ + public SecurityRuleProtocol protocol() { + return this.protocol; + } + + /** + * Set network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'. Possible values include: 'Tcp', 'Udp', '*'. + * + * @param protocol the protocol value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withProtocol(SecurityRuleProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the source port or range. Integer or range between 0 and 65535. Asterix '*' can also be used to match all ports. + * + * @return the sourcePortRange value + */ + public String sourcePortRange() { + return this.sourcePortRange; + } + + /** + * Set the source port or range. Integer or range between 0 and 65535. Asterix '*' can also be used to match all ports. + * + * @param sourcePortRange the sourcePortRange value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withSourcePortRange(String sourcePortRange) { + this.sourcePortRange = sourcePortRange; + return this; + } + + /** + * Get the destination port or range. Integer or range between 0 and 65535. Asterix '*' can also be used to match all ports. + * + * @return the destinationPortRange value + */ + public String destinationPortRange() { + return this.destinationPortRange; + } + + /** + * Set the destination port or range. Integer or range between 0 and 65535. Asterix '*' can also be used to match all ports. + * + * @param destinationPortRange the destinationPortRange value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withDestinationPortRange(String destinationPortRange) { + this.destinationPortRange = destinationPortRange; + return this; + } + + /** + * Get the CIDR or source IP range. Asterix '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. + * + * @return the sourceAddressPrefix value + */ + public String sourceAddressPrefix() { + return this.sourceAddressPrefix; + } + + /** + * Set the CIDR or source IP range. Asterix '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. + * + * @param sourceAddressPrefix the sourceAddressPrefix value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withSourceAddressPrefix(String sourceAddressPrefix) { + this.sourceAddressPrefix = sourceAddressPrefix; + return this; + } + + /** + * Get the CIDR or source IP ranges. + * + * @return the sourceAddressPrefixes value + */ + public List sourceAddressPrefixes() { + return this.sourceAddressPrefixes; + } + + /** + * Set the CIDR or source IP ranges. + * + * @param sourceAddressPrefixes the sourceAddressPrefixes value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withSourceAddressPrefixes(List sourceAddressPrefixes) { + this.sourceAddressPrefixes = sourceAddressPrefixes; + return this; + } + + /** + * Get the application security group specified as source. + * + * @return the sourceApplicationSecurityGroups value + */ + public List sourceApplicationSecurityGroups() { + return this.sourceApplicationSecurityGroups; + } + + /** + * Set the application security group specified as source. + * + * @param sourceApplicationSecurityGroups the sourceApplicationSecurityGroups value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withSourceApplicationSecurityGroups(List sourceApplicationSecurityGroups) { + this.sourceApplicationSecurityGroups = sourceApplicationSecurityGroups; + return this; + } + + /** + * Get the destination address prefix. CIDR or destination IP range. Asterix '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. + * + * @return the destinationAddressPrefix value + */ + public String destinationAddressPrefix() { + return this.destinationAddressPrefix; + } + + /** + * Set the destination address prefix. CIDR or destination IP range. Asterix '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. + * + * @param destinationAddressPrefix the destinationAddressPrefix value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withDestinationAddressPrefix(String destinationAddressPrefix) { + this.destinationAddressPrefix = destinationAddressPrefix; + return this; + } + + /** + * Get the destination address prefixes. CIDR or destination IP ranges. + * + * @return the destinationAddressPrefixes value + */ + public List destinationAddressPrefixes() { + return this.destinationAddressPrefixes; + } + + /** + * Set the destination address prefixes. CIDR or destination IP ranges. + * + * @param destinationAddressPrefixes the destinationAddressPrefixes value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withDestinationAddressPrefixes(List destinationAddressPrefixes) { + this.destinationAddressPrefixes = destinationAddressPrefixes; + return this; + } + + /** + * Get the application security group specified as destination. + * + * @return the destinationApplicationSecurityGroups value + */ + public List destinationApplicationSecurityGroups() { + return this.destinationApplicationSecurityGroups; + } + + /** + * Set the application security group specified as destination. + * + * @param destinationApplicationSecurityGroups the destinationApplicationSecurityGroups value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withDestinationApplicationSecurityGroups(List destinationApplicationSecurityGroups) { + this.destinationApplicationSecurityGroups = destinationApplicationSecurityGroups; + return this; + } + + /** + * Get the source port ranges. + * + * @return the sourcePortRanges value + */ + public List sourcePortRanges() { + return this.sourcePortRanges; + } + + /** + * Set the source port ranges. + * + * @param sourcePortRanges the sourcePortRanges value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withSourcePortRanges(List sourcePortRanges) { + this.sourcePortRanges = sourcePortRanges; + return this; + } + + /** + * Get the destination port ranges. + * + * @return the destinationPortRanges value + */ + public List destinationPortRanges() { + return this.destinationPortRanges; + } + + /** + * Set the destination port ranges. + * + * @param destinationPortRanges the destinationPortRanges value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withDestinationPortRanges(List destinationPortRanges) { + this.destinationPortRanges = destinationPortRanges; + return this; + } + + /** + * Get the network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'. Possible values include: 'Allow', 'Deny'. + * + * @return the access value + */ + public SecurityRuleAccess access() { + return this.access; + } + + /** + * Set the network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'. Possible values include: 'Allow', 'Deny'. + * + * @param access the access value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withAccess(SecurityRuleAccess access) { + this.access = access; + return this; + } + + /** + * Get the priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule. + * + * @return the priority value + */ + public Integer priority() { + return this.priority; + } + + /** + * Set the priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule. + * + * @param priority the priority value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withPriority(Integer priority) { + this.priority = priority; + return this; + } + + /** + * Get the direction of the rule. The direction specifies if rule will be evaluated on incoming or outcoming traffic. Possible values are: 'Inbound' and 'Outbound'. Possible values include: 'Inbound', 'Outbound'. + * + * @return the direction value + */ + public SecurityRuleDirection direction() { + return this.direction; + } + + /** + * Set the direction of the rule. The direction specifies if rule will be evaluated on incoming or outcoming traffic. Possible values are: 'Inbound' and 'Outbound'. Possible values include: 'Inbound', 'Outbound'. + * + * @param direction the direction value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withDirection(SecurityRuleDirection direction) { + this.direction = direction; + return this; + } + + /** + * Get the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the SecurityRuleInner object itself. + */ + public SecurityRuleInner withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/SecurityRulesImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/SecurityRulesImpl.java new file mode 100644 index 000000000000..3bbd71a3317a --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/SecurityRulesImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_06_01.SecurityRules; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_06_01.NetworkSecurityGroupSecurityRule; + +class SecurityRulesImpl extends WrapperImpl implements SecurityRules { + private final NetworkManager manager; + + SecurityRulesImpl(NetworkManager manager) { + super(manager.inner().securityRules()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public NetworkSecurityGroupSecurityRuleImpl define(String name) { + return wrapModel(name); + } + + private NetworkSecurityGroupSecurityRuleImpl wrapModel(SecurityRuleInner inner) { + return new NetworkSecurityGroupSecurityRuleImpl(inner, manager()); + } + + private NetworkSecurityGroupSecurityRuleImpl wrapModel(String name) { + return new NetworkSecurityGroupSecurityRuleImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String networkSecurityGroupName) { + SecurityRulesInner client = this.inner(); + return client.listAsync(resourceGroupName, networkSecurityGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NetworkSecurityGroupSecurityRule call(SecurityRuleInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { + SecurityRulesInner client = this.inner(); + return client.getAsync(resourceGroupName, networkSecurityGroupName, securityRuleName) + .map(new Func1() { + @Override + public NetworkSecurityGroupSecurityRule call(SecurityRuleInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { + SecurityRulesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, networkSecurityGroupName, securityRuleName).toCompletable(); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/SecurityRulesInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/SecurityRulesInner.java new file mode 100644 index 000000000000..9b0ea4b04aab --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/SecurityRulesInner.java @@ -0,0 +1,764 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.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 SecurityRules. + */ +public class SecurityRulesInner { + /** The Retrofit service to perform REST calls. */ + private SecurityRulesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of SecurityRulesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public SecurityRulesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(SecurityRulesService.class); + this.client = client; + } + + /** + * The interface defining all the services for SecurityRules to be + * used by Retrofit to perform actually REST calls. + */ + interface SecurityRulesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.SecurityRules delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("networkSecurityGroupName") String networkSecurityGroupName, @Path("securityRuleName") String securityRuleName, @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.network.v2018_06_01.SecurityRules beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("networkSecurityGroupName") String networkSecurityGroupName, @Path("securityRuleName") String securityRuleName, @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.network.v2018_06_01.SecurityRules get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("networkSecurityGroupName") String networkSecurityGroupName, @Path("securityRuleName") String securityRuleName, @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.network.v2018_06_01.SecurityRules createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("networkSecurityGroupName") String networkSecurityGroupName, @Path("securityRuleName") String securityRuleName, @Path("subscriptionId") String subscriptionId, @Body SecurityRuleInner securityRuleParameters, @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.network.v2018_06_01.SecurityRules beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("networkSecurityGroupName") String networkSecurityGroupName, @Path("securityRuleName") String securityRuleName, @Path("subscriptionId") String subscriptionId, @Body SecurityRuleInner securityRuleParameters, @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.network.v2018_06_01.SecurityRules list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("networkSecurityGroupName") String networkSecurityGroupName, @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.network.v2018_06_01.SecurityRules listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { + deleteWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName).toBlocking().last().body(); + } + + /** + * Deletes the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName), serviceCallback); + } + + /** + * Deletes the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { + return deleteWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (securityRuleName == null) { + throw new IllegalArgumentException("Parameter securityRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + Observable> observable = service.delete(resourceGroupName, networkSecurityGroupName, securityRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName).toBlocking().single().body(); + } + + /** + * Deletes the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName), serviceCallback); + } + + /** + * Deletes the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (securityRuleName == null) { + throw new IllegalArgumentException("Parameter securityRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.beginDelete(resourceGroupName, networkSecurityGroupName, securityRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SecurityRuleInner object if successful. + */ + public SecurityRuleInner get(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { + return getWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName).toBlocking().single().body(); + } + + /** + * Get the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName), serviceCallback); + } + + /** + * Get the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecurityRuleInner object + */ + public Observable getAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { + return getWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName).map(new Func1, SecurityRuleInner>() { + @Override + public SecurityRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecurityRuleInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (securityRuleName == null) { + throw new IllegalArgumentException("Parameter securityRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.get(resourceGroupName, networkSecurityGroupName, securityRuleName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a security rule in the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param securityRuleParameters Parameters supplied to the create or update network security rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SecurityRuleInner object if successful. + */ + public SecurityRuleInner createOrUpdate(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, SecurityRuleInner securityRuleParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters).toBlocking().last().body(); + } + + /** + * Creates or updates a security rule in the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param securityRuleParameters Parameters supplied to the create or update network security rule operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, SecurityRuleInner securityRuleParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters), serviceCallback); + } + + /** + * Creates or updates a security rule in the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param securityRuleParameters Parameters supplied to the create or update network security rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, SecurityRuleInner securityRuleParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters).map(new Func1, SecurityRuleInner>() { + @Override + public SecurityRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a security rule in the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param securityRuleParameters Parameters supplied to the create or update network security rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, SecurityRuleInner securityRuleParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (securityRuleName == null) { + throw new IllegalArgumentException("Parameter securityRuleName 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 (securityRuleParameters == null) { + throw new IllegalArgumentException("Parameter securityRuleParameters is required and cannot be null."); + } + Validator.validate(securityRuleParameters); + final String apiVersion = "2018-06-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, networkSecurityGroupName, securityRuleName, this.client.subscriptionId(), securityRuleParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a security rule in the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param securityRuleParameters Parameters supplied to the create or update network security rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SecurityRuleInner object if successful. + */ + public SecurityRuleInner beginCreateOrUpdate(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, SecurityRuleInner securityRuleParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters).toBlocking().single().body(); + } + + /** + * Creates or updates a security rule in the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param securityRuleParameters Parameters supplied to the create or update network security rule operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, SecurityRuleInner securityRuleParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters), serviceCallback); + } + + /** + * Creates or updates a security rule in the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param securityRuleParameters Parameters supplied to the create or update network security rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecurityRuleInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, SecurityRuleInner securityRuleParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters).map(new Func1, SecurityRuleInner>() { + @Override + public SecurityRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a security rule in the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param securityRuleParameters Parameters supplied to the create or update network security rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecurityRuleInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, SecurityRuleInner securityRuleParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (securityRuleName == null) { + throw new IllegalArgumentException("Parameter securityRuleName 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 (securityRuleParameters == null) { + throw new IllegalArgumentException("Parameter securityRuleParameters is required and cannot be null."); + } + Validator.validate(securityRuleParameters); + final String apiVersion = "2018-06-01"; + return service.beginCreateOrUpdate(resourceGroupName, networkSecurityGroupName, securityRuleName, this.client.subscriptionId(), securityRuleParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SecurityRuleInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String networkSecurityGroupName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, networkSecurityGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String networkSecurityGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, networkSecurityGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SecurityRuleInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String networkSecurityGroupName) { + return listWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SecurityRuleInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String networkSecurityGroupName) { + return listSinglePageAsync(resourceGroupName, networkSecurityGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all security rules in a network security group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SecurityRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String networkSecurityGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkSecurityGroupName == null) { + throw new IllegalArgumentException("Parameter networkSecurityGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.list(resourceGroupName, networkSecurityGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all security rules in a network security group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SecurityRuleInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all security rules in a network security group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all security rules in a network security group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SecurityRuleInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all security rules in a network security group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SecurityRuleInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all security rules in a network security group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SecurityRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/SubnetImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/SubnetImpl.java new file mode 100644 index 000000000000..912b38d60173 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/SubnetImpl.java @@ -0,0 +1,199 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.Subnet; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.ServiceEndpointPropertiesFormat; +import com.microsoft.azure.management.network.v2018_06_01.IPConfiguration; +import com.microsoft.azure.management.network.v2018_06_01.ResourceNavigationLink; +import com.microsoft.azure.management.network.v2018_06_01.NetworkSecurityGroup; +import com.microsoft.azure.management.network.v2018_06_01.RouteTable; + +class SubnetImpl extends CreatableUpdatableImpl implements Subnet, Subnet.Definition, Subnet.Update { + private final NetworkManager manager; + private String resourceGroupName; + private String virtualNetworkName; + private String subnetName; + + SubnetImpl(String name, NetworkManager manager) { + super(name, new SubnetInner()); + this.manager = manager; + // Set resource name + this.subnetName = name; + // + } + + SubnetImpl(SubnetInner inner, NetworkManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.subnetName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.virtualNetworkName = IdParsingUtils.getValueFromIdByName(inner.id(), "virtualNetworks"); + this.subnetName = IdParsingUtils.getValueFromIdByName(inner.id(), "subnets"); + // + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + SubnetsInner client = this.manager().inner().subnets(); + return client.createOrUpdateAsync(this.resourceGroupName, this.virtualNetworkName, this.subnetName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + SubnetsInner client = this.manager().inner().subnets(); + return client.createOrUpdateAsync(this.resourceGroupName, this.virtualNetworkName, this.subnetName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + SubnetsInner client = this.manager().inner().subnets(); + return client.getAsync(this.resourceGroupName, this.virtualNetworkName, this.subnetName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String addressPrefix() { + return this.inner().addressPrefix(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public List ipConfigurations() { + return this.inner().ipConfigurations(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public NetworkSecurityGroup networkSecurityGroup() { + NetworkSecurityGroupInner inner = this.inner().networkSecurityGroup(); + if (inner != null) { + return new NetworkSecurityGroupImpl(inner.name(), inner, manager()); + } else { + return null; + } + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public List resourceNavigationLinks() { + return this.inner().resourceNavigationLinks(); + } + + @Override + public RouteTable routeTable() { + RouteTableInner inner = this.inner().routeTable(); + if (inner != null) { + return new RouteTableImpl(inner.name(), inner, manager()); + } else { + return null; + } + } + + @Override + public List serviceEndpoints() { + return this.inner().serviceEndpoints(); + } + + @Override + public SubnetImpl withExistingVirtualNetwork(String resourceGroupName, String virtualNetworkName) { + this.resourceGroupName = resourceGroupName; + this.virtualNetworkName = virtualNetworkName; + return this; + } + + @Override + public SubnetImpl withAddressPrefix(String addressPrefix) { + this.inner().withAddressPrefix(addressPrefix); + return this; + } + + @Override + public SubnetImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public SubnetImpl withId(String id) { + this.inner().withId(id); + return this; + } + + @Override + public SubnetImpl withName(String name) { + this.inner().withName(name); + return this; + } + + @Override + public SubnetImpl withNetworkSecurityGroup(NetworkSecurityGroupInner networkSecurityGroup) { + this.inner().withNetworkSecurityGroup(networkSecurityGroup); + return this; + } + + @Override + public SubnetImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public SubnetImpl withResourceNavigationLinks(List resourceNavigationLinks) { + this.inner().withResourceNavigationLinks(resourceNavigationLinks); + return this; + } + + @Override + public SubnetImpl withRouteTable(RouteTableInner routeTable) { + this.inner().withRouteTable(routeTable); + return this; + } + + @Override + public SubnetImpl withServiceEndpoints(List serviceEndpoints) { + this.inner().withServiceEndpoints(serviceEndpoints); + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/SubnetInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/SubnetInner.java new file mode 100644 index 000000000000..b1f08dbffe5c --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/SubnetInner.java @@ -0,0 +1,249 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.ServiceEndpointPropertiesFormat; +import com.microsoft.azure.management.network.v2018_06_01.IPConfiguration; +import com.microsoft.azure.management.network.v2018_06_01.ResourceNavigationLink; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * Subnet in a virtual network resource. + */ +@JsonFlatten +public class SubnetInner extends SubResource { + /** + * The address prefix for the subnet. + */ + @JsonProperty(value = "properties.addressPrefix") + private String addressPrefix; + + /** + * The reference of the NetworkSecurityGroup resource. + */ + @JsonProperty(value = "properties.networkSecurityGroup") + private NetworkSecurityGroupInner networkSecurityGroup; + + /** + * The reference of the RouteTable resource. + */ + @JsonProperty(value = "properties.routeTable") + private RouteTableInner routeTable; + + /** + * An array of service endpoints. + */ + @JsonProperty(value = "properties.serviceEndpoints") + private List serviceEndpoints; + + /** + * Gets an array of references to the network interface IP configurations + * using subnet. + */ + @JsonProperty(value = "properties.ipConfigurations", access = JsonProperty.Access.WRITE_ONLY) + private List ipConfigurations; + + /** + * Gets an array of references to the external resources using subnet. + */ + @JsonProperty(value = "properties.resourceNavigationLinks") + private List resourceNavigationLinks; + + /** + * The provisioning state of the resource. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get the address prefix for the subnet. + * + * @return the addressPrefix value + */ + public String addressPrefix() { + return this.addressPrefix; + } + + /** + * Set the address prefix for the subnet. + * + * @param addressPrefix the addressPrefix value to set + * @return the SubnetInner object itself. + */ + public SubnetInner withAddressPrefix(String addressPrefix) { + this.addressPrefix = addressPrefix; + return this; + } + + /** + * Get the reference of the NetworkSecurityGroup resource. + * + * @return the networkSecurityGroup value + */ + public NetworkSecurityGroupInner networkSecurityGroup() { + return this.networkSecurityGroup; + } + + /** + * Set the reference of the NetworkSecurityGroup resource. + * + * @param networkSecurityGroup the networkSecurityGroup value to set + * @return the SubnetInner object itself. + */ + public SubnetInner withNetworkSecurityGroup(NetworkSecurityGroupInner networkSecurityGroup) { + this.networkSecurityGroup = networkSecurityGroup; + return this; + } + + /** + * Get the reference of the RouteTable resource. + * + * @return the routeTable value + */ + public RouteTableInner routeTable() { + return this.routeTable; + } + + /** + * Set the reference of the RouteTable resource. + * + * @param routeTable the routeTable value to set + * @return the SubnetInner object itself. + */ + public SubnetInner withRouteTable(RouteTableInner routeTable) { + this.routeTable = routeTable; + return this; + } + + /** + * Get an array of service endpoints. + * + * @return the serviceEndpoints value + */ + public List serviceEndpoints() { + return this.serviceEndpoints; + } + + /** + * Set an array of service endpoints. + * + * @param serviceEndpoints the serviceEndpoints value to set + * @return the SubnetInner object itself. + */ + public SubnetInner withServiceEndpoints(List serviceEndpoints) { + this.serviceEndpoints = serviceEndpoints; + return this; + } + + /** + * Get gets an array of references to the network interface IP configurations using subnet. + * + * @return the ipConfigurations value + */ + public List ipConfigurations() { + return this.ipConfigurations; + } + + /** + * Get gets an array of references to the external resources using subnet. + * + * @return the resourceNavigationLinks value + */ + public List resourceNavigationLinks() { + return this.resourceNavigationLinks; + } + + /** + * Set gets an array of references to the external resources using subnet. + * + * @param resourceNavigationLinks the resourceNavigationLinks value to set + * @return the SubnetInner object itself. + */ + public SubnetInner withResourceNavigationLinks(List resourceNavigationLinks) { + this.resourceNavigationLinks = resourceNavigationLinks; + return this; + } + + /** + * Get the provisioning state of the resource. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. + * + * @param provisioningState the provisioningState value to set + * @return the SubnetInner object itself. + */ + public SubnetInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the SubnetInner object itself. + */ + public SubnetInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the SubnetInner object itself. + */ + public SubnetInner withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/SubnetsImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/SubnetsImpl.java new file mode 100644 index 000000000000..163a60333ad1 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/SubnetsImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_06_01.Subnets; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_06_01.Subnet; + +class SubnetsImpl extends WrapperImpl implements Subnets { + private final NetworkManager manager; + + SubnetsImpl(NetworkManager manager) { + super(manager.inner().subnets()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public SubnetImpl define(String name) { + return wrapModel(name); + } + + private SubnetImpl wrapModel(SubnetInner inner) { + return new SubnetImpl(inner, manager()); + } + + private SubnetImpl wrapModel(String name) { + return new SubnetImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String virtualNetworkName) { + SubnetsInner client = this.inner(); + return client.listAsync(resourceGroupName, virtualNetworkName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Subnet call(SubnetInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String virtualNetworkName, String subnetName) { + SubnetsInner client = this.inner(); + return client.getAsync(resourceGroupName, virtualNetworkName, subnetName) + .map(new Func1() { + @Override + public Subnet call(SubnetInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String virtualNetworkName, String subnetName) { + SubnetsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, virtualNetworkName, subnetName).toCompletable(); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/SubnetsInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/SubnetsInner.java new file mode 100644 index 000000000000..05a6e8d3681a --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/SubnetsInner.java @@ -0,0 +1,853 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.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 Subnets. + */ +public class SubnetsInner { + /** The Retrofit service to perform REST calls. */ + private SubnetsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of SubnetsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public SubnetsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(SubnetsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Subnets to be + * used by Retrofit to perform actually REST calls. + */ + interface SubnetsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.Subnets delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subnetName") String subnetName, @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.network.v2018_06_01.Subnets beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subnetName") String subnetName, @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.network.v2018_06_01.Subnets get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subnetName") String subnetName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @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.network.v2018_06_01.Subnets createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subnetName") String subnetName, @Path("subscriptionId") String subscriptionId, @Body SubnetInner subnetParameters, @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.network.v2018_06_01.Subnets beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subnetName") String subnetName, @Path("subscriptionId") String subscriptionId, @Body SubnetInner subnetParameters, @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.network.v2018_06_01.Subnets list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @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.network.v2018_06_01.Subnets listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String virtualNetworkName, String subnetName) { + deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName).toBlocking().last().body(); + } + + /** + * Deletes the specified subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String virtualNetworkName, String subnetName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName), serviceCallback); + } + + /** + * Deletes the specified subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String virtualNetworkName, String subnetName) { + return deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String subnetName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (subnetName == null) { + throw new IllegalArgumentException("Parameter subnetName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + Observable> observable = service.delete(resourceGroupName, virtualNetworkName, subnetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String virtualNetworkName, String subnetName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName).toBlocking().single().body(); + } + + /** + * Deletes the specified subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String virtualNetworkName, String subnetName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName), serviceCallback); + } + + /** + * Deletes the specified subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String virtualNetworkName, String subnetName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String subnetName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (subnetName == null) { + throw new IllegalArgumentException("Parameter subnetName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.beginDelete(resourceGroupName, virtualNetworkName, subnetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified subnet by virtual network and resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SubnetInner object if successful. + */ + public SubnetInner get(String resourceGroupName, String virtualNetworkName, String subnetName) { + return getWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName).toBlocking().single().body(); + } + + /** + * Gets the specified subnet by virtual network and resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String virtualNetworkName, String subnetName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName), serviceCallback); + } + + /** + * Gets the specified subnet by virtual network and resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SubnetInner object + */ + public Observable getAsync(String resourceGroupName, String virtualNetworkName, String subnetName) { + return getWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName).map(new Func1, SubnetInner>() { + @Override + public SubnetInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified subnet by virtual network and resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SubnetInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String subnetName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (subnetName == null) { + throw new IllegalArgumentException("Parameter subnetName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + final String expand = null; + return service.get(resourceGroupName, virtualNetworkName, subnetName, this.client.subscriptionId(), apiVersion, expand, 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); + } + } + }); + } + + /** + * Gets the specified subnet by virtual network and resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SubnetInner object if successful. + */ + public SubnetInner get(String resourceGroupName, String virtualNetworkName, String subnetName, String expand) { + return getWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName, expand).toBlocking().single().body(); + } + + /** + * Gets the specified subnet by virtual network and resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param expand Expands referenced resources. + * @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 virtualNetworkName, String subnetName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName, expand), serviceCallback); + } + + /** + * Gets the specified subnet by virtual network and resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SubnetInner object + */ + public Observable getAsync(String resourceGroupName, String virtualNetworkName, String subnetName, String expand) { + return getWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName, expand).map(new Func1, SubnetInner>() { + @Override + public SubnetInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified subnet by virtual network and resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SubnetInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String subnetName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (subnetName == null) { + throw new IllegalArgumentException("Parameter subnetName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.get(resourceGroupName, virtualNetworkName, subnetName, this.client.subscriptionId(), apiVersion, expand, 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a subnet in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param subnetParameters Parameters supplied to the create or update subnet operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SubnetInner object if successful. + */ + public SubnetInner createOrUpdate(String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters).toBlocking().last().body(); + } + + /** + * Creates or updates a subnet in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param subnetParameters Parameters supplied to the create or update subnet operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters), serviceCallback); + } + + /** + * Creates or updates a subnet in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param subnetParameters Parameters supplied to the create or update subnet operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters).map(new Func1, SubnetInner>() { + @Override + public SubnetInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a subnet in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param subnetParameters Parameters supplied to the create or update subnet operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (subnetName == null) { + throw new IllegalArgumentException("Parameter subnetName 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 (subnetParameters == null) { + throw new IllegalArgumentException("Parameter subnetParameters is required and cannot be null."); + } + Validator.validate(subnetParameters); + final String apiVersion = "2018-06-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, virtualNetworkName, subnetName, this.client.subscriptionId(), subnetParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a subnet in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param subnetParameters Parameters supplied to the create or update subnet operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SubnetInner object if successful. + */ + public SubnetInner beginCreateOrUpdate(String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters).toBlocking().single().body(); + } + + /** + * Creates or updates a subnet in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param subnetParameters Parameters supplied to the create or update subnet operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters), serviceCallback); + } + + /** + * Creates or updates a subnet in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param subnetParameters Parameters supplied to the create or update subnet operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SubnetInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters).map(new Func1, SubnetInner>() { + @Override + public SubnetInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a subnet in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param subnetParameters Parameters supplied to the create or update subnet operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SubnetInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (subnetName == null) { + throw new IllegalArgumentException("Parameter subnetName 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 (subnetParameters == null) { + throw new IllegalArgumentException("Parameter subnetParameters is required and cannot be null."); + } + Validator.validate(subnetParameters); + final String apiVersion = "2018-06-01"; + return service.beginCreateOrUpdate(resourceGroupName, virtualNetworkName, subnetName, this.client.subscriptionId(), subnetParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all subnets in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SubnetInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String virtualNetworkName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, virtualNetworkName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all subnets in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String virtualNetworkName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, virtualNetworkName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all subnets in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SubnetInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String virtualNetworkName) { + return listWithServiceResponseAsync(resourceGroupName, virtualNetworkName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all subnets in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SubnetInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String virtualNetworkName) { + return listSinglePageAsync(resourceGroupName, virtualNetworkName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all subnets in a virtual network. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SubnetInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String virtualNetworkName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.list(resourceGroupName, virtualNetworkName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all subnets in a virtual network. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SubnetInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all subnets in a virtual network. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all subnets in a virtual network. + * + * @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<SubnetInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all subnets in a virtual network. + * + * @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<SubnetInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all subnets in a virtual network. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SubnetInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/TopologyImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/TopologyImpl.java new file mode 100644 index 000000000000..00483a490dc5 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/TopologyImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.Topology; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.TopologyResource; + +class TopologyImpl extends WrapperImpl implements Topology { + private final NetworkManager manager; + TopologyImpl(TopologyInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public DateTime createdDateTime() { + return this.inner().createdDateTime(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public DateTime lastModified() { + return this.inner().lastModified(); + } + + @Override + public List resources() { + return this.inner().resources(); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/TopologyInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/TopologyInner.java new file mode 100644 index 000000000000..d9a93951a12b --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/TopologyInner.java @@ -0,0 +1,92 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.TopologyResource; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Topology of the specified resource group. + */ +public class TopologyInner { + /** + * GUID representing the operation id. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * The datetime when the topology was initially created for the resource + * group. + */ + @JsonProperty(value = "createdDateTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime createdDateTime; + + /** + * The datetime when the topology was last modified. + */ + @JsonProperty(value = "lastModified", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastModified; + + /** + * The resources property. + */ + @JsonProperty(value = "resources") + private List resources; + + /** + * Get gUID representing the operation id. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get the datetime when the topology was initially created for the resource group. + * + * @return the createdDateTime value + */ + public DateTime createdDateTime() { + return this.createdDateTime; + } + + /** + * Get the datetime when the topology was last modified. + * + * @return the lastModified value + */ + public DateTime lastModified() { + return this.lastModified; + } + + /** + * Get the resources value. + * + * @return the resources value + */ + public List resources() { + return this.resources; + } + + /** + * Set the resources value. + * + * @param resources the resources value to set + * @return the TopologyInner object itself. + */ + public TopologyInner withResources(List resources) { + this.resources = resources; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/TroubleshootingResultImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/TroubleshootingResultImpl.java new file mode 100644 index 000000000000..a9ddb601ee3a --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/TroubleshootingResultImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.TroubleshootingResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.TroubleshootingDetails; + +class TroubleshootingResultImpl extends WrapperImpl implements TroubleshootingResult { + private final NetworkManager manager; + TroubleshootingResultImpl(TroubleshootingResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public String code() { + return this.inner().code(); + } + + @Override + public DateTime endTime() { + return this.inner().endTime(); + } + + @Override + public List results() { + return this.inner().results(); + } + + @Override + public DateTime startTime() { + return this.inner().startTime(); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/TroubleshootingResultInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/TroubleshootingResultInner.java new file mode 100644 index 000000000000..2ac669a4d080 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/TroubleshootingResultInner.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.network.v2018_06_01.implementation; + +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.TroubleshootingDetails; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Troubleshooting information gained from specified resource. + */ +public class TroubleshootingResultInner { + /** + * The start time of the troubleshooting. + */ + @JsonProperty(value = "startTime") + private DateTime startTime; + + /** + * The end time of the troubleshooting. + */ + @JsonProperty(value = "endTime") + private DateTime endTime; + + /** + * The result code of the troubleshooting. + */ + @JsonProperty(value = "code") + private String code; + + /** + * Information from troubleshooting. + */ + @JsonProperty(value = "results") + private List results; + + /** + * Get the start time of the troubleshooting. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set the start time of the troubleshooting. + * + * @param startTime the startTime value to set + * @return the TroubleshootingResultInner object itself. + */ + public TroubleshootingResultInner withStartTime(DateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the end time of the troubleshooting. + * + * @return the endTime value + */ + public DateTime endTime() { + return this.endTime; + } + + /** + * Set the end time of the troubleshooting. + * + * @param endTime the endTime value to set + * @return the TroubleshootingResultInner object itself. + */ + public TroubleshootingResultInner withEndTime(DateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get the result code of the troubleshooting. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set the result code of the troubleshooting. + * + * @param code the code value to set + * @return the TroubleshootingResultInner object itself. + */ + public TroubleshootingResultInner withCode(String code) { + this.code = code; + return this; + } + + /** + * Get information from troubleshooting. + * + * @return the results value + */ + public List results() { + return this.results; + } + + /** + * Set information from troubleshooting. + * + * @param results the results value to set + * @return the TroubleshootingResultInner object itself. + */ + public TroubleshootingResultInner withResults(List results) { + this.results = results; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/UsageImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/UsageImpl.java new file mode 100644 index 000000000000..0a45fe98cae7 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/UsageImpl.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.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.Usage; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_06_01.UsageName; + +class UsageImpl extends WrapperImpl implements Usage { + private final NetworkManager manager; + + UsageImpl(UsageInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + + + @Override + public long currentValue() { + return this.inner().currentValue(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public long limit() { + return this.inner().limit(); + } + + @Override + public UsageName name() { + return this.inner().name(); + } + + @Override + public String unit() { + return this.inner().unit(); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/UsageInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/UsageInner.java new file mode 100644 index 000000000000..53a7e9f648d8 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/UsageInner.java @@ -0,0 +1,147 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.UsageName; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes network resource usage. + */ +public class UsageInner { + /** + * Resource identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * An enum describing the unit of measurement. + */ + @JsonProperty(value = "unit", required = true) + private String unit; + + /** + * The current value of the usage. + */ + @JsonProperty(value = "currentValue", required = true) + private long currentValue; + + /** + * The limit of usage. + */ + @JsonProperty(value = "limit", required = true) + private long limit; + + /** + * The name of the type of usage. + */ + @JsonProperty(value = "name", required = true) + private UsageName name; + + /** + * Creates an instance of UsageInner class. + * @param currentValue the current value of the usage. + * @param limit the limit of usage. + * @param name the name of the type of usage. + */ + public UsageInner() { + unit = "Count"; + } + + /** + * Get resource identifier. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get an enum describing the unit of measurement. + * + * @return the unit value + */ + public String unit() { + return this.unit; + } + + /** + * Set an enum describing the unit of measurement. + * + * @param unit the unit value to set + * @return the UsageInner object itself. + */ + public UsageInner withUnit(String unit) { + this.unit = unit; + return this; + } + + /** + * Get the current value of the usage. + * + * @return the currentValue value + */ + public long currentValue() { + return this.currentValue; + } + + /** + * Set the current value of the usage. + * + * @param currentValue the currentValue value to set + * @return the UsageInner object itself. + */ + public UsageInner withCurrentValue(long currentValue) { + this.currentValue = currentValue; + return this; + } + + /** + * Get the limit of usage. + * + * @return the limit value + */ + public long limit() { + return this.limit; + } + + /** + * Set the limit of usage. + * + * @param limit the limit value to set + * @return the UsageInner object itself. + */ + public UsageInner withLimit(long limit) { + this.limit = limit; + return this; + } + + /** + * Get the name of the type of usage. + * + * @return the name value + */ + public UsageName name() { + return this.name; + } + + /** + * Set the name of the type of usage. + * + * @param name the name value to set + * @return the UsageInner object itself. + */ + public UsageInner withName(UsageName name) { + this.name = name; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/UsagesImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/UsagesImpl.java new file mode 100644 index 000000000000..b52e5d0c10f3 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/UsagesImpl.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.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_06_01.Usages; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_06_01.Usage; + +class UsagesImpl extends WrapperImpl implements Usages { + private final NetworkManager manager; + + UsagesImpl(NetworkManager manager) { + super(manager.inner().usages()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + private UsageImpl wrapModel(UsageInner inner) { + return new UsageImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String location) { + UsagesInner client = this.inner(); + return client.listAsync(location) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Usage call(UsageInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/UsagesInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/UsagesInner.java new file mode 100644 index 000000000000..3f6c54316c34 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/UsagesInner.java @@ -0,0 +1,293 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Usages. + */ +public class UsagesInner { + /** The Retrofit service to perform REST calls. */ + private UsagesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of UsagesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public UsagesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(UsagesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Usages to be + * used by Retrofit to perform actually REST calls. + */ + interface UsagesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.Usages list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/usages") + Observable> list(@Path("location") String location, @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.network.v2018_06_01.Usages listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List network usages for a subscription. + * + * @param location The location where resource usage is queried. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<UsageInner> object if successful. + */ + public PagedList list(final String location) { + ServiceResponse> response = listSinglePageAsync(location).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List network usages for a subscription. + * + * @param location The location where resource usage is queried. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String location, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(location), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List network usages for a subscription. + * + * @param location The location where resource usage is queried. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<UsageInner> object + */ + public Observable> listAsync(final String location) { + return listWithServiceResponseAsync(location) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List network usages for a subscription. + * + * @param location The location where resource usage is queried. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<UsageInner> object + */ + public Observable>> listWithServiceResponseAsync(final String location) { + return listSinglePageAsync(location) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List network usages for a subscription. + * + ServiceResponse> * @param location The location where resource usage is queried. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<UsageInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String location) { + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.list(location, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List network usages for a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<UsageInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List network usages for a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List network usages for a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<UsageInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List network usages for a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<UsageInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List network usages for a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<UsageInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VerificationIPFlowResultImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VerificationIPFlowResultImpl.java new file mode 100644 index 000000000000..fa0503314a85 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VerificationIPFlowResultImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.VerificationIPFlowResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_06_01.Access; + +class VerificationIPFlowResultImpl extends WrapperImpl implements VerificationIPFlowResult { + private final NetworkManager manager; + VerificationIPFlowResultImpl(VerificationIPFlowResultInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Access access() { + return this.inner().access(); + } + + @Override + public String ruleName() { + return this.inner().ruleName(); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VerificationIPFlowResultInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VerificationIPFlowResultInner.java new file mode 100644 index 000000000000..21fb003a4690 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VerificationIPFlowResultInner.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.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.Access; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Results of IP flow verification on the target resource. + */ +public class VerificationIPFlowResultInner { + /** + * Indicates whether the traffic is allowed or denied. Possible values + * include: 'Allow', 'Deny'. + */ + @JsonProperty(value = "access") + private Access access; + + /** + * Name of the rule. If input is not matched against any security rule, it + * is not displayed. + */ + @JsonProperty(value = "ruleName") + private String ruleName; + + /** + * Get indicates whether the traffic is allowed or denied. Possible values include: 'Allow', 'Deny'. + * + * @return the access value + */ + public Access access() { + return this.access; + } + + /** + * Set indicates whether the traffic is allowed or denied. Possible values include: 'Allow', 'Deny'. + * + * @param access the access value to set + * @return the VerificationIPFlowResultInner object itself. + */ + public VerificationIPFlowResultInner withAccess(Access access) { + this.access = access; + return this; + } + + /** + * Get name of the rule. If input is not matched against any security rule, it is not displayed. + * + * @return the ruleName value + */ + public String ruleName() { + return this.ruleName; + } + + /** + * Set name of the rule. If input is not matched against any security rule, it is not displayed. + * + * @param ruleName the ruleName value to set + * @return the VerificationIPFlowResultInner object itself. + */ + public VerificationIPFlowResultInner withRuleName(String ruleName) { + this.ruleName = ruleName; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualHubImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualHubImpl.java new file mode 100644 index 000000000000..a8ec23e5a920 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualHubImpl.java @@ -0,0 +1,106 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_06_01.VirtualHub; +import rx.Observable; +import com.microsoft.azure.SubResource; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.ProvisioningState; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_06_01.HubVirtualNetworkConnection; + +class VirtualHubImpl extends GroupableResourceCoreImpl implements VirtualHub, VirtualHub.Definition, VirtualHub.Update { + VirtualHubImpl(String name, VirtualHubInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + VirtualHubsInner client = this.manager().inner().virtualHubs(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + VirtualHubsInner client = this.manager().inner().virtualHubs(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + VirtualHubsInner client = this.manager().inner().virtualHubs(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String addressPrefix() { + return this.inner().addressPrefix(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public List hubVirtualNetworkConnections() { + List lst = new ArrayList(); + if (this.inner().hubVirtualNetworkConnections() != null) { + for (HubVirtualNetworkConnectionInner inner : this.inner().hubVirtualNetworkConnections()) { + lst.add( new HubVirtualNetworkConnectionImpl(inner, manager())); + } + } + return lst; + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public SubResource virtualWan() { + return this.inner().virtualWan(); + } + + @Override + public VirtualHubImpl withAddressPrefix(String addressPrefix) { + this.inner().withAddressPrefix(addressPrefix); + return this; + } + + @Override + public VirtualHubImpl withHubVirtualNetworkConnections(List hubVirtualNetworkConnections) { + this.inner().withHubVirtualNetworkConnections(hubVirtualNetworkConnections); + return this; + } + + @Override + public VirtualHubImpl withProvisioningState(ProvisioningState provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public VirtualHubImpl withVirtualWan(SubResource virtualWan) { + this.inner().withVirtualWan(virtualWan); + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualHubInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualHubInner.java new file mode 100644 index 000000000000..80531450f02a --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualHubInner.java @@ -0,0 +1,172 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.SubResource; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * VirtualHub Resource. + */ +@JsonFlatten +@SkipParentValidation +public class VirtualHubInner extends Resource { + /** + * The VirtualWAN to which the VirtualHub belongs. + */ + @JsonProperty(value = "properties.virtualWan") + private SubResource virtualWan; + + /** + * list of all vnet connections with this VirtualHub. + */ + @JsonProperty(value = "properties.hubVirtualNetworkConnections") + private List hubVirtualNetworkConnections; + + /** + * Address-prefix for this VirtualHub. + */ + @JsonProperty(value = "properties.addressPrefix") + private String addressPrefix; + + /** + * The provisioning state of the resource. Possible values include: + * 'Succeeded', 'Updating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningState provisioningState; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the VirtualWAN to which the VirtualHub belongs. + * + * @return the virtualWan value + */ + public SubResource virtualWan() { + return this.virtualWan; + } + + /** + * Set the VirtualWAN to which the VirtualHub belongs. + * + * @param virtualWan the virtualWan value to set + * @return the VirtualHubInner object itself. + */ + public VirtualHubInner withVirtualWan(SubResource virtualWan) { + this.virtualWan = virtualWan; + return this; + } + + /** + * Get list of all vnet connections with this VirtualHub. + * + * @return the hubVirtualNetworkConnections value + */ + public List hubVirtualNetworkConnections() { + return this.hubVirtualNetworkConnections; + } + + /** + * Set list of all vnet connections with this VirtualHub. + * + * @param hubVirtualNetworkConnections the hubVirtualNetworkConnections value to set + * @return the VirtualHubInner object itself. + */ + public VirtualHubInner withHubVirtualNetworkConnections(List hubVirtualNetworkConnections) { + this.hubVirtualNetworkConnections = hubVirtualNetworkConnections; + return this; + } + + /** + * Get address-prefix for this VirtualHub. + * + * @return the addressPrefix value + */ + public String addressPrefix() { + return this.addressPrefix; + } + + /** + * Set address-prefix for this VirtualHub. + * + * @param addressPrefix the addressPrefix value to set + * @return the VirtualHubInner object itself. + */ + public VirtualHubInner withAddressPrefix(String addressPrefix) { + this.addressPrefix = addressPrefix; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the VirtualHubInner object itself. + */ + public VirtualHubInner withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the VirtualHubInner object itself. + */ + public VirtualHubInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualHubsImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualHubsImpl.java new file mode 100644 index 000000000000..3e2a2d5f9c83 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualHubsImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_06_01.VirtualHubs; +import com.microsoft.azure.management.network.v2018_06_01.VirtualHub; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class VirtualHubsImpl extends GroupableResourcesCoreImpl implements VirtualHubs { + protected VirtualHubsImpl(NetworkManager manager) { + super(manager.inner().virtualHubs(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + VirtualHubsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + VirtualHubsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + VirtualHubsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + VirtualHubsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VirtualHub call(VirtualHubInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + VirtualHubsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + VirtualHubsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VirtualHub call(VirtualHubInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public VirtualHubImpl define(String name) { + return wrapModel(name); + } + + @Override + protected VirtualHubImpl wrapModel(VirtualHubInner inner) { + return new VirtualHubImpl(inner.name(), inner, manager()); + } + + @Override + protected VirtualHubImpl wrapModel(String name) { + return new VirtualHubImpl(name, new VirtualHubInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualHubsInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualHubsInner.java new file mode 100644 index 000000000000..cbd31834f606 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualHubsInner.java @@ -0,0 +1,1274 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_06_01.ErrorException; +import com.microsoft.azure.management.network.v2018_06_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.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 VirtualHubs. + */ +public class VirtualHubsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private VirtualHubsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of VirtualHubsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public VirtualHubsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(VirtualHubsService.class); + this.client = client; + } + + /** + * The interface defining all the services for VirtualHubs to be + * used by Retrofit to perform actually REST calls. + */ + interface VirtualHubsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.VirtualHubs getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualHubName") String virtualHubName, @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.network.v2018_06_01.VirtualHubs createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualHubName") String virtualHubName, @Query("api-version") String apiVersion, @Body VirtualHubInner virtualHubParameters, @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.network.v2018_06_01.VirtualHubs beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualHubName") String virtualHubName, @Query("api-version") String apiVersion, @Body VirtualHubInner virtualHubParameters, @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.network.v2018_06_01.VirtualHubs updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}") + Observable> updateTags(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualHubName") String virtualHubName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject virtualHubParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.VirtualHubs beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}") + Observable> beginUpdateTags(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualHubName") String virtualHubName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject virtualHubParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.VirtualHubs delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualHubName") String virtualHubName, @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.network.v2018_06_01.VirtualHubs beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualHubName") String virtualHubName, @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.network.v2018_06_01.VirtualHubs listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.VirtualHubs list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualHubs") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.VirtualHubs listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.VirtualHubs listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Retrieves the details of a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualHubInner object if successful. + */ + public VirtualHubInner getByResourceGroup(String resourceGroupName, String virtualHubName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualHubName).toBlocking().single().body(); + } + + /** + * Retrieves the details of a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String virtualHubName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualHubName), serviceCallback); + } + + /** + * Retrieves the details of a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualHubInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String virtualHubName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualHubName).map(new Func1, VirtualHubInner>() { + @Override + public VirtualHubInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Retrieves the details of a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualHubInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String virtualHubName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualHubName == null) { + throw new IllegalArgumentException("Parameter virtualHubName is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, virtualHubName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param virtualHubParameters Parameters supplied to create or update VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualHubInner object if successful. + */ + public VirtualHubInner createOrUpdate(String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualHubName, virtualHubParameters).toBlocking().last().body(); + } + + /** + * Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param virtualHubParameters Parameters supplied to create or update VirtualHub. + * @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 virtualHubName, VirtualHubInner virtualHubParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualHubName, virtualHubParameters), serviceCallback); + } + + /** + * Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param virtualHubParameters Parameters supplied to create or update VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualHubName, virtualHubParameters).map(new Func1, VirtualHubInner>() { + @Override + public VirtualHubInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param virtualHubParameters Parameters supplied to create or update VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualHubName == null) { + throw new IllegalArgumentException("Parameter virtualHubName is required and cannot be null."); + } + if (virtualHubParameters == null) { + throw new IllegalArgumentException("Parameter virtualHubParameters is required and cannot be null."); + } + Validator.validate(virtualHubParameters); + final String apiVersion = "2018-06-01"; + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, virtualHubName, apiVersion, virtualHubParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param virtualHubParameters Parameters supplied to create or update VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualHubInner object if successful. + */ + public VirtualHubInner beginCreateOrUpdate(String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualHubName, virtualHubParameters).toBlocking().single().body(); + } + + /** + * Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param virtualHubParameters Parameters supplied to create or update VirtualHub. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualHubName, virtualHubParameters), serviceCallback); + } + + /** + * Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param virtualHubParameters Parameters supplied to create or update VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualHubInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualHubName, virtualHubParameters).map(new Func1, VirtualHubInner>() { + @Override + public VirtualHubInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param virtualHubParameters Parameters supplied to create or update VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualHubInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualHubName == null) { + throw new IllegalArgumentException("Parameter virtualHubName is required and cannot be null."); + } + if (virtualHubParameters == null) { + throw new IllegalArgumentException("Parameter virtualHubParameters is required and cannot be null."); + } + Validator.validate(virtualHubParameters); + final String apiVersion = "2018-06-01"; + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, virtualHubName, apiVersion, virtualHubParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualHubInner object if successful. + */ + public VirtualHubInner updateTags(String resourceGroupName, String virtualHubName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualHubName).toBlocking().last().body(); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @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 updateTagsAsync(String resourceGroupName, String virtualHubName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, virtualHubName), serviceCallback); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String virtualHubName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualHubName).map(new Func1, VirtualHubInner>() { + @Override + public VirtualHubInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String virtualHubName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualHubName == null) { + throw new IllegalArgumentException("Parameter virtualHubName is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + final Map tags = null; + TagsObject virtualHubParameters = new TagsObject(); + virtualHubParameters.withTags(null); + Observable> observable = service.updateTags(this.client.subscriptionId(), resourceGroupName, virtualHubName, apiVersion, this.client.acceptLanguage(), virtualHubParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualHubInner object if successful. + */ + public VirtualHubInner updateTags(String resourceGroupName, String virtualHubName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualHubName, tags).toBlocking().last().body(); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String virtualHubName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, virtualHubName, tags), serviceCallback); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String virtualHubName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualHubName, tags).map(new Func1, VirtualHubInner>() { + @Override + public VirtualHubInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String virtualHubName, Map tags) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualHubName == null) { + throw new IllegalArgumentException("Parameter virtualHubName is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-06-01"; + TagsObject virtualHubParameters = new TagsObject(); + virtualHubParameters.withTags(tags); + Observable> observable = service.updateTags(this.client.subscriptionId(), resourceGroupName, virtualHubName, apiVersion, this.client.acceptLanguage(), virtualHubParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualHubInner object if successful. + */ + public VirtualHubInner beginUpdateTags(String resourceGroupName, String virtualHubName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualHubName).toBlocking().single().body(); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @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 beginUpdateTagsAsync(String resourceGroupName, String virtualHubName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualHubName), serviceCallback); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualHubInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String virtualHubName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualHubName).map(new Func1, VirtualHubInner>() { + @Override + public VirtualHubInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualHubInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String virtualHubName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualHubName == null) { + throw new IllegalArgumentException("Parameter virtualHubName is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + final Map tags = null; + TagsObject virtualHubParameters = new TagsObject(); + virtualHubParameters.withTags(null); + return service.beginUpdateTags(this.client.subscriptionId(), resourceGroupName, virtualHubName, apiVersion, this.client.acceptLanguage(), virtualHubParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualHubInner object if successful. + */ + public VirtualHubInner beginUpdateTags(String resourceGroupName, String virtualHubName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualHubName, tags).toBlocking().single().body(); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String virtualHubName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualHubName, tags), serviceCallback); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualHubInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String virtualHubName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualHubName, tags).map(new Func1, VirtualHubInner>() { + @Override + public VirtualHubInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualHubInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String virtualHubName, Map tags) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualHubName == null) { + throw new IllegalArgumentException("Parameter virtualHubName is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-06-01"; + TagsObject virtualHubParameters = new TagsObject(); + virtualHubParameters.withTags(tags); + return service.beginUpdateTags(this.client.subscriptionId(), resourceGroupName, virtualHubName, apiVersion, this.client.acceptLanguage(), virtualHubParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Deletes a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException 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 virtualHubName) { + deleteWithServiceResponseAsync(resourceGroupName, virtualHubName).toBlocking().last().body(); + } + + /** + * Deletes a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @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 virtualHubName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, virtualHubName), serviceCallback); + } + + /** + * Deletes a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String virtualHubName) { + return deleteWithServiceResponseAsync(resourceGroupName, virtualHubName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String virtualHubName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualHubName == null) { + throw new IllegalArgumentException("Parameter virtualHubName is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, virtualHubName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String virtualHubName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, virtualHubName).toBlocking().single().body(); + } + + /** + * Deletes a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String virtualHubName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, virtualHubName), serviceCallback); + } + + /** + * Deletes a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String virtualHubName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, virtualHubName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String virtualHubName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualHubName == null) { + throw new IllegalArgumentException("Parameter virtualHubName is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, virtualHubName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the VirtualHubs in a resource group. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException 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<VirtualHubInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the VirtualHubs in a resource group. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the VirtualHubs in a resource group. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualHubInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the VirtualHubs in a resource group. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualHubInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the VirtualHubs in a resource group. + * + ServiceResponse> * @param resourceGroupName The resource group name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualHubInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the VirtualHubs in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException 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<VirtualHubInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the VirtualHubs in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the VirtualHubs in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualHubInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the VirtualHubs in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualHubInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the VirtualHubs in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualHubInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the VirtualHubs in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException 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<VirtualHubInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the VirtualHubs in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the VirtualHubs in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualHubInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the VirtualHubs in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualHubInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the VirtualHubs in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualHubInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the VirtualHubs in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException 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<VirtualHubInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the VirtualHubs in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the VirtualHubs in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualHubInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the VirtualHubs in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualHubInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the VirtualHubs in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualHubInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl.java new file mode 100644 index 000000000000..9fbf5df29747 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl.java @@ -0,0 +1,154 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.VirtualMachineScaleSetNetworkInterfaceIPConfiguration; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationGatewayBackendAddressPool; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_06_01.ApplicationSecurityGroup; +import com.microsoft.azure.management.network.v2018_06_01.BackendAddressPool; +import com.microsoft.azure.management.network.v2018_06_01.InboundNatRule; +import com.microsoft.azure.management.network.v2018_06_01.IPVersion; +import com.microsoft.azure.management.network.v2018_06_01.IPAllocationMethod; +import com.microsoft.azure.management.network.v2018_06_01.PublicIPAddress; +import com.microsoft.azure.management.network.v2018_06_01.Subnet; + +class VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl extends IndexableRefreshableWrapperImpl implements VirtualMachineScaleSetNetworkInterfaceIPConfiguration { + private final NetworkManager manager; + private String resourceGroupName; + private String virtualMachineScaleSetName; + private String virtualmachineIndex; + private String networkInterfaceName; + private String ipConfigurationName; + + VirtualMachineScaleSetNetworkInterfaceIPConfigurationImpl(NetworkInterfaceIPConfigurationInner inner, NetworkManager manager) { + super(null, inner); + this.manager = manager; + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.virtualMachineScaleSetName = IdParsingUtils.getValueFromIdByName(inner.id(), "virtualMachineScaleSets"); + this.virtualmachineIndex = IdParsingUtils.getValueFromIdByName(inner.id(), "virtualMachines"); + this.networkInterfaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "networkInterfaces"); + this.ipConfigurationName = IdParsingUtils.getValueFromIdByName(inner.id(), "ipConfigurations"); + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + NetworkInterfacesInner client = this.manager().inner().networkInterfaces(); + return client.getVirtualMachineScaleSetIpConfigurationAsync(this.resourceGroupName, this.virtualMachineScaleSetName, this.virtualmachineIndex, this.networkInterfaceName, this.ipConfigurationName); + } + + + + @Override + public List applicationGatewayBackendAddressPools() { + return this.inner().applicationGatewayBackendAddressPools(); + } + + @Override + public List applicationSecurityGroups() { + List lst = new ArrayList(); + if (this.inner().applicationSecurityGroups() != null) { + for (ApplicationSecurityGroupInner inner : this.inner().applicationSecurityGroups()) { + lst.add( new ApplicationSecurityGroupImpl(inner.name(), inner, manager())); + } + } + return lst; + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public List loadBalancerBackendAddressPools() { + List lst = new ArrayList(); + if (this.inner().loadBalancerBackendAddressPools() != null) { + for (BackendAddressPoolInner inner : this.inner().loadBalancerBackendAddressPools()) { + lst.add( new BackendAddressPoolImpl(inner, manager())); + } + } + return lst; + } + + @Override + public List loadBalancerInboundNatRules() { + List lst = new ArrayList(); + if (this.inner().loadBalancerInboundNatRules() != null) { + for (InboundNatRuleInner inner : this.inner().loadBalancerInboundNatRules()) { + lst.add( new InboundNatRuleImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Boolean primary() { + return this.inner().primary(); + } + + @Override + public String privateIPAddress() { + return this.inner().privateIPAddress(); + } + + @Override + public IPVersion privateIPAddressVersion() { + return this.inner().privateIPAddressVersion(); + } + + @Override + public IPAllocationMethod privateIPAllocationMethod() { + return this.inner().privateIPAllocationMethod(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public PublicIPAddress publicIPAddress() { + PublicIPAddressInner inner = this.inner().publicIPAddress(); + if (inner != null) { + return new PublicIPAddressImpl(inner.name(), inner, manager()); + } else { + return null; + } + } + + @Override + public Subnet subnet() { + SubnetInner inner = this.inner().subnet(); + if (inner != null) { + return new SubnetImpl(inner, manager()); + } else { + return null; + } + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkGatewayConnectionImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkGatewayConnectionImpl.java new file mode 100644 index 000000000000..11fcc5de545a --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkGatewayConnectionImpl.java @@ -0,0 +1,237 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkGatewayConnection; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkGatewayConnectionType; +import com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkGatewayConnectionStatus; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.TunnelConnectionHealth; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_06_01.IpsecPolicy; +import com.microsoft.azure.management.network.v2018_06_01.LocalNetworkGateway; +import com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkGateway; + +class VirtualNetworkGatewayConnectionImpl extends GroupableResourceCoreImpl implements VirtualNetworkGatewayConnection, VirtualNetworkGatewayConnection.Definition, VirtualNetworkGatewayConnection.Update { + VirtualNetworkGatewayConnectionImpl(String name, VirtualNetworkGatewayConnectionInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + VirtualNetworkGatewayConnectionsInner client = this.manager().inner().virtualNetworkGatewayConnections(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + VirtualNetworkGatewayConnectionsInner client = this.manager().inner().virtualNetworkGatewayConnections(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + VirtualNetworkGatewayConnectionsInner client = this.manager().inner().virtualNetworkGatewayConnections(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String authorizationKey() { + return this.inner().authorizationKey(); + } + + @Override + public VirtualNetworkGatewayConnectionStatus connectionStatus() { + return this.inner().connectionStatus(); + } + + @Override + public VirtualNetworkGatewayConnectionType connectionType() { + return this.inner().connectionType(); + } + + @Override + public Long egressBytesTransferred() { + return this.inner().egressBytesTransferred(); + } + + @Override + public Boolean enableBgp() { + return this.inner().enableBgp(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public Long ingressBytesTransferred() { + return this.inner().ingressBytesTransferred(); + } + + @Override + public List ipsecPolicies() { + return this.inner().ipsecPolicies(); + } + + @Override + public LocalNetworkGateway localNetworkGateway2() { + LocalNetworkGatewayInner inner = this.inner().localNetworkGateway2(); + if (inner != null) { + return new LocalNetworkGatewayImpl(inner.name(), inner, manager()); + } else { + return null; + } + } + + @Override + public SubResource peer() { + return this.inner().peer(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public Integer routingWeight() { + return this.inner().routingWeight(); + } + + @Override + public String sharedKey() { + return this.inner().sharedKey(); + } + + @Override + public List tunnelConnectionStatus() { + return this.inner().tunnelConnectionStatus(); + } + + @Override + public Boolean usePolicyBasedTrafficSelectors() { + return this.inner().usePolicyBasedTrafficSelectors(); + } + + @Override + public VirtualNetworkGateway virtualNetworkGateway1() { + VirtualNetworkGatewayInner inner = this.inner().virtualNetworkGateway1(); + if (inner != null) { + return new VirtualNetworkGatewayImpl(inner.name(), inner, manager()); + } else { + return null; + } + } + + @Override + public VirtualNetworkGateway virtualNetworkGateway2() { + VirtualNetworkGatewayInner inner = this.inner().virtualNetworkGateway2(); + if (inner != null) { + return new VirtualNetworkGatewayImpl(inner.name(), inner, manager()); + } else { + return null; + } + } + + @Override + public VirtualNetworkGatewayConnectionImpl withConnectionType(VirtualNetworkGatewayConnectionType connectionType) { + this.inner().withConnectionType(connectionType); + return this; + } + + @Override + public VirtualNetworkGatewayConnectionImpl withVirtualNetworkGateway1(VirtualNetworkGatewayInner virtualNetworkGateway1) { + this.inner().withVirtualNetworkGateway1(virtualNetworkGateway1); + return this; + } + + @Override + public VirtualNetworkGatewayConnectionImpl withAuthorizationKey(String authorizationKey) { + this.inner().withAuthorizationKey(authorizationKey); + return this; + } + + @Override + public VirtualNetworkGatewayConnectionImpl withEnableBgp(Boolean enableBgp) { + this.inner().withEnableBgp(enableBgp); + return this; + } + + @Override + public VirtualNetworkGatewayConnectionImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public VirtualNetworkGatewayConnectionImpl withIpsecPolicies(List ipsecPolicies) { + this.inner().withIpsecPolicies(ipsecPolicies); + return this; + } + + @Override + public VirtualNetworkGatewayConnectionImpl withLocalNetworkGateway2(LocalNetworkGatewayInner localNetworkGateway2) { + this.inner().withLocalNetworkGateway2(localNetworkGateway2); + return this; + } + + @Override + public VirtualNetworkGatewayConnectionImpl withPeer(SubResource peer) { + this.inner().withPeer(peer); + return this; + } + + @Override + public VirtualNetworkGatewayConnectionImpl withResourceGuid(String resourceGuid) { + this.inner().withResourceGuid(resourceGuid); + return this; + } + + @Override + public VirtualNetworkGatewayConnectionImpl withRoutingWeight(Integer routingWeight) { + this.inner().withRoutingWeight(routingWeight); + return this; + } + + @Override + public VirtualNetworkGatewayConnectionImpl withSharedKey(String sharedKey) { + this.inner().withSharedKey(sharedKey); + return this; + } + + @Override + public VirtualNetworkGatewayConnectionImpl withUsePolicyBasedTrafficSelectors(Boolean usePolicyBasedTrafficSelectors) { + this.inner().withUsePolicyBasedTrafficSelectors(usePolicyBasedTrafficSelectors); + return this; + } + + @Override + public VirtualNetworkGatewayConnectionImpl withVirtualNetworkGateway2(VirtualNetworkGatewayInner virtualNetworkGateway2) { + this.inner().withVirtualNetworkGateway2(virtualNetworkGateway2); + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkGatewayConnectionInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkGatewayConnectionInner.java new file mode 100644 index 000000000000..5291e0849707 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkGatewayConnectionInner.java @@ -0,0 +1,474 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkGatewayConnectionType; +import com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkGatewayConnectionStatus; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.TunnelConnectionHealth; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_06_01.IpsecPolicy; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * A common class for general resource information. + */ +@JsonFlatten +@SkipParentValidation +public class VirtualNetworkGatewayConnectionInner extends Resource { + /** + * The authorizationKey. + */ + @JsonProperty(value = "properties.authorizationKey") + private String authorizationKey; + + /** + * The reference to virtual network gateway resource. + */ + @JsonProperty(value = "properties.virtualNetworkGateway1", required = true) + private VirtualNetworkGatewayInner virtualNetworkGateway1; + + /** + * The reference to virtual network gateway resource. + */ + @JsonProperty(value = "properties.virtualNetworkGateway2") + private VirtualNetworkGatewayInner virtualNetworkGateway2; + + /** + * The reference to local network gateway resource. + */ + @JsonProperty(value = "properties.localNetworkGateway2") + private LocalNetworkGatewayInner localNetworkGateway2; + + /** + * Gateway connection type. Possible values are: + * 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values + * include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient'. + */ + @JsonProperty(value = "properties.connectionType", required = true) + private VirtualNetworkGatewayConnectionType connectionType; + + /** + * The routing weight. + */ + @JsonProperty(value = "properties.routingWeight") + private Integer routingWeight; + + /** + * The IPSec shared key. + */ + @JsonProperty(value = "properties.sharedKey") + private String sharedKey; + + /** + * Virtual network Gateway connection status. Possible values are + * 'Unknown', 'Connecting', 'Connected' and 'NotConnected'. Possible values + * include: 'Unknown', 'Connecting', 'Connected', 'NotConnected'. + */ + @JsonProperty(value = "properties.connectionStatus", access = JsonProperty.Access.WRITE_ONLY) + private VirtualNetworkGatewayConnectionStatus connectionStatus; + + /** + * Collection of all tunnels' connection health status. + */ + @JsonProperty(value = "properties.tunnelConnectionStatus", access = JsonProperty.Access.WRITE_ONLY) + private List tunnelConnectionStatus; + + /** + * The egress bytes transferred in this connection. + */ + @JsonProperty(value = "properties.egressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long egressBytesTransferred; + + /** + * The ingress bytes transferred in this connection. + */ + @JsonProperty(value = "properties.ingressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long ingressBytesTransferred; + + /** + * The reference to peerings resource. + */ + @JsonProperty(value = "properties.peer") + private SubResource peer; + + /** + * EnableBgp flag. + */ + @JsonProperty(value = "properties.enableBgp") + private Boolean enableBgp; + + /** + * Enable policy-based traffic selectors. + */ + @JsonProperty(value = "properties.usePolicyBasedTrafficSelectors") + private Boolean usePolicyBasedTrafficSelectors; + + /** + * The IPSec Policies to be considered by this connection. + */ + @JsonProperty(value = "properties.ipsecPolicies") + private List ipsecPolicies; + + /** + * The resource GUID property of the VirtualNetworkGatewayConnection + * resource. + */ + @JsonProperty(value = "properties.resourceGuid") + private String resourceGuid; + + /** + * The provisioning state of the VirtualNetworkGatewayConnection resource. + * Possible values are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the authorizationKey. + * + * @return the authorizationKey value + */ + public String authorizationKey() { + return this.authorizationKey; + } + + /** + * Set the authorizationKey. + * + * @param authorizationKey the authorizationKey value to set + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withAuthorizationKey(String authorizationKey) { + this.authorizationKey = authorizationKey; + return this; + } + + /** + * Get the reference to virtual network gateway resource. + * + * @return the virtualNetworkGateway1 value + */ + public VirtualNetworkGatewayInner virtualNetworkGateway1() { + return this.virtualNetworkGateway1; + } + + /** + * Set the reference to virtual network gateway resource. + * + * @param virtualNetworkGateway1 the virtualNetworkGateway1 value to set + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withVirtualNetworkGateway1(VirtualNetworkGatewayInner virtualNetworkGateway1) { + this.virtualNetworkGateway1 = virtualNetworkGateway1; + return this; + } + + /** + * Get the reference to virtual network gateway resource. + * + * @return the virtualNetworkGateway2 value + */ + public VirtualNetworkGatewayInner virtualNetworkGateway2() { + return this.virtualNetworkGateway2; + } + + /** + * Set the reference to virtual network gateway resource. + * + * @param virtualNetworkGateway2 the virtualNetworkGateway2 value to set + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withVirtualNetworkGateway2(VirtualNetworkGatewayInner virtualNetworkGateway2) { + this.virtualNetworkGateway2 = virtualNetworkGateway2; + return this; + } + + /** + * Get the reference to local network gateway resource. + * + * @return the localNetworkGateway2 value + */ + public LocalNetworkGatewayInner localNetworkGateway2() { + return this.localNetworkGateway2; + } + + /** + * Set the reference to local network gateway resource. + * + * @param localNetworkGateway2 the localNetworkGateway2 value to set + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withLocalNetworkGateway2(LocalNetworkGatewayInner localNetworkGateway2) { + this.localNetworkGateway2 = localNetworkGateway2; + return this; + } + + /** + * Get gateway connection type. Possible values are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient'. + * + * @return the connectionType value + */ + public VirtualNetworkGatewayConnectionType connectionType() { + return this.connectionType; + } + + /** + * Set gateway connection type. Possible values are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient'. + * + * @param connectionType the connectionType value to set + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withConnectionType(VirtualNetworkGatewayConnectionType connectionType) { + this.connectionType = connectionType; + return this; + } + + /** + * Get the routing weight. + * + * @return the routingWeight value + */ + public Integer routingWeight() { + return this.routingWeight; + } + + /** + * Set the routing weight. + * + * @param routingWeight the routingWeight value to set + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withRoutingWeight(Integer routingWeight) { + this.routingWeight = routingWeight; + return this; + } + + /** + * Get the IPSec shared key. + * + * @return the sharedKey value + */ + public String sharedKey() { + return this.sharedKey; + } + + /** + * Set the IPSec shared key. + * + * @param sharedKey the sharedKey value to set + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withSharedKey(String sharedKey) { + this.sharedKey = sharedKey; + return this; + } + + /** + * Get virtual network Gateway connection status. Possible values are 'Unknown', 'Connecting', 'Connected' and 'NotConnected'. Possible values include: 'Unknown', 'Connecting', 'Connected', 'NotConnected'. + * + * @return the connectionStatus value + */ + public VirtualNetworkGatewayConnectionStatus connectionStatus() { + return this.connectionStatus; + } + + /** + * Get collection of all tunnels' connection health status. + * + * @return the tunnelConnectionStatus value + */ + public List tunnelConnectionStatus() { + return this.tunnelConnectionStatus; + } + + /** + * Get the egress bytes transferred in this connection. + * + * @return the egressBytesTransferred value + */ + public Long egressBytesTransferred() { + return this.egressBytesTransferred; + } + + /** + * Get the ingress bytes transferred in this connection. + * + * @return the ingressBytesTransferred value + */ + public Long ingressBytesTransferred() { + return this.ingressBytesTransferred; + } + + /** + * Get the reference to peerings resource. + * + * @return the peer value + */ + public SubResource peer() { + return this.peer; + } + + /** + * Set the reference to peerings resource. + * + * @param peer the peer value to set + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withPeer(SubResource peer) { + this.peer = peer; + return this; + } + + /** + * Get enableBgp flag. + * + * @return the enableBgp value + */ + public Boolean enableBgp() { + return this.enableBgp; + } + + /** + * Set enableBgp flag. + * + * @param enableBgp the enableBgp value to set + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withEnableBgp(Boolean enableBgp) { + this.enableBgp = enableBgp; + return this; + } + + /** + * Get enable policy-based traffic selectors. + * + * @return the usePolicyBasedTrafficSelectors value + */ + public Boolean usePolicyBasedTrafficSelectors() { + return this.usePolicyBasedTrafficSelectors; + } + + /** + * Set enable policy-based traffic selectors. + * + * @param usePolicyBasedTrafficSelectors the usePolicyBasedTrafficSelectors value to set + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withUsePolicyBasedTrafficSelectors(Boolean usePolicyBasedTrafficSelectors) { + this.usePolicyBasedTrafficSelectors = usePolicyBasedTrafficSelectors; + return this; + } + + /** + * Get the IPSec Policies to be considered by this connection. + * + * @return the ipsecPolicies value + */ + public List ipsecPolicies() { + return this.ipsecPolicies; + } + + /** + * Set the IPSec Policies to be considered by this connection. + * + * @param ipsecPolicies the ipsecPolicies value to set + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withIpsecPolicies(List ipsecPolicies) { + this.ipsecPolicies = ipsecPolicies; + return this; + } + + /** + * Get the resource GUID property of the VirtualNetworkGatewayConnection resource. + * + * @return the resourceGuid value + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Set the resource GUID property of the VirtualNetworkGatewayConnection resource. + * + * @param resourceGuid the resourceGuid value to set + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withResourceGuid(String resourceGuid) { + this.resourceGuid = resourceGuid; + return this; + } + + /** + * Get the provisioning state of the VirtualNetworkGatewayConnection resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set gets a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkGatewayConnectionListEntityImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkGatewayConnectionListEntityImpl.java new file mode 100644 index 000000000000..c9ade2d22d87 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkGatewayConnectionListEntityImpl.java @@ -0,0 +1,153 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkGatewayConnectionListEntity; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkGatewayConnectionStatus; +import com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkGatewayConnectionType; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.IpsecPolicy; +import com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkConnectionGatewayReference; +import com.microsoft.azure.SubResource; +import java.util.Map; +import com.microsoft.azure.management.network.v2018_06_01.TunnelConnectionHealth; + +class VirtualNetworkGatewayConnectionListEntityImpl extends WrapperImpl implements VirtualNetworkGatewayConnectionListEntity { + private final NetworkManager manager; + + VirtualNetworkGatewayConnectionListEntityImpl(VirtualNetworkGatewayConnectionListEntityInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + + + @Override + public String authorizationKey() { + return this.inner().authorizationKey(); + } + + @Override + public VirtualNetworkGatewayConnectionStatus connectionStatus() { + return this.inner().connectionStatus(); + } + + @Override + public VirtualNetworkGatewayConnectionType connectionType() { + return this.inner().connectionType(); + } + + @Override + public Long egressBytesTransferred() { + return this.inner().egressBytesTransferred(); + } + + @Override + public Boolean enableBgp() { + return this.inner().enableBgp(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Long ingressBytesTransferred() { + return this.inner().ingressBytesTransferred(); + } + + @Override + public List ipsecPolicies() { + return this.inner().ipsecPolicies(); + } + + @Override + public VirtualNetworkConnectionGatewayReference localNetworkGateway2() { + return this.inner().localNetworkGateway2(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public SubResource peer() { + return this.inner().peer(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public Integer routingWeight() { + return this.inner().routingWeight(); + } + + @Override + public String sharedKey() { + return this.inner().sharedKey(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public List tunnelConnectionStatus() { + return this.inner().tunnelConnectionStatus(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public Boolean usePolicyBasedTrafficSelectors() { + return this.inner().usePolicyBasedTrafficSelectors(); + } + + @Override + public VirtualNetworkConnectionGatewayReference virtualNetworkGateway1() { + return this.inner().virtualNetworkGateway1(); + } + + @Override + public VirtualNetworkConnectionGatewayReference virtualNetworkGateway2() { + return this.inner().virtualNetworkGateway2(); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkGatewayConnectionListEntityInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkGatewayConnectionListEntityInner.java new file mode 100644 index 000000000000..4cb4ab07fb1c --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkGatewayConnectionListEntityInner.java @@ -0,0 +1,475 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkConnectionGatewayReference; +import com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkGatewayConnectionType; +import com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkGatewayConnectionStatus; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.TunnelConnectionHealth; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_06_01.IpsecPolicy; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * A common class for general resource information. + */ +@JsonFlatten +@SkipParentValidation +public class VirtualNetworkGatewayConnectionListEntityInner extends Resource { + /** + * The authorizationKey. + */ + @JsonProperty(value = "properties.authorizationKey") + private String authorizationKey; + + /** + * The reference to virtual network gateway resource. + */ + @JsonProperty(value = "properties.virtualNetworkGateway1", required = true) + private VirtualNetworkConnectionGatewayReference virtualNetworkGateway1; + + /** + * The reference to virtual network gateway resource. + */ + @JsonProperty(value = "properties.virtualNetworkGateway2") + private VirtualNetworkConnectionGatewayReference virtualNetworkGateway2; + + /** + * The reference to local network gateway resource. + */ + @JsonProperty(value = "properties.localNetworkGateway2") + private VirtualNetworkConnectionGatewayReference localNetworkGateway2; + + /** + * Gateway connection type. Possible values are: + * 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values + * include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient'. + */ + @JsonProperty(value = "properties.connectionType", required = true) + private VirtualNetworkGatewayConnectionType connectionType; + + /** + * The routing weight. + */ + @JsonProperty(value = "properties.routingWeight") + private Integer routingWeight; + + /** + * The IPSec shared key. + */ + @JsonProperty(value = "properties.sharedKey") + private String sharedKey; + + /** + * Virtual network Gateway connection status. Possible values are + * 'Unknown', 'Connecting', 'Connected' and 'NotConnected'. Possible values + * include: 'Unknown', 'Connecting', 'Connected', 'NotConnected'. + */ + @JsonProperty(value = "properties.connectionStatus", access = JsonProperty.Access.WRITE_ONLY) + private VirtualNetworkGatewayConnectionStatus connectionStatus; + + /** + * Collection of all tunnels' connection health status. + */ + @JsonProperty(value = "properties.tunnelConnectionStatus", access = JsonProperty.Access.WRITE_ONLY) + private List tunnelConnectionStatus; + + /** + * The egress bytes transferred in this connection. + */ + @JsonProperty(value = "properties.egressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long egressBytesTransferred; + + /** + * The ingress bytes transferred in this connection. + */ + @JsonProperty(value = "properties.ingressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long ingressBytesTransferred; + + /** + * The reference to peerings resource. + */ + @JsonProperty(value = "properties.peer") + private SubResource peer; + + /** + * EnableBgp flag. + */ + @JsonProperty(value = "properties.enableBgp") + private Boolean enableBgp; + + /** + * Enable policy-based traffic selectors. + */ + @JsonProperty(value = "properties.usePolicyBasedTrafficSelectors") + private Boolean usePolicyBasedTrafficSelectors; + + /** + * The IPSec Policies to be considered by this connection. + */ + @JsonProperty(value = "properties.ipsecPolicies") + private List ipsecPolicies; + + /** + * The resource GUID property of the VirtualNetworkGatewayConnection + * resource. + */ + @JsonProperty(value = "properties.resourceGuid") + private String resourceGuid; + + /** + * The provisioning state of the VirtualNetworkGatewayConnection resource. + * Possible values are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the authorizationKey. + * + * @return the authorizationKey value + */ + public String authorizationKey() { + return this.authorizationKey; + } + + /** + * Set the authorizationKey. + * + * @param authorizationKey the authorizationKey value to set + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withAuthorizationKey(String authorizationKey) { + this.authorizationKey = authorizationKey; + return this; + } + + /** + * Get the reference to virtual network gateway resource. + * + * @return the virtualNetworkGateway1 value + */ + public VirtualNetworkConnectionGatewayReference virtualNetworkGateway1() { + return this.virtualNetworkGateway1; + } + + /** + * Set the reference to virtual network gateway resource. + * + * @param virtualNetworkGateway1 the virtualNetworkGateway1 value to set + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withVirtualNetworkGateway1(VirtualNetworkConnectionGatewayReference virtualNetworkGateway1) { + this.virtualNetworkGateway1 = virtualNetworkGateway1; + return this; + } + + /** + * Get the reference to virtual network gateway resource. + * + * @return the virtualNetworkGateway2 value + */ + public VirtualNetworkConnectionGatewayReference virtualNetworkGateway2() { + return this.virtualNetworkGateway2; + } + + /** + * Set the reference to virtual network gateway resource. + * + * @param virtualNetworkGateway2 the virtualNetworkGateway2 value to set + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withVirtualNetworkGateway2(VirtualNetworkConnectionGatewayReference virtualNetworkGateway2) { + this.virtualNetworkGateway2 = virtualNetworkGateway2; + return this; + } + + /** + * Get the reference to local network gateway resource. + * + * @return the localNetworkGateway2 value + */ + public VirtualNetworkConnectionGatewayReference localNetworkGateway2() { + return this.localNetworkGateway2; + } + + /** + * Set the reference to local network gateway resource. + * + * @param localNetworkGateway2 the localNetworkGateway2 value to set + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withLocalNetworkGateway2(VirtualNetworkConnectionGatewayReference localNetworkGateway2) { + this.localNetworkGateway2 = localNetworkGateway2; + return this; + } + + /** + * Get gateway connection type. Possible values are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient'. + * + * @return the connectionType value + */ + public VirtualNetworkGatewayConnectionType connectionType() { + return this.connectionType; + } + + /** + * Set gateway connection type. Possible values are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient'. + * + * @param connectionType the connectionType value to set + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withConnectionType(VirtualNetworkGatewayConnectionType connectionType) { + this.connectionType = connectionType; + return this; + } + + /** + * Get the routing weight. + * + * @return the routingWeight value + */ + public Integer routingWeight() { + return this.routingWeight; + } + + /** + * Set the routing weight. + * + * @param routingWeight the routingWeight value to set + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withRoutingWeight(Integer routingWeight) { + this.routingWeight = routingWeight; + return this; + } + + /** + * Get the IPSec shared key. + * + * @return the sharedKey value + */ + public String sharedKey() { + return this.sharedKey; + } + + /** + * Set the IPSec shared key. + * + * @param sharedKey the sharedKey value to set + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withSharedKey(String sharedKey) { + this.sharedKey = sharedKey; + return this; + } + + /** + * Get virtual network Gateway connection status. Possible values are 'Unknown', 'Connecting', 'Connected' and 'NotConnected'. Possible values include: 'Unknown', 'Connecting', 'Connected', 'NotConnected'. + * + * @return the connectionStatus value + */ + public VirtualNetworkGatewayConnectionStatus connectionStatus() { + return this.connectionStatus; + } + + /** + * Get collection of all tunnels' connection health status. + * + * @return the tunnelConnectionStatus value + */ + public List tunnelConnectionStatus() { + return this.tunnelConnectionStatus; + } + + /** + * Get the egress bytes transferred in this connection. + * + * @return the egressBytesTransferred value + */ + public Long egressBytesTransferred() { + return this.egressBytesTransferred; + } + + /** + * Get the ingress bytes transferred in this connection. + * + * @return the ingressBytesTransferred value + */ + public Long ingressBytesTransferred() { + return this.ingressBytesTransferred; + } + + /** + * Get the reference to peerings resource. + * + * @return the peer value + */ + public SubResource peer() { + return this.peer; + } + + /** + * Set the reference to peerings resource. + * + * @param peer the peer value to set + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withPeer(SubResource peer) { + this.peer = peer; + return this; + } + + /** + * Get enableBgp flag. + * + * @return the enableBgp value + */ + public Boolean enableBgp() { + return this.enableBgp; + } + + /** + * Set enableBgp flag. + * + * @param enableBgp the enableBgp value to set + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withEnableBgp(Boolean enableBgp) { + this.enableBgp = enableBgp; + return this; + } + + /** + * Get enable policy-based traffic selectors. + * + * @return the usePolicyBasedTrafficSelectors value + */ + public Boolean usePolicyBasedTrafficSelectors() { + return this.usePolicyBasedTrafficSelectors; + } + + /** + * Set enable policy-based traffic selectors. + * + * @param usePolicyBasedTrafficSelectors the usePolicyBasedTrafficSelectors value to set + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withUsePolicyBasedTrafficSelectors(Boolean usePolicyBasedTrafficSelectors) { + this.usePolicyBasedTrafficSelectors = usePolicyBasedTrafficSelectors; + return this; + } + + /** + * Get the IPSec Policies to be considered by this connection. + * + * @return the ipsecPolicies value + */ + public List ipsecPolicies() { + return this.ipsecPolicies; + } + + /** + * Set the IPSec Policies to be considered by this connection. + * + * @param ipsecPolicies the ipsecPolicies value to set + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withIpsecPolicies(List ipsecPolicies) { + this.ipsecPolicies = ipsecPolicies; + return this; + } + + /** + * Get the resource GUID property of the VirtualNetworkGatewayConnection resource. + * + * @return the resourceGuid value + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Set the resource GUID property of the VirtualNetworkGatewayConnection resource. + * + * @param resourceGuid the resourceGuid value to set + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withResourceGuid(String resourceGuid) { + this.resourceGuid = resourceGuid; + return this; + } + + /** + * Get the provisioning state of the VirtualNetworkGatewayConnection resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set gets a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkGatewayConnectionsImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkGatewayConnectionsImpl.java new file mode 100644 index 000000000000..292ffcd7aad7 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkGatewayConnectionsImpl.java @@ -0,0 +1,152 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkGatewayConnections; +import com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkGatewayConnection; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_06_01.ConnectionSharedKey; +import com.microsoft.azure.management.network.v2018_06_01.ConnectionResetSharedKey; + +class VirtualNetworkGatewayConnectionsImpl extends GroupableResourcesCoreImpl implements VirtualNetworkGatewayConnections { + protected VirtualNetworkGatewayConnectionsImpl(NetworkManager manager) { + super(manager.inner().virtualNetworkGatewayConnections(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + VirtualNetworkGatewayConnectionsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + VirtualNetworkGatewayConnectionsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + VirtualNetworkGatewayConnectionsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + VirtualNetworkGatewayConnectionsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VirtualNetworkGatewayConnection call(VirtualNetworkGatewayConnectionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public VirtualNetworkGatewayConnectionImpl define(String name) { + return wrapModel(name); + } + + @Override + public Observable setSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters) { + VirtualNetworkGatewayConnectionsInner client = this.inner(); + return client.setSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters) + .map(new Func1() { + @Override + public ConnectionSharedKey call(ConnectionSharedKeyInner inner) { + return new ConnectionSharedKeyImpl(inner, manager()); + } + }); + } + + @Override + public Observable getSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + VirtualNetworkGatewayConnectionsInner client = this.inner(); + return client.getSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName) + .map(new Func1() { + @Override + public ConnectionSharedKey call(ConnectionSharedKeyInner inner) { + return new ConnectionSharedKeyImpl(inner, manager()); + } + }); + } + + @Override + public Observable resetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, int keyLength) { + VirtualNetworkGatewayConnectionsInner client = this.inner(); + return client.resetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, keyLength) + .map(new Func1() { + @Override + public ConnectionResetSharedKey call(ConnectionResetSharedKeyInner inner) { + return new ConnectionResetSharedKeyImpl(inner, manager()); + } + }); + } + + @Override + protected VirtualNetworkGatewayConnectionImpl wrapModel(VirtualNetworkGatewayConnectionInner inner) { + return new VirtualNetworkGatewayConnectionImpl(inner.name(), inner, manager()); + } + + @Override + protected VirtualNetworkGatewayConnectionImpl wrapModel(String name) { + return new VirtualNetworkGatewayConnectionImpl(name, new VirtualNetworkGatewayConnectionInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkGatewayConnectionsInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkGatewayConnectionsInner.java new file mode 100644 index 000000000000..24d2625beb4b --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkGatewayConnectionsInner.java @@ -0,0 +1,1485 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_06_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in VirtualNetworkGatewayConnections. + */ +public class VirtualNetworkGatewayConnectionsInner implements InnerSupportsGet, InnerSupportsDelete { + /** The Retrofit service to perform REST calls. */ + private VirtualNetworkGatewayConnectionsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of VirtualNetworkGatewayConnectionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public VirtualNetworkGatewayConnectionsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(VirtualNetworkGatewayConnectionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for VirtualNetworkGatewayConnections to be + * used by Retrofit to perform actually REST calls. + */ + interface VirtualNetworkGatewayConnectionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkGatewayConnections createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, @Path("subscriptionId") String subscriptionId, @Body VirtualNetworkGatewayConnectionInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkGatewayConnections beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, @Path("subscriptionId") String subscriptionId, @Body VirtualNetworkGatewayConnectionInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkGatewayConnections getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, @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.network.v2018_06_01.VirtualNetworkGatewayConnections delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, @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.network.v2018_06_01.VirtualNetworkGatewayConnections beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, @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.network.v2018_06_01.VirtualNetworkGatewayConnections updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkGatewayConnections beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}") + Observable> beginUpdateTags(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkGatewayConnections setSharedKey" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey") + Observable> setSharedKey(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, @Path("subscriptionId") String subscriptionId, @Body ConnectionSharedKeyInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkGatewayConnections beginSetSharedKey" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey") + Observable> beginSetSharedKey(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, @Path("subscriptionId") String subscriptionId, @Body ConnectionSharedKeyInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkGatewayConnections getSharedKey" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey") + Observable> getSharedKey(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, @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.network.v2018_06_01.VirtualNetworkGatewayConnections listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @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.network.v2018_06_01.VirtualNetworkGatewayConnections resetSharedKey" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey/reset") + Observable> resetSharedKey(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ConnectionResetSharedKeyInner parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkGatewayConnections beginResetSharedKey" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey/reset") + Observable> beginResetSharedKey(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ConnectionResetSharedKeyInner parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkGatewayConnections listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Creates or updates a virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Parameters supplied to the create or update virtual network gateway connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayConnectionInner object if successful. + */ + public VirtualNetworkGatewayConnectionInner createOrUpdate(String resourceGroupName, String virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnectionInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates a virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Parameters supplied to the create or update virtual network gateway connection operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnectionInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters), serviceCallback); + } + + /** + * Creates or updates a virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Parameters supplied to the create or update virtual network gateway connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnectionInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).map(new Func1, VirtualNetworkGatewayConnectionInner>() { + @Override + public VirtualNetworkGatewayConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Parameters supplied to the create or update virtual network gateway connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnectionInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Parameters supplied to the create or update virtual network gateway connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayConnectionInner object if successful. + */ + public VirtualNetworkGatewayConnectionInner beginCreateOrUpdate(String resourceGroupName, String virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnectionInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates a virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Parameters supplied to the create or update virtual network gateway connection operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnectionInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters), serviceCallback); + } + + /** + * Creates or updates a virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Parameters supplied to the create or update virtual network gateway connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayConnectionInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnectionInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).map(new Func1, VirtualNetworkGatewayConnectionInner>() { + @Override + public VirtualNetworkGatewayConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Parameters supplied to the create or update virtual network gateway connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayConnectionInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnectionInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + return service.beginCreateOrUpdate(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified virtual network gateway connection by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayConnectionInner object if successful. + */ + public VirtualNetworkGatewayConnectionInner getByResourceGroup(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).toBlocking().single().body(); + } + + /** + * Gets the specified virtual network gateway connection by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName), serviceCallback); + } + + /** + * Gets the specified virtual network gateway connection by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayConnectionInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).map(new Func1, VirtualNetworkGatewayConnectionInner>() { + @Override + public VirtualNetworkGatewayConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified virtual network gateway connection by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayConnectionInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.getByResourceGroup(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes the specified virtual network Gateway connection. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).toBlocking().last().body(); + } + + /** + * Deletes the specified virtual network Gateway connection. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName), serviceCallback); + } + + /** + * Deletes the specified virtual network Gateway connection. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified virtual network Gateway connection. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + Observable> observable = service.delete(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified virtual network Gateway connection. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).toBlocking().single().body(); + } + + /** + * Deletes the specified virtual network Gateway connection. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName), serviceCallback); + } + + /** + * Deletes the specified virtual network Gateway connection. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified virtual network Gateway connection. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.beginDelete(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayConnectionInner object if successful. + */ + public VirtualNetworkGatewayConnectionInner updateTags(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).toBlocking().last().body(); + } + + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName), serviceCallback); + } + + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).map(new Func1, VirtualNetworkGatewayConnectionInner>() { + @Override + public VirtualNetworkGatewayConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + Observable> observable = service.updateTags(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayConnectionInner object if successful. + */ + public VirtualNetworkGatewayConnectionInner updateTags(String resourceGroupName, String virtualNetworkGatewayConnectionName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, tags).toBlocking().last().body(); + } + + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, tags), serviceCallback); + } + + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, tags).map(new Func1, VirtualNetworkGatewayConnectionInner>() { + @Override + public VirtualNetworkGatewayConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-06-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + Observable> observable = service.updateTags(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayConnectionInner object if successful. + */ + public VirtualNetworkGatewayConnectionInner beginUpdateTags(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).toBlocking().single().body(); + } + + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName), serviceCallback); + } + + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayConnectionInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).map(new Func1, VirtualNetworkGatewayConnectionInner>() { + @Override + public VirtualNetworkGatewayConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayConnectionInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.beginUpdateTags(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayConnectionInner object if successful. + */ + public VirtualNetworkGatewayConnectionInner beginUpdateTags(String resourceGroupName, String virtualNetworkGatewayConnectionName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, tags).toBlocking().single().body(); + } + + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, tags), serviceCallback); + } + + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayConnectionInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, tags).map(new Func1, VirtualNetworkGatewayConnectionInner>() { + @Override + public VirtualNetworkGatewayConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayConnectionInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-06-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.beginUpdateTags(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. + * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation throughNetwork resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ConnectionSharedKeyInner object if successful. + */ + public ConnectionSharedKeyInner setSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters) { + return setSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).toBlocking().last().body(); + } + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. + * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation throughNetwork resource provider. + * @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 setSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(setSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters), serviceCallback); + } + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. + * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation throughNetwork resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable setSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters) { + return setSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).map(new Func1, ConnectionSharedKeyInner>() { + @Override + public ConnectionSharedKeyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. + * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation throughNetwork resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> setSharedKeyWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + Observable> observable = service.setSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. + * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation throughNetwork resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ConnectionSharedKeyInner object if successful. + */ + public ConnectionSharedKeyInner beginSetSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters) { + return beginSetSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).toBlocking().single().body(); + } + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. + * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation throughNetwork resource provider. + * @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 beginSetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginSetSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters), serviceCallback); + } + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. + * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation throughNetwork resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConnectionSharedKeyInner object + */ + public Observable beginSetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters) { + return beginSetSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).map(new Func1, ConnectionSharedKeyInner>() { + @Override + public ConnectionSharedKeyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. + * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation throughNetwork resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConnectionSharedKeyInner object + */ + public Observable> beginSetSharedKeyWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + return service.beginSetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginSetSharedKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginSetSharedKeyDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection shared key name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ConnectionSharedKeyInner object if successful. + */ + public ConnectionSharedKeyInner getSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return getSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).toBlocking().single().body(); + } + + /** + * The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection shared key 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 getSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName), serviceCallback); + } + + /** + * The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection shared key name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConnectionSharedKeyInner object + */ + public Observable getSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return getSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).map(new Func1, ConnectionSharedKeyInner>() { + @Override + public ConnectionSharedKeyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection shared key name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConnectionSharedKeyInner object + */ + public Observable> getSharedKeyWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.getSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getSharedKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getSharedKeyDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkGatewayConnectionInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkGatewayConnectionInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkGatewayConnectionInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkGatewayConnectionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. + * @param keyLength The virtual network connection reset shared key length, should between 1 and 128. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ConnectionResetSharedKeyInner object if successful. + */ + public ConnectionResetSharedKeyInner resetSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName, int keyLength) { + return resetSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, keyLength).toBlocking().last().body(); + } + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. + * @param keyLength The virtual network connection reset shared key length, should between 1 and 128. + * @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 resetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, int keyLength, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(resetSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, keyLength), serviceCallback); + } + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. + * @param keyLength The virtual network connection reset shared key length, should between 1 and 128. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable resetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, int keyLength) { + return resetSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, keyLength).map(new Func1, ConnectionResetSharedKeyInner>() { + @Override + public ConnectionResetSharedKeyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. + * @param keyLength The virtual network connection reset shared key length, should between 1 and 128. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> resetSharedKeyWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, int keyLength) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + ConnectionResetSharedKeyInner parameters = new ConnectionResetSharedKeyInner(); + parameters.withKeyLength(keyLength); + Observable> observable = service.resetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. + * @param keyLength The virtual network connection reset shared key length, should between 1 and 128. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ConnectionResetSharedKeyInner object if successful. + */ + public ConnectionResetSharedKeyInner beginResetSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName, int keyLength) { + return beginResetSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, keyLength).toBlocking().single().body(); + } + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. + * @param keyLength The virtual network connection reset shared key length, should between 1 and 128. + * @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 beginResetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, int keyLength, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginResetSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, keyLength), serviceCallback); + } + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. + * @param keyLength The virtual network connection reset shared key length, should between 1 and 128. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConnectionResetSharedKeyInner object + */ + public Observable beginResetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, int keyLength) { + return beginResetSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, keyLength).map(new Func1, ConnectionResetSharedKeyInner>() { + @Override + public ConnectionResetSharedKeyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. + * @param keyLength The virtual network connection reset shared key length, should between 1 and 128. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConnectionResetSharedKeyInner object + */ + public Observable> beginResetSharedKeyWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, int keyLength) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + ConnectionResetSharedKeyInner parameters = new ConnectionResetSharedKeyInner(); + parameters.withKeyLength(keyLength); + return service.beginResetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginResetSharedKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginResetSharedKeyDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkGatewayConnectionInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. + * + * @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<VirtualNetworkGatewayConnectionInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. + * + * @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<VirtualNetworkGatewayConnectionInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkGatewayConnectionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkGatewayImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkGatewayImpl.java new file mode 100644 index 000000000000..cf4fe999f00f --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkGatewayImpl.java @@ -0,0 +1,180 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkGateway; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkGatewayIPConfiguration; +import com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkGatewayType; +import com.microsoft.azure.management.network.v2018_06_01.VpnType; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkGatewaySku; +import com.microsoft.azure.management.network.v2018_06_01.VpnClientConfiguration; +import com.microsoft.azure.management.network.v2018_06_01.BgpSettings; + +class VirtualNetworkGatewayImpl extends GroupableResourceCoreImpl implements VirtualNetworkGateway, VirtualNetworkGateway.Definition, VirtualNetworkGateway.Update { + VirtualNetworkGatewayImpl(String name, VirtualNetworkGatewayInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + VirtualNetworkGatewaysInner client = this.manager().inner().virtualNetworkGateways(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + VirtualNetworkGatewaysInner client = this.manager().inner().virtualNetworkGateways(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + VirtualNetworkGatewaysInner client = this.manager().inner().virtualNetworkGateways(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public Boolean activeActive() { + return this.inner().activeActive(); + } + + @Override + public BgpSettings bgpSettings() { + return this.inner().bgpSettings(); + } + + @Override + public Boolean enableBgp() { + return this.inner().enableBgp(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public SubResource gatewayDefaultSite() { + return this.inner().gatewayDefaultSite(); + } + + @Override + public VirtualNetworkGatewayType gatewayType() { + return this.inner().gatewayType(); + } + + @Override + public List ipConfigurations() { + return this.inner().ipConfigurations(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public VirtualNetworkGatewaySku sku() { + return this.inner().sku(); + } + + @Override + public VpnClientConfiguration vpnClientConfiguration() { + return this.inner().vpnClientConfiguration(); + } + + @Override + public VpnType vpnType() { + return this.inner().vpnType(); + } + + @Override + public VirtualNetworkGatewayImpl withActiveActive(Boolean activeActive) { + this.inner().withActiveActive(activeActive); + return this; + } + + @Override + public VirtualNetworkGatewayImpl withBgpSettings(BgpSettings bgpSettings) { + this.inner().withBgpSettings(bgpSettings); + return this; + } + + @Override + public VirtualNetworkGatewayImpl withEnableBgp(Boolean enableBgp) { + this.inner().withEnableBgp(enableBgp); + return this; + } + + @Override + public VirtualNetworkGatewayImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public VirtualNetworkGatewayImpl withGatewayDefaultSite(SubResource gatewayDefaultSite) { + this.inner().withGatewayDefaultSite(gatewayDefaultSite); + return this; + } + + @Override + public VirtualNetworkGatewayImpl withGatewayType(VirtualNetworkGatewayType gatewayType) { + this.inner().withGatewayType(gatewayType); + return this; + } + + @Override + public VirtualNetworkGatewayImpl withIpConfigurations(List ipConfigurations) { + this.inner().withIpConfigurations(ipConfigurations); + return this; + } + + @Override + public VirtualNetworkGatewayImpl withResourceGuid(String resourceGuid) { + this.inner().withResourceGuid(resourceGuid); + return this; + } + + @Override + public VirtualNetworkGatewayImpl withSku(VirtualNetworkGatewaySku sku) { + this.inner().withSku(sku); + return this; + } + + @Override + public VirtualNetworkGatewayImpl withVpnClientConfiguration(VpnClientConfiguration vpnClientConfiguration) { + this.inner().withVpnClientConfiguration(vpnClientConfiguration); + return this; + } + + @Override + public VirtualNetworkGatewayImpl withVpnType(VpnType vpnType) { + this.inner().withVpnType(vpnType); + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkGatewayInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkGatewayInner.java new file mode 100644 index 000000000000..8edccb79ba5d --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkGatewayInner.java @@ -0,0 +1,366 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkGatewayIPConfiguration; +import com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkGatewayType; +import com.microsoft.azure.management.network.v2018_06_01.VpnType; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkGatewaySku; +import com.microsoft.azure.management.network.v2018_06_01.VpnClientConfiguration; +import com.microsoft.azure.management.network.v2018_06_01.BgpSettings; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * A common class for general resource information. + */ +@JsonFlatten +@SkipParentValidation +public class VirtualNetworkGatewayInner extends Resource { + /** + * IP configurations for virtual network gateway. + */ + @JsonProperty(value = "properties.ipConfigurations") + private List ipConfigurations; + + /** + * The type of this virtual network gateway. Possible values are: 'Vpn' and + * 'ExpressRoute'. Possible values include: 'Vpn', 'ExpressRoute'. + */ + @JsonProperty(value = "properties.gatewayType") + private VirtualNetworkGatewayType gatewayType; + + /** + * The type of this virtual network gateway. Possible values are: + * 'PolicyBased' and 'RouteBased'. Possible values include: 'PolicyBased', + * 'RouteBased'. + */ + @JsonProperty(value = "properties.vpnType") + private VpnType vpnType; + + /** + * Whether BGP is enabled for this virtual network gateway or not. + */ + @JsonProperty(value = "properties.enableBgp") + private Boolean enableBgp; + + /** + * ActiveActive flag. + */ + @JsonProperty(value = "properties.activeActive") + private Boolean activeActive; + + /** + * The reference of the LocalNetworkGateway resource which represents local + * network site having default routes. Assign Null value in case of + * removing existing default site setting. + */ + @JsonProperty(value = "properties.gatewayDefaultSite") + private SubResource gatewayDefaultSite; + + /** + * The reference of the VirtualNetworkGatewaySku resource which represents + * the SKU selected for Virtual network gateway. + */ + @JsonProperty(value = "properties.sku") + private VirtualNetworkGatewaySku sku; + + /** + * The reference of the VpnClientConfiguration resource which represents + * the P2S VpnClient configurations. + */ + @JsonProperty(value = "properties.vpnClientConfiguration") + private VpnClientConfiguration vpnClientConfiguration; + + /** + * Virtual network gateway's BGP speaker settings. + */ + @JsonProperty(value = "properties.bgpSettings") + private BgpSettings bgpSettings; + + /** + * The resource GUID property of the VirtualNetworkGateway resource. + */ + @JsonProperty(value = "properties.resourceGuid") + private String resourceGuid; + + /** + * The provisioning state of the VirtualNetworkGateway resource. Possible + * values are: 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get iP configurations for virtual network gateway. + * + * @return the ipConfigurations value + */ + public List ipConfigurations() { + return this.ipConfigurations; + } + + /** + * Set iP configurations for virtual network gateway. + * + * @param ipConfigurations the ipConfigurations value to set + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withIpConfigurations(List ipConfigurations) { + this.ipConfigurations = ipConfigurations; + return this; + } + + /** + * Get the type of this virtual network gateway. Possible values are: 'Vpn' and 'ExpressRoute'. Possible values include: 'Vpn', 'ExpressRoute'. + * + * @return the gatewayType value + */ + public VirtualNetworkGatewayType gatewayType() { + return this.gatewayType; + } + + /** + * Set the type of this virtual network gateway. Possible values are: 'Vpn' and 'ExpressRoute'. Possible values include: 'Vpn', 'ExpressRoute'. + * + * @param gatewayType the gatewayType value to set + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withGatewayType(VirtualNetworkGatewayType gatewayType) { + this.gatewayType = gatewayType; + return this; + } + + /** + * Get the type of this virtual network gateway. Possible values are: 'PolicyBased' and 'RouteBased'. Possible values include: 'PolicyBased', 'RouteBased'. + * + * @return the vpnType value + */ + public VpnType vpnType() { + return this.vpnType; + } + + /** + * Set the type of this virtual network gateway. Possible values are: 'PolicyBased' and 'RouteBased'. Possible values include: 'PolicyBased', 'RouteBased'. + * + * @param vpnType the vpnType value to set + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withVpnType(VpnType vpnType) { + this.vpnType = vpnType; + return this; + } + + /** + * Get whether BGP is enabled for this virtual network gateway or not. + * + * @return the enableBgp value + */ + public Boolean enableBgp() { + return this.enableBgp; + } + + /** + * Set whether BGP is enabled for this virtual network gateway or not. + * + * @param enableBgp the enableBgp value to set + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withEnableBgp(Boolean enableBgp) { + this.enableBgp = enableBgp; + return this; + } + + /** + * Get activeActive flag. + * + * @return the activeActive value + */ + public Boolean activeActive() { + return this.activeActive; + } + + /** + * Set activeActive flag. + * + * @param activeActive the activeActive value to set + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withActiveActive(Boolean activeActive) { + this.activeActive = activeActive; + return this; + } + + /** + * Get the reference of the LocalNetworkGateway resource which represents local network site having default routes. Assign Null value in case of removing existing default site setting. + * + * @return the gatewayDefaultSite value + */ + public SubResource gatewayDefaultSite() { + return this.gatewayDefaultSite; + } + + /** + * Set the reference of the LocalNetworkGateway resource which represents local network site having default routes. Assign Null value in case of removing existing default site setting. + * + * @param gatewayDefaultSite the gatewayDefaultSite value to set + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withGatewayDefaultSite(SubResource gatewayDefaultSite) { + this.gatewayDefaultSite = gatewayDefaultSite; + return this; + } + + /** + * Get the reference of the VirtualNetworkGatewaySku resource which represents the SKU selected for Virtual network gateway. + * + * @return the sku value + */ + public VirtualNetworkGatewaySku sku() { + return this.sku; + } + + /** + * Set the reference of the VirtualNetworkGatewaySku resource which represents the SKU selected for Virtual network gateway. + * + * @param sku the sku value to set + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withSku(VirtualNetworkGatewaySku sku) { + this.sku = sku; + return this; + } + + /** + * Get the reference of the VpnClientConfiguration resource which represents the P2S VpnClient configurations. + * + * @return the vpnClientConfiguration value + */ + public VpnClientConfiguration vpnClientConfiguration() { + return this.vpnClientConfiguration; + } + + /** + * Set the reference of the VpnClientConfiguration resource which represents the P2S VpnClient configurations. + * + * @param vpnClientConfiguration the vpnClientConfiguration value to set + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withVpnClientConfiguration(VpnClientConfiguration vpnClientConfiguration) { + this.vpnClientConfiguration = vpnClientConfiguration; + return this; + } + + /** + * Get virtual network gateway's BGP speaker settings. + * + * @return the bgpSettings value + */ + public BgpSettings bgpSettings() { + return this.bgpSettings; + } + + /** + * Set virtual network gateway's BGP speaker settings. + * + * @param bgpSettings the bgpSettings value to set + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withBgpSettings(BgpSettings bgpSettings) { + this.bgpSettings = bgpSettings; + return this; + } + + /** + * Get the resource GUID property of the VirtualNetworkGateway resource. + * + * @return the resourceGuid value + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Set the resource GUID property of the VirtualNetworkGateway resource. + * + * @param resourceGuid the resourceGuid value to set + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withResourceGuid(String resourceGuid) { + this.resourceGuid = resourceGuid; + return this; + } + + /** + * Get the provisioning state of the VirtualNetworkGateway resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set gets a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkGatewaysImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkGatewaysImpl.java new file mode 100644 index 000000000000..605cbe0c8669 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkGatewaysImpl.java @@ -0,0 +1,244 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkGateways; +import com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkGateway; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_06_01.BgpPeerStatusListResult; +import com.microsoft.azure.management.network.v2018_06_01.GatewayRouteListResult; +import com.microsoft.azure.management.network.v2018_06_01.VpnClientIPsecParameters; +import com.microsoft.azure.management.network.v2018_06_01.VpnClientParameters; +import com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkGatewayConnectionListEntity; +import com.microsoft.azure.management.network.v2018_06_01.VpnDeviceScriptParameters; + +class VirtualNetworkGatewaysImpl extends GroupableResourcesCoreImpl implements VirtualNetworkGateways { + protected VirtualNetworkGatewaysImpl(NetworkManager manager) { + super(manager.inner().virtualNetworkGateways(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + VirtualNetworkGatewaysInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VirtualNetworkGateway call(VirtualNetworkGatewayInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public VirtualNetworkGatewayImpl define(String name) { + return wrapModel(name); + } + + @Override + public Observable resetAsync(String resourceGroupName, String virtualNetworkGatewayName) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.resetAsync(resourceGroupName, virtualNetworkGatewayName) + .map(new Func1() { + @Override + public VirtualNetworkGateway call(VirtualNetworkGatewayInner inner) { + return new VirtualNetworkGatewayImpl(inner.name(), inner, manager()); + } + }); + } + + @Override + public Completable generatevpnclientpackageAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.generatevpnclientpackageAsync(resourceGroupName, virtualNetworkGatewayName, parameters).toCompletable(); + } + + @Override + public Completable generateVpnProfileAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.generateVpnProfileAsync(resourceGroupName, virtualNetworkGatewayName, parameters).toCompletable(); + } + + @Override + public Completable getVpnProfilePackageUrlAsync(String resourceGroupName, String virtualNetworkGatewayName) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.getVpnProfilePackageUrlAsync(resourceGroupName, virtualNetworkGatewayName).toCompletable(); + } + + @Override + public Observable getBgpPeerStatusAsync(String resourceGroupName, String virtualNetworkGatewayName) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.getBgpPeerStatusAsync(resourceGroupName, virtualNetworkGatewayName) + .map(new Func1() { + @Override + public BgpPeerStatusListResult call(BgpPeerStatusListResultInner inner) { + return new BgpPeerStatusListResultImpl(inner, manager()); + } + }); + } + + @Override + public Completable supportedVpnDevicesAsync(String resourceGroupName, String virtualNetworkGatewayName) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.supportedVpnDevicesAsync(resourceGroupName, virtualNetworkGatewayName).toCompletable(); + } + + @Override + public Observable getLearnedRoutesAsync(String resourceGroupName, String virtualNetworkGatewayName) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.getLearnedRoutesAsync(resourceGroupName, virtualNetworkGatewayName) + .map(new Func1() { + @Override + public GatewayRouteListResult call(GatewayRouteListResultInner inner) { + return new GatewayRouteListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable getAdvertisedRoutesAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.getAdvertisedRoutesAsync(resourceGroupName, virtualNetworkGatewayName, peer) + .map(new Func1() { + @Override + public GatewayRouteListResult call(GatewayRouteListResultInner inner) { + return new GatewayRouteListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable setVpnclientIpsecParametersAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientIPsecParametersInner vpnclientIpsecParams) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.setVpnclientIpsecParametersAsync(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams) + .map(new Func1() { + @Override + public VpnClientIPsecParameters call(VpnClientIPsecParametersInner inner) { + return new VpnClientIPsecParametersImpl(inner, manager()); + } + }); + } + + @Override + public Observable getVpnclientIpsecParametersAsync(String resourceGroupName, String virtualNetworkGatewayName) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.getVpnclientIpsecParametersAsync(resourceGroupName, virtualNetworkGatewayName) + .map(new Func1() { + @Override + public VpnClientIPsecParameters call(VpnClientIPsecParametersInner inner) { + return new VpnClientIPsecParametersImpl(inner, manager()); + } + }); + } + + @Override + protected VirtualNetworkGatewayImpl wrapModel(VirtualNetworkGatewayInner inner) { + return new VirtualNetworkGatewayImpl(inner.name(), inner, manager()); + } + + @Override + protected VirtualNetworkGatewayImpl wrapModel(String name) { + return new VirtualNetworkGatewayImpl(name, new VirtualNetworkGatewayInner(), this.manager()); + } + + private VirtualNetworkGatewayConnectionListEntityImpl wrapVirtualNetworkGatewayConnectionListEntityModel(VirtualNetworkGatewayConnectionListEntityInner inner) { + return new VirtualNetworkGatewayConnectionListEntityImpl(inner, manager()); + } + + @Override + public Observable listConnectionsAsync(final String resourceGroupName, final String virtualNetworkGatewayName) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.listConnectionsAsync(resourceGroupName, virtualNetworkGatewayName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VirtualNetworkGatewayConnectionListEntity call(VirtualNetworkGatewayConnectionListEntityInner inner) { + return wrapVirtualNetworkGatewayConnectionListEntityModel(inner); + } + }); + } + + @Override + public Completable vpnDeviceConfigurationScriptAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters) { + VirtualNetworkGatewaysInner client = this.inner(); + return client.vpnDeviceConfigurationScriptAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).toCompletable(); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkGatewaysInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkGatewaysInner.java new file mode 100644 index 000000000000..bdc1fc7f4891 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkGatewaysInner.java @@ -0,0 +1,3281 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_06_01.TagsObject; +import com.microsoft.azure.management.network.v2018_06_01.VpnClientParameters; +import com.microsoft.azure.management.network.v2018_06_01.VpnDeviceScriptParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in VirtualNetworkGateways. + */ +public class VirtualNetworkGatewaysInner implements InnerSupportsGet, InnerSupportsDelete { + /** The Retrofit service to perform REST calls. */ + private VirtualNetworkGatewaysService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of VirtualNetworkGatewaysInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public VirtualNetworkGatewaysInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(VirtualNetworkGatewaysService.class); + this.client = client; + } + + /** + * The interface defining all the services for VirtualNetworkGateways to be + * used by Retrofit to perform actually REST calls. + */ + interface VirtualNetworkGatewaysService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkGateways createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Body VirtualNetworkGatewayInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkGateways beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Body VirtualNetworkGatewayInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkGateways getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @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.network.v2018_06_01.VirtualNetworkGateways delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @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.network.v2018_06_01.VirtualNetworkGateways beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @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.network.v2018_06_01.VirtualNetworkGateways updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkGateways beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}") + Observable> beginUpdateTags(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkGateways listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @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.network.v2018_06_01.VirtualNetworkGateways listConnections" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/connections") + Observable> listConnections(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @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.network.v2018_06_01.VirtualNetworkGateways reset" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset") + Observable> reset(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("gatewayVip") String gatewayVip, @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.network.v2018_06_01.VirtualNetworkGateways beginReset" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset") + Observable> beginReset(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("gatewayVip") String gatewayVip, @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.network.v2018_06_01.VirtualNetworkGateways generatevpnclientpackage" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage") + Observable> generatevpnclientpackage(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Body VpnClientParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkGateways beginGeneratevpnclientpackage" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage") + Observable> beginGeneratevpnclientpackage(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Body VpnClientParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkGateways generateVpnProfile" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile") + Observable> generateVpnProfile(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Body VpnClientParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkGateways beginGenerateVpnProfile" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile") + Observable> beginGenerateVpnProfile(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Body VpnClientParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkGateways getVpnProfilePackageUrl" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnprofilepackageurl") + Observable> getVpnProfilePackageUrl(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @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.network.v2018_06_01.VirtualNetworkGateways beginGetVpnProfilePackageUrl" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnprofilepackageurl") + Observable> beginGetVpnProfilePackageUrl(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @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.network.v2018_06_01.VirtualNetworkGateways getBgpPeerStatus" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getBgpPeerStatus") + Observable> getBgpPeerStatus(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("peer") String peer, @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.network.v2018_06_01.VirtualNetworkGateways beginGetBgpPeerStatus" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getBgpPeerStatus") + Observable> beginGetBgpPeerStatus(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("peer") String peer, @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.network.v2018_06_01.VirtualNetworkGateways supportedVpnDevices" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/supportedvpndevices") + Observable> supportedVpnDevices(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @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.network.v2018_06_01.VirtualNetworkGateways getLearnedRoutes" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getLearnedRoutes") + Observable> getLearnedRoutes(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @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.network.v2018_06_01.VirtualNetworkGateways beginGetLearnedRoutes" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getLearnedRoutes") + Observable> beginGetLearnedRoutes(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @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.network.v2018_06_01.VirtualNetworkGateways getAdvertisedRoutes" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getAdvertisedRoutes") + Observable> getAdvertisedRoutes(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("peer") String peer, @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.network.v2018_06_01.VirtualNetworkGateways beginGetAdvertisedRoutes" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getAdvertisedRoutes") + Observable> beginGetAdvertisedRoutes(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("peer") String peer, @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.network.v2018_06_01.VirtualNetworkGateways setVpnclientIpsecParameters" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/setvpnclientipsecparameters") + Observable> setVpnclientIpsecParameters(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Body VpnClientIPsecParametersInner vpnclientIpsecParams, @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.network.v2018_06_01.VirtualNetworkGateways beginSetVpnclientIpsecParameters" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/setvpnclientipsecparameters") + Observable> beginSetVpnclientIpsecParameters(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Body VpnClientIPsecParametersInner vpnclientIpsecParams, @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.network.v2018_06_01.VirtualNetworkGateways getVpnclientIpsecParameters" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnclientipsecparameters") + Observable> getVpnclientIpsecParameters(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @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.network.v2018_06_01.VirtualNetworkGateways beginGetVpnclientIpsecParameters" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnclientipsecparameters") + Observable> beginGetVpnclientIpsecParameters(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @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.network.v2018_06_01.VirtualNetworkGateways vpnDeviceConfigurationScript" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/vpndeviceconfigurationscript") + Observable> vpnDeviceConfigurationScript(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, @Path("subscriptionId") String subscriptionId, @Body VpnDeviceScriptParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkGateways listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkGateways listConnectionsNext" }) + @GET + Observable> listConnectionsNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Creates or updates a virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to create or update virtual network gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayInner object if successful. + */ + public VirtualNetworkGatewayInner createOrUpdate(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates a virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to create or update virtual network gateway operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters), serviceCallback); + } + + /** + * Creates or updates a virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to create or update virtual network gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).map(new Func1, VirtualNetworkGatewayInner>() { + @Override + public VirtualNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to create or update virtual network gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to create or update virtual network gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayInner object if successful. + */ + public VirtualNetworkGatewayInner beginCreateOrUpdate(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates a virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to create or update virtual network gateway operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters), serviceCallback); + } + + /** + * Creates or updates a virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to create or update virtual network gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).map(new Func1, VirtualNetworkGatewayInner>() { + @Override + public VirtualNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to create or update virtual network gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + return service.beginCreateOrUpdate(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified virtual network gateway by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayInner object if successful. + */ + public VirtualNetworkGatewayInner getByResourceGroup(String resourceGroupName, String virtualNetworkGatewayName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().single().body(); + } + + /** + * Gets the specified virtual network gateway by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * Gets the specified virtual network gateway by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, VirtualNetworkGatewayInner>() { + @Override + public VirtualNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified virtual network gateway by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.getByResourceGroup(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes the specified virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String virtualNetworkGatewayName) { + deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().last().body(); + } + + /** + * Deletes the specified virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @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 virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * Deletes the specified virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + Observable> observable = service.delete(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String virtualNetworkGatewayName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().single().body(); + } + + /** + * Deletes the specified virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * Deletes the specified virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.beginDelete(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayInner object if successful. + */ + public VirtualNetworkGatewayInner updateTags(String resourceGroupName, String virtualNetworkGatewayName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().last().body(); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @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 updateTagsAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, VirtualNetworkGatewayInner>() { + @Override + public VirtualNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + Observable> observable = service.updateTags(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayInner object if successful. + */ + public VirtualNetworkGatewayInner updateTags(String resourceGroupName, String virtualNetworkGatewayName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, tags).toBlocking().last().body(); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String virtualNetworkGatewayName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, tags), serviceCallback); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String virtualNetworkGatewayName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, tags).map(new Func1, VirtualNetworkGatewayInner>() { + @Override + public VirtualNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-06-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + Observable> observable = service.updateTags(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayInner object if successful. + */ + public VirtualNetworkGatewayInner beginUpdateTags(String resourceGroupName, String virtualNetworkGatewayName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().single().body(); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @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 beginUpdateTagsAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, VirtualNetworkGatewayInner>() { + @Override + public VirtualNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.beginUpdateTags(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayInner object if successful. + */ + public VirtualNetworkGatewayInner beginUpdateTags(String resourceGroupName, String virtualNetworkGatewayName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, tags).toBlocking().single().body(); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String virtualNetworkGatewayName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, tags), serviceCallback); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String virtualNetworkGatewayName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, tags).map(new Func1, VirtualNetworkGatewayInner>() { + @Override + public VirtualNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-06-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.beginUpdateTags(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all virtual network gateways by resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkGatewayInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all virtual network gateways by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all virtual network gateways by resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkGatewayInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all virtual network gateways by resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkGatewayInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all virtual network gateways by resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkGatewayInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the connections in a virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkGatewayConnectionListEntityInner> object if successful. + */ + public PagedList listConnections(final String resourceGroupName, final String virtualNetworkGatewayName) { + ServiceResponse> response = listConnectionsSinglePageAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listConnectionsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the connections in a virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @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> listConnectionsAsync(final String resourceGroupName, final String virtualNetworkGatewayName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listConnectionsSinglePageAsync(resourceGroupName, virtualNetworkGatewayName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listConnectionsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the connections in a virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkGatewayConnectionListEntityInner> object + */ + public Observable> listConnectionsAsync(final String resourceGroupName, final String virtualNetworkGatewayName) { + return listConnectionsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the connections in a virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkGatewayConnectionListEntityInner> object + */ + public Observable>> listConnectionsWithServiceResponseAsync(final String resourceGroupName, final String virtualNetworkGatewayName) { + return listConnectionsSinglePageAsync(resourceGroupName, virtualNetworkGatewayName) + .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(listConnectionsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the connections in a virtual network gateway. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkGatewayConnectionListEntityInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listConnectionsSinglePageAsync(final String resourceGroupName, final String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.listConnections(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listConnectionsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listConnectionsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayInner object if successful. + */ + public VirtualNetworkGatewayInner reset(String resourceGroupName, String virtualNetworkGatewayName) { + return resetWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().last().body(); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @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 resetAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(resetWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable resetAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return resetWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, VirtualNetworkGatewayInner>() { + @Override + public VirtualNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> resetWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + final String gatewayVip = null; + Observable> observable = service.reset(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), gatewayVip, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature enabled gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayInner object if successful. + */ + public VirtualNetworkGatewayInner reset(String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip) { + return resetWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip).toBlocking().last().body(); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature enabled gateway. + * @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 resetAsync(String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(resetWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip), serviceCallback); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature enabled gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable resetAsync(String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip) { + return resetWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip).map(new Func1, VirtualNetworkGatewayInner>() { + @Override + public VirtualNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature enabled gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> resetWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + Observable> observable = service.reset(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), gatewayVip, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayInner object if successful. + */ + public VirtualNetworkGatewayInner beginReset(String resourceGroupName, String virtualNetworkGatewayName) { + return beginResetWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().single().body(); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @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 beginResetAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginResetWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayInner object + */ + public Observable beginResetAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return beginResetWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, VirtualNetworkGatewayInner>() { + @Override + public VirtualNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayInner object + */ + public Observable> beginResetWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + final String gatewayVip = null; + return service.beginReset(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), gatewayVip, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginResetDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature enabled gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkGatewayInner object if successful. + */ + public VirtualNetworkGatewayInner beginReset(String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip) { + return beginResetWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip).toBlocking().single().body(); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature enabled gateway. + * @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 beginResetAsync(String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginResetWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip), serviceCallback); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature enabled gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayInner object + */ + public Observable beginResetAsync(String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip) { + return beginResetWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip).map(new Func1, VirtualNetworkGatewayInner>() { + @Override + public VirtualNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature enabled gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkGatewayInner object + */ + public Observable> beginResetWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.beginReset(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), gatewayVip, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginResetDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginResetDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the String object if successful. + */ + public String generatevpnclientpackage(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + return generatevpnclientpackageWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).toBlocking().last().body(); + } + + /** + * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture generatevpnclientpackageAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(generatevpnclientpackageWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters), serviceCallback); + } + + /** + * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable generatevpnclientpackageAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + return generatevpnclientpackageWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).map(new Func1, String>() { + @Override + public String call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> generatevpnclientpackageWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + Observable> observable = service.generatevpnclientpackage(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the String object if successful. + */ + public String beginGeneratevpnclientpackage(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + return beginGeneratevpnclientpackageWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).toBlocking().single().body(); + } + + /** + * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginGeneratevpnclientpackageAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGeneratevpnclientpackageWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters), serviceCallback); + } + + /** + * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + public Observable beginGeneratevpnclientpackageAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + return beginGeneratevpnclientpackageWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).map(new Func1, String>() { + @Override + public String call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + public Observable> beginGeneratevpnclientpackageWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + return service.beginGeneratevpnclientpackage(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGeneratevpnclientpackageDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGeneratevpnclientpackageDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the String object if successful. + */ + public String generateVpnProfile(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + return generateVpnProfileWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).toBlocking().last().body(); + } + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture generateVpnProfileAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(generateVpnProfileWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters), serviceCallback); + } + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable generateVpnProfileAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + return generateVpnProfileWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).map(new Func1, String>() { + @Override + public String call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> generateVpnProfileWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + Observable> observable = service.generateVpnProfile(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the String object if successful. + */ + public String beginGenerateVpnProfile(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + return beginGenerateVpnProfileWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).toBlocking().single().body(); + } + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginGenerateVpnProfileAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGenerateVpnProfileWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters), serviceCallback); + } + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + public Observable beginGenerateVpnProfileAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + return beginGenerateVpnProfileWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).map(new Func1, String>() { + @Override + public String call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + public Observable> beginGenerateVpnProfileWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + return service.beginGenerateVpnProfile(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGenerateVpnProfileDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGenerateVpnProfileDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The profile needs to be generated first using generateVpnProfile. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the String object if successful. + */ + public String getVpnProfilePackageUrl(String resourceGroupName, String virtualNetworkGatewayName) { + return getVpnProfilePackageUrlWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().last().body(); + } + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The profile needs to be generated first using generateVpnProfile. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @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 getVpnProfilePackageUrlAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getVpnProfilePackageUrlWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The profile needs to be generated first using generateVpnProfile. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable getVpnProfilePackageUrlAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return getVpnProfilePackageUrlWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, String>() { + @Override + public String call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The profile needs to be generated first using generateVpnProfile. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> getVpnProfilePackageUrlWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + Observable> observable = service.getVpnProfilePackageUrl(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The profile needs to be generated first using generateVpnProfile. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the String object if successful. + */ + public String beginGetVpnProfilePackageUrl(String resourceGroupName, String virtualNetworkGatewayName) { + return beginGetVpnProfilePackageUrlWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().single().body(); + } + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The profile needs to be generated first using generateVpnProfile. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @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 beginGetVpnProfilePackageUrlAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetVpnProfilePackageUrlWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The profile needs to be generated first using generateVpnProfile. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + public Observable beginGetVpnProfilePackageUrlAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return beginGetVpnProfilePackageUrlWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, String>() { + @Override + public String call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The profile needs to be generated first using generateVpnProfile. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + public Observable> beginGetVpnProfilePackageUrlWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.beginGetVpnProfilePackageUrl(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGetVpnProfilePackageUrlDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGetVpnProfilePackageUrlDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BgpPeerStatusListResultInner object if successful. + */ + public BgpPeerStatusListResultInner getBgpPeerStatus(String resourceGroupName, String virtualNetworkGatewayName) { + return getBgpPeerStatusWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().last().body(); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @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 getBgpPeerStatusAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getBgpPeerStatusWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable getBgpPeerStatusAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return getBgpPeerStatusWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, BgpPeerStatusListResultInner>() { + @Override + public BgpPeerStatusListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> getBgpPeerStatusWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + final String peer = null; + Observable> observable = service.getBgpPeerStatus(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), peer, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer to retrieve the status of. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BgpPeerStatusListResultInner object if successful. + */ + public BgpPeerStatusListResultInner getBgpPeerStatus(String resourceGroupName, String virtualNetworkGatewayName, String peer) { + return getBgpPeerStatusWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer).toBlocking().last().body(); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer to retrieve the status of. + * @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 getBgpPeerStatusAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getBgpPeerStatusWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer), serviceCallback); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer to retrieve the status of. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable getBgpPeerStatusAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer) { + return getBgpPeerStatusWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer).map(new Func1, BgpPeerStatusListResultInner>() { + @Override + public BgpPeerStatusListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer to retrieve the status of. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> getBgpPeerStatusWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + Observable> observable = service.getBgpPeerStatus(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), peer, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BgpPeerStatusListResultInner object if successful. + */ + public BgpPeerStatusListResultInner beginGetBgpPeerStatus(String resourceGroupName, String virtualNetworkGatewayName) { + return beginGetBgpPeerStatusWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().single().body(); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @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 beginGetBgpPeerStatusAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetBgpPeerStatusWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BgpPeerStatusListResultInner object + */ + public Observable beginGetBgpPeerStatusAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return beginGetBgpPeerStatusWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, BgpPeerStatusListResultInner>() { + @Override + public BgpPeerStatusListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BgpPeerStatusListResultInner object + */ + public Observable> beginGetBgpPeerStatusWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + final String peer = null; + return service.beginGetBgpPeerStatus(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), peer, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGetBgpPeerStatusDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer to retrieve the status of. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BgpPeerStatusListResultInner object if successful. + */ + public BgpPeerStatusListResultInner beginGetBgpPeerStatus(String resourceGroupName, String virtualNetworkGatewayName, String peer) { + return beginGetBgpPeerStatusWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer).toBlocking().single().body(); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer to retrieve the status of. + * @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 beginGetBgpPeerStatusAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetBgpPeerStatusWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer), serviceCallback); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer to retrieve the status of. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BgpPeerStatusListResultInner object + */ + public Observable beginGetBgpPeerStatusAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer) { + return beginGetBgpPeerStatusWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer).map(new Func1, BgpPeerStatusListResultInner>() { + @Override + public BgpPeerStatusListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer to retrieve the status of. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BgpPeerStatusListResultInner object + */ + public Observable> beginGetBgpPeerStatusWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.beginGetBgpPeerStatus(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), peer, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGetBgpPeerStatusDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGetBgpPeerStatusDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a xml format representation for supported vpn devices. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the String object if successful. + */ + public String supportedVpnDevices(String resourceGroupName, String virtualNetworkGatewayName) { + return supportedVpnDevicesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().single().body(); + } + + /** + * Gets a xml format representation for supported vpn devices. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @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 supportedVpnDevicesAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(supportedVpnDevicesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * Gets a xml format representation for supported vpn devices. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + public Observable supportedVpnDevicesAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return supportedVpnDevicesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, String>() { + @Override + public String call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a xml format representation for supported vpn devices. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + public Observable> supportedVpnDevicesWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.supportedVpnDevices(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = supportedVpnDevicesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse supportedVpnDevicesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the GatewayRouteListResultInner object if successful. + */ + public GatewayRouteListResultInner getLearnedRoutes(String resourceGroupName, String virtualNetworkGatewayName) { + return getLearnedRoutesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().last().body(); + } + + /** + * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @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 getLearnedRoutesAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getLearnedRoutesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable getLearnedRoutesAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return getLearnedRoutesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, GatewayRouteListResultInner>() { + @Override + public GatewayRouteListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> getLearnedRoutesWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + Observable> observable = service.getLearnedRoutes(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the GatewayRouteListResultInner object if successful. + */ + public GatewayRouteListResultInner beginGetLearnedRoutes(String resourceGroupName, String virtualNetworkGatewayName) { + return beginGetLearnedRoutesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().single().body(); + } + + /** + * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @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 beginGetLearnedRoutesAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetLearnedRoutesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the GatewayRouteListResultInner object + */ + public Observable beginGetLearnedRoutesAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return beginGetLearnedRoutesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, GatewayRouteListResultInner>() { + @Override + public GatewayRouteListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the GatewayRouteListResultInner object + */ + public Observable> beginGetLearnedRoutesWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.beginGetLearnedRoutes(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGetLearnedRoutesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGetLearnedRoutesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the GatewayRouteListResultInner object if successful. + */ + public GatewayRouteListResultInner getAdvertisedRoutes(String resourceGroupName, String virtualNetworkGatewayName, String peer) { + return getAdvertisedRoutesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer).toBlocking().last().body(); + } + + /** + * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer + * @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 getAdvertisedRoutesAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getAdvertisedRoutesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer), serviceCallback); + } + + /** + * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable getAdvertisedRoutesAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer) { + return getAdvertisedRoutesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer).map(new Func1, GatewayRouteListResultInner>() { + @Override + public GatewayRouteListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> getAdvertisedRoutesWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName 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 (peer == null) { + throw new IllegalArgumentException("Parameter peer is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + Observable> observable = service.getAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), peer, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the GatewayRouteListResultInner object if successful. + */ + public GatewayRouteListResultInner beginGetAdvertisedRoutes(String resourceGroupName, String virtualNetworkGatewayName, String peer) { + return beginGetAdvertisedRoutesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer).toBlocking().single().body(); + } + + /** + * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer + * @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 beginGetAdvertisedRoutesAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetAdvertisedRoutesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer), serviceCallback); + } + + /** + * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the GatewayRouteListResultInner object + */ + public Observable beginGetAdvertisedRoutesAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer) { + return beginGetAdvertisedRoutesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer).map(new Func1, GatewayRouteListResultInner>() { + @Override + public GatewayRouteListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the GatewayRouteListResultInner object + */ + public Observable> beginGetAdvertisedRoutesWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName 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 (peer == null) { + throw new IllegalArgumentException("Parameter peer is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.beginGetAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), peer, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGetAdvertisedRoutesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGetAdvertisedRoutesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network Gateway P2S client operation through Network resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnClientIPsecParametersInner object if successful. + */ + public VpnClientIPsecParametersInner setVpnclientIpsecParameters(String resourceGroupName, String virtualNetworkGatewayName, VpnClientIPsecParametersInner vpnclientIpsecParams) { + return setVpnclientIpsecParametersWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams).toBlocking().last().body(); + } + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network Gateway P2S client operation through Network resource provider. + * @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 setVpnclientIpsecParametersAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientIPsecParametersInner vpnclientIpsecParams, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(setVpnclientIpsecParametersWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams), serviceCallback); + } + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network Gateway P2S client operation through Network resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable setVpnclientIpsecParametersAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientIPsecParametersInner vpnclientIpsecParams) { + return setVpnclientIpsecParametersWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams).map(new Func1, VpnClientIPsecParametersInner>() { + @Override + public VpnClientIPsecParametersInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network Gateway P2S client operation through Network resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> setVpnclientIpsecParametersWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientIPsecParametersInner vpnclientIpsecParams) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName 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 (vpnclientIpsecParams == null) { + throw new IllegalArgumentException("Parameter vpnclientIpsecParams is required and cannot be null."); + } + Validator.validate(vpnclientIpsecParams); + final String apiVersion = "2018-06-01"; + Observable> observable = service.setVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), vpnclientIpsecParams, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network Gateway P2S client operation through Network resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnClientIPsecParametersInner object if successful. + */ + public VpnClientIPsecParametersInner beginSetVpnclientIpsecParameters(String resourceGroupName, String virtualNetworkGatewayName, VpnClientIPsecParametersInner vpnclientIpsecParams) { + return beginSetVpnclientIpsecParametersWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams).toBlocking().single().body(); + } + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network Gateway P2S client operation through Network resource provider. + * @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 beginSetVpnclientIpsecParametersAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientIPsecParametersInner vpnclientIpsecParams, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginSetVpnclientIpsecParametersWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams), serviceCallback); + } + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network Gateway P2S client operation through Network resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnClientIPsecParametersInner object + */ + public Observable beginSetVpnclientIpsecParametersAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientIPsecParametersInner vpnclientIpsecParams) { + return beginSetVpnclientIpsecParametersWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams).map(new Func1, VpnClientIPsecParametersInner>() { + @Override + public VpnClientIPsecParametersInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network Gateway P2S client operation through Network resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnClientIPsecParametersInner object + */ + public Observable> beginSetVpnclientIpsecParametersWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientIPsecParametersInner vpnclientIpsecParams) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName 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 (vpnclientIpsecParams == null) { + throw new IllegalArgumentException("Parameter vpnclientIpsecParams is required and cannot be null."); + } + Validator.validate(vpnclientIpsecParams); + final String apiVersion = "2018-06-01"; + return service.beginSetVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), vpnclientIpsecParams, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginSetVpnclientIpsecParametersDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginSetVpnclientIpsecParametersDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The virtual network gateway name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnClientIPsecParametersInner object if successful. + */ + public VpnClientIPsecParametersInner getVpnclientIpsecParameters(String resourceGroupName, String virtualNetworkGatewayName) { + return getVpnclientIpsecParametersWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().last().body(); + } + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The virtual network gateway 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 getVpnclientIpsecParametersAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getVpnclientIpsecParametersWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The virtual network gateway name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable getVpnclientIpsecParametersAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return getVpnclientIpsecParametersWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, VpnClientIPsecParametersInner>() { + @Override + public VpnClientIPsecParametersInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The virtual network gateway name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> getVpnclientIpsecParametersWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + Observable> observable = service.getVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The virtual network gateway name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnClientIPsecParametersInner object if successful. + */ + public VpnClientIPsecParametersInner beginGetVpnclientIpsecParameters(String resourceGroupName, String virtualNetworkGatewayName) { + return beginGetVpnclientIpsecParametersWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().single().body(); + } + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The virtual network gateway 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 beginGetVpnclientIpsecParametersAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetVpnclientIpsecParametersWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The virtual network gateway name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnClientIPsecParametersInner object + */ + public Observable beginGetVpnclientIpsecParametersAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return beginGetVpnclientIpsecParametersWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, VpnClientIPsecParametersInner>() { + @Override + public VpnClientIPsecParametersInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The virtual network gateway name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnClientIPsecParametersInner object + */ + public Observable> beginGetVpnclientIpsecParametersWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.beginGetVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGetVpnclientIpsecParametersDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGetVpnclientIpsecParametersDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a xml format representation for vpn device configuration script. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection for which the configuration script is generated. + * @param parameters Parameters supplied to the generate vpn device script operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the String object if successful. + */ + public String vpnDeviceConfigurationScript(String resourceGroupName, String virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters) { + return vpnDeviceConfigurationScriptWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).toBlocking().single().body(); + } + + /** + * Gets a xml format representation for vpn device configuration script. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection for which the configuration script is generated. + * @param parameters Parameters supplied to the generate vpn device script operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture vpnDeviceConfigurationScriptAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(vpnDeviceConfigurationScriptWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters), serviceCallback); + } + + /** + * Gets a xml format representation for vpn device configuration script. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection for which the configuration script is generated. + * @param parameters Parameters supplied to the generate vpn device script operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + public Observable vpnDeviceConfigurationScriptAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters) { + return vpnDeviceConfigurationScriptWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).map(new Func1, String>() { + @Override + public String call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a xml format representation for vpn device configuration script. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection for which the configuration script is generated. + * @param parameters Parameters supplied to the generate vpn device script operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + public Observable> vpnDeviceConfigurationScriptWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkGatewayConnectionName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + return service.vpnDeviceConfigurationScript(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = vpnDeviceConfigurationScriptDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse vpnDeviceConfigurationScriptDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all virtual network gateways by resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkGatewayInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all virtual network gateways by resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all virtual network gateways by resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkGatewayInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all virtual network gateways by resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkGatewayInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all virtual network gateways by resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkGatewayInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the connections in a virtual network gateway. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkGatewayConnectionListEntityInner> object if successful. + */ + public PagedList listConnectionsNext(final String nextPageLink) { + ServiceResponse> response = listConnectionsNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listConnectionsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the connections in a virtual network gateway. + * + * @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> listConnectionsNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listConnectionsNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listConnectionsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the connections in a virtual network gateway. + * + * @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<VirtualNetworkGatewayConnectionListEntityInner> object + */ + public Observable> listConnectionsNextAsync(final String nextPageLink) { + return listConnectionsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the connections in a virtual network gateway. + * + * @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<VirtualNetworkGatewayConnectionListEntityInner> object + */ + public Observable>> listConnectionsNextWithServiceResponseAsync(final String nextPageLink) { + return listConnectionsNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listConnectionsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the connections in a virtual network gateway. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkGatewayConnectionListEntityInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listConnectionsNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listConnectionsNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listConnectionsNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listConnectionsNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkImpl.java new file mode 100644 index 000000000000..a4f39459bd24 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkImpl.java @@ -0,0 +1,175 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_06_01.VirtualNetwork; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_06_01.AddressSpace; +import com.microsoft.azure.management.network.v2018_06_01.DhcpOptions; +import java.util.List; +import com.microsoft.azure.SubResource; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_06_01.Subnet; +import com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkPeering; + +class VirtualNetworkImpl extends GroupableResourceCoreImpl implements VirtualNetwork, VirtualNetwork.Definition, VirtualNetwork.Update { + VirtualNetworkImpl(String name, VirtualNetworkInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + VirtualNetworksInner client = this.manager().inner().virtualNetworks(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + VirtualNetworksInner client = this.manager().inner().virtualNetworks(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + VirtualNetworksInner client = this.manager().inner().virtualNetworks(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public AddressSpace addressSpace() { + return this.inner().addressSpace(); + } + + @Override + public SubResource ddosProtectionPlan() { + return this.inner().ddosProtectionPlan(); + } + + @Override + public DhcpOptions dhcpOptions() { + return this.inner().dhcpOptions(); + } + + @Override + public Boolean enableDdosProtection() { + return this.inner().enableDdosProtection(); + } + + @Override + public Boolean enableVmProtection() { + return this.inner().enableVmProtection(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String resourceGuid() { + return this.inner().resourceGuid(); + } + + @Override + public List subnets() { + List lst = new ArrayList(); + if (this.inner().subnets() != null) { + for (SubnetInner inner : this.inner().subnets()) { + lst.add( new SubnetImpl(inner, manager())); + } + } + return lst; + } + + @Override + public List virtualNetworkPeerings() { + List lst = new ArrayList(); + if (this.inner().virtualNetworkPeerings() != null) { + for (VirtualNetworkPeeringInner inner : this.inner().virtualNetworkPeerings()) { + lst.add( new VirtualNetworkPeeringImpl(inner, manager())); + } + } + return lst; + } + + @Override + public VirtualNetworkImpl withAddressSpace(AddressSpace addressSpace) { + this.inner().withAddressSpace(addressSpace); + return this; + } + + @Override + public VirtualNetworkImpl withDdosProtectionPlan(SubResource ddosProtectionPlan) { + this.inner().withDdosProtectionPlan(ddosProtectionPlan); + return this; + } + + @Override + public VirtualNetworkImpl withDhcpOptions(DhcpOptions dhcpOptions) { + this.inner().withDhcpOptions(dhcpOptions); + return this; + } + + @Override + public VirtualNetworkImpl withEnableDdosProtection(Boolean enableDdosProtection) { + this.inner().withEnableDdosProtection(enableDdosProtection); + return this; + } + + @Override + public VirtualNetworkImpl withEnableVmProtection(Boolean enableVmProtection) { + this.inner().withEnableVmProtection(enableVmProtection); + return this; + } + + @Override + public VirtualNetworkImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public VirtualNetworkImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public VirtualNetworkImpl withResourceGuid(String resourceGuid) { + this.inner().withResourceGuid(resourceGuid); + return this; + } + + @Override + public VirtualNetworkImpl withSubnets(List subnets) { + this.inner().withSubnets(subnets); + return this; + } + + @Override + public VirtualNetworkImpl withVirtualNetworkPeerings(List virtualNetworkPeerings) { + this.inner().withVirtualNetworkPeerings(virtualNetworkPeerings); + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkInner.java new file mode 100644 index 000000000000..62825f3b0110 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkInner.java @@ -0,0 +1,319 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.AddressSpace; +import com.microsoft.azure.management.network.v2018_06_01.DhcpOptions; +import java.util.List; +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Virtual Network resource. + */ +@JsonFlatten +@SkipParentValidation +public class VirtualNetworkInner extends Resource { + /** + * The AddressSpace that contains an array of IP address ranges that can be + * used by subnets. + */ + @JsonProperty(value = "properties.addressSpace") + private AddressSpace addressSpace; + + /** + * The dhcpOptions that contains an array of DNS servers available to VMs + * deployed in the virtual network. + */ + @JsonProperty(value = "properties.dhcpOptions") + private DhcpOptions dhcpOptions; + + /** + * A list of subnets in a Virtual Network. + */ + @JsonProperty(value = "properties.subnets") + private List subnets; + + /** + * A list of peerings in a Virtual Network. + */ + @JsonProperty(value = "properties.virtualNetworkPeerings") + private List virtualNetworkPeerings; + + /** + * The resourceGuid property of the Virtual Network resource. + */ + @JsonProperty(value = "properties.resourceGuid") + private String resourceGuid; + + /** + * The provisioning state of the PublicIP resource. Possible values are: + * 'Updating', 'Deleting', and 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Indicates if DDoS protection is enabled for all the protected resources + * in the virtual network. It requires a DDoS protection plan associated + * with the resource. + */ + @JsonProperty(value = "properties.enableDdosProtection") + private Boolean enableDdosProtection; + + /** + * Indicates if VM protection is enabled for all the subnets in the virtual + * network. + */ + @JsonProperty(value = "properties.enableVmProtection") + private Boolean enableVmProtection; + + /** + * The DDoS protection plan associated with the virtual network. + */ + @JsonProperty(value = "properties.ddosProtectionPlan") + private SubResource ddosProtectionPlan; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the AddressSpace that contains an array of IP address ranges that can be used by subnets. + * + * @return the addressSpace value + */ + public AddressSpace addressSpace() { + return this.addressSpace; + } + + /** + * Set the AddressSpace that contains an array of IP address ranges that can be used by subnets. + * + * @param addressSpace the addressSpace value to set + * @return the VirtualNetworkInner object itself. + */ + public VirtualNetworkInner withAddressSpace(AddressSpace addressSpace) { + this.addressSpace = addressSpace; + return this; + } + + /** + * Get the dhcpOptions that contains an array of DNS servers available to VMs deployed in the virtual network. + * + * @return the dhcpOptions value + */ + public DhcpOptions dhcpOptions() { + return this.dhcpOptions; + } + + /** + * Set the dhcpOptions that contains an array of DNS servers available to VMs deployed in the virtual network. + * + * @param dhcpOptions the dhcpOptions value to set + * @return the VirtualNetworkInner object itself. + */ + public VirtualNetworkInner withDhcpOptions(DhcpOptions dhcpOptions) { + this.dhcpOptions = dhcpOptions; + return this; + } + + /** + * Get a list of subnets in a Virtual Network. + * + * @return the subnets value + */ + public List subnets() { + return this.subnets; + } + + /** + * Set a list of subnets in a Virtual Network. + * + * @param subnets the subnets value to set + * @return the VirtualNetworkInner object itself. + */ + public VirtualNetworkInner withSubnets(List subnets) { + this.subnets = subnets; + return this; + } + + /** + * Get a list of peerings in a Virtual Network. + * + * @return the virtualNetworkPeerings value + */ + public List virtualNetworkPeerings() { + return this.virtualNetworkPeerings; + } + + /** + * Set a list of peerings in a Virtual Network. + * + * @param virtualNetworkPeerings the virtualNetworkPeerings value to set + * @return the VirtualNetworkInner object itself. + */ + public VirtualNetworkInner withVirtualNetworkPeerings(List virtualNetworkPeerings) { + this.virtualNetworkPeerings = virtualNetworkPeerings; + return this; + } + + /** + * Get the resourceGuid property of the Virtual Network resource. + * + * @return the resourceGuid value + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Set the resourceGuid property of the Virtual Network resource. + * + * @param resourceGuid the resourceGuid value to set + * @return the VirtualNetworkInner object itself. + */ + public VirtualNetworkInner withResourceGuid(String resourceGuid) { + this.resourceGuid = resourceGuid; + return this; + } + + /** + * Get the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the VirtualNetworkInner object itself. + */ + public VirtualNetworkInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get indicates if DDoS protection is enabled for all the protected resources in the virtual network. It requires a DDoS protection plan associated with the resource. + * + * @return the enableDdosProtection value + */ + public Boolean enableDdosProtection() { + return this.enableDdosProtection; + } + + /** + * Set indicates if DDoS protection is enabled for all the protected resources in the virtual network. It requires a DDoS protection plan associated with the resource. + * + * @param enableDdosProtection the enableDdosProtection value to set + * @return the VirtualNetworkInner object itself. + */ + public VirtualNetworkInner withEnableDdosProtection(Boolean enableDdosProtection) { + this.enableDdosProtection = enableDdosProtection; + return this; + } + + /** + * Get indicates if VM protection is enabled for all the subnets in the virtual network. + * + * @return the enableVmProtection value + */ + public Boolean enableVmProtection() { + return this.enableVmProtection; + } + + /** + * Set indicates if VM protection is enabled for all the subnets in the virtual network. + * + * @param enableVmProtection the enableVmProtection value to set + * @return the VirtualNetworkInner object itself. + */ + public VirtualNetworkInner withEnableVmProtection(Boolean enableVmProtection) { + this.enableVmProtection = enableVmProtection; + return this; + } + + /** + * Get the DDoS protection plan associated with the virtual network. + * + * @return the ddosProtectionPlan value + */ + public SubResource ddosProtectionPlan() { + return this.ddosProtectionPlan; + } + + /** + * Set the DDoS protection plan associated with the virtual network. + * + * @param ddosProtectionPlan the ddosProtectionPlan value to set + * @return the VirtualNetworkInner object itself. + */ + public VirtualNetworkInner withDdosProtectionPlan(SubResource ddosProtectionPlan) { + this.ddosProtectionPlan = ddosProtectionPlan; + return this; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set gets a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the VirtualNetworkInner object itself. + */ + public VirtualNetworkInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the VirtualNetworkInner object itself. + */ + public VirtualNetworkInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkPeeringImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkPeeringImpl.java new file mode 100644 index 000000000000..fc50beecef8a --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkPeeringImpl.java @@ -0,0 +1,203 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkPeering; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_06_01.AddressSpace; +import com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkPeeringState; + +class VirtualNetworkPeeringImpl extends CreatableUpdatableImpl implements VirtualNetworkPeering, VirtualNetworkPeering.Definition, VirtualNetworkPeering.Update { + private final NetworkManager manager; + private String resourceGroupName; + private String virtualNetworkName; + private String virtualNetworkPeeringName; + + VirtualNetworkPeeringImpl(String name, NetworkManager manager) { + super(name, new VirtualNetworkPeeringInner()); + this.manager = manager; + // Set resource name + this.virtualNetworkPeeringName = name; + // + } + + VirtualNetworkPeeringImpl(VirtualNetworkPeeringInner inner, NetworkManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.virtualNetworkPeeringName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.virtualNetworkName = IdParsingUtils.getValueFromIdByName(inner.id(), "virtualNetworks"); + this.virtualNetworkPeeringName = IdParsingUtils.getValueFromIdByName(inner.id(), "virtualNetworkPeerings"); + // + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + VirtualNetworkPeeringsInner client = this.manager().inner().virtualNetworkPeerings(); + return client.createOrUpdateAsync(this.resourceGroupName, this.virtualNetworkName, this.virtualNetworkPeeringName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + VirtualNetworkPeeringsInner client = this.manager().inner().virtualNetworkPeerings(); + return client.createOrUpdateAsync(this.resourceGroupName, this.virtualNetworkName, this.virtualNetworkPeeringName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + VirtualNetworkPeeringsInner client = this.manager().inner().virtualNetworkPeerings(); + return client.getAsync(this.resourceGroupName, this.virtualNetworkName, this.virtualNetworkPeeringName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public Boolean allowForwardedTraffic() { + return this.inner().allowForwardedTraffic(); + } + + @Override + public Boolean allowGatewayTransit() { + return this.inner().allowGatewayTransit(); + } + + @Override + public Boolean allowVirtualNetworkAccess() { + return this.inner().allowVirtualNetworkAccess(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public VirtualNetworkPeeringState peeringState() { + return this.inner().peeringState(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public AddressSpace remoteAddressSpace() { + return this.inner().remoteAddressSpace(); + } + + @Override + public SubResource remoteVirtualNetwork() { + return this.inner().remoteVirtualNetwork(); + } + + @Override + public Boolean useRemoteGateways() { + return this.inner().useRemoteGateways(); + } + + @Override + public VirtualNetworkPeeringImpl withExistingVirtualNetwork(String resourceGroupName, String virtualNetworkName) { + this.resourceGroupName = resourceGroupName; + this.virtualNetworkName = virtualNetworkName; + return this; + } + + @Override + public VirtualNetworkPeeringImpl withAllowForwardedTraffic(Boolean allowForwardedTraffic) { + this.inner().withAllowForwardedTraffic(allowForwardedTraffic); + return this; + } + + @Override + public VirtualNetworkPeeringImpl withAllowGatewayTransit(Boolean allowGatewayTransit) { + this.inner().withAllowGatewayTransit(allowGatewayTransit); + return this; + } + + @Override + public VirtualNetworkPeeringImpl withAllowVirtualNetworkAccess(Boolean allowVirtualNetworkAccess) { + this.inner().withAllowVirtualNetworkAccess(allowVirtualNetworkAccess); + return this; + } + + @Override + public VirtualNetworkPeeringImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public VirtualNetworkPeeringImpl withId(String id) { + this.inner().withId(id); + return this; + } + + @Override + public VirtualNetworkPeeringImpl withName(String name) { + this.inner().withName(name); + return this; + } + + @Override + public VirtualNetworkPeeringImpl withPeeringState(VirtualNetworkPeeringState peeringState) { + this.inner().withPeeringState(peeringState); + return this; + } + + @Override + public VirtualNetworkPeeringImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public VirtualNetworkPeeringImpl withRemoteAddressSpace(AddressSpace remoteAddressSpace) { + this.inner().withRemoteAddressSpace(remoteAddressSpace); + return this; + } + + @Override + public VirtualNetworkPeeringImpl withRemoteVirtualNetwork(SubResource remoteVirtualNetwork) { + this.inner().withRemoteVirtualNetwork(remoteVirtualNetwork); + return this; + } + + @Override + public VirtualNetworkPeeringImpl withUseRemoteGateways(Boolean useRemoteGateways) { + this.inner().withUseRemoteGateways(useRemoteGateways); + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkPeeringInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkPeeringInner.java new file mode 100644 index 000000000000..0e37f79a5110 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkPeeringInner.java @@ -0,0 +1,295 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_06_01.AddressSpace; +import com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkPeeringState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Peerings in a virtual network resource. + */ +@JsonFlatten +public class VirtualNetworkPeeringInner extends SubResource { + /** + * Whether the VMs in the linked virtual network space would be able to + * access all the VMs in local Virtual network space. + */ + @JsonProperty(value = "properties.allowVirtualNetworkAccess") + private Boolean allowVirtualNetworkAccess; + + /** + * Whether the forwarded traffic from the VMs in the remote virtual network + * will be allowed/disallowed. + */ + @JsonProperty(value = "properties.allowForwardedTraffic") + private Boolean allowForwardedTraffic; + + /** + * If gateway links can be used in remote virtual networking to link to + * this virtual network. + */ + @JsonProperty(value = "properties.allowGatewayTransit") + private Boolean allowGatewayTransit; + + /** + * If remote gateways can be used on this virtual network. If the flag is + * set to true, and allowGatewayTransit on remote peering is also true, + * virtual network will use gateways of remote virtual network for transit. + * Only one peering can have this flag set to true. This flag cannot be set + * if virtual network already has a gateway. + */ + @JsonProperty(value = "properties.useRemoteGateways") + private Boolean useRemoteGateways; + + /** + * The reference of the remote virtual network. The remote virtual network + * can be in the same or different region (preview). See here to register + * for the preview and learn more + * (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). + */ + @JsonProperty(value = "properties.remoteVirtualNetwork") + private SubResource remoteVirtualNetwork; + + /** + * The reference of the remote virtual network address space. + */ + @JsonProperty(value = "properties.remoteAddressSpace") + private AddressSpace remoteAddressSpace; + + /** + * The status of the virtual network peering. Possible values are + * 'Initiated', 'Connected', and 'Disconnected'. Possible values include: + * 'Initiated', 'Connected', 'Disconnected'. + */ + @JsonProperty(value = "properties.peeringState") + private VirtualNetworkPeeringState peeringState; + + /** + * The provisioning state of the resource. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get whether the VMs in the linked virtual network space would be able to access all the VMs in local Virtual network space. + * + * @return the allowVirtualNetworkAccess value + */ + public Boolean allowVirtualNetworkAccess() { + return this.allowVirtualNetworkAccess; + } + + /** + * Set whether the VMs in the linked virtual network space would be able to access all the VMs in local Virtual network space. + * + * @param allowVirtualNetworkAccess the allowVirtualNetworkAccess value to set + * @return the VirtualNetworkPeeringInner object itself. + */ + public VirtualNetworkPeeringInner withAllowVirtualNetworkAccess(Boolean allowVirtualNetworkAccess) { + this.allowVirtualNetworkAccess = allowVirtualNetworkAccess; + return this; + } + + /** + * Get whether the forwarded traffic from the VMs in the remote virtual network will be allowed/disallowed. + * + * @return the allowForwardedTraffic value + */ + public Boolean allowForwardedTraffic() { + return this.allowForwardedTraffic; + } + + /** + * Set whether the forwarded traffic from the VMs in the remote virtual network will be allowed/disallowed. + * + * @param allowForwardedTraffic the allowForwardedTraffic value to set + * @return the VirtualNetworkPeeringInner object itself. + */ + public VirtualNetworkPeeringInner withAllowForwardedTraffic(Boolean allowForwardedTraffic) { + this.allowForwardedTraffic = allowForwardedTraffic; + return this; + } + + /** + * Get if gateway links can be used in remote virtual networking to link to this virtual network. + * + * @return the allowGatewayTransit value + */ + public Boolean allowGatewayTransit() { + return this.allowGatewayTransit; + } + + /** + * Set if gateway links can be used in remote virtual networking to link to this virtual network. + * + * @param allowGatewayTransit the allowGatewayTransit value to set + * @return the VirtualNetworkPeeringInner object itself. + */ + public VirtualNetworkPeeringInner withAllowGatewayTransit(Boolean allowGatewayTransit) { + this.allowGatewayTransit = allowGatewayTransit; + return this; + } + + /** + * Get if remote gateways can be used on this virtual network. If the flag is set to true, and allowGatewayTransit on remote peering is also true, virtual network will use gateways of remote virtual network for transit. Only one peering can have this flag set to true. This flag cannot be set if virtual network already has a gateway. + * + * @return the useRemoteGateways value + */ + public Boolean useRemoteGateways() { + return this.useRemoteGateways; + } + + /** + * Set if remote gateways can be used on this virtual network. If the flag is set to true, and allowGatewayTransit on remote peering is also true, virtual network will use gateways of remote virtual network for transit. Only one peering can have this flag set to true. This flag cannot be set if virtual network already has a gateway. + * + * @param useRemoteGateways the useRemoteGateways value to set + * @return the VirtualNetworkPeeringInner object itself. + */ + public VirtualNetworkPeeringInner withUseRemoteGateways(Boolean useRemoteGateways) { + this.useRemoteGateways = useRemoteGateways; + return this; + } + + /** + * Get the reference of the remote virtual network. The remote virtual network can be in the same or different region (preview). See here to register for the preview and learn more (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). + * + * @return the remoteVirtualNetwork value + */ + public SubResource remoteVirtualNetwork() { + return this.remoteVirtualNetwork; + } + + /** + * Set the reference of the remote virtual network. The remote virtual network can be in the same or different region (preview). See here to register for the preview and learn more (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). + * + * @param remoteVirtualNetwork the remoteVirtualNetwork value to set + * @return the VirtualNetworkPeeringInner object itself. + */ + public VirtualNetworkPeeringInner withRemoteVirtualNetwork(SubResource remoteVirtualNetwork) { + this.remoteVirtualNetwork = remoteVirtualNetwork; + return this; + } + + /** + * Get the reference of the remote virtual network address space. + * + * @return the remoteAddressSpace value + */ + public AddressSpace remoteAddressSpace() { + return this.remoteAddressSpace; + } + + /** + * Set the reference of the remote virtual network address space. + * + * @param remoteAddressSpace the remoteAddressSpace value to set + * @return the VirtualNetworkPeeringInner object itself. + */ + public VirtualNetworkPeeringInner withRemoteAddressSpace(AddressSpace remoteAddressSpace) { + this.remoteAddressSpace = remoteAddressSpace; + return this; + } + + /** + * Get the status of the virtual network peering. Possible values are 'Initiated', 'Connected', and 'Disconnected'. Possible values include: 'Initiated', 'Connected', 'Disconnected'. + * + * @return the peeringState value + */ + public VirtualNetworkPeeringState peeringState() { + return this.peeringState; + } + + /** + * Set the status of the virtual network peering. Possible values are 'Initiated', 'Connected', and 'Disconnected'. Possible values include: 'Initiated', 'Connected', 'Disconnected'. + * + * @param peeringState the peeringState value to set + * @return the VirtualNetworkPeeringInner object itself. + */ + public VirtualNetworkPeeringInner withPeeringState(VirtualNetworkPeeringState peeringState) { + this.peeringState = peeringState; + return this; + } + + /** + * Get the provisioning state of the resource. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. + * + * @param provisioningState the provisioningState value to set + * @return the VirtualNetworkPeeringInner object itself. + */ + public VirtualNetworkPeeringInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource that is unique within a resource group. This name can be used to access the resource. + * + * @param name the name value to set + * @return the VirtualNetworkPeeringInner object itself. + */ + public VirtualNetworkPeeringInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set + * @return the VirtualNetworkPeeringInner object itself. + */ + public VirtualNetworkPeeringInner withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkPeeringsImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkPeeringsImpl.java new file mode 100644 index 000000000000..5a0fb3a97a08 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkPeeringsImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkPeerings; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkPeering; + +class VirtualNetworkPeeringsImpl extends WrapperImpl implements VirtualNetworkPeerings { + private final NetworkManager manager; + + VirtualNetworkPeeringsImpl(NetworkManager manager) { + super(manager.inner().virtualNetworkPeerings()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public VirtualNetworkPeeringImpl define(String name) { + return wrapModel(name); + } + + private VirtualNetworkPeeringImpl wrapModel(VirtualNetworkPeeringInner inner) { + return new VirtualNetworkPeeringImpl(inner, manager()); + } + + private VirtualNetworkPeeringImpl wrapModel(String name) { + return new VirtualNetworkPeeringImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String virtualNetworkName) { + VirtualNetworkPeeringsInner client = this.inner(); + return client.listAsync(resourceGroupName, virtualNetworkName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VirtualNetworkPeering call(VirtualNetworkPeeringInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { + VirtualNetworkPeeringsInner client = this.inner(); + return client.getAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName) + .map(new Func1() { + @Override + public VirtualNetworkPeering call(VirtualNetworkPeeringInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { + VirtualNetworkPeeringsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName).toCompletable(); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkPeeringsInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkPeeringsInner.java new file mode 100644 index 000000000000..6cae994586fa --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkPeeringsInner.java @@ -0,0 +1,764 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.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 VirtualNetworkPeerings. + */ +public class VirtualNetworkPeeringsInner { + /** The Retrofit service to perform REST calls. */ + private VirtualNetworkPeeringsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of VirtualNetworkPeeringsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public VirtualNetworkPeeringsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(VirtualNetworkPeeringsService.class); + this.client = client; + } + + /** + * The interface defining all the services for VirtualNetworkPeerings to be + * used by Retrofit to perform actually REST calls. + */ + interface VirtualNetworkPeeringsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkPeerings delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("virtualNetworkPeeringName") String virtualNetworkPeeringName, @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.network.v2018_06_01.VirtualNetworkPeerings beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("virtualNetworkPeeringName") String virtualNetworkPeeringName, @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.network.v2018_06_01.VirtualNetworkPeerings get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("virtualNetworkPeeringName") String virtualNetworkPeeringName, @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.network.v2018_06_01.VirtualNetworkPeerings createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("virtualNetworkPeeringName") String virtualNetworkPeeringName, @Path("subscriptionId") String subscriptionId, @Body VirtualNetworkPeeringInner virtualNetworkPeeringParameters, @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.network.v2018_06_01.VirtualNetworkPeerings beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("virtualNetworkPeeringName") String virtualNetworkPeeringName, @Path("subscriptionId") String subscriptionId, @Body VirtualNetworkPeeringInner virtualNetworkPeeringParameters, @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.network.v2018_06_01.VirtualNetworkPeerings list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @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.network.v2018_06_01.VirtualNetworkPeerings listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { + deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName).toBlocking().last().body(); + } + + /** + * Deletes the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @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 virtualNetworkName, String virtualNetworkPeeringName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName), serviceCallback); + } + + /** + * Deletes the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { + return deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (virtualNetworkPeeringName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkPeeringName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + Observable> observable = service.delete(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName).toBlocking().single().body(); + } + + /** + * Deletes the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName), serviceCallback); + } + + /** + * Deletes the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (virtualNetworkPeeringName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkPeeringName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.beginDelete(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkPeeringInner object if successful. + */ + public VirtualNetworkPeeringInner get(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { + return getWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName).toBlocking().single().body(); + } + + /** + * Gets the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @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 virtualNetworkName, String virtualNetworkPeeringName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName), serviceCallback); + } + + /** + * Gets the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkPeeringInner object + */ + public Observable getAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { + return getWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName).map(new Func1, VirtualNetworkPeeringInner>() { + @Override + public VirtualNetworkPeeringInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkPeeringInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (virtualNetworkPeeringName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkPeeringName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.get(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a peering in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the peering. + * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkPeeringInner object if successful. + */ + public VirtualNetworkPeeringInner createOrUpdate(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, VirtualNetworkPeeringInner virtualNetworkPeeringParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters).toBlocking().last().body(); + } + + /** + * Creates or updates a peering in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the peering. + * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, VirtualNetworkPeeringInner virtualNetworkPeeringParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters), serviceCallback); + } + + /** + * Creates or updates a peering in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the peering. + * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, VirtualNetworkPeeringInner virtualNetworkPeeringParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters).map(new Func1, VirtualNetworkPeeringInner>() { + @Override + public VirtualNetworkPeeringInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a peering in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the peering. + * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, VirtualNetworkPeeringInner virtualNetworkPeeringParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (virtualNetworkPeeringName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkPeeringName 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 (virtualNetworkPeeringParameters == null) { + throw new IllegalArgumentException("Parameter virtualNetworkPeeringParameters is required and cannot be null."); + } + Validator.validate(virtualNetworkPeeringParameters); + final String apiVersion = "2018-06-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, this.client.subscriptionId(), virtualNetworkPeeringParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a peering in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the peering. + * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkPeeringInner object if successful. + */ + public VirtualNetworkPeeringInner beginCreateOrUpdate(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, VirtualNetworkPeeringInner virtualNetworkPeeringParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters).toBlocking().single().body(); + } + + /** + * Creates or updates a peering in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the peering. + * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, VirtualNetworkPeeringInner virtualNetworkPeeringParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters), serviceCallback); + } + + /** + * Creates or updates a peering in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the peering. + * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkPeeringInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, VirtualNetworkPeeringInner virtualNetworkPeeringParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters).map(new Func1, VirtualNetworkPeeringInner>() { + @Override + public VirtualNetworkPeeringInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a peering in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the peering. + * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkPeeringInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, VirtualNetworkPeeringInner virtualNetworkPeeringParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (virtualNetworkPeeringName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkPeeringName 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 (virtualNetworkPeeringParameters == null) { + throw new IllegalArgumentException("Parameter virtualNetworkPeeringParameters is required and cannot be null."); + } + Validator.validate(virtualNetworkPeeringParameters); + final String apiVersion = "2018-06-01"; + return service.beginCreateOrUpdate(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, this.client.subscriptionId(), virtualNetworkPeeringParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all virtual network peerings in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkPeeringInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String virtualNetworkName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, virtualNetworkName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all virtual network peerings in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String virtualNetworkName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, virtualNetworkName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all virtual network peerings in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkPeeringInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String virtualNetworkName) { + return listWithServiceResponseAsync(resourceGroupName, virtualNetworkName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all virtual network peerings in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkPeeringInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String virtualNetworkName) { + return listSinglePageAsync(resourceGroupName, virtualNetworkName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all virtual network peerings in a virtual network. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkPeeringInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String virtualNetworkName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.list(resourceGroupName, virtualNetworkName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all virtual network peerings in a virtual network. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkPeeringInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all virtual network peerings in a virtual network. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all virtual network peerings in a virtual network. + * + * @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<VirtualNetworkPeeringInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all virtual network peerings in a virtual network. + * + * @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<VirtualNetworkPeeringInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all virtual network peerings in a virtual network. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkPeeringInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkUsageImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkUsageImpl.java new file mode 100644 index 000000000000..5cba0b31af2a --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkUsageImpl.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.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkUsage; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkUsageName; + +class VirtualNetworkUsageImpl extends WrapperImpl implements VirtualNetworkUsage { + private final NetworkManager manager; + + VirtualNetworkUsageImpl(VirtualNetworkUsageInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + + + @Override + public Double currentValue() { + return this.inner().currentValue(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Double limit() { + return this.inner().limit(); + } + + @Override + public VirtualNetworkUsageName name() { + return this.inner().name(); + } + + @Override + public String unit() { + return this.inner().unit(); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkUsageInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkUsageInner.java new file mode 100644 index 000000000000..f74f2e22cad7 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkUsageInner.java @@ -0,0 +1,93 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkUsageName; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Usage details for subnet. + */ +public class VirtualNetworkUsageInner { + /** + * Indicates number of IPs used from the Subnet. + */ + @JsonProperty(value = "currentValue", access = JsonProperty.Access.WRITE_ONLY) + private Double currentValue; + + /** + * Subnet identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Indicates the size of the subnet. + */ + @JsonProperty(value = "limit", access = JsonProperty.Access.WRITE_ONLY) + private Double limit; + + /** + * The name containing common and localized value for usage. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private VirtualNetworkUsageName name; + + /** + * Usage units. Returns 'Count'. + */ + @JsonProperty(value = "unit", access = JsonProperty.Access.WRITE_ONLY) + private String unit; + + /** + * Get indicates number of IPs used from the Subnet. + * + * @return the currentValue value + */ + public Double currentValue() { + return this.currentValue; + } + + /** + * Get subnet identifier. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get indicates the size of the subnet. + * + * @return the limit value + */ + public Double limit() { + return this.limit; + } + + /** + * Get the name containing common and localized value for usage. + * + * @return the name value + */ + public VirtualNetworkUsageName name() { + return this.name; + } + + /** + * Get usage units. Returns 'Count'. + * + * @return the unit value + */ + public String unit() { + return this.unit; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworksImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworksImpl.java new file mode 100644 index 000000000000..59b52074a42b --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworksImpl.java @@ -0,0 +1,174 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_06_01.VirtualNetworks; +import com.microsoft.azure.management.network.v2018_06_01.VirtualNetwork; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_06_01.IPAddressAvailabilityResult; +import com.microsoft.azure.management.network.v2018_06_01.VirtualNetworkUsage; + +class VirtualNetworksImpl extends GroupableResourcesCoreImpl implements VirtualNetworks { + protected VirtualNetworksImpl(NetworkManager manager) { + super(manager.inner().virtualNetworks(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + VirtualNetworksInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + VirtualNetworksInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + VirtualNetworksInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + VirtualNetworksInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VirtualNetwork call(VirtualNetworkInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + VirtualNetworksInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + VirtualNetworksInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VirtualNetwork call(VirtualNetworkInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public VirtualNetworkImpl define(String name) { + return wrapModel(name); + } + + @Override + public Observable checkIPAddressAvailabilityAsync(String resourceGroupName, String virtualNetworkName) { + VirtualNetworksInner client = this.inner(); + return client.checkIPAddressAvailabilityAsync(resourceGroupName, virtualNetworkName) + .map(new Func1() { + @Override + public IPAddressAvailabilityResult call(IPAddressAvailabilityResultInner inner) { + return new IPAddressAvailabilityResultImpl(inner, manager()); + } + }); + } + + @Override + protected VirtualNetworkImpl wrapModel(VirtualNetworkInner inner) { + return new VirtualNetworkImpl(inner.name(), inner, manager()); + } + + @Override + protected VirtualNetworkImpl wrapModel(String name) { + return new VirtualNetworkImpl(name, new VirtualNetworkInner(), this.manager()); + } + + private VirtualNetworkUsageImpl wrapVirtualNetworkUsageModel(VirtualNetworkUsageInner inner) { + return new VirtualNetworkUsageImpl(inner, manager()); + } + + @Override + public Observable listUsageAsync(final String resourceGroupName, final String virtualNetworkName) { + VirtualNetworksInner client = this.inner(); + return client.listUsageAsync(resourceGroupName, virtualNetworkName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VirtualNetworkUsage call(VirtualNetworkUsageInner inner) { + return wrapVirtualNetworkUsageModel(inner); + } + }); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworksInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworksInner.java new file mode 100644 index 000000000000..e5fe5d037c2f --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworksInner.java @@ -0,0 +1,1765 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_06_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.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 VirtualNetworks. + */ +public class VirtualNetworksInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private VirtualNetworksService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of VirtualNetworksInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public VirtualNetworksInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(VirtualNetworksService.class); + this.client = client; + } + + /** + * The interface defining all the services for VirtualNetworks to be + * used by Retrofit to perform actually REST calls. + */ + interface VirtualNetworksService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.VirtualNetworks delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @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.network.v2018_06_01.VirtualNetworks beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @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.network.v2018_06_01.VirtualNetworks getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @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.network.v2018_06_01.VirtualNetworks createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subscriptionId") String subscriptionId, @Body VirtualNetworkInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.VirtualNetworks beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subscriptionId") String subscriptionId, @Body VirtualNetworkInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.VirtualNetworks updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.VirtualNetworks beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}") + Observable> beginUpdateTags(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.VirtualNetworks list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworks") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.VirtualNetworks listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @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.network.v2018_06_01.VirtualNetworks checkIPAddressAvailability" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/CheckIPAddressAvailability") + Observable> checkIPAddressAvailability(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subscriptionId") String subscriptionId, @Query("ipAddress") String ipAddress, @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.network.v2018_06_01.VirtualNetworks listUsage" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/usages") + Observable> listUsage(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @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.network.v2018_06_01.VirtualNetworks listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.VirtualNetworks listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.VirtualNetworks listUsageNext" }) + @GET + Observable> listUsageNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String virtualNetworkName) { + deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName).toBlocking().last().body(); + } + + /** + * Deletes the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @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 virtualNetworkName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName), serviceCallback); + } + + /** + * Deletes the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String virtualNetworkName) { + return deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + Observable> observable = service.delete(resourceGroupName, virtualNetworkName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String virtualNetworkName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName).toBlocking().single().body(); + } + + /** + * Deletes the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String virtualNetworkName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName), serviceCallback); + } + + /** + * Deletes the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String virtualNetworkName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.beginDelete(resourceGroupName, virtualNetworkName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified virtual network by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkInner object if successful. + */ + public VirtualNetworkInner getByResourceGroup(String resourceGroupName, String virtualNetworkName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualNetworkName).toBlocking().single().body(); + } + + /** + * Gets the specified virtual network by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String virtualNetworkName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualNetworkName), serviceCallback); + } + + /** + * Gets the specified virtual network by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String virtualNetworkName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualNetworkName).map(new Func1, VirtualNetworkInner>() { + @Override + public VirtualNetworkInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified virtual network by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + final String expand = null; + return service.getByResourceGroup(resourceGroupName, virtualNetworkName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the specified virtual network by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkInner object if successful. + */ + public VirtualNetworkInner getByResourceGroup(String resourceGroupName, String virtualNetworkName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualNetworkName, expand).toBlocking().single().body(); + } + + /** + * Gets the specified virtual network by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param expand Expands referenced resources. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String virtualNetworkName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualNetworkName, expand), serviceCallback); + } + + /** + * Gets the specified virtual network by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String virtualNetworkName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualNetworkName, expand).map(new Func1, VirtualNetworkInner>() { + @Override + public VirtualNetworkInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified virtual network by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.getByResourceGroup(resourceGroupName, virtualNetworkName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a virtual network in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to the create or update virtual network operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkInner object if successful. + */ + public VirtualNetworkInner createOrUpdate(String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates a virtual network in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to the create or update virtual network operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, parameters), serviceCallback); + } + + /** + * Creates or updates a virtual network in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to the create or update virtual network operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, parameters).map(new Func1, VirtualNetworkInner>() { + @Override + public VirtualNetworkInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a virtual network in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to the create or update virtual network operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, virtualNetworkName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a virtual network in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to the create or update virtual network operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkInner object if successful. + */ + public VirtualNetworkInner beginCreateOrUpdate(String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates a virtual network in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to the create or update virtual network operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, parameters), serviceCallback); + } + + /** + * Creates or updates a virtual network in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to the create or update virtual network operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, parameters).map(new Func1, VirtualNetworkInner>() { + @Override + public VirtualNetworkInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a virtual network in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to the create or update virtual network operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + return service.beginCreateOrUpdate(resourceGroupName, virtualNetworkName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkInner object if successful. + */ + public VirtualNetworkInner updateTags(String resourceGroupName, String virtualNetworkName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkName).toBlocking().last().body(); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @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 updateTagsAsync(String resourceGroupName, String virtualNetworkName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkName), serviceCallback); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String virtualNetworkName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkName).map(new Func1, VirtualNetworkInner>() { + @Override + public VirtualNetworkInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + Observable> observable = service.updateTags(resourceGroupName, virtualNetworkName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkInner object if successful. + */ + public VirtualNetworkInner updateTags(String resourceGroupName, String virtualNetworkName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkName, tags).toBlocking().last().body(); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String virtualNetworkName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkName, tags), serviceCallback); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String virtualNetworkName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkName, tags).map(new Func1, VirtualNetworkInner>() { + @Override + public VirtualNetworkInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-06-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + Observable> observable = service.updateTags(resourceGroupName, virtualNetworkName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkInner object if successful. + */ + public VirtualNetworkInner beginUpdateTags(String resourceGroupName, String virtualNetworkName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkName).toBlocking().single().body(); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @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 beginUpdateTagsAsync(String resourceGroupName, String virtualNetworkName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkName), serviceCallback); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String virtualNetworkName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkName).map(new Func1, VirtualNetworkInner>() { + @Override + public VirtualNetworkInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.beginUpdateTags(resourceGroupName, virtualNetworkName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkInner object if successful. + */ + public VirtualNetworkInner beginUpdateTags(String resourceGroupName, String virtualNetworkName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkName, tags).toBlocking().single().body(); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String virtualNetworkName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkName, tags), serviceCallback); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String virtualNetworkName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkName, tags).map(new Func1, VirtualNetworkInner>() { + @Override + public VirtualNetworkInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-06-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.beginUpdateTags(resourceGroupName, virtualNetworkName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all virtual networks in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all virtual networks in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all virtual networks in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all virtual networks in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all virtual networks in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all virtual networks in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all virtual networks in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all virtual networks in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all virtual networks in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all virtual networks in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Checks whether a private IP address is available for use. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the IPAddressAvailabilityResultInner object if successful. + */ + public IPAddressAvailabilityResultInner checkIPAddressAvailability(String resourceGroupName, String virtualNetworkName) { + return checkIPAddressAvailabilityWithServiceResponseAsync(resourceGroupName, virtualNetworkName).toBlocking().single().body(); + } + + /** + * Checks whether a private IP address is available for use. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @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 checkIPAddressAvailabilityAsync(String resourceGroupName, String virtualNetworkName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkIPAddressAvailabilityWithServiceResponseAsync(resourceGroupName, virtualNetworkName), serviceCallback); + } + + /** + * Checks whether a private IP address is available for use. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IPAddressAvailabilityResultInner object + */ + public Observable checkIPAddressAvailabilityAsync(String resourceGroupName, String virtualNetworkName) { + return checkIPAddressAvailabilityWithServiceResponseAsync(resourceGroupName, virtualNetworkName).map(new Func1, IPAddressAvailabilityResultInner>() { + @Override + public IPAddressAvailabilityResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Checks whether a private IP address is available for use. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IPAddressAvailabilityResultInner object + */ + public Observable> checkIPAddressAvailabilityWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + final String ipAddress = null; + return service.checkIPAddressAvailability(resourceGroupName, virtualNetworkName, this.client.subscriptionId(), ipAddress, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkIPAddressAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Checks whether a private IP address is available for use. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param ipAddress The private IP address to be verified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the IPAddressAvailabilityResultInner object if successful. + */ + public IPAddressAvailabilityResultInner checkIPAddressAvailability(String resourceGroupName, String virtualNetworkName, String ipAddress) { + return checkIPAddressAvailabilityWithServiceResponseAsync(resourceGroupName, virtualNetworkName, ipAddress).toBlocking().single().body(); + } + + /** + * Checks whether a private IP address is available for use. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param ipAddress The private IP address to be verified. + * @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 checkIPAddressAvailabilityAsync(String resourceGroupName, String virtualNetworkName, String ipAddress, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkIPAddressAvailabilityWithServiceResponseAsync(resourceGroupName, virtualNetworkName, ipAddress), serviceCallback); + } + + /** + * Checks whether a private IP address is available for use. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param ipAddress The private IP address to be verified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IPAddressAvailabilityResultInner object + */ + public Observable checkIPAddressAvailabilityAsync(String resourceGroupName, String virtualNetworkName, String ipAddress) { + return checkIPAddressAvailabilityWithServiceResponseAsync(resourceGroupName, virtualNetworkName, ipAddress).map(new Func1, IPAddressAvailabilityResultInner>() { + @Override + public IPAddressAvailabilityResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Checks whether a private IP address is available for use. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param ipAddress The private IP address to be verified. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IPAddressAvailabilityResultInner object + */ + public Observable> checkIPAddressAvailabilityWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String ipAddress) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.checkIPAddressAvailability(resourceGroupName, virtualNetworkName, this.client.subscriptionId(), ipAddress, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkIPAddressAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkIPAddressAvailabilityDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists usage stats. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkUsageInner> object if successful. + */ + public PagedList listUsage(final String resourceGroupName, final String virtualNetworkName) { + ServiceResponse> response = listUsageSinglePageAsync(resourceGroupName, virtualNetworkName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listUsageNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists usage stats. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @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> listUsageAsync(final String resourceGroupName, final String virtualNetworkName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listUsageSinglePageAsync(resourceGroupName, virtualNetworkName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listUsageNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists usage stats. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkUsageInner> object + */ + public Observable> listUsageAsync(final String resourceGroupName, final String virtualNetworkName) { + return listUsageWithServiceResponseAsync(resourceGroupName, virtualNetworkName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists usage stats. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkUsageInner> object + */ + public Observable>> listUsageWithServiceResponseAsync(final String resourceGroupName, final String virtualNetworkName) { + return listUsageSinglePageAsync(resourceGroupName, virtualNetworkName) + .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(listUsageNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists usage stats. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkUsageInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listUsageSinglePageAsync(final String resourceGroupName, final String virtualNetworkName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.listUsage(resourceGroupName, virtualNetworkName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listUsageDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listUsageDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all virtual networks in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all virtual networks in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all virtual networks in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all virtual networks in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all virtual networks in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all virtual networks in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all virtual networks in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all virtual networks in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all virtual networks in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all virtual networks in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists usage stats. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkUsageInner> object if successful. + */ + public PagedList listUsageNext(final String nextPageLink) { + ServiceResponse> response = listUsageNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listUsageNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists usage stats. + * + * @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> listUsageNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listUsageNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listUsageNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists usage stats. + * + * @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<VirtualNetworkUsageInner> object + */ + public Observable> listUsageNextAsync(final String nextPageLink) { + return listUsageNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists usage stats. + * + * @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<VirtualNetworkUsageInner> object + */ + public Observable>> listUsageNextWithServiceResponseAsync(final String nextPageLink) { + return listUsageNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listUsageNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists usage stats. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkUsageInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listUsageNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listUsageNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listUsageNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listUsageNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualWANImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualWANImpl.java new file mode 100644 index 000000000000..5965ad14e439 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualWANImpl.java @@ -0,0 +1,86 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_06_01.VirtualWAN; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_06_01.ProvisioningState; + +class VirtualWANImpl extends GroupableResourceCoreImpl implements VirtualWAN, VirtualWAN.Definition, VirtualWAN.Update { + VirtualWANImpl(String name, VirtualWANInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + VirtualWANsInner client = this.manager().inner().virtualWANs(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + VirtualWANsInner client = this.manager().inner().virtualWANs(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + VirtualWANsInner client = this.manager().inner().virtualWANs(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public Boolean disableVpnEncryption() { + return this.inner().disableVpnEncryption(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public List virtualHubs() { + return this.inner().virtualHubs(); + } + + @Override + public List vpnSites() { + return this.inner().vpnSites(); + } + + @Override + public VirtualWANImpl withDisableVpnEncryption(Boolean disableVpnEncryption) { + this.inner().withDisableVpnEncryption(disableVpnEncryption); + return this; + } + + @Override + public VirtualWANImpl withProvisioningState(ProvisioningState provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualWANInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualWANInner.java new file mode 100644 index 000000000000..5a2763320069 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualWANInner.java @@ -0,0 +1,150 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import java.util.List; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_06_01.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * VirtualWAN Resource. + */ +@JsonFlatten +@SkipParentValidation +public class VirtualWANInner extends Resource { + /** + * Vpn encryption to be disabled or not. + */ + @JsonProperty(value = "properties.disableVpnEncryption") + private Boolean disableVpnEncryption; + + /** + * List of VirtualHubs in the VirtualWAN. + */ + @JsonProperty(value = "properties.virtualHubs", access = JsonProperty.Access.WRITE_ONLY) + private List virtualHubs; + + /** + * The vpnSites property. + */ + @JsonProperty(value = "properties.vpnSites", access = JsonProperty.Access.WRITE_ONLY) + private List vpnSites; + + /** + * The provisioning state of the resource. Possible values include: + * 'Succeeded', 'Updating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningState provisioningState; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get vpn encryption to be disabled or not. + * + * @return the disableVpnEncryption value + */ + public Boolean disableVpnEncryption() { + return this.disableVpnEncryption; + } + + /** + * Set vpn encryption to be disabled or not. + * + * @param disableVpnEncryption the disableVpnEncryption value to set + * @return the VirtualWANInner object itself. + */ + public VirtualWANInner withDisableVpnEncryption(Boolean disableVpnEncryption) { + this.disableVpnEncryption = disableVpnEncryption; + return this; + } + + /** + * Get list of VirtualHubs in the VirtualWAN. + * + * @return the virtualHubs value + */ + public List virtualHubs() { + return this.virtualHubs; + } + + /** + * Get the vpnSites value. + * + * @return the vpnSites value + */ + public List vpnSites() { + return this.vpnSites; + } + + /** + * Get the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the VirtualWANInner object itself. + */ + public VirtualWANInner withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the VirtualWANInner object itself. + */ + public VirtualWANInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualWANsImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualWANsImpl.java new file mode 100644 index 000000000000..a74c1db6746d --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualWANsImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_06_01.VirtualWANs; +import com.microsoft.azure.management.network.v2018_06_01.VirtualWAN; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class VirtualWANsImpl extends GroupableResourcesCoreImpl implements VirtualWANs { + protected VirtualWANsImpl(NetworkManager manager) { + super(manager.inner().virtualWANs(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + VirtualWANsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + VirtualWANsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + VirtualWANsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + VirtualWANsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VirtualWAN call(VirtualWANInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + VirtualWANsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + VirtualWANsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VirtualWAN call(VirtualWANInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public VirtualWANImpl define(String name) { + return wrapModel(name); + } + + @Override + protected VirtualWANImpl wrapModel(VirtualWANInner inner) { + return new VirtualWANImpl(inner.name(), inner, manager()); + } + + @Override + protected VirtualWANImpl wrapModel(String name) { + return new VirtualWANImpl(name, new VirtualWANInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualWANsInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualWANsInner.java new file mode 100644 index 000000000000..0ab80de3aaed --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualWANsInner.java @@ -0,0 +1,1274 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_06_01.ErrorException; +import com.microsoft.azure.management.network.v2018_06_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.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 VirtualWANs. + */ +public class VirtualWANsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private VirtualWANsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of VirtualWANsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public VirtualWANsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(VirtualWANsService.class); + this.client = client; + } + + /** + * The interface defining all the services for VirtualWANs to be + * used by Retrofit to perform actually REST calls. + */ + interface VirtualWANsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.VirtualWANs getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("VirtualWANName") String virtualWANName, @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.network.v2018_06_01.VirtualWANs createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("VirtualWANName") String virtualWANName, @Query("api-version") String apiVersion, @Body VirtualWANInner wANParameters, @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.network.v2018_06_01.VirtualWANs beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("VirtualWANName") String virtualWANName, @Query("api-version") String apiVersion, @Body VirtualWANInner wANParameters, @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.network.v2018_06_01.VirtualWANs updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}") + Observable> updateTags(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("VirtualWANName") String virtualWANName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject wANParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.VirtualWANs beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}") + Observable> beginUpdateTags(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("VirtualWANName") String virtualWANName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject wANParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.VirtualWANs delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("VirtualWANName") String virtualWANName, @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.network.v2018_06_01.VirtualWANs beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("VirtualWANName") String virtualWANName, @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.network.v2018_06_01.VirtualWANs listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.VirtualWANs list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualWans") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.VirtualWANs listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.VirtualWANs listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Retrieves the details of a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualWANInner object if successful. + */ + public VirtualWANInner getByResourceGroup(String resourceGroupName, String virtualWANName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualWANName).toBlocking().single().body(); + } + + /** + * Retrieves the details of a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being retrieved. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String virtualWANName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualWANName), serviceCallback); + } + + /** + * Retrieves the details of a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualWANInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String virtualWANName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualWANName).map(new Func1, VirtualWANInner>() { + @Override + public VirtualWANInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Retrieves the details of a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualWANInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String virtualWANName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualWANName == null) { + throw new IllegalArgumentException("Parameter virtualWANName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.getByResourceGroup(resourceGroupName, virtualWANName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being created or updated. + * @param wANParameters Parameters supplied to create or update VirtualWAN. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualWANInner object if successful. + */ + public VirtualWANInner createOrUpdate(String resourceGroupName, String virtualWANName, VirtualWANInner wANParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualWANName, wANParameters).toBlocking().last().body(); + } + + /** + * Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being created or updated. + * @param wANParameters Parameters supplied to create or update VirtualWAN. + * @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 virtualWANName, VirtualWANInner wANParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualWANName, wANParameters), serviceCallback); + } + + /** + * Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being created or updated. + * @param wANParameters Parameters supplied to create or update VirtualWAN. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String virtualWANName, VirtualWANInner wANParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualWANName, wANParameters).map(new Func1, VirtualWANInner>() { + @Override + public VirtualWANInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being created or updated. + * @param wANParameters Parameters supplied to create or update VirtualWAN. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualWANName, VirtualWANInner wANParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualWANName == null) { + throw new IllegalArgumentException("Parameter virtualWANName is required and cannot be null."); + } + if (wANParameters == null) { + throw new IllegalArgumentException("Parameter wANParameters is required and cannot be null."); + } + Validator.validate(wANParameters); + final String apiVersion = "2018-06-01"; + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, virtualWANName, apiVersion, wANParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being created or updated. + * @param wANParameters Parameters supplied to create or update VirtualWAN. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualWANInner object if successful. + */ + public VirtualWANInner beginCreateOrUpdate(String resourceGroupName, String virtualWANName, VirtualWANInner wANParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualWANName, wANParameters).toBlocking().single().body(); + } + + /** + * Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being created or updated. + * @param wANParameters Parameters supplied to create or update VirtualWAN. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String virtualWANName, VirtualWANInner wANParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualWANName, wANParameters), serviceCallback); + } + + /** + * Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being created or updated. + * @param wANParameters Parameters supplied to create or update VirtualWAN. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualWANInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String virtualWANName, VirtualWANInner wANParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualWANName, wANParameters).map(new Func1, VirtualWANInner>() { + @Override + public VirtualWANInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being created or updated. + * @param wANParameters Parameters supplied to create or update VirtualWAN. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualWANInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualWANName, VirtualWANInner wANParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualWANName == null) { + throw new IllegalArgumentException("Parameter virtualWANName is required and cannot be null."); + } + if (wANParameters == null) { + throw new IllegalArgumentException("Parameter wANParameters is required and cannot be null."); + } + Validator.validate(wANParameters); + final String apiVersion = "2018-06-01"; + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, virtualWANName, apiVersion, wANParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualWANInner object if successful. + */ + public VirtualWANInner updateTags(String resourceGroupName, String virtualWANName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualWANName).toBlocking().last().body(); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @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 updateTagsAsync(String resourceGroupName, String virtualWANName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, virtualWANName), serviceCallback); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String virtualWANName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualWANName).map(new Func1, VirtualWANInner>() { + @Override + public VirtualWANInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String virtualWANName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualWANName == null) { + throw new IllegalArgumentException("Parameter virtualWANName is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + final Map tags = null; + TagsObject wANParameters = new TagsObject(); + wANParameters.withTags(null); + Observable> observable = service.updateTags(this.client.subscriptionId(), resourceGroupName, virtualWANName, apiVersion, this.client.acceptLanguage(), wANParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualWANInner object if successful. + */ + public VirtualWANInner updateTags(String resourceGroupName, String virtualWANName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualWANName, tags).toBlocking().last().body(); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String virtualWANName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, virtualWANName, tags), serviceCallback); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String virtualWANName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, virtualWANName, tags).map(new Func1, VirtualWANInner>() { + @Override + public VirtualWANInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String virtualWANName, Map tags) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualWANName == null) { + throw new IllegalArgumentException("Parameter virtualWANName is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-06-01"; + TagsObject wANParameters = new TagsObject(); + wANParameters.withTags(tags); + Observable> observable = service.updateTags(this.client.subscriptionId(), resourceGroupName, virtualWANName, apiVersion, this.client.acceptLanguage(), wANParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualWANInner object if successful. + */ + public VirtualWANInner beginUpdateTags(String resourceGroupName, String virtualWANName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualWANName).toBlocking().single().body(); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @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 beginUpdateTagsAsync(String resourceGroupName, String virtualWANName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualWANName), serviceCallback); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualWANInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String virtualWANName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualWANName).map(new Func1, VirtualWANInner>() { + @Override + public VirtualWANInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualWANInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String virtualWANName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualWANName == null) { + throw new IllegalArgumentException("Parameter virtualWANName is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + final Map tags = null; + TagsObject wANParameters = new TagsObject(); + wANParameters.withTags(null); + return service.beginUpdateTags(this.client.subscriptionId(), resourceGroupName, virtualWANName, apiVersion, this.client.acceptLanguage(), wANParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualWANInner object if successful. + */ + public VirtualWANInner beginUpdateTags(String resourceGroupName, String virtualWANName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualWANName, tags).toBlocking().single().body(); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String virtualWANName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualWANName, tags), serviceCallback); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualWANInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String virtualWANName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualWANName, tags).map(new Func1, VirtualWANInner>() { + @Override + public VirtualWANInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being updated. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualWANInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String virtualWANName, Map tags) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualWANName == null) { + throw new IllegalArgumentException("Parameter virtualWANName is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-06-01"; + TagsObject wANParameters = new TagsObject(); + wANParameters.withTags(tags); + return service.beginUpdateTags(this.client.subscriptionId(), resourceGroupName, virtualWANName, apiVersion, this.client.acceptLanguage(), wANParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Deletes a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException 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 virtualWANName) { + deleteWithServiceResponseAsync(resourceGroupName, virtualWANName).toBlocking().last().body(); + } + + /** + * Deletes a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being deleted. + * @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 virtualWANName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, virtualWANName), serviceCallback); + } + + /** + * Deletes a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String virtualWANName) { + return deleteWithServiceResponseAsync(resourceGroupName, virtualWANName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String virtualWANName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualWANName == null) { + throw new IllegalArgumentException("Parameter virtualWANName is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, virtualWANName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String virtualWANName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, virtualWANName).toBlocking().single().body(); + } + + /** + * Deletes a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being deleted. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String virtualWANName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, virtualWANName), serviceCallback); + } + + /** + * Deletes a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String virtualWANName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, virtualWANName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWANName The name of the VirtualWAN being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String virtualWANName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualWANName == null) { + throw new IllegalArgumentException("Parameter virtualWANName is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, virtualWANName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the VirtualWANs in a resource group. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException 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<VirtualWANInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the VirtualWANs in a resource group. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the VirtualWANs in a resource group. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualWANInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the VirtualWANs in a resource group. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualWANInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the VirtualWANs in a resource group. + * + ServiceResponse> * @param resourceGroupName The resource group name of the VirtualWan. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualWANInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the VirtualWANs in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException 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<VirtualWANInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the VirtualWANs in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the VirtualWANs in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualWANInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the VirtualWANs in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualWANInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the VirtualWANs in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualWANInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the VirtualWANs in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException 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<VirtualWANInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the VirtualWANs in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the VirtualWANs in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualWANInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the VirtualWANs in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualWANInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the VirtualWANs in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualWANInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the VirtualWANs in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException 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<VirtualWANInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the VirtualWANs in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the VirtualWANs in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualWANInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the VirtualWANs in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualWANInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the VirtualWANs in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualWANInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VpnClientIPsecParametersImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VpnClientIPsecParametersImpl.java new file mode 100644 index 000000000000..5b2209172f04 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VpnClientIPsecParametersImpl.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.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.VpnClientIPsecParameters; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_06_01.DhGroup; +import com.microsoft.azure.management.network.v2018_06_01.IkeEncryption; +import com.microsoft.azure.management.network.v2018_06_01.IkeIntegrity; +import com.microsoft.azure.management.network.v2018_06_01.IpsecEncryption; +import com.microsoft.azure.management.network.v2018_06_01.IpsecIntegrity; +import com.microsoft.azure.management.network.v2018_06_01.PfsGroup; + +class VpnClientIPsecParametersImpl extends WrapperImpl implements VpnClientIPsecParameters { + private final NetworkManager manager; + VpnClientIPsecParametersImpl(VpnClientIPsecParametersInner inner, NetworkManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public DhGroup dhGroup() { + return this.inner().dhGroup(); + } + + @Override + public IkeEncryption ikeEncryption() { + return this.inner().ikeEncryption(); + } + + @Override + public IkeIntegrity ikeIntegrity() { + return this.inner().ikeIntegrity(); + } + + @Override + public IpsecEncryption ipsecEncryption() { + return this.inner().ipsecEncryption(); + } + + @Override + public IpsecIntegrity ipsecIntegrity() { + return this.inner().ipsecIntegrity(); + } + + @Override + public PfsGroup pfsGroup() { + return this.inner().pfsGroup(); + } + + @Override + public int saDataSizeKilobytes() { + return this.inner().saDataSizeKilobytes(); + } + + @Override + public int saLifeTimeSeconds() { + return this.inner().saLifeTimeSeconds(); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VpnClientIPsecParametersInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VpnClientIPsecParametersInner.java new file mode 100644 index 000000000000..6b4f357901db --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VpnClientIPsecParametersInner.java @@ -0,0 +1,242 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.IpsecEncryption; +import com.microsoft.azure.management.network.v2018_06_01.IpsecIntegrity; +import com.microsoft.azure.management.network.v2018_06_01.IkeEncryption; +import com.microsoft.azure.management.network.v2018_06_01.IkeIntegrity; +import com.microsoft.azure.management.network.v2018_06_01.DhGroup; +import com.microsoft.azure.management.network.v2018_06_01.PfsGroup; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An IPSec parameters for a virtual network gateway P2S connection. + */ +public class VpnClientIPsecParametersInner { + /** + * The IPSec Security Association (also called Quick Mode or Phase 2 SA) + * lifetime in seconds for P2S client. + */ + @JsonProperty(value = "saLifeTimeSeconds", required = true) + private int saLifeTimeSeconds; + + /** + * The IPSec Security Association (also called Quick Mode or Phase 2 SA) + * payload size in KB for P2S client.. + */ + @JsonProperty(value = "saDataSizeKilobytes", required = true) + private int saDataSizeKilobytes; + + /** + * The IPSec encryption algorithm (IKE phase 1). Possible values include: + * 'None', 'DES', 'DES3', 'AES128', 'AES192', 'AES256', 'GCMAES128', + * 'GCMAES192', 'GCMAES256'. + */ + @JsonProperty(value = "ipsecEncryption", required = true) + private IpsecEncryption ipsecEncryption; + + /** + * The IPSec integrity algorithm (IKE phase 1). Possible values include: + * 'MD5', 'SHA1', 'SHA256', 'GCMAES128', 'GCMAES192', 'GCMAES256'. + */ + @JsonProperty(value = "ipsecIntegrity", required = true) + private IpsecIntegrity ipsecIntegrity; + + /** + * The IKE encryption algorithm (IKE phase 2). Possible values include: + * 'DES', 'DES3', 'AES128', 'AES192', 'AES256', 'GCMAES256', 'GCMAES128'. + */ + @JsonProperty(value = "ikeEncryption", required = true) + private IkeEncryption ikeEncryption; + + /** + * The IKE integrity algorithm (IKE phase 2). Possible values include: + * 'MD5', 'SHA1', 'SHA256', 'SHA384', 'GCMAES256', 'GCMAES128'. + */ + @JsonProperty(value = "ikeIntegrity", required = true) + private IkeIntegrity ikeIntegrity; + + /** + * The DH Groups used in IKE Phase 1 for initial SA. Possible values + * include: 'None', 'DHGroup1', 'DHGroup2', 'DHGroup14', 'DHGroup2048', + * 'ECP256', 'ECP384', 'DHGroup24'. + */ + @JsonProperty(value = "dhGroup", required = true) + private DhGroup dhGroup; + + /** + * The Pfs Groups used in IKE Phase 2 for new child SA. Possible values + * include: 'None', 'PFS1', 'PFS2', 'PFS2048', 'ECP256', 'ECP384', 'PFS24', + * 'PFS14', 'PFSMM'. + */ + @JsonProperty(value = "pfsGroup", required = true) + private PfsGroup pfsGroup; + + /** + * Get the IPSec Security Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for P2S client. + * + * @return the saLifeTimeSeconds value + */ + public int saLifeTimeSeconds() { + return this.saLifeTimeSeconds; + } + + /** + * Set the IPSec Security Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for P2S client. + * + * @param saLifeTimeSeconds the saLifeTimeSeconds value to set + * @return the VpnClientIPsecParametersInner object itself. + */ + public VpnClientIPsecParametersInner withSaLifeTimeSeconds(int saLifeTimeSeconds) { + this.saLifeTimeSeconds = saLifeTimeSeconds; + return this; + } + + /** + * Get the IPSec Security Association (also called Quick Mode or Phase 2 SA) payload size in KB for P2S client.. + * + * @return the saDataSizeKilobytes value + */ + public int saDataSizeKilobytes() { + return this.saDataSizeKilobytes; + } + + /** + * Set the IPSec Security Association (also called Quick Mode or Phase 2 SA) payload size in KB for P2S client.. + * + * @param saDataSizeKilobytes the saDataSizeKilobytes value to set + * @return the VpnClientIPsecParametersInner object itself. + */ + public VpnClientIPsecParametersInner withSaDataSizeKilobytes(int saDataSizeKilobytes) { + this.saDataSizeKilobytes = saDataSizeKilobytes; + return this; + } + + /** + * Get the IPSec encryption algorithm (IKE phase 1). Possible values include: 'None', 'DES', 'DES3', 'AES128', 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256'. + * + * @return the ipsecEncryption value + */ + public IpsecEncryption ipsecEncryption() { + return this.ipsecEncryption; + } + + /** + * Set the IPSec encryption algorithm (IKE phase 1). Possible values include: 'None', 'DES', 'DES3', 'AES128', 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256'. + * + * @param ipsecEncryption the ipsecEncryption value to set + * @return the VpnClientIPsecParametersInner object itself. + */ + public VpnClientIPsecParametersInner withIpsecEncryption(IpsecEncryption ipsecEncryption) { + this.ipsecEncryption = ipsecEncryption; + return this; + } + + /** + * Get the IPSec integrity algorithm (IKE phase 1). Possible values include: 'MD5', 'SHA1', 'SHA256', 'GCMAES128', 'GCMAES192', 'GCMAES256'. + * + * @return the ipsecIntegrity value + */ + public IpsecIntegrity ipsecIntegrity() { + return this.ipsecIntegrity; + } + + /** + * Set the IPSec integrity algorithm (IKE phase 1). Possible values include: 'MD5', 'SHA1', 'SHA256', 'GCMAES128', 'GCMAES192', 'GCMAES256'. + * + * @param ipsecIntegrity the ipsecIntegrity value to set + * @return the VpnClientIPsecParametersInner object itself. + */ + public VpnClientIPsecParametersInner withIpsecIntegrity(IpsecIntegrity ipsecIntegrity) { + this.ipsecIntegrity = ipsecIntegrity; + return this; + } + + /** + * Get the IKE encryption algorithm (IKE phase 2). Possible values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256', 'GCMAES256', 'GCMAES128'. + * + * @return the ikeEncryption value + */ + public IkeEncryption ikeEncryption() { + return this.ikeEncryption; + } + + /** + * Set the IKE encryption algorithm (IKE phase 2). Possible values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256', 'GCMAES256', 'GCMAES128'. + * + * @param ikeEncryption the ikeEncryption value to set + * @return the VpnClientIPsecParametersInner object itself. + */ + public VpnClientIPsecParametersInner withIkeEncryption(IkeEncryption ikeEncryption) { + this.ikeEncryption = ikeEncryption; + return this; + } + + /** + * Get the IKE integrity algorithm (IKE phase 2). Possible values include: 'MD5', 'SHA1', 'SHA256', 'SHA384', 'GCMAES256', 'GCMAES128'. + * + * @return the ikeIntegrity value + */ + public IkeIntegrity ikeIntegrity() { + return this.ikeIntegrity; + } + + /** + * Set the IKE integrity algorithm (IKE phase 2). Possible values include: 'MD5', 'SHA1', 'SHA256', 'SHA384', 'GCMAES256', 'GCMAES128'. + * + * @param ikeIntegrity the ikeIntegrity value to set + * @return the VpnClientIPsecParametersInner object itself. + */ + public VpnClientIPsecParametersInner withIkeIntegrity(IkeIntegrity ikeIntegrity) { + this.ikeIntegrity = ikeIntegrity; + return this; + } + + /** + * Get the DH Groups used in IKE Phase 1 for initial SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24'. + * + * @return the dhGroup value + */ + public DhGroup dhGroup() { + return this.dhGroup; + } + + /** + * Set the DH Groups used in IKE Phase 1 for initial SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24'. + * + * @param dhGroup the dhGroup value to set + * @return the VpnClientIPsecParametersInner object itself. + */ + public VpnClientIPsecParametersInner withDhGroup(DhGroup dhGroup) { + this.dhGroup = dhGroup; + return this; + } + + /** + * Get the Pfs Groups used in IKE Phase 2 for new child SA. Possible values include: 'None', 'PFS1', 'PFS2', 'PFS2048', 'ECP256', 'ECP384', 'PFS24', 'PFS14', 'PFSMM'. + * + * @return the pfsGroup value + */ + public PfsGroup pfsGroup() { + return this.pfsGroup; + } + + /** + * Set the Pfs Groups used in IKE Phase 2 for new child SA. Possible values include: 'None', 'PFS1', 'PFS2', 'PFS2048', 'ECP256', 'ECP384', 'PFS24', 'PFS14', 'PFSMM'. + * + * @param pfsGroup the pfsGroup value to set + * @return the VpnClientIPsecParametersInner object itself. + */ + public VpnClientIPsecParametersInner withPfsGroup(PfsGroup pfsGroup) { + this.pfsGroup = pfsGroup; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VpnConnectionImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VpnConnectionImpl.java new file mode 100644 index 000000000000..bab586129f1f --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VpnConnectionImpl.java @@ -0,0 +1,225 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.management.network.v2018_06_01.VpnConnection; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.Map; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_06_01.VpnConnectionStatus; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.IpsecPolicy; +import com.microsoft.azure.management.network.v2018_06_01.ProvisioningState; + +class VpnConnectionImpl extends CreatableUpdatableImpl implements VpnConnection, VpnConnection.Definition, VpnConnection.Update { + private final NetworkManager manager; + private String resourceGroupName; + private String gatewayName; + private String connectionName; + + VpnConnectionImpl(String name, NetworkManager manager) { + super(name, new VpnConnectionInner()); + this.manager = manager; + // Set resource name + this.connectionName = name; + // + } + + VpnConnectionImpl(VpnConnectionInner inner, NetworkManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.connectionName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.gatewayName = IdParsingUtils.getValueFromIdByName(inner.id(), "vpnGateways"); + this.connectionName = IdParsingUtils.getValueFromIdByName(inner.id(), "vpnConnections"); + // + } + + @Override + public NetworkManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + VpnConnectionsInner client = this.manager().inner().vpnConnections(); + return client.createOrUpdateAsync(this.resourceGroupName, this.gatewayName, this.connectionName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + VpnConnectionsInner client = this.manager().inner().vpnConnections(); + return client.createOrUpdateAsync(this.resourceGroupName, this.gatewayName, this.connectionName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + VpnConnectionsInner client = this.manager().inner().vpnConnections(); + return client.getAsync(this.resourceGroupName, this.gatewayName, this.connectionName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public Integer connectionBandwidthInMbps() { + return this.inner().connectionBandwidthInMbps(); + } + + @Override + public VpnConnectionStatus connectionStatus() { + return this.inner().connectionStatus(); + } + + @Override + public Long egressBytesTransferred() { + return this.inner().egressBytesTransferred(); + } + + @Override + public Boolean enableBgp() { + return this.inner().enableBgp(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Long ingressBytesTransferred() { + return this.inner().ingressBytesTransferred(); + } + + @Override + public List ipsecPolicies() { + return this.inner().ipsecPolicies(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public SubResource remoteVpnSite() { + return this.inner().remoteVpnSite(); + } + + @Override + public Integer routingWeight() { + return this.inner().routingWeight(); + } + + @Override + public String sharedKey() { + return this.inner().sharedKey(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public VpnConnectionImpl withExistingVpnGateway(String resourceGroupName, String gatewayName) { + this.resourceGroupName = resourceGroupName; + this.gatewayName = gatewayName; + return this; + } + + @Override + public VpnConnectionImpl withConnectionStatus(VpnConnectionStatus connectionStatus) { + this.inner().withConnectionStatus(connectionStatus); + return this; + } + + @Override + public VpnConnectionImpl withEnableBgp(Boolean enableBgp) { + this.inner().withEnableBgp(enableBgp); + return this; + } + + @Override + public VpnConnectionImpl withId(String id) { + this.inner().withId(id); + return this; + } + + @Override + public VpnConnectionImpl withIpsecPolicies(List ipsecPolicies) { + this.inner().withIpsecPolicies(ipsecPolicies); + return this; + } + + @Override + public VpnConnectionImpl withLocation(String location) { + this.inner().withLocation(location); + return this; + } + + @Override + public VpnConnectionImpl withProvisioningState(ProvisioningState provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public VpnConnectionImpl withRemoteVpnSite(SubResource remoteVpnSite) { + this.inner().withRemoteVpnSite(remoteVpnSite); + return this; + } + + @Override + public VpnConnectionImpl withRoutingWeight(Integer routingWeight) { + this.inner().withRoutingWeight(routingWeight); + return this; + } + + @Override + public VpnConnectionImpl withSharedKey(String sharedKey) { + this.inner().withSharedKey(sharedKey); + return this; + } + + @Override + public VpnConnectionImpl withTags(Map tags) { + this.inner().withTags(tags); + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VpnConnectionInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VpnConnectionInner.java new file mode 100644 index 000000000000..c9623a582804 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VpnConnectionInner.java @@ -0,0 +1,298 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_06_01.VpnConnectionStatus; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.IpsecPolicy; +import com.microsoft.azure.management.network.v2018_06_01.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * VpnConnection Resource. + */ +@JsonFlatten +@SkipParentValidation +public class VpnConnectionInner extends Resource { + /** + * Id of the connected vpn site. + */ + @JsonProperty(value = "properties.remoteVpnSite") + private SubResource remoteVpnSite; + + /** + * routing weight for vpn connection. + */ + @JsonProperty(value = "properties.routingWeight") + private Integer routingWeight; + + /** + * The connection status. Possible values include: 'Unknown', 'Connecting', + * 'Connected', 'NotConnected'. + */ + @JsonProperty(value = "properties.connectionStatus") + private VpnConnectionStatus connectionStatus; + + /** + * Ingress bytes transferred. + */ + @JsonProperty(value = "properties.ingressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long ingressBytesTransferred; + + /** + * Egress bytes transferred. + */ + @JsonProperty(value = "properties.egressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long egressBytesTransferred; + + /** + * Expected bandwidth in MBPS. + */ + @JsonProperty(value = "properties.connectionBandwidthInMbps", access = JsonProperty.Access.WRITE_ONLY) + private Integer connectionBandwidthInMbps; + + /** + * SharedKey for the vpn connection. + */ + @JsonProperty(value = "properties.sharedKey") + private String sharedKey; + + /** + * EnableBgp flag. + */ + @JsonProperty(value = "properties.enableBgp") + private Boolean enableBgp; + + /** + * The IPSec Policies to be considered by this connection. + */ + @JsonProperty(value = "properties.ipsecPolicies") + private List ipsecPolicies; + + /** + * The provisioning state of the resource. Possible values include: + * 'Succeeded', 'Updating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningState provisioningState; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get id of the connected vpn site. + * + * @return the remoteVpnSite value + */ + public SubResource remoteVpnSite() { + return this.remoteVpnSite; + } + + /** + * Set id of the connected vpn site. + * + * @param remoteVpnSite the remoteVpnSite value to set + * @return the VpnConnectionInner object itself. + */ + public VpnConnectionInner withRemoteVpnSite(SubResource remoteVpnSite) { + this.remoteVpnSite = remoteVpnSite; + return this; + } + + /** + * Get routing weight for vpn connection. + * + * @return the routingWeight value + */ + public Integer routingWeight() { + return this.routingWeight; + } + + /** + * Set routing weight for vpn connection. + * + * @param routingWeight the routingWeight value to set + * @return the VpnConnectionInner object itself. + */ + public VpnConnectionInner withRoutingWeight(Integer routingWeight) { + this.routingWeight = routingWeight; + return this; + } + + /** + * Get the connection status. Possible values include: 'Unknown', 'Connecting', 'Connected', 'NotConnected'. + * + * @return the connectionStatus value + */ + public VpnConnectionStatus connectionStatus() { + return this.connectionStatus; + } + + /** + * Set the connection status. Possible values include: 'Unknown', 'Connecting', 'Connected', 'NotConnected'. + * + * @param connectionStatus the connectionStatus value to set + * @return the VpnConnectionInner object itself. + */ + public VpnConnectionInner withConnectionStatus(VpnConnectionStatus connectionStatus) { + this.connectionStatus = connectionStatus; + return this; + } + + /** + * Get ingress bytes transferred. + * + * @return the ingressBytesTransferred value + */ + public Long ingressBytesTransferred() { + return this.ingressBytesTransferred; + } + + /** + * Get egress bytes transferred. + * + * @return the egressBytesTransferred value + */ + public Long egressBytesTransferred() { + return this.egressBytesTransferred; + } + + /** + * Get expected bandwidth in MBPS. + * + * @return the connectionBandwidthInMbps value + */ + public Integer connectionBandwidthInMbps() { + return this.connectionBandwidthInMbps; + } + + /** + * Get sharedKey for the vpn connection. + * + * @return the sharedKey value + */ + public String sharedKey() { + return this.sharedKey; + } + + /** + * Set sharedKey for the vpn connection. + * + * @param sharedKey the sharedKey value to set + * @return the VpnConnectionInner object itself. + */ + public VpnConnectionInner withSharedKey(String sharedKey) { + this.sharedKey = sharedKey; + return this; + } + + /** + * Get enableBgp flag. + * + * @return the enableBgp value + */ + public Boolean enableBgp() { + return this.enableBgp; + } + + /** + * Set enableBgp flag. + * + * @param enableBgp the enableBgp value to set + * @return the VpnConnectionInner object itself. + */ + public VpnConnectionInner withEnableBgp(Boolean enableBgp) { + this.enableBgp = enableBgp; + return this; + } + + /** + * Get the IPSec Policies to be considered by this connection. + * + * @return the ipsecPolicies value + */ + public List ipsecPolicies() { + return this.ipsecPolicies; + } + + /** + * Set the IPSec Policies to be considered by this connection. + * + * @param ipsecPolicies the ipsecPolicies value to set + * @return the VpnConnectionInner object itself. + */ + public VpnConnectionInner withIpsecPolicies(List ipsecPolicies) { + this.ipsecPolicies = ipsecPolicies; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the VpnConnectionInner object itself. + */ + public VpnConnectionInner withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the VpnConnectionInner object itself. + */ + public VpnConnectionInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VpnConnectionsImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VpnConnectionsImpl.java new file mode 100644 index 000000000000..0ce34ffb3489 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VpnConnectionsImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_06_01.VpnConnections; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.network.v2018_06_01.VpnConnection; + +class VpnConnectionsImpl extends WrapperImpl implements VpnConnections { + private final NetworkManager manager; + + VpnConnectionsImpl(NetworkManager manager) { + super(manager.inner().vpnConnections()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public VpnConnectionImpl define(String name) { + return wrapModel(name); + } + + private VpnConnectionImpl wrapModel(VpnConnectionInner inner) { + return new VpnConnectionImpl(inner, manager()); + } + + private VpnConnectionImpl wrapModel(String name) { + return new VpnConnectionImpl(name, this.manager()); + } + + @Override + public Observable listByVpnGatewayAsync(final String resourceGroupName, final String gatewayName) { + VpnConnectionsInner client = this.inner(); + return client.listByVpnGatewayAsync(resourceGroupName, gatewayName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VpnConnection call(VpnConnectionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String gatewayName, String connectionName) { + VpnConnectionsInner client = this.inner(); + return client.getAsync(resourceGroupName, gatewayName, connectionName) + .map(new Func1() { + @Override + public VpnConnection call(VpnConnectionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String gatewayName, String connectionName) { + VpnConnectionsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, gatewayName, connectionName).toCompletable(); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VpnConnectionsInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VpnConnectionsInner.java new file mode 100644 index 000000000000..8ba49e8966e2 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VpnConnectionsInner.java @@ -0,0 +1,764 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_06_01.ErrorException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.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 VpnConnections. + */ +public class VpnConnectionsInner { + /** The Retrofit service to perform REST calls. */ + private VpnConnectionsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of VpnConnectionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public VpnConnectionsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(VpnConnectionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for VpnConnections to be + * used by Retrofit to perform actually REST calls. + */ + interface VpnConnectionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.VpnConnections get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Path("connectionName") String connectionName, @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.network.v2018_06_01.VpnConnections createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Path("connectionName") String connectionName, @Query("api-version") String apiVersion, @Body VpnConnectionInner vpnConnectionParameters, @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.network.v2018_06_01.VpnConnections beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Path("connectionName") String connectionName, @Query("api-version") String apiVersion, @Body VpnConnectionInner vpnConnectionParameters, @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.network.v2018_06_01.VpnConnections delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Path("connectionName") String connectionName, @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.network.v2018_06_01.VpnConnections beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Path("connectionName") String connectionName, @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.network.v2018_06_01.VpnConnections listByVpnGateway" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections") + Observable> listByVpnGateway(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @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.network.v2018_06_01.VpnConnections listByVpnGatewayNext" }) + @GET + Observable> listByVpnGatewayNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Retrieves the details of a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnConnectionInner object if successful. + */ + public VpnConnectionInner get(String resourceGroupName, String gatewayName, String connectionName) { + return getWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName).toBlocking().single().body(); + } + + /** + * Retrieves the details of a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String gatewayName, String connectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName), serviceCallback); + } + + /** + * Retrieves the details of a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnConnectionInner object + */ + public Observable getAsync(String resourceGroupName, String gatewayName, String connectionName) { + return getWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName).map(new Func1, VpnConnectionInner>() { + @Override + public VpnConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Retrieves the details of a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnConnectionInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String gatewayName, String connectionName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + if (connectionName == null) { + throw new IllegalArgumentException("Parameter connectionName is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.get(this.client.subscriptionId(), resourceGroupName, gatewayName, connectionName, 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 ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnConnectionInner object if successful. + */ + public VpnConnectionInner createOrUpdate(String resourceGroupName, String gatewayName, String connectionName, VpnConnectionInner vpnConnectionParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters).toBlocking().last().body(); + } + + /** + * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String gatewayName, String connectionName, VpnConnectionInner vpnConnectionParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters), serviceCallback); + } + + /** + * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String gatewayName, String connectionName, VpnConnectionInner vpnConnectionParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters).map(new Func1, VpnConnectionInner>() { + @Override + public VpnConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String gatewayName, String connectionName, VpnConnectionInner vpnConnectionParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + if (connectionName == null) { + throw new IllegalArgumentException("Parameter connectionName is required and cannot be null."); + } + if (vpnConnectionParameters == null) { + throw new IllegalArgumentException("Parameter vpnConnectionParameters is required and cannot be null."); + } + Validator.validate(vpnConnectionParameters); + final String apiVersion = "2018-06-01"; + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, gatewayName, connectionName, apiVersion, vpnConnectionParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnConnectionInner object if successful. + */ + public VpnConnectionInner beginCreateOrUpdate(String resourceGroupName, String gatewayName, String connectionName, VpnConnectionInner vpnConnectionParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters).toBlocking().single().body(); + } + + /** + * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String gatewayName, String connectionName, VpnConnectionInner vpnConnectionParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters), serviceCallback); + } + + /** + * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnConnectionInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String gatewayName, String connectionName, VpnConnectionInner vpnConnectionParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters).map(new Func1, VpnConnectionInner>() { + @Override + public VpnConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnConnectionInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String gatewayName, String connectionName, VpnConnectionInner vpnConnectionParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + if (connectionName == null) { + throw new IllegalArgumentException("Parameter connectionName is required and cannot be null."); + } + if (vpnConnectionParameters == null) { + throw new IllegalArgumentException("Parameter vpnConnectionParameters is required and cannot be null."); + } + Validator.validate(vpnConnectionParameters); + final String apiVersion = "2018-06-01"; + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, gatewayName, connectionName, apiVersion, vpnConnectionParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Deletes a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException 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 gatewayName, String connectionName) { + deleteWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName).toBlocking().last().body(); + } + + /** + * Deletes a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String gatewayName, String connectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName), serviceCallback); + } + + /** + * Deletes a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String gatewayName, String connectionName) { + return deleteWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String gatewayName, String connectionName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + if (connectionName == null) { + throw new IllegalArgumentException("Parameter connectionName is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, gatewayName, connectionName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String gatewayName, String connectionName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName).toBlocking().single().body(); + } + + /** + * Deletes a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String gatewayName, String connectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName), serviceCallback); + } + + /** + * Deletes a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String gatewayName, String connectionName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String gatewayName, String connectionName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + if (connectionName == null) { + throw new IllegalArgumentException("Parameter connectionName is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, gatewayName, connectionName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException 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<VpnConnectionInner> object if successful. + */ + public PagedList listByVpnGateway(final String resourceGroupName, final String gatewayName) { + ServiceResponse> response = listByVpnGatewaySinglePageAsync(resourceGroupName, gatewayName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByVpnGatewayNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @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> listByVpnGatewayAsync(final String resourceGroupName, final String gatewayName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByVpnGatewaySinglePageAsync(resourceGroupName, gatewayName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByVpnGatewayNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnConnectionInner> object + */ + public Observable> listByVpnGatewayAsync(final String resourceGroupName, final String gatewayName) { + return listByVpnGatewayWithServiceResponseAsync(resourceGroupName, gatewayName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnConnectionInner> object + */ + public Observable>> listByVpnGatewayWithServiceResponseAsync(final String resourceGroupName, final String gatewayName) { + return listByVpnGatewaySinglePageAsync(resourceGroupName, gatewayName) + .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(listByVpnGatewayNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + ServiceResponse> * @param resourceGroupName The resource group name of the VpnGateway. + ServiceResponse> * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VpnConnectionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByVpnGatewaySinglePageAsync(final String resourceGroupName, final String gatewayName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.listByVpnGateway(this.client.subscriptionId(), resourceGroupName, gatewayName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByVpnGatewayDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByVpnGatewayDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException 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<VpnConnectionInner> object if successful. + */ + public PagedList listByVpnGatewayNext(final String nextPageLink) { + ServiceResponse> response = listByVpnGatewayNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByVpnGatewayNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + * @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> listByVpnGatewayNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByVpnGatewayNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByVpnGatewayNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + * @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<VpnConnectionInner> object + */ + public Observable> listByVpnGatewayNextAsync(final String nextPageLink) { + return listByVpnGatewayNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + * @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<VpnConnectionInner> object + */ + public Observable>> listByVpnGatewayNextWithServiceResponseAsync(final String nextPageLink) { + return listByVpnGatewayNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByVpnGatewayNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VpnConnectionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByVpnGatewayNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByVpnGatewayNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByVpnGatewayNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByVpnGatewayNextDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VpnGatewayImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VpnGatewayImpl.java new file mode 100644 index 000000000000..2b282e1e1f8b --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VpnGatewayImpl.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.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_06_01.VpnGateway; +import rx.Observable; +import com.microsoft.azure.SubResource; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.BgpSettings; +import com.microsoft.azure.management.network.v2018_06_01.ProvisioningState; +import com.microsoft.azure.management.network.v2018_06_01.Policies; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_06_01.VpnConnection; + +class VpnGatewayImpl extends GroupableResourceCoreImpl implements VpnGateway, VpnGateway.Definition, VpnGateway.Update { + VpnGatewayImpl(String name, VpnGatewayInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + VpnGatewaysInner client = this.manager().inner().vpnGateways(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + VpnGatewaysInner client = this.manager().inner().vpnGateways(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + VpnGatewaysInner client = this.manager().inner().vpnGateways(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public BgpSettings bgpSettings() { + return this.inner().bgpSettings(); + } + + @Override + public List connections() { + List lst = new ArrayList(); + if (this.inner().connections() != null) { + for (VpnConnectionInner inner : this.inner().connections()) { + lst.add( new VpnConnectionImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public Policies policies() { + return this.inner().policies(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public SubResource virtualHub() { + return this.inner().virtualHub(); + } + + @Override + public VpnGatewayImpl withBgpSettings(BgpSettings bgpSettings) { + this.inner().withBgpSettings(bgpSettings); + return this; + } + + @Override + public VpnGatewayImpl withConnections(List connections) { + this.inner().withConnections(connections); + return this; + } + + @Override + public VpnGatewayImpl withPolicies(Policies policies) { + this.inner().withPolicies(policies); + return this; + } + + @Override + public VpnGatewayImpl withProvisioningState(ProvisioningState provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public VpnGatewayImpl withVirtualHub(SubResource virtualHub) { + this.inner().withVirtualHub(virtualHub); + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VpnGatewayInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VpnGatewayInner.java new file mode 100644 index 000000000000..13acd5b6c44e --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VpnGatewayInner.java @@ -0,0 +1,200 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.SubResource; +import java.util.List; +import com.microsoft.azure.management.network.v2018_06_01.BgpSettings; +import com.microsoft.azure.management.network.v2018_06_01.ProvisioningState; +import com.microsoft.azure.management.network.v2018_06_01.Policies; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * VpnGateway Resource. + */ +@JsonFlatten +@SkipParentValidation +public class VpnGatewayInner extends Resource { + /** + * The VirtualHub to which the gateway belongs. + */ + @JsonProperty(value = "properties.virtualHub") + private SubResource virtualHub; + + /** + * list of all vpn connections to the gateway. + */ + @JsonProperty(value = "properties.connections") + private List connections; + + /** + * Local network gateway's BGP speaker settings. + */ + @JsonProperty(value = "properties.bgpSettings") + private BgpSettings bgpSettings; + + /** + * The provisioning state of the resource. Possible values include: + * 'Succeeded', 'Updating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningState provisioningState; + + /** + * The policies applied to this vpn gateway. + */ + @JsonProperty(value = "properties.policies") + private Policies policies; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the VirtualHub to which the gateway belongs. + * + * @return the virtualHub value + */ + public SubResource virtualHub() { + return this.virtualHub; + } + + /** + * Set the VirtualHub to which the gateway belongs. + * + * @param virtualHub the virtualHub value to set + * @return the VpnGatewayInner object itself. + */ + public VpnGatewayInner withVirtualHub(SubResource virtualHub) { + this.virtualHub = virtualHub; + return this; + } + + /** + * Get list of all vpn connections to the gateway. + * + * @return the connections value + */ + public List connections() { + return this.connections; + } + + /** + * Set list of all vpn connections to the gateway. + * + * @param connections the connections value to set + * @return the VpnGatewayInner object itself. + */ + public VpnGatewayInner withConnections(List connections) { + this.connections = connections; + return this; + } + + /** + * Get local network gateway's BGP speaker settings. + * + * @return the bgpSettings value + */ + public BgpSettings bgpSettings() { + return this.bgpSettings; + } + + /** + * Set local network gateway's BGP speaker settings. + * + * @param bgpSettings the bgpSettings value to set + * @return the VpnGatewayInner object itself. + */ + public VpnGatewayInner withBgpSettings(BgpSettings bgpSettings) { + this.bgpSettings = bgpSettings; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the VpnGatewayInner object itself. + */ + public VpnGatewayInner withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the policies applied to this vpn gateway. + * + * @return the policies value + */ + public Policies policies() { + return this.policies; + } + + /** + * Set the policies applied to this vpn gateway. + * + * @param policies the policies value to set + * @return the VpnGatewayInner object itself. + */ + public VpnGatewayInner withPolicies(Policies policies) { + this.policies = policies; + return this; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the VpnGatewayInner object itself. + */ + public VpnGatewayInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VpnGatewaysImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VpnGatewaysImpl.java new file mode 100644 index 000000000000..86dab7550383 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VpnGatewaysImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_06_01.VpnGateways; +import com.microsoft.azure.management.network.v2018_06_01.VpnGateway; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class VpnGatewaysImpl extends GroupableResourcesCoreImpl implements VpnGateways { + protected VpnGatewaysImpl(NetworkManager manager) { + super(manager.inner().vpnGateways(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + VpnGatewaysInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + VpnGatewaysInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + VpnGatewaysInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + VpnGatewaysInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VpnGateway call(VpnGatewayInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + VpnGatewaysInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + VpnGatewaysInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VpnGateway call(VpnGatewayInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public VpnGatewayImpl define(String name) { + return wrapModel(name); + } + + @Override + protected VpnGatewayImpl wrapModel(VpnGatewayInner inner) { + return new VpnGatewayImpl(inner.name(), inner, manager()); + } + + @Override + protected VpnGatewayImpl wrapModel(String name) { + return new VpnGatewayImpl(name, new VpnGatewayInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VpnGatewaysInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VpnGatewaysInner.java new file mode 100644 index 000000000000..4b136f27cbe3 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VpnGatewaysInner.java @@ -0,0 +1,1274 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_06_01.ErrorException; +import com.microsoft.azure.management.network.v2018_06_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.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 VpnGateways. + */ +public class VpnGatewaysInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private VpnGatewaysService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of VpnGatewaysInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public VpnGatewaysInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(VpnGatewaysService.class); + this.client = client; + } + + /** + * The interface defining all the services for VpnGateways to be + * used by Retrofit to perform actually REST calls. + */ + interface VpnGatewaysService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.VpnGateways getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @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.network.v2018_06_01.VpnGateways createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Query("api-version") String apiVersion, @Body VpnGatewayInner vpnGatewayParameters, @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.network.v2018_06_01.VpnGateways beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Query("api-version") String apiVersion, @Body VpnGatewayInner vpnGatewayParameters, @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.network.v2018_06_01.VpnGateways updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}") + Observable> updateTags(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject vpnGatewayParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.VpnGateways beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}") + Observable> beginUpdateTags(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject vpnGatewayParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.VpnGateways delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @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.network.v2018_06_01.VpnGateways beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @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.network.v2018_06_01.VpnGateways listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.VpnGateways list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/vpnGateways") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.VpnGateways listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.VpnGateways listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Retrieves the details of a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnGatewayInner object if successful. + */ + public VpnGatewayInner getByResourceGroup(String resourceGroupName, String gatewayName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, gatewayName).toBlocking().single().body(); + } + + /** + * Retrieves the details of a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String gatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, gatewayName), serviceCallback); + } + + /** + * Retrieves the details of a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnGatewayInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String gatewayName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, gatewayName).map(new Func1, VpnGatewayInner>() { + @Override + public VpnGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Retrieves the details of a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnGatewayInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String gatewayName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, gatewayName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param vpnGatewayParameters Parameters supplied to create or Update a virtual wan vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnGatewayInner object if successful. + */ + public VpnGatewayInner createOrUpdate(String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, vpnGatewayParameters).toBlocking().last().body(); + } + + /** + * Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param vpnGatewayParameters Parameters supplied to create or Update a virtual wan vpn gateway. + * @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 gatewayName, VpnGatewayInner vpnGatewayParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, vpnGatewayParameters), serviceCallback); + } + + /** + * Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param vpnGatewayParameters Parameters supplied to create or Update a virtual wan vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, vpnGatewayParameters).map(new Func1, VpnGatewayInner>() { + @Override + public VpnGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param vpnGatewayParameters Parameters supplied to create or Update a virtual wan vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + if (vpnGatewayParameters == null) { + throw new IllegalArgumentException("Parameter vpnGatewayParameters is required and cannot be null."); + } + Validator.validate(vpnGatewayParameters); + final String apiVersion = "2018-06-01"; + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, gatewayName, apiVersion, vpnGatewayParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param vpnGatewayParameters Parameters supplied to create or Update a virtual wan vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnGatewayInner object if successful. + */ + public VpnGatewayInner beginCreateOrUpdate(String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, vpnGatewayParameters).toBlocking().single().body(); + } + + /** + * Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param vpnGatewayParameters Parameters supplied to create or Update a virtual wan vpn gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, vpnGatewayParameters), serviceCallback); + } + + /** + * Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param vpnGatewayParameters Parameters supplied to create or Update a virtual wan vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnGatewayInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, vpnGatewayParameters).map(new Func1, VpnGatewayInner>() { + @Override + public VpnGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param vpnGatewayParameters Parameters supplied to create or Update a virtual wan vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnGatewayInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + if (vpnGatewayParameters == null) { + throw new IllegalArgumentException("Parameter vpnGatewayParameters is required and cannot be null."); + } + Validator.validate(vpnGatewayParameters); + final String apiVersion = "2018-06-01"; + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, gatewayName, apiVersion, vpnGatewayParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnGatewayInner object if successful. + */ + public VpnGatewayInner updateTags(String resourceGroupName, String gatewayName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, gatewayName).toBlocking().last().body(); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @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 updateTagsAsync(String resourceGroupName, String gatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, gatewayName), serviceCallback); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String gatewayName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, gatewayName).map(new Func1, VpnGatewayInner>() { + @Override + public VpnGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String gatewayName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + final Map tags = null; + TagsObject vpnGatewayParameters = new TagsObject(); + vpnGatewayParameters.withTags(null); + Observable> observable = service.updateTags(this.client.subscriptionId(), resourceGroupName, gatewayName, apiVersion, this.client.acceptLanguage(), vpnGatewayParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnGatewayInner object if successful. + */ + public VpnGatewayInner updateTags(String resourceGroupName, String gatewayName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, gatewayName, tags).toBlocking().last().body(); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String gatewayName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, gatewayName, tags), serviceCallback); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String gatewayName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, gatewayName, tags).map(new Func1, VpnGatewayInner>() { + @Override + public VpnGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String gatewayName, Map tags) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-06-01"; + TagsObject vpnGatewayParameters = new TagsObject(); + vpnGatewayParameters.withTags(tags); + Observable> observable = service.updateTags(this.client.subscriptionId(), resourceGroupName, gatewayName, apiVersion, this.client.acceptLanguage(), vpnGatewayParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnGatewayInner object if successful. + */ + public VpnGatewayInner beginUpdateTags(String resourceGroupName, String gatewayName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, gatewayName).toBlocking().single().body(); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @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 beginUpdateTagsAsync(String resourceGroupName, String gatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, gatewayName), serviceCallback); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnGatewayInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String gatewayName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, gatewayName).map(new Func1, VpnGatewayInner>() { + @Override + public VpnGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnGatewayInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String gatewayName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + final Map tags = null; + TagsObject vpnGatewayParameters = new TagsObject(); + vpnGatewayParameters.withTags(null); + return service.beginUpdateTags(this.client.subscriptionId(), resourceGroupName, gatewayName, apiVersion, this.client.acceptLanguage(), vpnGatewayParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnGatewayInner object if successful. + */ + public VpnGatewayInner beginUpdateTags(String resourceGroupName, String gatewayName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, gatewayName, tags).toBlocking().single().body(); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String gatewayName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, gatewayName, tags), serviceCallback); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnGatewayInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String gatewayName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, gatewayName, tags).map(new Func1, VpnGatewayInner>() { + @Override + public VpnGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnGatewayInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String gatewayName, Map tags) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-06-01"; + TagsObject vpnGatewayParameters = new TagsObject(); + vpnGatewayParameters.withTags(tags); + return service.beginUpdateTags(this.client.subscriptionId(), resourceGroupName, gatewayName, apiVersion, this.client.acceptLanguage(), vpnGatewayParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Deletes a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException 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 gatewayName) { + deleteWithServiceResponseAsync(resourceGroupName, gatewayName).toBlocking().last().body(); + } + + /** + * Deletes a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @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 gatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, gatewayName), serviceCallback); + } + + /** + * Deletes a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String gatewayName) { + return deleteWithServiceResponseAsync(resourceGroupName, gatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String gatewayName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, gatewayName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String gatewayName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, gatewayName).toBlocking().single().body(); + } + + /** + * Deletes a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String gatewayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, gatewayName), serviceCallback); + } + + /** + * Deletes a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String gatewayName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, gatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String gatewayName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (gatewayName == null) { + throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, gatewayName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the VpnGateways in a resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException 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<VpnGatewayInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the VpnGateways in a resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the VpnGateways in a resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnGatewayInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the VpnGateways in a resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnGatewayInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the VpnGateways in a resource group. + * + ServiceResponse> * @param resourceGroupName The resource group name of the VpnGateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VpnGatewayInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the VpnGateways in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException 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<VpnGatewayInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the VpnGateways in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the VpnGateways in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnGatewayInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the VpnGateways in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnGatewayInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the VpnGateways in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VpnGatewayInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the VpnGateways in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException 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<VpnGatewayInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the VpnGateways in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the VpnGateways in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnGatewayInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the VpnGateways in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnGatewayInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the VpnGateways in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VpnGatewayInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the VpnGateways in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException 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<VpnGatewayInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the VpnGateways in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the VpnGateways in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnGatewayInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the VpnGateways in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnGatewayInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the VpnGateways in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VpnGatewayInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VpnSiteImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VpnSiteImpl.java new file mode 100644 index 000000000000..f79f7a99feaa --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VpnSiteImpl.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.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_06_01.VpnSite; +import rx.Observable; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_06_01.DeviceProperties; +import com.microsoft.azure.management.network.v2018_06_01.AddressSpace; +import com.microsoft.azure.management.network.v2018_06_01.BgpSettings; +import com.microsoft.azure.management.network.v2018_06_01.ProvisioningState; + +class VpnSiteImpl extends GroupableResourceCoreImpl implements VpnSite, VpnSite.Definition, VpnSite.Update { + VpnSiteImpl(String name, VpnSiteInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + VpnSitesInner client = this.manager().inner().vpnSites(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + VpnSitesInner client = this.manager().inner().vpnSites(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + VpnSitesInner client = this.manager().inner().vpnSites(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public AddressSpace addressSpace() { + return this.inner().addressSpace(); + } + + @Override + public BgpSettings bgpProperties() { + return this.inner().bgpProperties(); + } + + @Override + public DeviceProperties deviceProperties() { + return this.inner().deviceProperties(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String ipAddress() { + return this.inner().ipAddress(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String siteKey() { + return this.inner().siteKey(); + } + + @Override + public SubResource virtualWAN() { + return this.inner().virtualWAN(); + } + + @Override + public VpnSiteImpl withAddressSpace(AddressSpace addressSpace) { + this.inner().withAddressSpace(addressSpace); + return this; + } + + @Override + public VpnSiteImpl withBgpProperties(BgpSettings bgpProperties) { + this.inner().withBgpProperties(bgpProperties); + return this; + } + + @Override + public VpnSiteImpl withDeviceProperties(DeviceProperties deviceProperties) { + this.inner().withDeviceProperties(deviceProperties); + return this; + } + + @Override + public VpnSiteImpl withIpAddress(String ipAddress) { + this.inner().withIpAddress(ipAddress); + return this; + } + + @Override + public VpnSiteImpl withProvisioningState(ProvisioningState provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public VpnSiteImpl withSiteKey(String siteKey) { + this.inner().withSiteKey(siteKey); + return this; + } + + @Override + public VpnSiteImpl withVirtualWAN(SubResource virtualWAN) { + this.inner().withVirtualWAN(virtualWAN); + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VpnSiteInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VpnSiteInner.java new file mode 100644 index 000000000000..b0e44725d6c4 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VpnSiteInner.java @@ -0,0 +1,252 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.network.v2018_06_01.DeviceProperties; +import com.microsoft.azure.management.network.v2018_06_01.AddressSpace; +import com.microsoft.azure.management.network.v2018_06_01.BgpSettings; +import com.microsoft.azure.management.network.v2018_06_01.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * VpnSite Resource. + */ +@JsonFlatten +@SkipParentValidation +public class VpnSiteInner extends Resource { + /** + * The VirtualWAN to which the vpnSite belongs. + */ + @JsonProperty(value = "properties.virtualWAN") + private SubResource virtualWAN; + + /** + * The device properties. + */ + @JsonProperty(value = "properties.deviceProperties") + private DeviceProperties deviceProperties; + + /** + * The ip-address for the vpn-site. + */ + @JsonProperty(value = "properties.ipAddress") + private String ipAddress; + + /** + * The key for vpn-site that can be used for connections. + */ + @JsonProperty(value = "properties.siteKey") + private String siteKey; + + /** + * The AddressSpace that contains an array of IP address ranges. + */ + @JsonProperty(value = "properties.addressSpace") + private AddressSpace addressSpace; + + /** + * The set of bgp properties. + */ + @JsonProperty(value = "properties.bgpProperties") + private BgpSettings bgpProperties; + + /** + * The provisioning state of the resource. Possible values include: + * 'Succeeded', 'Updating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningState provisioningState; + + /** + * Gets a unique read-only string that changes whenever the resource is + * updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the VirtualWAN to which the vpnSite belongs. + * + * @return the virtualWAN value + */ + public SubResource virtualWAN() { + return this.virtualWAN; + } + + /** + * Set the VirtualWAN to which the vpnSite belongs. + * + * @param virtualWAN the virtualWAN value to set + * @return the VpnSiteInner object itself. + */ + public VpnSiteInner withVirtualWAN(SubResource virtualWAN) { + this.virtualWAN = virtualWAN; + return this; + } + + /** + * Get the device properties. + * + * @return the deviceProperties value + */ + public DeviceProperties deviceProperties() { + return this.deviceProperties; + } + + /** + * Set the device properties. + * + * @param deviceProperties the deviceProperties value to set + * @return the VpnSiteInner object itself. + */ + public VpnSiteInner withDeviceProperties(DeviceProperties deviceProperties) { + this.deviceProperties = deviceProperties; + return this; + } + + /** + * Get the ip-address for the vpn-site. + * + * @return the ipAddress value + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Set the ip-address for the vpn-site. + * + * @param ipAddress the ipAddress value to set + * @return the VpnSiteInner object itself. + */ + public VpnSiteInner withIpAddress(String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + * Get the key for vpn-site that can be used for connections. + * + * @return the siteKey value + */ + public String siteKey() { + return this.siteKey; + } + + /** + * Set the key for vpn-site that can be used for connections. + * + * @param siteKey the siteKey value to set + * @return the VpnSiteInner object itself. + */ + public VpnSiteInner withSiteKey(String siteKey) { + this.siteKey = siteKey; + return this; + } + + /** + * Get the AddressSpace that contains an array of IP address ranges. + * + * @return the addressSpace value + */ + public AddressSpace addressSpace() { + return this.addressSpace; + } + + /** + * Set the AddressSpace that contains an array of IP address ranges. + * + * @param addressSpace the addressSpace value to set + * @return the VpnSiteInner object itself. + */ + public VpnSiteInner withAddressSpace(AddressSpace addressSpace) { + this.addressSpace = addressSpace; + return this; + } + + /** + * Get the set of bgp properties. + * + * @return the bgpProperties value + */ + public BgpSettings bgpProperties() { + return this.bgpProperties; + } + + /** + * Set the set of bgp properties. + * + * @param bgpProperties the bgpProperties value to set + * @return the VpnSiteInner object itself. + */ + public VpnSiteInner withBgpProperties(BgpSettings bgpProperties) { + this.bgpProperties = bgpProperties; + return this; + } + + /** + * Get the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the VpnSiteInner object itself. + */ + public VpnSiteInner withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID. + * + * @param id the id value to set + * @return the VpnSiteInner object itself. + */ + public VpnSiteInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VpnSitesConfigurationsImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VpnSitesConfigurationsImpl.java new file mode 100644 index 000000000000..e90dd8f25436 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VpnSitesConfigurationsImpl.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. + * abc + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.network.v2018_06_01.VpnSitesConfigurations; +import rx.Completable; +import com.microsoft.azure.management.network.v2018_06_01.GetVpnSitesConfigurationRequest; + +class VpnSitesConfigurationsImpl extends WrapperImpl implements VpnSitesConfigurations { + private final NetworkManager manager; + + VpnSitesConfigurationsImpl(NetworkManager manager) { + super(manager.inner().vpnSitesConfigurations()); + this.manager = manager; + } + + public NetworkManager manager() { + return this.manager; + } + + @Override + public Completable downloadAsync(String resourceGroupName, String virtualWANName, GetVpnSitesConfigurationRequest request) { + VpnSitesConfigurationsInner client = this.inner(); + return client.downloadAsync(resourceGroupName, virtualWANName, request).toCompletable(); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VpnSitesConfigurationsInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VpnSitesConfigurationsInner.java new file mode 100644 index 000000000000..d0d601220454 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VpnSitesConfigurationsInner.java @@ -0,0 +1,233 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.network.v2018_06_01.ErrorException; +import com.microsoft.azure.management.network.v2018_06_01.GetVpnSitesConfigurationRequest; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in VpnSitesConfigurations. + */ +public class VpnSitesConfigurationsInner { + /** The Retrofit service to perform REST calls. */ + private VpnSitesConfigurationsService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of VpnSitesConfigurationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public VpnSitesConfigurationsInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(VpnSitesConfigurationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for VpnSitesConfigurations to be + * used by Retrofit to perform actually REST calls. + */ + interface VpnSitesConfigurationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.VpnSitesConfigurations download" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWANName}/vpnConfiguration") + Observable> download(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualWANName") String virtualWANName, @Body GetVpnSitesConfigurationRequest request, @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.network.v2018_06_01.VpnSitesConfigurations beginDownload" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWANName}/vpnConfiguration") + Observable> beginDownload(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualWANName") String virtualWANName, @Body GetVpnSitesConfigurationRequest request, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gives the sas-url to download the configurations for vpn-sites in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWANName The name of the VirtualWAN for which configuration of all vpn-sites is needed. + * @param request Parameters supplied to download vpn-sites configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void download(String resourceGroupName, String virtualWANName, GetVpnSitesConfigurationRequest request) { + downloadWithServiceResponseAsync(resourceGroupName, virtualWANName, request).toBlocking().last().body(); + } + + /** + * Gives the sas-url to download the configurations for vpn-sites in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWANName The name of the VirtualWAN for which configuration of all vpn-sites is needed. + * @param request Parameters supplied to download vpn-sites configuration. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture downloadAsync(String resourceGroupName, String virtualWANName, GetVpnSitesConfigurationRequest request, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(downloadWithServiceResponseAsync(resourceGroupName, virtualWANName, request), serviceCallback); + } + + /** + * Gives the sas-url to download the configurations for vpn-sites in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWANName The name of the VirtualWAN for which configuration of all vpn-sites is needed. + * @param request Parameters supplied to download vpn-sites configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable downloadAsync(String resourceGroupName, String virtualWANName, GetVpnSitesConfigurationRequest request) { + return downloadWithServiceResponseAsync(resourceGroupName, virtualWANName, request).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gives the sas-url to download the configurations for vpn-sites in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWANName The name of the VirtualWAN for which configuration of all vpn-sites is needed. + * @param request Parameters supplied to download vpn-sites configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> downloadWithServiceResponseAsync(String resourceGroupName, String virtualWANName, GetVpnSitesConfigurationRequest request) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualWANName == null) { + throw new IllegalArgumentException("Parameter virtualWANName is required and cannot be null."); + } + if (request == null) { + throw new IllegalArgumentException("Parameter request is required and cannot be null."); + } + Validator.validate(request); + final String apiVersion = "2018-06-01"; + Observable> observable = service.download(this.client.subscriptionId(), resourceGroupName, virtualWANName, request, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Gives the sas-url to download the configurations for vpn-sites in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWANName The name of the VirtualWAN for which configuration of all vpn-sites is needed. + * @param request Parameters supplied to download vpn-sites configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDownload(String resourceGroupName, String virtualWANName, GetVpnSitesConfigurationRequest request) { + beginDownloadWithServiceResponseAsync(resourceGroupName, virtualWANName, request).toBlocking().single().body(); + } + + /** + * Gives the sas-url to download the configurations for vpn-sites in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWANName The name of the VirtualWAN for which configuration of all vpn-sites is needed. + * @param request Parameters supplied to download vpn-sites configuration. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDownloadAsync(String resourceGroupName, String virtualWANName, GetVpnSitesConfigurationRequest request, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDownloadWithServiceResponseAsync(resourceGroupName, virtualWANName, request), serviceCallback); + } + + /** + * Gives the sas-url to download the configurations for vpn-sites in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWANName The name of the VirtualWAN for which configuration of all vpn-sites is needed. + * @param request Parameters supplied to download vpn-sites configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDownloadAsync(String resourceGroupName, String virtualWANName, GetVpnSitesConfigurationRequest request) { + return beginDownloadWithServiceResponseAsync(resourceGroupName, virtualWANName, request).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gives the sas-url to download the configurations for vpn-sites in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWANName The name of the VirtualWAN for which configuration of all vpn-sites is needed. + * @param request Parameters supplied to download vpn-sites configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDownloadWithServiceResponseAsync(String resourceGroupName, String virtualWANName, GetVpnSitesConfigurationRequest request) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualWANName == null) { + throw new IllegalArgumentException("Parameter virtualWANName is required and cannot be null."); + } + if (request == null) { + throw new IllegalArgumentException("Parameter request is required and cannot be null."); + } + Validator.validate(request); + final String apiVersion = "2018-06-01"; + return service.beginDownload(this.client.subscriptionId(), resourceGroupName, virtualWANName, request, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDownloadDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDownloadDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VpnSitesImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VpnSitesImpl.java new file mode 100644 index 000000000000..5b172fccd692 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VpnSitesImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.network.v2018_06_01.VpnSites; +import com.microsoft.azure.management.network.v2018_06_01.VpnSite; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class VpnSitesImpl extends GroupableResourcesCoreImpl implements VpnSites { + protected VpnSitesImpl(NetworkManager manager) { + super(manager.inner().vpnSites(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + VpnSitesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + VpnSitesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + VpnSitesInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + VpnSitesInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VpnSite call(VpnSiteInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + VpnSitesInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + VpnSitesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VpnSite call(VpnSiteInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public VpnSiteImpl define(String name) { + return wrapModel(name); + } + + @Override + protected VpnSiteImpl wrapModel(VpnSiteInner inner) { + return new VpnSiteImpl(inner.name(), inner, manager()); + } + + @Override + protected VpnSiteImpl wrapModel(String name) { + return new VpnSiteImpl(name, new VpnSiteInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VpnSitesInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VpnSitesInner.java new file mode 100644 index 000000000000..adccee320aa6 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VpnSitesInner.java @@ -0,0 +1,1274 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_06_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_06_01.ErrorException; +import com.microsoft.azure.management.network.v2018_06_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.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 VpnSites. + */ +public class VpnSitesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private VpnSitesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of VpnSitesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public VpnSitesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(VpnSitesService.class); + this.client = client; + } + + /** + * The interface defining all the services for VpnSites to be + * used by Retrofit to perform actually REST calls. + */ + interface VpnSitesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.VpnSites getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("vpnSiteName") String vpnSiteName, @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.network.v2018_06_01.VpnSites createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("vpnSiteName") String vpnSiteName, @Query("api-version") String apiVersion, @Body VpnSiteInner vpnSiteParameters, @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.network.v2018_06_01.VpnSites beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("vpnSiteName") String vpnSiteName, @Query("api-version") String apiVersion, @Body VpnSiteInner vpnSiteParameters, @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.network.v2018_06_01.VpnSites updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}") + Observable> updateTags(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("vpnSiteName") String vpnSiteName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject vpnSiteParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.VpnSites beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}") + Observable> beginUpdateTags(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("vpnSiteName") String vpnSiteName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject vpnSiteParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.VpnSites delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("vpnSiteName") String vpnSiteName, @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.network.v2018_06_01.VpnSites beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("vpnSiteName") String vpnSiteName, @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.network.v2018_06_01.VpnSites listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.VpnSites list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/vpnSites") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.VpnSites listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.VpnSites listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Retrieves the details of a VPNsite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnSiteInner object if successful. + */ + public VpnSiteInner getByResourceGroup(String resourceGroupName, String vpnSiteName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, vpnSiteName).toBlocking().single().body(); + } + + /** + * Retrieves the details of a VPNsite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being retrieved. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String vpnSiteName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, vpnSiteName), serviceCallback); + } + + /** + * Retrieves the details of a VPNsite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnSiteInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String vpnSiteName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, vpnSiteName).map(new Func1, VpnSiteInner>() { + @Override + public VpnSiteInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Retrieves the details of a VPNsite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnSiteInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String vpnSiteName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vpnSiteName == null) { + throw new IllegalArgumentException("Parameter vpnSiteName is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, vpnSiteName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being created or updated. + * @param vpnSiteParameters Parameters supplied to create or update VpnSite. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnSiteInner object if successful. + */ + public VpnSiteInner createOrUpdate(String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, vpnSiteName, vpnSiteParameters).toBlocking().last().body(); + } + + /** + * Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being created or updated. + * @param vpnSiteParameters Parameters supplied to create or update VpnSite. + * @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 vpnSiteName, VpnSiteInner vpnSiteParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, vpnSiteName, vpnSiteParameters), serviceCallback); + } + + /** + * Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being created or updated. + * @param vpnSiteParameters Parameters supplied to create or update VpnSite. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, vpnSiteName, vpnSiteParameters).map(new Func1, VpnSiteInner>() { + @Override + public VpnSiteInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being created or updated. + * @param vpnSiteParameters Parameters supplied to create or update VpnSite. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vpnSiteName == null) { + throw new IllegalArgumentException("Parameter vpnSiteName is required and cannot be null."); + } + if (vpnSiteParameters == null) { + throw new IllegalArgumentException("Parameter vpnSiteParameters is required and cannot be null."); + } + Validator.validate(vpnSiteParameters); + final String apiVersion = "2018-06-01"; + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, vpnSiteName, apiVersion, vpnSiteParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being created or updated. + * @param vpnSiteParameters Parameters supplied to create or update VpnSite. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnSiteInner object if successful. + */ + public VpnSiteInner beginCreateOrUpdate(String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, vpnSiteName, vpnSiteParameters).toBlocking().single().body(); + } + + /** + * Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being created or updated. + * @param vpnSiteParameters Parameters supplied to create or update VpnSite. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, vpnSiteName, vpnSiteParameters), serviceCallback); + } + + /** + * Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being created or updated. + * @param vpnSiteParameters Parameters supplied to create or update VpnSite. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnSiteInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, vpnSiteName, vpnSiteParameters).map(new Func1, VpnSiteInner>() { + @Override + public VpnSiteInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being created or updated. + * @param vpnSiteParameters Parameters supplied to create or update VpnSite. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnSiteInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vpnSiteName == null) { + throw new IllegalArgumentException("Parameter vpnSiteName is required and cannot be null."); + } + if (vpnSiteParameters == null) { + throw new IllegalArgumentException("Parameter vpnSiteParameters is required and cannot be null."); + } + Validator.validate(vpnSiteParameters); + final String apiVersion = "2018-06-01"; + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, vpnSiteName, apiVersion, vpnSiteParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnSiteInner object if successful. + */ + public VpnSiteInner updateTags(String resourceGroupName, String vpnSiteName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, vpnSiteName).toBlocking().last().body(); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @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 updateTagsAsync(String resourceGroupName, String vpnSiteName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, vpnSiteName), serviceCallback); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String vpnSiteName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, vpnSiteName).map(new Func1, VpnSiteInner>() { + @Override + public VpnSiteInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String vpnSiteName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vpnSiteName == null) { + throw new IllegalArgumentException("Parameter vpnSiteName is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + final Map tags = null; + TagsObject vpnSiteParameters = new TagsObject(); + vpnSiteParameters.withTags(null); + Observable> observable = service.updateTags(this.client.subscriptionId(), resourceGroupName, vpnSiteName, apiVersion, this.client.acceptLanguage(), vpnSiteParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnSiteInner object if successful. + */ + public VpnSiteInner updateTags(String resourceGroupName, String vpnSiteName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, vpnSiteName, tags).toBlocking().last().body(); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String vpnSiteName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, vpnSiteName, tags), serviceCallback); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String vpnSiteName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, vpnSiteName, tags).map(new Func1, VpnSiteInner>() { + @Override + public VpnSiteInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String vpnSiteName, Map tags) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vpnSiteName == null) { + throw new IllegalArgumentException("Parameter vpnSiteName is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-06-01"; + TagsObject vpnSiteParameters = new TagsObject(); + vpnSiteParameters.withTags(tags); + Observable> observable = service.updateTags(this.client.subscriptionId(), resourceGroupName, vpnSiteName, apiVersion, this.client.acceptLanguage(), vpnSiteParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnSiteInner object if successful. + */ + public VpnSiteInner beginUpdateTags(String resourceGroupName, String vpnSiteName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, vpnSiteName).toBlocking().single().body(); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @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 beginUpdateTagsAsync(String resourceGroupName, String vpnSiteName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, vpnSiteName), serviceCallback); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnSiteInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String vpnSiteName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, vpnSiteName).map(new Func1, VpnSiteInner>() { + @Override + public VpnSiteInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnSiteInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String vpnSiteName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vpnSiteName == null) { + throw new IllegalArgumentException("Parameter vpnSiteName is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + final Map tags = null; + TagsObject vpnSiteParameters = new TagsObject(); + vpnSiteParameters.withTags(null); + return service.beginUpdateTags(this.client.subscriptionId(), resourceGroupName, vpnSiteName, apiVersion, this.client.acceptLanguage(), vpnSiteParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VpnSiteInner object if successful. + */ + public VpnSiteInner beginUpdateTags(String resourceGroupName, String vpnSiteName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, vpnSiteName, tags).toBlocking().single().body(); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String vpnSiteName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, vpnSiteName, tags), serviceCallback); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnSiteInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String vpnSiteName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, vpnSiteName, tags).map(new Func1, VpnSiteInner>() { + @Override + public VpnSiteInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VpnSiteInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String vpnSiteName, Map tags) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vpnSiteName == null) { + throw new IllegalArgumentException("Parameter vpnSiteName is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2018-06-01"; + TagsObject vpnSiteParameters = new TagsObject(); + vpnSiteParameters.withTags(tags); + return service.beginUpdateTags(this.client.subscriptionId(), resourceGroupName, vpnSiteName, apiVersion, this.client.acceptLanguage(), vpnSiteParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Deletes a VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException 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 vpnSiteName) { + deleteWithServiceResponseAsync(resourceGroupName, vpnSiteName).toBlocking().last().body(); + } + + /** + * Deletes a VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being deleted. + * @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 vpnSiteName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, vpnSiteName), serviceCallback); + } + + /** + * Deletes a VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String vpnSiteName) { + return deleteWithServiceResponseAsync(resourceGroupName, vpnSiteName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String vpnSiteName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vpnSiteName == null) { + throw new IllegalArgumentException("Parameter vpnSiteName is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, vpnSiteName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes a VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String vpnSiteName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, vpnSiteName).toBlocking().single().body(); + } + + /** + * Deletes a VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being deleted. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String vpnSiteName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, vpnSiteName), serviceCallback); + } + + /** + * Deletes a VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String vpnSiteName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, vpnSiteName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String vpnSiteName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vpnSiteName == null) { + throw new IllegalArgumentException("Parameter vpnSiteName is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, vpnSiteName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the vpnSites in a resource group. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException 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<VpnSiteInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the vpnSites in a resource group. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the vpnSites in a resource group. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnSiteInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the vpnSites in a resource group. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnSiteInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the vpnSites in a resource group. + * + ServiceResponse> * @param resourceGroupName The resource group name of the VpnSite. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VpnSiteInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the VpnSites in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException 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<VpnSiteInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the VpnSites in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the VpnSites in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnSiteInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the VpnSites in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnSiteInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the VpnSites in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VpnSiteInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the vpnSites in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException 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<VpnSiteInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the vpnSites in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the vpnSites in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnSiteInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the vpnSites in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnSiteInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the vpnSites in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VpnSiteInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Lists all the VpnSites in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException 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<VpnSiteInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the VpnSites in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the VpnSites in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnSiteInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the VpnSites in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VpnSiteInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the VpnSites in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VpnSiteInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/package-info.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/package-info.java new file mode 100644 index 000000000000..370286c59ee5 --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for NetworkManagementClient. + * Network Client. + */ +package com.microsoft.azure.management.network.v2018_06_01.implementation; diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/package-info.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/package-info.java new file mode 100644 index 000000000000..d0090a02cf7a --- /dev/null +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for NetworkManagementClient. + * Network Client. + */ +package com.microsoft.azure.management.network.v2018_06_01;