// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.network.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.network.models.ApplicationGatewayAutoscaleConfiguration;
import com.azure.resourcemanager.network.models.ApplicationGatewayBackendAddressPool;
import com.azure.resourcemanager.network.models.ApplicationGatewayBackendHttpSettings;
import com.azure.resourcemanager.network.models.ApplicationGatewayCustomError;
import com.azure.resourcemanager.network.models.ApplicationGatewayFrontendIpConfiguration;
import com.azure.resourcemanager.network.models.ApplicationGatewayFrontendPort;
import com.azure.resourcemanager.network.models.ApplicationGatewayHttpListener;
import com.azure.resourcemanager.network.models.ApplicationGatewayOperationalState;
import com.azure.resourcemanager.network.models.ApplicationGatewayRewriteRuleSet;
import com.azure.resourcemanager.network.models.ApplicationGatewaySku;
import com.azure.resourcemanager.network.models.ApplicationGatewaySslPolicy;
import com.azure.resourcemanager.network.models.ApplicationGatewayTrustedRootCertificate;
import com.azure.resourcemanager.network.models.ApplicationGatewayWebApplicationFirewallConfiguration;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** Properties of the application gateway. */
@Fluent
public final class ApplicationGatewayPropertiesFormat {
    @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayPropertiesFormat.class);

    /*
     * SKU of the application gateway resource.
     */
    @JsonProperty(value = "sku")
    private ApplicationGatewaySku sku;

    /*
     * SSL policy of the application gateway resource.
     */
    @JsonProperty(value = "sslPolicy")
    private ApplicationGatewaySslPolicy sslPolicy;

    /*
     * Operational state of the application gateway resource.
     */
    @JsonProperty(value = "operationalState", access = JsonProperty.Access.WRITE_ONLY)
    private ApplicationGatewayOperationalState operationalState;

    /*
     * Subnets of application the gateway resource.
     */
    @JsonProperty(value = "gatewayIPConfigurations")
    private List<ApplicationGatewayIpConfigurationInner> gatewayIpConfigurations;

    /*
     * Authentication certificates of the application gateway resource.
     */
    @JsonProperty(value = "authenticationCertificates")
    private List<ApplicationGatewayAuthenticationCertificateInner> authenticationCertificates;

    /*
     * Trusted Root certificates of the application gateway resource.
     */
    @JsonProperty(value = "trustedRootCertificates")
    private List<ApplicationGatewayTrustedRootCertificate> trustedRootCertificates;

    /*
     * SSL certificates of the application gateway resource.
     */
    @JsonProperty(value = "sslCertificates")
    private List<ApplicationGatewaySslCertificateInner> sslCertificates;

    /*
     * Frontend IP addresses of the application gateway resource.
     */
    @JsonProperty(value = "frontendIPConfigurations")
    private List<ApplicationGatewayFrontendIpConfiguration> frontendIpConfigurations;

    /*
     * Frontend ports of the application gateway resource.
     */
    @JsonProperty(value = "frontendPorts")
    private List<ApplicationGatewayFrontendPort> frontendPorts;

    /*
     * Probes of the application gateway resource.
     */
    @JsonProperty(value = "probes")
    private List<ApplicationGatewayProbeInner> probes;

    /*
     * Backend address pool of the application gateway resource.
     */
    @JsonProperty(value = "backendAddressPools")
    private List<ApplicationGatewayBackendAddressPool> backendAddressPools;

    /*
     * Backend http settings of the application gateway resource.
     */
    @JsonProperty(value = "backendHttpSettingsCollection")
    private List<ApplicationGatewayBackendHttpSettings> backendHttpSettingsCollection;

    /*
     * Http listeners of the application gateway resource.
     */
    @JsonProperty(value = "httpListeners")
    private List<ApplicationGatewayHttpListener> httpListeners;

    /*
     * URL path map of the application gateway resource.
     */
    @JsonProperty(value = "urlPathMaps")
    private List<ApplicationGatewayUrlPathMapInner> urlPathMaps;

    /*
     * Request routing rules of the application gateway resource.
     */
    @JsonProperty(value = "requestRoutingRules")
    private List<ApplicationGatewayRequestRoutingRuleInner> requestRoutingRules;

    /*
     * Rewrite rules for the application gateway resource.
     */
    @JsonProperty(value = "rewriteRuleSets")
    private List<ApplicationGatewayRewriteRuleSet> rewriteRuleSets;

    /*
     * Redirect configurations of the application gateway resource.
     */
    @JsonProperty(value = "redirectConfigurations")
    private List<ApplicationGatewayRedirectConfigurationInner> redirectConfigurations;

    /*
     * Web application firewall configuration.
     */
    @JsonProperty(value = "webApplicationFirewallConfiguration")
    private ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration;

    /*
     * Whether HTTP2 is enabled on the application gateway resource.
     */
    @JsonProperty(value = "enableHttp2")
    private Boolean enableHttp2;

    /*
     * Whether FIPS is enabled on the application gateway resource.
     */
    @JsonProperty(value = "enableFips")
    private Boolean enableFips;

    /*
     * Autoscale Configuration.
     */
    @JsonProperty(value = "autoscaleConfiguration")
    private ApplicationGatewayAutoscaleConfiguration autoscaleConfiguration;

    /*
     * Resource GUID property of the application gateway resource.
     */
    @JsonProperty(value = "resourceGuid")
    private String resourceGuid;

    /*
     * Provisioning state of the application gateway resource. Possible values
     * are: 'Updating', 'Deleting', and 'Failed'.
     */
    @JsonProperty(value = "provisioningState")
    private String provisioningState;

    /*
     * Custom error configurations of the application gateway resource.
     */
    @JsonProperty(value = "customErrorConfigurations")
    private List<ApplicationGatewayCustomError> customErrorConfigurations;

    /**
     * Get the sku property: SKU of the application gateway resource.
     *
     * @return the sku value.
     */
    public ApplicationGatewaySku sku() {
        return this.sku;
    }

    /**
     * Set the sku property: SKU of the application gateway resource.
     *
     * @param sku the sku value to set.
     * @return the ApplicationGatewayPropertiesFormat object itself.
     */
    public ApplicationGatewayPropertiesFormat withSku(ApplicationGatewaySku sku) {
        this.sku = sku;
        return this;
    }

    /**
     * Get the sslPolicy property: SSL policy of the application gateway resource.
     *
     * @return the sslPolicy value.
     */
    public ApplicationGatewaySslPolicy sslPolicy() {
        return this.sslPolicy;
    }

    /**
     * Set the sslPolicy property: SSL policy of the application gateway resource.
     *
     * @param sslPolicy the sslPolicy value to set.
     * @return the ApplicationGatewayPropertiesFormat object itself.
     */
    public ApplicationGatewayPropertiesFormat withSslPolicy(ApplicationGatewaySslPolicy sslPolicy) {
        this.sslPolicy = sslPolicy;
        return this;
    }

    /**
     * Get the operationalState property: Operational state of the application gateway resource.
     *
     * @return the operationalState value.
     */
    public ApplicationGatewayOperationalState operationalState() {
        return this.operationalState;
    }

    /**
     * Get the gatewayIpConfigurations property: Subnets of application the gateway resource.
     *
     * @return the gatewayIpConfigurations value.
     */
    public List<ApplicationGatewayIpConfigurationInner> gatewayIpConfigurations() {
        return this.gatewayIpConfigurations;
    }

    /**
     * Set the gatewayIpConfigurations property: Subnets of application the gateway resource.
     *
     * @param gatewayIpConfigurations the gatewayIpConfigurations value to set.
     * @return the ApplicationGatewayPropertiesFormat object itself.
     */
    public ApplicationGatewayPropertiesFormat withGatewayIpConfigurations(
        List<ApplicationGatewayIpConfigurationInner> gatewayIpConfigurations) {
        this.gatewayIpConfigurations = gatewayIpConfigurations;
        return this;
    }

    /**
     * Get the authenticationCertificates property: Authentication certificates of the application gateway resource.
     *
     * @return the authenticationCertificates value.
     */
    public List<ApplicationGatewayAuthenticationCertificateInner> authenticationCertificates() {
        return this.authenticationCertificates;
    }

    /**
     * Set the authenticationCertificates property: Authentication certificates of the application gateway resource.
     *
     * @param authenticationCertificates the authenticationCertificates value to set.
     * @return the ApplicationGatewayPropertiesFormat object itself.
     */
    public ApplicationGatewayPropertiesFormat withAuthenticationCertificates(
        List<ApplicationGatewayAuthenticationCertificateInner> authenticationCertificates) {
        this.authenticationCertificates = authenticationCertificates;
        return this;
    }

    /**
     * Get the trustedRootCertificates property: Trusted Root certificates of the application gateway resource.
     *
     * @return the trustedRootCertificates value.
     */
    public List<ApplicationGatewayTrustedRootCertificate> trustedRootCertificates() {
        return this.trustedRootCertificates;
    }

    /**
     * Set the trustedRootCertificates property: Trusted Root certificates of the application gateway resource.
     *
     * @param trustedRootCertificates the trustedRootCertificates value to set.
     * @return the ApplicationGatewayPropertiesFormat object itself.
     */
    public ApplicationGatewayPropertiesFormat withTrustedRootCertificates(
        List<ApplicationGatewayTrustedRootCertificate> trustedRootCertificates) {
        this.trustedRootCertificates = trustedRootCertificates;
        return this;
    }

    /**
     * Get the sslCertificates property: SSL certificates of the application gateway resource.
     *
     * @return the sslCertificates value.
     */
    public List<ApplicationGatewaySslCertificateInner> sslCertificates() {
        return this.sslCertificates;
    }

    /**
     * Set the sslCertificates property: SSL certificates of the application gateway resource.
     *
     * @param sslCertificates the sslCertificates value to set.
     * @return the ApplicationGatewayPropertiesFormat object itself.
     */
    public ApplicationGatewayPropertiesFormat withSslCertificates(
        List<ApplicationGatewaySslCertificateInner> sslCertificates) {
        this.sslCertificates = sslCertificates;
        return this;
    }

    /**
     * Get the frontendIpConfigurations property: Frontend IP addresses of the application gateway resource.
     *
     * @return the frontendIpConfigurations value.
     */
    public List<ApplicationGatewayFrontendIpConfiguration> frontendIpConfigurations() {
        return this.frontendIpConfigurations;
    }

    /**
     * Set the frontendIpConfigurations property: Frontend IP addresses of the application gateway resource.
     *
     * @param frontendIpConfigurations the frontendIpConfigurations value to set.
     * @return the ApplicationGatewayPropertiesFormat object itself.
     */
    public ApplicationGatewayPropertiesFormat withFrontendIpConfigurations(
        List<ApplicationGatewayFrontendIpConfiguration> frontendIpConfigurations) {
        this.frontendIpConfigurations = frontendIpConfigurations;
        return this;
    }

    /**
     * Get the frontendPorts property: Frontend ports of the application gateway resource.
     *
     * @return the frontendPorts value.
     */
    public List<ApplicationGatewayFrontendPort> frontendPorts() {
        return this.frontendPorts;
    }

    /**
     * Set the frontendPorts property: Frontend ports of the application gateway resource.
     *
     * @param frontendPorts the frontendPorts value to set.
     * @return the ApplicationGatewayPropertiesFormat object itself.
     */
    public ApplicationGatewayPropertiesFormat withFrontendPorts(List<ApplicationGatewayFrontendPort> frontendPorts) {
        this.frontendPorts = frontendPorts;
        return this;
    }

    /**
     * Get the probes property: Probes of the application gateway resource.
     *
     * @return the probes value.
     */
    public List<ApplicationGatewayProbeInner> probes() {
        return this.probes;
    }

    /**
     * Set the probes property: Probes of the application gateway resource.
     *
     * @param probes the probes value to set.
     * @return the ApplicationGatewayPropertiesFormat object itself.
     */
    public ApplicationGatewayPropertiesFormat withProbes(List<ApplicationGatewayProbeInner> probes) {
        this.probes = probes;
        return this;
    }

    /**
     * Get the backendAddressPools property: Backend address pool of the application gateway resource.
     *
     * @return the backendAddressPools value.
     */
    public List<ApplicationGatewayBackendAddressPool> backendAddressPools() {
        return this.backendAddressPools;
    }

    /**
     * Set the backendAddressPools property: Backend address pool of the application gateway resource.
     *
     * @param backendAddressPools the backendAddressPools value to set.
     * @return the ApplicationGatewayPropertiesFormat object itself.
     */
    public ApplicationGatewayPropertiesFormat withBackendAddressPools(
        List<ApplicationGatewayBackendAddressPool> backendAddressPools) {
        this.backendAddressPools = backendAddressPools;
        return this;
    }

    /**
     * Get the backendHttpSettingsCollection property: Backend http settings of the application gateway resource.
     *
     * @return the backendHttpSettingsCollection value.
     */
    public List<ApplicationGatewayBackendHttpSettings> backendHttpSettingsCollection() {
        return this.backendHttpSettingsCollection;
    }

    /**
     * Set the backendHttpSettingsCollection property: Backend http settings of the application gateway resource.
     *
     * @param backendHttpSettingsCollection the backendHttpSettingsCollection value to set.
     * @return the ApplicationGatewayPropertiesFormat object itself.
     */
    public ApplicationGatewayPropertiesFormat withBackendHttpSettingsCollection(
        List<ApplicationGatewayBackendHttpSettings> backendHttpSettingsCollection) {
        this.backendHttpSettingsCollection = backendHttpSettingsCollection;
        return this;
    }

    /**
     * Get the httpListeners property: Http listeners of the application gateway resource.
     *
     * @return the httpListeners value.
     */
    public List<ApplicationGatewayHttpListener> httpListeners() {
        return this.httpListeners;
    }

    /**
     * Set the httpListeners property: Http listeners of the application gateway resource.
     *
     * @param httpListeners the httpListeners value to set.
     * @return the ApplicationGatewayPropertiesFormat object itself.
     */
    public ApplicationGatewayPropertiesFormat withHttpListeners(List<ApplicationGatewayHttpListener> httpListeners) {
        this.httpListeners = httpListeners;
        return this;
    }

    /**
     * Get the urlPathMaps property: URL path map of the application gateway resource.
     *
     * @return the urlPathMaps value.
     */
    public List<ApplicationGatewayUrlPathMapInner> urlPathMaps() {
        return this.urlPathMaps;
    }

    /**
     * Set the urlPathMaps property: URL path map of the application gateway resource.
     *
     * @param urlPathMaps the urlPathMaps value to set.
     * @return the ApplicationGatewayPropertiesFormat object itself.
     */
    public ApplicationGatewayPropertiesFormat withUrlPathMaps(List<ApplicationGatewayUrlPathMapInner> urlPathMaps) {
        this.urlPathMaps = urlPathMaps;
        return this;
    }

    /**
     * Get the requestRoutingRules property: Request routing rules of the application gateway resource.
     *
     * @return the requestRoutingRules value.
     */
    public List<ApplicationGatewayRequestRoutingRuleInner> requestRoutingRules() {
        return this.requestRoutingRules;
    }

    /**
     * Set the requestRoutingRules property: Request routing rules of the application gateway resource.
     *
     * @param requestRoutingRules the requestRoutingRules value to set.
     * @return the ApplicationGatewayPropertiesFormat object itself.
     */
    public ApplicationGatewayPropertiesFormat withRequestRoutingRules(
        List<ApplicationGatewayRequestRoutingRuleInner> requestRoutingRules) {
        this.requestRoutingRules = requestRoutingRules;
        return this;
    }

    /**
     * Get the rewriteRuleSets property: Rewrite rules for the application gateway resource.
     *
     * @return the rewriteRuleSets value.
     */
    public List<ApplicationGatewayRewriteRuleSet> rewriteRuleSets() {
        return this.rewriteRuleSets;
    }

    /**
     * Set the rewriteRuleSets property: Rewrite rules for the application gateway resource.
     *
     * @param rewriteRuleSets the rewriteRuleSets value to set.
     * @return the ApplicationGatewayPropertiesFormat object itself.
     */
    public ApplicationGatewayPropertiesFormat withRewriteRuleSets(
        List<ApplicationGatewayRewriteRuleSet> rewriteRuleSets) {
        this.rewriteRuleSets = rewriteRuleSets;
        return this;
    }

    /**
     * Get the redirectConfigurations property: Redirect configurations of the application gateway resource.
     *
     * @return the redirectConfigurations value.
     */
    public List<ApplicationGatewayRedirectConfigurationInner> redirectConfigurations() {
        return this.redirectConfigurations;
    }

    /**
     * Set the redirectConfigurations property: Redirect configurations of the application gateway resource.
     *
     * @param redirectConfigurations the redirectConfigurations value to set.
     * @return the ApplicationGatewayPropertiesFormat object itself.
     */
    public ApplicationGatewayPropertiesFormat withRedirectConfigurations(
        List<ApplicationGatewayRedirectConfigurationInner> redirectConfigurations) {
        this.redirectConfigurations = redirectConfigurations;
        return this;
    }

    /**
     * Get the webApplicationFirewallConfiguration property: Web application firewall configuration.
     *
     * @return the webApplicationFirewallConfiguration value.
     */
    public ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration() {
        return this.webApplicationFirewallConfiguration;
    }

    /**
     * Set the webApplicationFirewallConfiguration property: Web application firewall configuration.
     *
     * @param webApplicationFirewallConfiguration the webApplicationFirewallConfiguration value to set.
     * @return the ApplicationGatewayPropertiesFormat object itself.
     */
    public ApplicationGatewayPropertiesFormat withWebApplicationFirewallConfiguration(
        ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration) {
        this.webApplicationFirewallConfiguration = webApplicationFirewallConfiguration;
        return this;
    }

    /**
     * Get the enableHttp2 property: Whether HTTP2 is enabled on the application gateway resource.
     *
     * @return the enableHttp2 value.
     */
    public Boolean enableHttp2() {
        return this.enableHttp2;
    }

    /**
     * Set the enableHttp2 property: Whether HTTP2 is enabled on the application gateway resource.
     *
     * @param enableHttp2 the enableHttp2 value to set.
     * @return the ApplicationGatewayPropertiesFormat object itself.
     */
    public ApplicationGatewayPropertiesFormat withEnableHttp2(Boolean enableHttp2) {
        this.enableHttp2 = enableHttp2;
        return this;
    }

    /**
     * Get the enableFips property: Whether FIPS is enabled on the application gateway resource.
     *
     * @return the enableFips value.
     */
    public Boolean enableFips() {
        return this.enableFips;
    }

    /**
     * Set the enableFips property: Whether FIPS is enabled on the application gateway resource.
     *
     * @param enableFips the enableFips value to set.
     * @return the ApplicationGatewayPropertiesFormat object itself.
     */
    public ApplicationGatewayPropertiesFormat withEnableFips(Boolean enableFips) {
        this.enableFips = enableFips;
        return this;
    }

    /**
     * Get the autoscaleConfiguration property: Autoscale Configuration.
     *
     * @return the autoscaleConfiguration value.
     */
    public ApplicationGatewayAutoscaleConfiguration autoscaleConfiguration() {
        return this.autoscaleConfiguration;
    }

    /**
     * Set the autoscaleConfiguration property: Autoscale Configuration.
     *
     * @param autoscaleConfiguration the autoscaleConfiguration value to set.
     * @return the ApplicationGatewayPropertiesFormat object itself.
     */
    public ApplicationGatewayPropertiesFormat withAutoscaleConfiguration(
        ApplicationGatewayAutoscaleConfiguration autoscaleConfiguration) {
        this.autoscaleConfiguration = autoscaleConfiguration;
        return this;
    }

    /**
     * Get the resourceGuid property: Resource GUID property of the application gateway resource.
     *
     * @return the resourceGuid value.
     */
    public String resourceGuid() {
        return this.resourceGuid;
    }

    /**
     * Set the resourceGuid property: Resource GUID property of the application gateway resource.
     *
     * @param resourceGuid the resourceGuid value to set.
     * @return the ApplicationGatewayPropertiesFormat object itself.
     */
    public ApplicationGatewayPropertiesFormat withResourceGuid(String resourceGuid) {
        this.resourceGuid = resourceGuid;
        return this;
    }

    /**
     * Get the provisioningState property: Provisioning state of the application gateway resource. Possible values are:
     * 'Updating', 'Deleting', and 'Failed'.
     *
     * @return the provisioningState value.
     */
    public String provisioningState() {
        return this.provisioningState;
    }

    /**
     * Set the provisioningState property: Provisioning state of the application gateway resource. Possible values are:
     * 'Updating', 'Deleting', and 'Failed'.
     *
     * @param provisioningState the provisioningState value to set.
     * @return the ApplicationGatewayPropertiesFormat object itself.
     */
    public ApplicationGatewayPropertiesFormat withProvisioningState(String provisioningState) {
        this.provisioningState = provisioningState;
        return this;
    }

    /**
     * Get the customErrorConfigurations property: Custom error configurations of the application gateway resource.
     *
     * @return the customErrorConfigurations value.
     */
    public List<ApplicationGatewayCustomError> customErrorConfigurations() {
        return this.customErrorConfigurations;
    }

    /**
     * Set the customErrorConfigurations property: Custom error configurations of the application gateway resource.
     *
     * @param customErrorConfigurations the customErrorConfigurations value to set.
     * @return the ApplicationGatewayPropertiesFormat object itself.
     */
    public ApplicationGatewayPropertiesFormat withCustomErrorConfigurations(
        List<ApplicationGatewayCustomError> customErrorConfigurations) {
        this.customErrorConfigurations = customErrorConfigurations;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (sku() != null) {
            sku().validate();
        }
        if (sslPolicy() != null) {
            sslPolicy().validate();
        }
        if (gatewayIpConfigurations() != null) {
            gatewayIpConfigurations().forEach(e -> e.validate());
        }
        if (authenticationCertificates() != null) {
            authenticationCertificates().forEach(e -> e.validate());
        }
        if (trustedRootCertificates() != null) {
            trustedRootCertificates().forEach(e -> e.validate());
        }
        if (sslCertificates() != null) {
            sslCertificates().forEach(e -> e.validate());
        }
        if (frontendIpConfigurations() != null) {
            frontendIpConfigurations().forEach(e -> e.validate());
        }
        if (frontendPorts() != null) {
            frontendPorts().forEach(e -> e.validate());
        }
        if (probes() != null) {
            probes().forEach(e -> e.validate());
        }
        if (backendAddressPools() != null) {
            backendAddressPools().forEach(e -> e.validate());
        }
        if (backendHttpSettingsCollection() != null) {
            backendHttpSettingsCollection().forEach(e -> e.validate());
        }
        if (httpListeners() != null) {
            httpListeners().forEach(e -> e.validate());
        }
        if (urlPathMaps() != null) {
            urlPathMaps().forEach(e -> e.validate());
        }
        if (requestRoutingRules() != null) {
            requestRoutingRules().forEach(e -> e.validate());
        }
        if (rewriteRuleSets() != null) {
            rewriteRuleSets().forEach(e -> e.validate());
        }
        if (redirectConfigurations() != null) {
            redirectConfigurations().forEach(e -> e.validate());
        }
        if (webApplicationFirewallConfiguration() != null) {
            webApplicationFirewallConfiguration().validate();
        }
        if (autoscaleConfiguration() != null) {
            autoscaleConfiguration().validate();
        }
        if (customErrorConfigurations() != null) {
            customErrorConfigurations().forEach(e -> e.validate());
        }
    }
}
