diff --git a/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/ApplicationGateway.java b/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/ApplicationGateway.java index b5aa0cc40812..a1cf898aecf6 100644 --- a/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/ApplicationGateway.java +++ b/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/ApplicationGateway.java @@ -19,6 +19,7 @@ import com.microsoft.azure.arm.resources.models.HasManager; import com.microsoft.azure.management.network.v2018_12_01.implementation.NetworkManager; import java.util.List; +import com.microsoft.azure.SubResource; import com.microsoft.azure.management.network.v2018_12_01.implementation.ApplicationGatewayInner; /** @@ -65,6 +66,11 @@ public interface ApplicationGateway extends HasInner, R */ String etag(); + /** + * @return the firewallPolicy value. + */ + SubResource firewallPolicy(); + /** * @return the frontendIPConfigurations value. */ @@ -188,7 +194,7 @@ interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup authenticationCertificates); @@ -212,7 +218,7 @@ interface WithAutoscaleConfiguration { interface WithBackendAddressPools { /** * Specifies backendAddressPools. - * @param backendAddressPools Backend address pool of the application gateway resource + * @param backendAddressPools Backend address pool of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits) * @return the next definition stage */ WithCreate withBackendAddressPools(List backendAddressPools); @@ -224,7 +230,7 @@ interface WithBackendAddressPools { interface WithBackendHttpSettingsCollection { /** * Specifies backendHttpSettingsCollection. - * @param backendHttpSettingsCollection Backend http settings of the application gateway resource + * @param backendHttpSettingsCollection Backend http settings of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits) * @return the next definition stage */ WithCreate withBackendHttpSettingsCollection(List backendHttpSettingsCollection); @@ -278,13 +284,25 @@ interface WithEtag { WithCreate withEtag(String etag); } + /** + * The stage of the applicationgateway definition allowing to specify FirewallPolicy. + */ + interface WithFirewallPolicy { + /** + * Specifies firewallPolicy. + * @param firewallPolicy Reference of the FirewallPolicy resource + * @return the next definition stage + */ + WithCreate withFirewallPolicy(SubResource firewallPolicy); + } + /** * The stage of the applicationgateway definition allowing to specify FrontendIPConfigurations. */ interface WithFrontendIPConfigurations { /** * Specifies frontendIPConfigurations. - * @param frontendIPConfigurations Frontend IP addresses of the application gateway resource + * @param frontendIPConfigurations Frontend IP addresses of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits) * @return the next definition stage */ WithCreate withFrontendIPConfigurations(List frontendIPConfigurations); @@ -296,7 +314,7 @@ interface WithFrontendIPConfigurations { interface WithFrontendPorts { /** * Specifies frontendPorts. - * @param frontendPorts Frontend ports of the application gateway resource + * @param frontendPorts Frontend ports of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits) * @return the next definition stage */ WithCreate withFrontendPorts(List frontendPorts); @@ -308,7 +326,7 @@ interface WithFrontendPorts { interface WithGatewayIPConfigurations { /** * Specifies gatewayIPConfigurations. - * @param gatewayIPConfigurations Subnets of application the gateway resource + * @param gatewayIPConfigurations Subnets of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits) * @return the next definition stage */ WithCreate withGatewayIPConfigurations(List gatewayIPConfigurations); @@ -320,7 +338,7 @@ interface WithGatewayIPConfigurations { interface WithHttpListeners { /** * Specifies httpListeners. - * @param httpListeners Http listeners of the application gateway resource + * @param httpListeners Http listeners of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits) * @return the next definition stage */ WithCreate withHttpListeners(List httpListeners); @@ -368,7 +386,7 @@ interface WithProvisioningState { interface WithRedirectConfigurations { /** * Specifies redirectConfigurations. - * @param redirectConfigurations Redirect configurations of the application gateway resource + * @param redirectConfigurations Redirect configurations of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits) * @return the next definition stage */ WithCreate withRedirectConfigurations(List redirectConfigurations); @@ -428,7 +446,7 @@ interface WithSku { interface WithSslCertificates { /** * Specifies sslCertificates. - * @param sslCertificates SSL certificates of the application gateway resource + * @param sslCertificates SSL certificates of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits) * @return the next definition stage */ WithCreate withSslCertificates(List sslCertificates); @@ -452,7 +470,7 @@ interface WithSslPolicy { interface WithTrustedRootCertificates { /** * Specifies trustedRootCertificates. - * @param trustedRootCertificates Trusted Root certificates of the application gateway resource + * @param trustedRootCertificates Trusted Root certificates of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits) * @return the next definition stage */ WithCreate withTrustedRootCertificates(List trustedRootCertificates); @@ -464,7 +482,7 @@ interface WithTrustedRootCertificates { interface WithUrlPathMaps { /** * Specifies urlPathMaps. - * @param urlPathMaps URL path map of the application gateway resource + * @param urlPathMaps URL path map of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits) * @return the next definition stage */ WithCreate withUrlPathMaps(List urlPathMaps); @@ -499,13 +517,13 @@ interface WithZones { * 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.WithCustomErrorConfigurations, DefinitionStages.WithEnableFips, DefinitionStages.WithEnableHttp2, DefinitionStages.WithEtag, DefinitionStages.WithFrontendIPConfigurations, DefinitionStages.WithFrontendPorts, DefinitionStages.WithGatewayIPConfigurations, DefinitionStages.WithHttpListeners, DefinitionStages.WithIdentity, DefinitionStages.WithProbes, DefinitionStages.WithProvisioningState, DefinitionStages.WithRedirectConfigurations, DefinitionStages.WithRequestRoutingRules, DefinitionStages.WithResourceGuid, DefinitionStages.WithRewriteRuleSets, DefinitionStages.WithSku, DefinitionStages.WithSslCertificates, DefinitionStages.WithSslPolicy, DefinitionStages.WithTrustedRootCertificates, DefinitionStages.WithUrlPathMaps, DefinitionStages.WithWebApplicationFirewallConfiguration, DefinitionStages.WithZones { + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithAuthenticationCertificates, DefinitionStages.WithAutoscaleConfiguration, DefinitionStages.WithBackendAddressPools, DefinitionStages.WithBackendHttpSettingsCollection, DefinitionStages.WithCustomErrorConfigurations, DefinitionStages.WithEnableFips, DefinitionStages.WithEnableHttp2, DefinitionStages.WithEtag, DefinitionStages.WithFirewallPolicy, DefinitionStages.WithFrontendIPConfigurations, DefinitionStages.WithFrontendPorts, DefinitionStages.WithGatewayIPConfigurations, DefinitionStages.WithHttpListeners, DefinitionStages.WithIdentity, DefinitionStages.WithProbes, DefinitionStages.WithProvisioningState, DefinitionStages.WithRedirectConfigurations, DefinitionStages.WithRequestRoutingRules, DefinitionStages.WithResourceGuid, DefinitionStages.WithRewriteRuleSets, DefinitionStages.WithSku, DefinitionStages.WithSslCertificates, DefinitionStages.WithSslPolicy, DefinitionStages.WithTrustedRootCertificates, 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.WithCustomErrorConfigurations, UpdateStages.WithEnableFips, UpdateStages.WithEnableHttp2, UpdateStages.WithEtag, UpdateStages.WithFrontendIPConfigurations, UpdateStages.WithFrontendPorts, UpdateStages.WithGatewayIPConfigurations, UpdateStages.WithHttpListeners, UpdateStages.WithIdentity, UpdateStages.WithProbes, UpdateStages.WithProvisioningState, UpdateStages.WithRedirectConfigurations, UpdateStages.WithRequestRoutingRules, UpdateStages.WithResourceGuid, UpdateStages.WithRewriteRuleSets, UpdateStages.WithSku, UpdateStages.WithSslCertificates, UpdateStages.WithSslPolicy, UpdateStages.WithTrustedRootCertificates, UpdateStages.WithUrlPathMaps, UpdateStages.WithWebApplicationFirewallConfiguration, UpdateStages.WithZones { + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithAuthenticationCertificates, UpdateStages.WithAutoscaleConfiguration, UpdateStages.WithBackendAddressPools, UpdateStages.WithBackendHttpSettingsCollection, UpdateStages.WithCustomErrorConfigurations, UpdateStages.WithEnableFips, UpdateStages.WithEnableHttp2, UpdateStages.WithEtag, UpdateStages.WithFirewallPolicy, UpdateStages.WithFrontendIPConfigurations, UpdateStages.WithFrontendPorts, UpdateStages.WithGatewayIPConfigurations, UpdateStages.WithHttpListeners, UpdateStages.WithIdentity, UpdateStages.WithProbes, UpdateStages.WithProvisioningState, UpdateStages.WithRedirectConfigurations, UpdateStages.WithRequestRoutingRules, UpdateStages.WithResourceGuid, UpdateStages.WithRewriteRuleSets, UpdateStages.WithSku, UpdateStages.WithSslCertificates, UpdateStages.WithSslPolicy, UpdateStages.WithTrustedRootCertificates, UpdateStages.WithUrlPathMaps, UpdateStages.WithWebApplicationFirewallConfiguration, UpdateStages.WithZones { } /** @@ -518,7 +536,7 @@ interface UpdateStages { interface WithAuthenticationCertificates { /** * Specifies authenticationCertificates. - * @param authenticationCertificates Authentication certificates of the application gateway resource + * @param authenticationCertificates Authentication certificates of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits) * @return the next update stage */ Update withAuthenticationCertificates(List authenticationCertificates); @@ -542,7 +560,7 @@ interface WithAutoscaleConfiguration { interface WithBackendAddressPools { /** * Specifies backendAddressPools. - * @param backendAddressPools Backend address pool of the application gateway resource + * @param backendAddressPools Backend address pool of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits) * @return the next update stage */ Update withBackendAddressPools(List backendAddressPools); @@ -554,7 +572,7 @@ interface WithBackendAddressPools { interface WithBackendHttpSettingsCollection { /** * Specifies backendHttpSettingsCollection. - * @param backendHttpSettingsCollection Backend http settings of the application gateway resource + * @param backendHttpSettingsCollection Backend http settings of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits) * @return the next update stage */ Update withBackendHttpSettingsCollection(List backendHttpSettingsCollection); @@ -608,13 +626,25 @@ interface WithEtag { Update withEtag(String etag); } + /** + * The stage of the applicationgateway update allowing to specify FirewallPolicy. + */ + interface WithFirewallPolicy { + /** + * Specifies firewallPolicy. + * @param firewallPolicy Reference of the FirewallPolicy resource + * @return the next update stage + */ + Update withFirewallPolicy(SubResource firewallPolicy); + } + /** * The stage of the applicationgateway update allowing to specify FrontendIPConfigurations. */ interface WithFrontendIPConfigurations { /** * Specifies frontendIPConfigurations. - * @param frontendIPConfigurations Frontend IP addresses of the application gateway resource + * @param frontendIPConfigurations Frontend IP addresses of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits) * @return the next update stage */ Update withFrontendIPConfigurations(List frontendIPConfigurations); @@ -626,7 +656,7 @@ interface WithFrontendIPConfigurations { interface WithFrontendPorts { /** * Specifies frontendPorts. - * @param frontendPorts Frontend ports of the application gateway resource + * @param frontendPorts Frontend ports of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits) * @return the next update stage */ Update withFrontendPorts(List frontendPorts); @@ -638,7 +668,7 @@ interface WithFrontendPorts { interface WithGatewayIPConfigurations { /** * Specifies gatewayIPConfigurations. - * @param gatewayIPConfigurations Subnets of application the gateway resource + * @param gatewayIPConfigurations Subnets of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits) * @return the next update stage */ Update withGatewayIPConfigurations(List gatewayIPConfigurations); @@ -650,7 +680,7 @@ interface WithGatewayIPConfigurations { interface WithHttpListeners { /** * Specifies httpListeners. - * @param httpListeners Http listeners of the application gateway resource + * @param httpListeners Http listeners of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits) * @return the next update stage */ Update withHttpListeners(List httpListeners); @@ -698,7 +728,7 @@ interface WithProvisioningState { interface WithRedirectConfigurations { /** * Specifies redirectConfigurations. - * @param redirectConfigurations Redirect configurations of the application gateway resource + * @param redirectConfigurations Redirect configurations of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits) * @return the next update stage */ Update withRedirectConfigurations(List redirectConfigurations); @@ -758,7 +788,7 @@ interface WithSku { interface WithSslCertificates { /** * Specifies sslCertificates. - * @param sslCertificates SSL certificates of the application gateway resource + * @param sslCertificates SSL certificates of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits) * @return the next update stage */ Update withSslCertificates(List sslCertificates); @@ -782,7 +812,7 @@ interface WithSslPolicy { interface WithTrustedRootCertificates { /** * Specifies trustedRootCertificates. - * @param trustedRootCertificates Trusted Root certificates of the application gateway resource + * @param trustedRootCertificates Trusted Root certificates of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits) * @return the next update stage */ Update withTrustedRootCertificates(List trustedRootCertificates); @@ -794,7 +824,7 @@ interface WithTrustedRootCertificates { interface WithUrlPathMaps { /** * Specifies urlPathMaps. - * @param urlPathMaps URL path map of the application gateway resource + * @param urlPathMaps URL path map of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits) * @return the next update stage */ Update withUrlPathMaps(List urlPathMaps); diff --git a/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/ApplicationGatewayBackendHealthServer.java b/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/ApplicationGatewayBackendHealthServer.java index 763e7ecefe78..9d63667f2304 100644 --- a/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/ApplicationGatewayBackendHealthServer.java +++ b/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/ApplicationGatewayBackendHealthServer.java @@ -34,6 +34,12 @@ public class ApplicationGatewayBackendHealthServer { @JsonProperty(value = "health") private ApplicationGatewayBackendHealthServerHealth health; + /** + * Health Probe Log. + */ + @JsonProperty(value = "healthProbeLog") + private String healthProbeLog; + /** * Get iP address or FQDN of backend server. * @@ -94,4 +100,24 @@ public ApplicationGatewayBackendHealthServer withHealth(ApplicationGatewayBacken return this; } + /** + * Get health Probe Log. + * + * @return the healthProbeLog value + */ + public String healthProbeLog() { + return this.healthProbeLog; + } + + /** + * Set health Probe Log. + * + * @param healthProbeLog the healthProbeLog value to set + * @return the ApplicationGatewayBackendHealthServer object itself. + */ + public ApplicationGatewayBackendHealthServer withHealthProbeLog(String healthProbeLog) { + this.healthProbeLog = healthProbeLog; + return this; + } + } diff --git a/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/MatchCondition.java b/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/MatchCondition.java new file mode 100644 index 000000000000..b08caa234c98 --- /dev/null +++ b/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/MatchCondition.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_12_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Define match conditions. + */ +public class MatchCondition { + /** + * List of match variables. + */ + @JsonProperty(value = "matchVariables", required = true) + private List matchVariables; + + /** + * Describes operator to be matched. Possible values include: 'IPMatch', + * 'Equal', 'Contains', 'LessThan', 'GreaterThan', 'LessThanOrEqual', + * 'GreaterThanOrEqual', 'BeginsWith', 'EndsWith', 'Regex'. + */ + @JsonProperty(value = "operator", required = true) + private WebApplicationFirewallOperator operator; + + /** + * Describes if this is negate condition or not. + */ + @JsonProperty(value = "negationConditon") + private Boolean negationConditon; + + /** + * Match value. + */ + @JsonProperty(value = "matchValues", required = true) + private List matchValues; + + /** + * List of transforms. + */ + @JsonProperty(value = "transforms") + private List transforms; + + /** + * Get list of match variables. + * + * @return the matchVariables value + */ + public List matchVariables() { + return this.matchVariables; + } + + /** + * Set list of match variables. + * + * @param matchVariables the matchVariables value to set + * @return the MatchCondition object itself. + */ + public MatchCondition withMatchVariables(List matchVariables) { + this.matchVariables = matchVariables; + return this; + } + + /** + * Get describes operator to be matched. Possible values include: 'IPMatch', 'Equal', 'Contains', 'LessThan', 'GreaterThan', 'LessThanOrEqual', 'GreaterThanOrEqual', 'BeginsWith', 'EndsWith', 'Regex'. + * + * @return the operator value + */ + public WebApplicationFirewallOperator operator() { + return this.operator; + } + + /** + * Set describes operator to be matched. Possible values include: 'IPMatch', 'Equal', 'Contains', 'LessThan', 'GreaterThan', 'LessThanOrEqual', 'GreaterThanOrEqual', 'BeginsWith', 'EndsWith', 'Regex'. + * + * @param operator the operator value to set + * @return the MatchCondition object itself. + */ + public MatchCondition withOperator(WebApplicationFirewallOperator operator) { + this.operator = operator; + return this; + } + + /** + * Get describes if this is negate condition or not. + * + * @return the negationConditon value + */ + public Boolean negationConditon() { + return this.negationConditon; + } + + /** + * Set describes if this is negate condition or not. + * + * @param negationConditon the negationConditon value to set + * @return the MatchCondition object itself. + */ + public MatchCondition withNegationConditon(Boolean negationConditon) { + this.negationConditon = negationConditon; + return this; + } + + /** + * Get match value. + * + * @return the matchValues value + */ + public List matchValues() { + return this.matchValues; + } + + /** + * Set match value. + * + * @param matchValues the matchValues value to set + * @return the MatchCondition object itself. + */ + public MatchCondition withMatchValues(List matchValues) { + this.matchValues = matchValues; + return this; + } + + /** + * Get list of transforms. + * + * @return the transforms value + */ + public List transforms() { + return this.transforms; + } + + /** + * Set list of transforms. + * + * @param transforms the transforms value to set + * @return the MatchCondition object itself. + */ + public MatchCondition withTransforms(List transforms) { + this.transforms = transforms; + return this; + } + +} diff --git a/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/MatchVariable.java b/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/MatchVariable.java new file mode 100644 index 000000000000..c705fd4a3816 --- /dev/null +++ b/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/MatchVariable.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_12_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Define match variables. + */ +public class MatchVariable { + /** + * Match Variable. Possible values include: 'RemoteAddr', 'RequestMethod', + * 'QueryString', 'PostArgs', 'RequestUri', 'RequestHeaders', + * 'RequestBody', 'RequestCookies'. + */ + @JsonProperty(value = "variableName", required = true) + private WebApplicationFirewallMatchVariable variableName; + + /** + * Describes field of the matchVariable collection. + */ + @JsonProperty(value = "selector") + private String selector; + + /** + * Get match Variable. Possible values include: 'RemoteAddr', 'RequestMethod', 'QueryString', 'PostArgs', 'RequestUri', 'RequestHeaders', 'RequestBody', 'RequestCookies'. + * + * @return the variableName value + */ + public WebApplicationFirewallMatchVariable variableName() { + return this.variableName; + } + + /** + * Set match Variable. Possible values include: 'RemoteAddr', 'RequestMethod', 'QueryString', 'PostArgs', 'RequestUri', 'RequestHeaders', 'RequestBody', 'RequestCookies'. + * + * @param variableName the variableName value to set + * @return the MatchVariable object itself. + */ + public MatchVariable withVariableName(WebApplicationFirewallMatchVariable variableName) { + this.variableName = variableName; + return this; + } + + /** + * Get describes field of the matchVariable collection. + * + * @return the selector value + */ + public String selector() { + return this.selector; + } + + /** + * Set describes field of the matchVariable collection. + * + * @param selector the selector value to set + * @return the MatchVariable object itself. + */ + public MatchVariable withSelector(String selector) { + this.selector = selector; + return this; + } + +} diff --git a/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/PolicySettings.java b/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/PolicySettings.java new file mode 100644 index 000000000000..894b939b5e90 --- /dev/null +++ b/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/PolicySettings.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_12_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines contents of a web application firewall global configuration. + */ +public class PolicySettings { + /** + * Describes if the policy is in enabled state or disabled state. Possible + * values include: 'Disabled', 'Enabled'. + */ + @JsonProperty(value = "enabledState") + private WebApplicationFirewallEnabledState enabledState; + + /** + * Describes if it is in detection mode or prevention mode at policy + * level. Possible values include: 'Prevention', 'Detection'. + */ + @JsonProperty(value = "mode") + private WebApplicationFirewallMode mode; + + /** + * Get describes if the policy is in enabled state or disabled state. Possible values include: 'Disabled', 'Enabled'. + * + * @return the enabledState value + */ + public WebApplicationFirewallEnabledState enabledState() { + return this.enabledState; + } + + /** + * Set describes if the policy is in enabled state or disabled state. Possible values include: 'Disabled', 'Enabled'. + * + * @param enabledState the enabledState value to set + * @return the PolicySettings object itself. + */ + public PolicySettings withEnabledState(WebApplicationFirewallEnabledState enabledState) { + this.enabledState = enabledState; + return this; + } + + /** + * Get describes if it is in detection mode or prevention mode at policy level. Possible values include: 'Prevention', 'Detection'. + * + * @return the mode value + */ + public WebApplicationFirewallMode mode() { + return this.mode; + } + + /** + * Set describes if it is in detection mode or prevention mode at policy level. Possible values include: 'Prevention', 'Detection'. + * + * @param mode the mode value to set + * @return the PolicySettings object itself. + */ + public PolicySettings withMode(WebApplicationFirewallMode mode) { + this.mode = mode; + return this; + } + +} diff --git a/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/WebApplicationFirewallAction.java b/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/WebApplicationFirewallAction.java new file mode 100644 index 000000000000..f170582acf3e --- /dev/null +++ b/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/WebApplicationFirewallAction.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_12_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for WebApplicationFirewallAction. + */ +public final class WebApplicationFirewallAction extends ExpandableStringEnum { + /** Static value Allow for WebApplicationFirewallAction. */ + public static final WebApplicationFirewallAction ALLOW = fromString("Allow"); + + /** Static value Block for WebApplicationFirewallAction. */ + public static final WebApplicationFirewallAction BLOCK = fromString("Block"); + + /** Static value Log for WebApplicationFirewallAction. */ + public static final WebApplicationFirewallAction LOG = fromString("Log"); + + /** + * Creates or finds a WebApplicationFirewallAction from its string representation. + * @param name a name to look for + * @return the corresponding WebApplicationFirewallAction + */ + @JsonCreator + public static WebApplicationFirewallAction fromString(String name) { + return fromString(name, WebApplicationFirewallAction.class); + } + + /** + * @return known WebApplicationFirewallAction values + */ + public static Collection values() { + return values(WebApplicationFirewallAction.class); + } +} diff --git a/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/WebApplicationFirewallCustomRule.java b/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/WebApplicationFirewallCustomRule.java new file mode 100644 index 000000000000..807974383b06 --- /dev/null +++ b/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/WebApplicationFirewallCustomRule.java @@ -0,0 +1,166 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_12_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines contents of a web application rule. + */ +public class WebApplicationFirewallCustomRule { + /** + * Gets name of the resource that is unique within a policy. 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; + + /** + * Describes priority of the rule. Rules with a lower value will be + * evaluated before rules with a higher value. + */ + @JsonProperty(value = "priority", required = true) + private int priority; + + /** + * Describes type of rule. Possible values include: 'MatchRule', 'Invalid'. + */ + @JsonProperty(value = "ruleType", required = true) + private WebApplicationFirewallRuleType ruleType; + + /** + * List of match conditions. + */ + @JsonProperty(value = "matchConditions", required = true) + private List matchConditions; + + /** + * Type of Actions. Possible values include: 'Allow', 'Block', 'Log'. + */ + @JsonProperty(value = "action", required = true) + private WebApplicationFirewallAction action; + + /** + * Get gets name of the resource that is unique within a policy. 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 policy. This name can be used to access the resource. + * + * @param name the name value to set + * @return the WebApplicationFirewallCustomRule object itself. + */ + public WebApplicationFirewallCustomRule 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; + } + + /** + * Get describes priority of the rule. Rules with a lower value will be evaluated before rules with a higher value. + * + * @return the priority value + */ + public int priority() { + return this.priority; + } + + /** + * Set describes priority of the rule. Rules with a lower value will be evaluated before rules with a higher value. + * + * @param priority the priority value to set + * @return the WebApplicationFirewallCustomRule object itself. + */ + public WebApplicationFirewallCustomRule withPriority(int priority) { + this.priority = priority; + return this; + } + + /** + * Get describes type of rule. Possible values include: 'MatchRule', 'Invalid'. + * + * @return the ruleType value + */ + public WebApplicationFirewallRuleType ruleType() { + return this.ruleType; + } + + /** + * Set describes type of rule. Possible values include: 'MatchRule', 'Invalid'. + * + * @param ruleType the ruleType value to set + * @return the WebApplicationFirewallCustomRule object itself. + */ + public WebApplicationFirewallCustomRule withRuleType(WebApplicationFirewallRuleType ruleType) { + this.ruleType = ruleType; + return this; + } + + /** + * Get list of match conditions. + * + * @return the matchConditions value + */ + public List matchConditions() { + return this.matchConditions; + } + + /** + * Set list of match conditions. + * + * @param matchConditions the matchConditions value to set + * @return the WebApplicationFirewallCustomRule object itself. + */ + public WebApplicationFirewallCustomRule withMatchConditions(List matchConditions) { + this.matchConditions = matchConditions; + return this; + } + + /** + * Get type of Actions. Possible values include: 'Allow', 'Block', 'Log'. + * + * @return the action value + */ + public WebApplicationFirewallAction action() { + return this.action; + } + + /** + * Set type of Actions. Possible values include: 'Allow', 'Block', 'Log'. + * + * @param action the action value to set + * @return the WebApplicationFirewallCustomRule object itself. + */ + public WebApplicationFirewallCustomRule withAction(WebApplicationFirewallAction action) { + this.action = action; + return this; + } + +} diff --git a/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/WebApplicationFirewallEnabledState.java b/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/WebApplicationFirewallEnabledState.java new file mode 100644 index 000000000000..5c8f4940a6e9 --- /dev/null +++ b/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/WebApplicationFirewallEnabledState.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_12_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for WebApplicationFirewallEnabledState. + */ +public final class WebApplicationFirewallEnabledState extends ExpandableStringEnum { + /** Static value Disabled for WebApplicationFirewallEnabledState. */ + public static final WebApplicationFirewallEnabledState DISABLED = fromString("Disabled"); + + /** Static value Enabled for WebApplicationFirewallEnabledState. */ + public static final WebApplicationFirewallEnabledState ENABLED = fromString("Enabled"); + + /** + * Creates or finds a WebApplicationFirewallEnabledState from its string representation. + * @param name a name to look for + * @return the corresponding WebApplicationFirewallEnabledState + */ + @JsonCreator + public static WebApplicationFirewallEnabledState fromString(String name) { + return fromString(name, WebApplicationFirewallEnabledState.class); + } + + /** + * @return known WebApplicationFirewallEnabledState values + */ + public static Collection values() { + return values(WebApplicationFirewallEnabledState.class); + } +} diff --git a/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/WebApplicationFirewallMatchVariable.java b/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/WebApplicationFirewallMatchVariable.java new file mode 100644 index 000000000000..c769bc2e7b31 --- /dev/null +++ b/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/WebApplicationFirewallMatchVariable.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_12_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for WebApplicationFirewallMatchVariable. + */ +public final class WebApplicationFirewallMatchVariable extends ExpandableStringEnum { + /** Static value RemoteAddr for WebApplicationFirewallMatchVariable. */ + public static final WebApplicationFirewallMatchVariable REMOTE_ADDR = fromString("RemoteAddr"); + + /** Static value RequestMethod for WebApplicationFirewallMatchVariable. */ + public static final WebApplicationFirewallMatchVariable REQUEST_METHOD = fromString("RequestMethod"); + + /** Static value QueryString for WebApplicationFirewallMatchVariable. */ + public static final WebApplicationFirewallMatchVariable QUERY_STRING = fromString("QueryString"); + + /** Static value PostArgs for WebApplicationFirewallMatchVariable. */ + public static final WebApplicationFirewallMatchVariable POST_ARGS = fromString("PostArgs"); + + /** Static value RequestUri for WebApplicationFirewallMatchVariable. */ + public static final WebApplicationFirewallMatchVariable REQUEST_URI = fromString("RequestUri"); + + /** Static value RequestHeaders for WebApplicationFirewallMatchVariable. */ + public static final WebApplicationFirewallMatchVariable REQUEST_HEADERS = fromString("RequestHeaders"); + + /** Static value RequestBody for WebApplicationFirewallMatchVariable. */ + public static final WebApplicationFirewallMatchVariable REQUEST_BODY = fromString("RequestBody"); + + /** Static value RequestCookies for WebApplicationFirewallMatchVariable. */ + public static final WebApplicationFirewallMatchVariable REQUEST_COOKIES = fromString("RequestCookies"); + + /** + * Creates or finds a WebApplicationFirewallMatchVariable from its string representation. + * @param name a name to look for + * @return the corresponding WebApplicationFirewallMatchVariable + */ + @JsonCreator + public static WebApplicationFirewallMatchVariable fromString(String name) { + return fromString(name, WebApplicationFirewallMatchVariable.class); + } + + /** + * @return known WebApplicationFirewallMatchVariable values + */ + public static Collection values() { + return values(WebApplicationFirewallMatchVariable.class); + } +} diff --git a/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/WebApplicationFirewallMode.java b/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/WebApplicationFirewallMode.java new file mode 100644 index 000000000000..1ddf51d1f233 --- /dev/null +++ b/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/WebApplicationFirewallMode.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_12_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for WebApplicationFirewallMode. + */ +public final class WebApplicationFirewallMode extends ExpandableStringEnum { + /** Static value Prevention for WebApplicationFirewallMode. */ + public static final WebApplicationFirewallMode PREVENTION = fromString("Prevention"); + + /** Static value Detection for WebApplicationFirewallMode. */ + public static final WebApplicationFirewallMode DETECTION = fromString("Detection"); + + /** + * Creates or finds a WebApplicationFirewallMode from its string representation. + * @param name a name to look for + * @return the corresponding WebApplicationFirewallMode + */ + @JsonCreator + public static WebApplicationFirewallMode fromString(String name) { + return fromString(name, WebApplicationFirewallMode.class); + } + + /** + * @return known WebApplicationFirewallMode values + */ + public static Collection values() { + return values(WebApplicationFirewallMode.class); + } +} diff --git a/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/WebApplicationFirewallOperator.java b/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/WebApplicationFirewallOperator.java new file mode 100644 index 000000000000..061d3ea80a28 --- /dev/null +++ b/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/WebApplicationFirewallOperator.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_12_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for WebApplicationFirewallOperator. + */ +public final class WebApplicationFirewallOperator extends ExpandableStringEnum { + /** Static value IPMatch for WebApplicationFirewallOperator. */ + public static final WebApplicationFirewallOperator IPMATCH = fromString("IPMatch"); + + /** Static value Equal for WebApplicationFirewallOperator. */ + public static final WebApplicationFirewallOperator EQUAL = fromString("Equal"); + + /** Static value Contains for WebApplicationFirewallOperator. */ + public static final WebApplicationFirewallOperator CONTAINS = fromString("Contains"); + + /** Static value LessThan for WebApplicationFirewallOperator. */ + public static final WebApplicationFirewallOperator LESS_THAN = fromString("LessThan"); + + /** Static value GreaterThan for WebApplicationFirewallOperator. */ + public static final WebApplicationFirewallOperator GREATER_THAN = fromString("GreaterThan"); + + /** Static value LessThanOrEqual for WebApplicationFirewallOperator. */ + public static final WebApplicationFirewallOperator LESS_THAN_OR_EQUAL = fromString("LessThanOrEqual"); + + /** Static value GreaterThanOrEqual for WebApplicationFirewallOperator. */ + public static final WebApplicationFirewallOperator GREATER_THAN_OR_EQUAL = fromString("GreaterThanOrEqual"); + + /** Static value BeginsWith for WebApplicationFirewallOperator. */ + public static final WebApplicationFirewallOperator BEGINS_WITH = fromString("BeginsWith"); + + /** Static value EndsWith for WebApplicationFirewallOperator. */ + public static final WebApplicationFirewallOperator ENDS_WITH = fromString("EndsWith"); + + /** Static value Regex for WebApplicationFirewallOperator. */ + public static final WebApplicationFirewallOperator REGEX = fromString("Regex"); + + /** + * Creates or finds a WebApplicationFirewallOperator from its string representation. + * @param name a name to look for + * @return the corresponding WebApplicationFirewallOperator + */ + @JsonCreator + public static WebApplicationFirewallOperator fromString(String name) { + return fromString(name, WebApplicationFirewallOperator.class); + } + + /** + * @return known WebApplicationFirewallOperator values + */ + public static Collection values() { + return values(WebApplicationFirewallOperator.class); + } +} diff --git a/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/WebApplicationFirewallPolicies.java b/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/WebApplicationFirewallPolicies.java new file mode 100644 index 000000000000..e9820395f0ce --- /dev/null +++ b/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/WebApplicationFirewallPolicies.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_12_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_12_01.implementation.WebApplicationFirewallPoliciesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing WebApplicationFirewallPolicies. + */ +public interface WebApplicationFirewallPolicies extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/WebApplicationFirewallPolicy.java b/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/WebApplicationFirewallPolicy.java new file mode 100644 index 000000000000..41c500579c2f --- /dev/null +++ b/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/WebApplicationFirewallPolicy.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_12_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.network.v2018_12_01.implementation.NetworkManager; +import java.util.List; +import com.microsoft.azure.management.network.v2018_12_01.implementation.WebApplicationFirewallPolicyInner; + +/** + * Type representing WebApplicationFirewallPolicy. + */ +public interface WebApplicationFirewallPolicy extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the applicationGateways value. + */ + List applicationGateways(); + + /** + * @return the customRules value. + */ + List customRules(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the policySettings value. + */ + PolicySettings policySettings(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceState value. + */ + WebApplicationFirewallPolicyResourceState resourceState(); + + /** + * The entirety of the WebApplicationFirewallPolicy definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of WebApplicationFirewallPolicy definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a WebApplicationFirewallPolicy definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the WebApplicationFirewallPolicy definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the webapplicationfirewallpolicy definition allowing to specify CustomRules. + */ + interface WithCustomRules { + /** + * Specifies customRules. + * @param customRules Describes custom rules inside the policy + * @return the next definition stage + */ + WithCreate withCustomRules(List customRules); + } + + /** + * The stage of the webapplicationfirewallpolicy definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag Gets a unique read-only string that changes whenever the resource is updated + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the webapplicationfirewallpolicy definition allowing to specify PolicySettings. + */ + interface WithPolicySettings { + /** + * Specifies policySettings. + * @param policySettings Describes policySettings for policy + * @return the next definition stage + */ + WithCreate withPolicySettings(PolicySettings policySettings); + } + + /** + * 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.WithCustomRules, DefinitionStages.WithEtag, DefinitionStages.WithPolicySettings { + } + } + /** + * The template for a WebApplicationFirewallPolicy update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithCustomRules, UpdateStages.WithEtag, UpdateStages.WithPolicySettings { + } + + /** + * Grouping of WebApplicationFirewallPolicy update stages. + */ + interface UpdateStages { + /** + * The stage of the webapplicationfirewallpolicy update allowing to specify CustomRules. + */ + interface WithCustomRules { + /** + * Specifies customRules. + * @param customRules Describes custom rules inside the policy + * @return the next update stage + */ + Update withCustomRules(List customRules); + } + + /** + * The stage of the webapplicationfirewallpolicy update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag Gets a unique read-only string that changes whenever the resource is updated + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the webapplicationfirewallpolicy update allowing to specify PolicySettings. + */ + interface WithPolicySettings { + /** + * Specifies policySettings. + * @param policySettings Describes policySettings for policy + * @return the next update stage + */ + Update withPolicySettings(PolicySettings policySettings); + } + + } +} diff --git a/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/WebApplicationFirewallPolicyResourceState.java b/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/WebApplicationFirewallPolicyResourceState.java new file mode 100644 index 000000000000..cd5f9b4c598b --- /dev/null +++ b/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/WebApplicationFirewallPolicyResourceState.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_12_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for WebApplicationFirewallPolicyResourceState. + */ +public final class WebApplicationFirewallPolicyResourceState extends ExpandableStringEnum { + /** Static value Creating for WebApplicationFirewallPolicyResourceState. */ + public static final WebApplicationFirewallPolicyResourceState CREATING = fromString("Creating"); + + /** Static value Enabling for WebApplicationFirewallPolicyResourceState. */ + public static final WebApplicationFirewallPolicyResourceState ENABLING = fromString("Enabling"); + + /** Static value Enabled for WebApplicationFirewallPolicyResourceState. */ + public static final WebApplicationFirewallPolicyResourceState ENABLED = fromString("Enabled"); + + /** Static value Disabling for WebApplicationFirewallPolicyResourceState. */ + public static final WebApplicationFirewallPolicyResourceState DISABLING = fromString("Disabling"); + + /** Static value Disabled for WebApplicationFirewallPolicyResourceState. */ + public static final WebApplicationFirewallPolicyResourceState DISABLED = fromString("Disabled"); + + /** Static value Deleting for WebApplicationFirewallPolicyResourceState. */ + public static final WebApplicationFirewallPolicyResourceState DELETING = fromString("Deleting"); + + /** + * Creates or finds a WebApplicationFirewallPolicyResourceState from its string representation. + * @param name a name to look for + * @return the corresponding WebApplicationFirewallPolicyResourceState + */ + @JsonCreator + public static WebApplicationFirewallPolicyResourceState fromString(String name) { + return fromString(name, WebApplicationFirewallPolicyResourceState.class); + } + + /** + * @return known WebApplicationFirewallPolicyResourceState values + */ + public static Collection values() { + return values(WebApplicationFirewallPolicyResourceState.class); + } +} diff --git a/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/WebApplicationFirewallRuleType.java b/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/WebApplicationFirewallRuleType.java new file mode 100644 index 000000000000..12603fda03d4 --- /dev/null +++ b/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/WebApplicationFirewallRuleType.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_12_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for WebApplicationFirewallRuleType. + */ +public final class WebApplicationFirewallRuleType extends ExpandableStringEnum { + /** Static value MatchRule for WebApplicationFirewallRuleType. */ + public static final WebApplicationFirewallRuleType MATCH_RULE = fromString("MatchRule"); + + /** Static value Invalid for WebApplicationFirewallRuleType. */ + public static final WebApplicationFirewallRuleType INVALID = fromString("Invalid"); + + /** + * Creates or finds a WebApplicationFirewallRuleType from its string representation. + * @param name a name to look for + * @return the corresponding WebApplicationFirewallRuleType + */ + @JsonCreator + public static WebApplicationFirewallRuleType fromString(String name) { + return fromString(name, WebApplicationFirewallRuleType.class); + } + + /** + * @return known WebApplicationFirewallRuleType values + */ + public static Collection values() { + return values(WebApplicationFirewallRuleType.class); + } +} diff --git a/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/WebApplicationFirewallTransform.java b/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/WebApplicationFirewallTransform.java new file mode 100644 index 000000000000..93f924683114 --- /dev/null +++ b/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/WebApplicationFirewallTransform.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_12_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for WebApplicationFirewallTransform. + */ +public final class WebApplicationFirewallTransform extends ExpandableStringEnum { + /** Static value Lowercase for WebApplicationFirewallTransform. */ + public static final WebApplicationFirewallTransform LOWERCASE = fromString("Lowercase"); + + /** Static value Trim for WebApplicationFirewallTransform. */ + public static final WebApplicationFirewallTransform TRIM = fromString("Trim"); + + /** Static value UrlDecode for WebApplicationFirewallTransform. */ + public static final WebApplicationFirewallTransform URL_DECODE = fromString("UrlDecode"); + + /** Static value UrlEncode for WebApplicationFirewallTransform. */ + public static final WebApplicationFirewallTransform URL_ENCODE = fromString("UrlEncode"); + + /** Static value RemoveNulls for WebApplicationFirewallTransform. */ + public static final WebApplicationFirewallTransform REMOVE_NULLS = fromString("RemoveNulls"); + + /** Static value HtmlEntityDecode for WebApplicationFirewallTransform. */ + public static final WebApplicationFirewallTransform HTML_ENTITY_DECODE = fromString("HtmlEntityDecode"); + + /** + * Creates or finds a WebApplicationFirewallTransform from its string representation. + * @param name a name to look for + * @return the corresponding WebApplicationFirewallTransform + */ + @JsonCreator + public static WebApplicationFirewallTransform fromString(String name) { + return fromString(name, WebApplicationFirewallTransform.class); + } + + /** + * @return known WebApplicationFirewallTransform values + */ + public static Collection values() { + return values(WebApplicationFirewallTransform.class); + } +} diff --git a/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/implementation/ApplicationGatewayImpl.java b/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/implementation/ApplicationGatewayImpl.java index 2cfadfac3d9b..78d3ceacc04e 100644 --- a/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/implementation/ApplicationGatewayImpl.java +++ b/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/implementation/ApplicationGatewayImpl.java @@ -30,6 +30,7 @@ import com.microsoft.azure.management.network.v2018_12_01.ApplicationGatewayRewriteRuleSet; import com.microsoft.azure.management.network.v2018_12_01.ApplicationGatewayRedirectConfiguration; import com.microsoft.azure.management.network.v2018_12_01.ApplicationGatewayWebApplicationFirewallConfiguration; +import com.microsoft.azure.SubResource; import com.microsoft.azure.management.network.v2018_12_01.ApplicationGatewayAutoscaleConfiguration; import com.microsoft.azure.management.network.v2018_12_01.ApplicationGatewayCustomError; import com.microsoft.azure.management.network.v2018_12_01.ManagedServiceIdentity; @@ -105,6 +106,11 @@ public String etag() { return this.inner().etag(); } + @Override + public SubResource firewallPolicy() { + return this.inner().firewallPolicy(); + } + @Override public List frontendIPConfigurations() { return this.inner().frontendIPConfigurations(); @@ -248,6 +254,12 @@ public ApplicationGatewayImpl withEtag(String etag) { return this; } + @Override + public ApplicationGatewayImpl withFirewallPolicy(SubResource firewallPolicy) { + this.inner().withFirewallPolicy(firewallPolicy); + return this; + } + @Override public ApplicationGatewayImpl withFrontendIPConfigurations(List frontendIPConfigurations) { this.inner().withFrontendIPConfigurations(frontendIPConfigurations); diff --git a/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/implementation/ApplicationGatewayInner.java b/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/implementation/ApplicationGatewayInner.java index 6139b88ddbd8..c1e85876d36b 100644 --- a/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/implementation/ApplicationGatewayInner.java +++ b/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/implementation/ApplicationGatewayInner.java @@ -27,6 +27,7 @@ import com.microsoft.azure.management.network.v2018_12_01.ApplicationGatewayRewriteRuleSet; import com.microsoft.azure.management.network.v2018_12_01.ApplicationGatewayRedirectConfiguration; import com.microsoft.azure.management.network.v2018_12_01.ApplicationGatewayWebApplicationFirewallConfiguration; +import com.microsoft.azure.SubResource; import com.microsoft.azure.management.network.v2018_12_01.ApplicationGatewayAutoscaleConfiguration; import com.microsoft.azure.management.network.v2018_12_01.ApplicationGatewayCustomError; import com.microsoft.azure.management.network.v2018_12_01.ManagedServiceIdentity; @@ -61,37 +62,49 @@ public class ApplicationGatewayInner extends Resource { private ApplicationGatewayOperationalState operationalState; /** - * Subnets of application the gateway resource. + * Subnets of the application gateway resource. For default limits, see + * [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). */ @JsonProperty(value = "properties.gatewayIPConfigurations") private List gatewayIPConfigurations; /** - * Authentication certificates of the application gateway resource. + * Authentication certificates of the application gateway resource. For + * default limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). */ @JsonProperty(value = "properties.authenticationCertificates") private List authenticationCertificates; /** - * Trusted Root certificates of the application gateway resource. + * Trusted Root certificates of the application gateway resource. For + * default limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). */ @JsonProperty(value = "properties.trustedRootCertificates") private List trustedRootCertificates; /** - * SSL certificates of the application gateway resource. + * SSL certificates of the application gateway resource. For default + * limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). */ @JsonProperty(value = "properties.sslCertificates") private List sslCertificates; /** - * Frontend IP addresses of the application gateway resource. + * Frontend IP addresses of the application gateway resource. For default + * limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). */ @JsonProperty(value = "properties.frontendIPConfigurations") private List frontendIPConfigurations; /** - * Frontend ports of the application gateway resource. + * Frontend ports of the application gateway resource. For default limits, + * see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). */ @JsonProperty(value = "properties.frontendPorts") private List frontendPorts; @@ -103,25 +116,33 @@ public class ApplicationGatewayInner extends Resource { private List probes; /** - * Backend address pool of the application gateway resource. + * Backend address pool of the application gateway resource. For default + * limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). */ @JsonProperty(value = "properties.backendAddressPools") private List backendAddressPools; /** - * Backend http settings of the application gateway resource. + * Backend http settings of the application gateway resource. For default + * limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). */ @JsonProperty(value = "properties.backendHttpSettingsCollection") private List backendHttpSettingsCollection; /** - * Http listeners of the application gateway resource. + * Http listeners of the application gateway resource. For default limits, + * see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). */ @JsonProperty(value = "properties.httpListeners") private List httpListeners; /** - * URL path map of the application gateway resource. + * URL path map of the application gateway resource. For default limits, + * see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). */ @JsonProperty(value = "properties.urlPathMaps") private List urlPathMaps; @@ -139,7 +160,9 @@ public class ApplicationGatewayInner extends Resource { private List rewriteRuleSets; /** - * Redirect configurations of the application gateway resource. + * Redirect configurations of the application gateway resource. For default + * limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). */ @JsonProperty(value = "properties.redirectConfigurations") private List redirectConfigurations; @@ -150,6 +173,12 @@ public class ApplicationGatewayInner extends Resource { @JsonProperty(value = "properties.webApplicationFirewallConfiguration") private ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration; + /** + * Reference of the FirewallPolicy resource. + */ + @JsonProperty(value = "properties.firewallPolicy") + private SubResource firewallPolicy; + /** * Whether HTTP2 is enabled on the application gateway resource. */ @@ -262,7 +291,7 @@ public ApplicationGatewayOperationalState operationalState() { } /** - * Get subnets of application the gateway resource. + * Get subnets of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). * * @return the gatewayIPConfigurations value */ @@ -271,7 +300,7 @@ public List gatewayIPConfigurations() { } /** - * Set subnets of application the gateway resource. + * Set subnets of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). * * @param gatewayIPConfigurations the gatewayIPConfigurations value to set * @return the ApplicationGatewayInner object itself. @@ -282,7 +311,7 @@ public ApplicationGatewayInner withGatewayIPConfigurations(List authenticationCertifica } /** - * Set authentication certificates of the application gateway resource. + * Set authentication certificates of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). * * @param authenticationCertificates the authenticationCertificates value to set * @return the ApplicationGatewayInner object itself. @@ -302,7 +331,7 @@ public ApplicationGatewayInner withAuthenticationCertificates(List trustedRootCertificates() } /** - * Set trusted Root certificates of the application gateway resource. + * Set trusted Root certificates of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). * * @param trustedRootCertificates the trustedRootCertificates value to set * @return the ApplicationGatewayInner object itself. @@ -322,7 +351,7 @@ public ApplicationGatewayInner withTrustedRootCertificates(List sslCertificates() { } /** - * Set sSL certificates of the application gateway resource. + * Set sSL certificates of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). * * @param sslCertificates the sslCertificates value to set * @return the ApplicationGatewayInner object itself. @@ -342,7 +371,7 @@ public ApplicationGatewayInner withSslCertificates(List frontendIPConfigurations( } /** - * Set frontend IP addresses of the application gateway resource. + * Set frontend IP addresses of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). * * @param frontendIPConfigurations the frontendIPConfigurations value to set * @return the ApplicationGatewayInner object itself. @@ -362,7 +391,7 @@ public ApplicationGatewayInner withFrontendIPConfigurations(List frontendPorts() { } /** - * Set frontend ports of the application gateway resource. + * Set frontend ports of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). * * @param frontendPorts the frontendPorts value to set * @return the ApplicationGatewayInner object itself. @@ -402,7 +431,7 @@ public ApplicationGatewayInner withProbes(List probes) } /** - * Get backend address pool of the application gateway resource. + * Get backend address pool of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). * * @return the backendAddressPools value */ @@ -411,7 +440,7 @@ public List backendAddressPools() { } /** - * Set backend address pool of the application gateway resource. + * Set backend address pool of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). * * @param backendAddressPools the backendAddressPools value to set * @return the ApplicationGatewayInner object itself. @@ -422,7 +451,7 @@ public ApplicationGatewayInner withBackendAddressPools(List backendHttpSettingsCollection } /** - * Set backend http settings of the application gateway resource. + * Set backend http settings of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). * * @param backendHttpSettingsCollection the backendHttpSettingsCollection value to set * @return the ApplicationGatewayInner object itself. @@ -442,7 +471,7 @@ public ApplicationGatewayInner withBackendHttpSettingsCollection(List httpListeners() { } /** - * Set http listeners of the application gateway resource. + * Set http listeners of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). * * @param httpListeners the httpListeners value to set * @return the ApplicationGatewayInner object itself. @@ -462,7 +491,7 @@ public ApplicationGatewayInner withHttpListeners(List urlPathMaps() { } /** - * Set uRL path map of the application gateway resource. + * Set uRL path map of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). * * @param urlPathMaps the urlPathMaps value to set * @return the ApplicationGatewayInner object itself. @@ -522,7 +551,7 @@ public ApplicationGatewayInner withRewriteRuleSets(List redirectConfigurations() { } /** - * Set redirect configurations of the application gateway resource. + * Set redirect configurations of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). * * @param redirectConfigurations the redirectConfigurations value to set * @return the ApplicationGatewayInner object itself. @@ -561,6 +590,26 @@ public ApplicationGatewayInner withWebApplicationFirewallConfiguration(Applicati return this; } + /** + * Get reference of the FirewallPolicy resource. + * + * @return the firewallPolicy value + */ + public SubResource firewallPolicy() { + return this.firewallPolicy; + } + + /** + * Set reference of the FirewallPolicy resource. + * + * @param firewallPolicy the firewallPolicy value to set + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withFirewallPolicy(SubResource firewallPolicy) { + this.firewallPolicy = firewallPolicy; + return this; + } + /** * Get whether HTTP2 is enabled on the application gateway resource. * diff --git a/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/implementation/DdosProtectionPlansInner.java b/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/implementation/DdosProtectionPlansInner.java index fa8cbabdda06..2ffe2a80c890 100644 --- a/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/implementation/DdosProtectionPlansInner.java +++ b/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/implementation/DdosProtectionPlansInner.java @@ -16,6 +16,7 @@ import com.microsoft.azure.AzureServiceFuture; import com.microsoft.azure.CloudException; import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2018_12_01.TagsObject; import com.microsoft.azure.Page; import com.microsoft.azure.PagedList; import com.microsoft.rest.ServiceCallback; @@ -24,12 +25,14 @@ 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; @@ -84,6 +87,10 @@ interface DdosProtectionPlansService { @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_12_01.DdosProtectionPlans update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("ddosProtectionPlanName") String ddosProtectionPlanName, @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_12_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); @@ -505,6 +512,177 @@ private ServiceResponse beginCreateOrUpdateDelegate(Res .build(response); } + /** + * Update a 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 update(String resourceGroupName, String ddosProtectionPlanName) { + return updateWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName).toBlocking().single().body(); + } + + /** + * Update a 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 updateAsync(String resourceGroupName, String ddosProtectionPlanName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName), serviceCallback); + } + + /** + * Update a 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 updateAsync(String resourceGroupName, String ddosProtectionPlanName) { + return updateWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName).map(new Func1, DdosProtectionPlanInner>() { + @Override + public DdosProtectionPlanInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a 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> updateWithServiceResponseAsync(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-12-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.update(resourceGroupName, ddosProtectionPlanName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Update a DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @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 DdosProtectionPlanInner object if successful. + */ + public DdosProtectionPlanInner update(String resourceGroupName, String ddosProtectionPlanName, Map tags) { + return updateWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName, tags).toBlocking().single().body(); + } + + /** + * Update a DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String ddosProtectionPlanName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName, tags), serviceCallback); + } + + /** + * Update a DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DdosProtectionPlanInner object + */ + public Observable updateAsync(String resourceGroupName, String ddosProtectionPlanName, Map tags) { + return updateWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName, tags).map(new Func1, DdosProtectionPlanInner>() { + @Override + public DdosProtectionPlanInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DdosProtectionPlanInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String ddosProtectionPlanName, Map tags) { + 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."); + } + Validator.validate(tags); + final String apiVersion = "2018-12-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.update(resourceGroupName, ddosProtectionPlanName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + /** * Gets all DDoS protection plans in a subscription. * diff --git a/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/implementation/NetworkManagementClientImpl.java b/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/implementation/NetworkManagementClientImpl.java index 8f55b1a978d6..1706caadf53a 100644 --- a/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/implementation/NetworkManagementClientImpl.java +++ b/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/implementation/NetworkManagementClientImpl.java @@ -1035,6 +1035,19 @@ public P2sVpnGatewaysInner p2sVpnGateways() { return this.p2sVpnGateways; } + /** + * The WebApplicationFirewallPoliciesInner object to access its operations. + */ + private WebApplicationFirewallPoliciesInner webApplicationFirewallPolicies; + + /** + * Gets the WebApplicationFirewallPoliciesInner object to access its operations. + * @return the WebApplicationFirewallPoliciesInner object. + */ + public WebApplicationFirewallPoliciesInner webApplicationFirewallPolicies() { + return this.webApplicationFirewallPolicies; + } + /** * Initializes an instance of NetworkManagementClient client. * @@ -1138,6 +1151,7 @@ protected void initialize() { this.vpnConnections = new VpnConnectionsInner(restClient().retrofit(), this); this.p2sVpnServerConfigurations = new P2sVpnServerConfigurationsInner(restClient().retrofit(), this); this.p2sVpnGateways = new P2sVpnGatewaysInner(restClient().retrofit(), this); + this.webApplicationFirewallPolicies = new WebApplicationFirewallPoliciesInner(restClient().retrofit(), this); this.azureClient = new AzureClient(this); initializeService(); } diff --git a/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/implementation/NetworkManager.java b/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/implementation/NetworkManager.java index 47c95c164297..f6f9f35c6f8b 100644 --- a/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/implementation/NetworkManager.java +++ b/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/implementation/NetworkManager.java @@ -85,6 +85,7 @@ import com.microsoft.azure.management.network.v2018_12_01.VpnConnections; import com.microsoft.azure.management.network.v2018_12_01.P2sVpnServerConfigurations; import com.microsoft.azure.management.network.v2018_12_01.P2sVpnGateways; +import com.microsoft.azure.management.network.v2018_12_01.WebApplicationFirewallPolicies; import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; import com.microsoft.azure.arm.resources.implementation.ManagerCore; @@ -161,6 +162,7 @@ public final class NetworkManager extends ManagerCore implements WebApplicationFirewallPolicies { + protected WebApplicationFirewallPoliciesImpl(NetworkManager manager) { + super(manager.inner().webApplicationFirewallPolicies(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + WebApplicationFirewallPoliciesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + WebApplicationFirewallPoliciesInner 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) { + WebApplicationFirewallPoliciesInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + WebApplicationFirewallPoliciesInner 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 WebApplicationFirewallPolicy call(WebApplicationFirewallPolicyInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + WebApplicationFirewallPoliciesInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + WebApplicationFirewallPoliciesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public WebApplicationFirewallPolicy call(WebApplicationFirewallPolicyInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public WebApplicationFirewallPolicyImpl define(String name) { + return wrapModel(name); + } + + @Override + protected WebApplicationFirewallPolicyImpl wrapModel(WebApplicationFirewallPolicyInner inner) { + return new WebApplicationFirewallPolicyImpl(inner.name(), inner, manager()); + } + + @Override + protected WebApplicationFirewallPolicyImpl wrapModel(String name) { + return new WebApplicationFirewallPolicyImpl(name, new WebApplicationFirewallPolicyInner(), this.manager()); + } + +} diff --git a/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/implementation/WebApplicationFirewallPoliciesInner.java b/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/implementation/WebApplicationFirewallPoliciesInner.java new file mode 100644 index 000000000000..3594dcd1dfb2 --- /dev/null +++ b/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/implementation/WebApplicationFirewallPoliciesInner.java @@ -0,0 +1,869 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.network.v2018_12_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.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 WebApplicationFirewallPolicies. + */ +public class WebApplicationFirewallPoliciesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private WebApplicationFirewallPoliciesService service; + /** The service client containing this operation class. */ + private NetworkManagementClientImpl client; + + /** + * Initializes an instance of WebApplicationFirewallPoliciesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public WebApplicationFirewallPoliciesInner(Retrofit retrofit, NetworkManagementClientImpl client) { + this.service = retrofit.create(WebApplicationFirewallPoliciesService.class); + this.client = client; + } + + /** + * The interface defining all the services for WebApplicationFirewallPolicies to be + * used by Retrofit to perform actually REST calls. + */ + interface WebApplicationFirewallPoliciesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_12_01.WebApplicationFirewallPolicies listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies") + 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_12_01.WebApplicationFirewallPolicies list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies") + 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_12_01.WebApplicationFirewallPolicies getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/{policyName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("policyName") String policyName, @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_12_01.WebApplicationFirewallPolicies createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/{policyName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("policyName") String policyName, @Path("subscriptionId") String subscriptionId, @Body WebApplicationFirewallPolicyInner 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_12_01.WebApplicationFirewallPolicies delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/{policyName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("policyName") String policyName, @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_12_01.WebApplicationFirewallPolicies beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/{policyName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("policyName") String policyName, @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_12_01.WebApplicationFirewallPolicies 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_12_01.WebApplicationFirewallPolicies listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the protection policies within 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<WebApplicationFirewallPolicyInner> 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 of the protection policies within 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 of the protection policies within 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<WebApplicationFirewallPolicyInner> 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 of the protection policies within 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<WebApplicationFirewallPolicyInner> 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 of the protection policies within a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<WebApplicationFirewallPolicyInner> 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-12-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 WAF policies 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<WebApplicationFirewallPolicyInner> 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 WAF policies 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 WAF policies in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<WebApplicationFirewallPolicyInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the WAF policies in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<WebApplicationFirewallPolicyInner> 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 WAF policies in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<WebApplicationFirewallPolicyInner> 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-12-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); + } + + /** + * Retrieve protection policy with specified name within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the 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 WebApplicationFirewallPolicyInner object if successful. + */ + public WebApplicationFirewallPolicyInner getByResourceGroup(String resourceGroupName, String policyName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, policyName).toBlocking().single().body(); + } + + /** + * Retrieve protection policy with specified name within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the 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 getByResourceGroupAsync(String resourceGroupName, String policyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, policyName), serviceCallback); + } + + /** + * Retrieve protection policy with specified name within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the policy + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WebApplicationFirewallPolicyInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String policyName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, policyName).map(new Func1, WebApplicationFirewallPolicyInner>() { + @Override + public WebApplicationFirewallPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Retrieve protection policy with specified name within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the policy + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WebApplicationFirewallPolicyInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String policyName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (policyName == null) { + throw new IllegalArgumentException("Parameter policyName is required and 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-12-01"; + return service.getByResourceGroup(resourceGroupName, policyName, 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 update policy with specified rule set name within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the policy. + * @param parameters Policy to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WebApplicationFirewallPolicyInner object if successful. + */ + public WebApplicationFirewallPolicyInner createOrUpdate(String resourceGroupName, String policyName, WebApplicationFirewallPolicyInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, policyName, parameters).toBlocking().single().body(); + } + + /** + * Creates or update policy with specified rule set name within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the policy. + * @param parameters Policy to be created. + * @param serviceCallback 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 policyName, WebApplicationFirewallPolicyInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, policyName, parameters), serviceCallback); + } + + /** + * Creates or update policy with specified rule set name within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the policy. + * @param parameters Policy to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WebApplicationFirewallPolicyInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String policyName, WebApplicationFirewallPolicyInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, policyName, parameters).map(new Func1, WebApplicationFirewallPolicyInner>() { + @Override + public WebApplicationFirewallPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or update policy with specified rule set name within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the policy. + * @param parameters Policy to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WebApplicationFirewallPolicyInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String policyName, WebApplicationFirewallPolicyInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (policyName == null) { + throw new IllegalArgumentException("Parameter policyName 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-12-01"; + return service.createOrUpdate(resourceGroupName, policyName, 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); + } + + /** + * Deletes Policy. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the 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 + */ + public void delete(String resourceGroupName, String policyName) { + deleteWithServiceResponseAsync(resourceGroupName, policyName).toBlocking().last().body(); + } + + /** + * Deletes Policy. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the 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 deleteAsync(String resourceGroupName, String policyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, policyName), serviceCallback); + } + + /** + * Deletes Policy. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String policyName) { + return deleteWithServiceResponseAsync(resourceGroupName, policyName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes Policy. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String policyName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (policyName == null) { + throw new IllegalArgumentException("Parameter policyName is required and 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-12-01"; + Observable> observable = service.delete(resourceGroupName, policyName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes Policy. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the 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 + */ + public void beginDelete(String resourceGroupName, String policyName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, policyName).toBlocking().single().body(); + } + + /** + * Deletes Policy. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the 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 beginDeleteAsync(String resourceGroupName, String policyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, policyName), serviceCallback); + } + + /** + * Deletes Policy. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String policyName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, policyName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes Policy. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String policyName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (policyName == null) { + throw new IllegalArgumentException("Parameter policyName is required and 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-12-01"; + return service.beginDelete(resourceGroupName, policyName, 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); + } + + /** + * Lists all of the protection policies within 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<WebApplicationFirewallPolicyInner> 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 of the protection policies within 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 of the protection policies within 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<WebApplicationFirewallPolicyInner> 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 of the protection policies within 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<WebApplicationFirewallPolicyInner> 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 of the protection policies within 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<WebApplicationFirewallPolicyInner> 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 WAF policies 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<WebApplicationFirewallPolicyInner> 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 WAF policies 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 WAF policies 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<WebApplicationFirewallPolicyInner> 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 WAF policies 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<WebApplicationFirewallPolicyInner> 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 WAF policies 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<WebApplicationFirewallPolicyInner> 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_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/implementation/WebApplicationFirewallPolicyImpl.java b/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/implementation/WebApplicationFirewallPolicyImpl.java new file mode 100644 index 000000000000..a7516572602e --- /dev/null +++ b/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/implementation/WebApplicationFirewallPolicyImpl.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_12_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.network.v2018_12_01.WebApplicationFirewallPolicy; +import rx.Observable; +import com.microsoft.azure.management.network.v2018_12_01.PolicySettings; +import java.util.List; +import com.microsoft.azure.management.network.v2018_12_01.WebApplicationFirewallCustomRule; +import com.microsoft.azure.management.network.v2018_12_01.WebApplicationFirewallPolicyResourceState; +import java.util.ArrayList; +import com.microsoft.azure.management.network.v2018_12_01.ApplicationGateway; + +class WebApplicationFirewallPolicyImpl extends GroupableResourceCoreImpl implements WebApplicationFirewallPolicy, WebApplicationFirewallPolicy.Definition, WebApplicationFirewallPolicy.Update { + WebApplicationFirewallPolicyImpl(String name, WebApplicationFirewallPolicyInner inner, NetworkManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + WebApplicationFirewallPoliciesInner client = this.manager().inner().webApplicationFirewallPolicies(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + WebApplicationFirewallPoliciesInner client = this.manager().inner().webApplicationFirewallPolicies(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + WebApplicationFirewallPoliciesInner client = this.manager().inner().webApplicationFirewallPolicies(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public List applicationGateways() { + List lst = new ArrayList(); + if (this.inner().applicationGateways() != null) { + for (ApplicationGatewayInner inner : this.inner().applicationGateways()) { + lst.add( new ApplicationGatewayImpl(inner.name(), inner, manager())); + } + } + return lst; + } + + @Override + public List customRules() { + return this.inner().customRules(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public PolicySettings policySettings() { + return this.inner().policySettings(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public WebApplicationFirewallPolicyResourceState resourceState() { + return this.inner().resourceState(); + } + + @Override + public WebApplicationFirewallPolicyImpl withCustomRules(List customRules) { + this.inner().withCustomRules(customRules); + return this; + } + + @Override + public WebApplicationFirewallPolicyImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public WebApplicationFirewallPolicyImpl withPolicySettings(PolicySettings policySettings) { + this.inner().withPolicySettings(policySettings); + return this; + } + +} diff --git a/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/implementation/WebApplicationFirewallPolicyInner.java b/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/implementation/WebApplicationFirewallPolicyInner.java new file mode 100644 index 000000000000..485a5deb1a0d --- /dev/null +++ b/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/implementation/WebApplicationFirewallPolicyInner.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_12_01.implementation; + +import com.microsoft.azure.management.network.v2018_12_01.PolicySettings; +import java.util.List; +import com.microsoft.azure.management.network.v2018_12_01.WebApplicationFirewallCustomRule; +import com.microsoft.azure.management.network.v2018_12_01.WebApplicationFirewallPolicyResourceState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Defines web application firewall policy. + */ +@JsonFlatten +@SkipParentValidation +public class WebApplicationFirewallPolicyInner extends Resource { + /** + * Describes policySettings for policy. + */ + @JsonProperty(value = "properties.policySettings") + private PolicySettings policySettings; + + /** + * Describes custom rules inside the policy. + */ + @JsonProperty(value = "properties.customRules") + private List customRules; + + /** + * A collection of references to application gateways. + */ + @JsonProperty(value = "properties.applicationGateways", access = JsonProperty.Access.WRITE_ONLY) + private List applicationGateways; + + /** + * Provisioning state of the WebApplicationFirewallPolicy. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Resource status of the policy. + * Possible values include: 'Creating', 'Enabling', 'Enabled', 'Disabling', + * 'Disabled', 'Deleting'. + */ + @JsonProperty(value = "properties.resourceState", access = JsonProperty.Access.WRITE_ONLY) + private WebApplicationFirewallPolicyResourceState resourceState; + + /** + * 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 describes policySettings for policy. + * + * @return the policySettings value + */ + public PolicySettings policySettings() { + return this.policySettings; + } + + /** + * Set describes policySettings for policy. + * + * @param policySettings the policySettings value to set + * @return the WebApplicationFirewallPolicyInner object itself. + */ + public WebApplicationFirewallPolicyInner withPolicySettings(PolicySettings policySettings) { + this.policySettings = policySettings; + return this; + } + + /** + * Get describes custom rules inside the policy. + * + * @return the customRules value + */ + public List customRules() { + return this.customRules; + } + + /** + * Set describes custom rules inside the policy. + * + * @param customRules the customRules value to set + * @return the WebApplicationFirewallPolicyInner object itself. + */ + public WebApplicationFirewallPolicyInner withCustomRules(List customRules) { + this.customRules = customRules; + return this; + } + + /** + * Get a collection of references to application gateways. + * + * @return the applicationGateways value + */ + public List applicationGateways() { + return this.applicationGateways; + } + + /** + * Get provisioning state of the WebApplicationFirewallPolicy. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get possible values include: 'Creating', 'Enabling', 'Enabled', 'Disabling', 'Disabled', 'Deleting'. + * + * @return the resourceState value + */ + public WebApplicationFirewallPolicyResourceState resourceState() { + return this.resourceState; + } + + /** + * 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 WebApplicationFirewallPolicyInner object itself. + */ + public WebApplicationFirewallPolicyInner 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 WebApplicationFirewallPolicyInner object itself. + */ + public WebApplicationFirewallPolicyInner withId(String id) { + this.id = id; + return this; + } + +}