// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.gcp.compute;

import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.gcp.compute.inputs.RegionBackendServiceBackendArgs;
import com.pulumi.gcp.compute.inputs.RegionBackendServiceCdnPolicyArgs;
import com.pulumi.gcp.compute.inputs.RegionBackendServiceCircuitBreakersArgs;
import com.pulumi.gcp.compute.inputs.RegionBackendServiceConnectionTrackingPolicyArgs;
import com.pulumi.gcp.compute.inputs.RegionBackendServiceConsistentHashArgs;
import com.pulumi.gcp.compute.inputs.RegionBackendServiceFailoverPolicyArgs;
import com.pulumi.gcp.compute.inputs.RegionBackendServiceIapArgs;
import com.pulumi.gcp.compute.inputs.RegionBackendServiceLogConfigArgs;
import com.pulumi.gcp.compute.inputs.RegionBackendServiceOutlierDetectionArgs;
import com.pulumi.gcp.compute.inputs.RegionBackendServiceSubsettingArgs;
import java.lang.Boolean;
import java.lang.Integer;
import java.lang.String;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


public final class RegionBackendServiceArgs extends com.pulumi.resources.ResourceArgs {

    public static final RegionBackendServiceArgs Empty = new RegionBackendServiceArgs();

    /**
     * Lifetime of cookies in seconds if session_affinity is
     * GENERATED_COOKIE. If set to 0, the cookie is non-persistent and lasts
     * only until the end of the browser session (or equivalent). The
     * maximum allowed value for TTL is one day.
     * When the load balancing scheme is INTERNAL, this field is not used.
     * 
     */
    @Import(name="affinityCookieTtlSec")
    private @Nullable Output<Integer> affinityCookieTtlSec;

    /**
     * @return Lifetime of cookies in seconds if session_affinity is
     * GENERATED_COOKIE. If set to 0, the cookie is non-persistent and lasts
     * only until the end of the browser session (or equivalent). The
     * maximum allowed value for TTL is one day.
     * When the load balancing scheme is INTERNAL, this field is not used.
     * 
     */
    public Optional<Output<Integer>> affinityCookieTtlSec() {
        return Optional.ofNullable(this.affinityCookieTtlSec);
    }

    /**
     * The set of backends that serve this RegionBackendService.
     * Structure is documented below.
     * 
     */
    @Import(name="backends")
    private @Nullable Output<List<RegionBackendServiceBackendArgs>> backends;

    /**
     * @return The set of backends that serve this RegionBackendService.
     * Structure is documented below.
     * 
     */
    public Optional<Output<List<RegionBackendServiceBackendArgs>>> backends() {
        return Optional.ofNullable(this.backends);
    }

    /**
     * Cloud CDN configuration for this BackendService.
     * Structure is documented below.
     * 
     */
    @Import(name="cdnPolicy")
    private @Nullable Output<RegionBackendServiceCdnPolicyArgs> cdnPolicy;

    /**
     * @return Cloud CDN configuration for this BackendService.
     * Structure is documented below.
     * 
     */
    public Optional<Output<RegionBackendServiceCdnPolicyArgs>> cdnPolicy() {
        return Optional.ofNullable(this.cdnPolicy);
    }

    /**
     * Settings controlling the volume of connections to a backend service. This field
     * is applicable only when the `load_balancing_scheme` is set to INTERNAL_MANAGED
     * and the `protocol` is set to HTTP, HTTPS, or HTTP2.
     * Structure is documented below.
     * 
     */
    @Import(name="circuitBreakers")
    private @Nullable Output<RegionBackendServiceCircuitBreakersArgs> circuitBreakers;

    /**
     * @return Settings controlling the volume of connections to a backend service. This field
     * is applicable only when the `load_balancing_scheme` is set to INTERNAL_MANAGED
     * and the `protocol` is set to HTTP, HTTPS, or HTTP2.
     * Structure is documented below.
     * 
     */
    public Optional<Output<RegionBackendServiceCircuitBreakersArgs>> circuitBreakers() {
        return Optional.ofNullable(this.circuitBreakers);
    }

    /**
     * Time for which instance will be drained (not accept new
     * connections, but still work to finish started).
     * 
     */
    @Import(name="connectionDrainingTimeoutSec")
    private @Nullable Output<Integer> connectionDrainingTimeoutSec;

    /**
     * @return Time for which instance will be drained (not accept new
     * connections, but still work to finish started).
     * 
     */
    public Optional<Output<Integer>> connectionDrainingTimeoutSec() {
        return Optional.ofNullable(this.connectionDrainingTimeoutSec);
    }

    /**
     * Connection Tracking configuration for this BackendService.
     * This is available only for Layer 4 Internal Load Balancing and
     * Network Load Balancing.
     * Structure is documented below.
     * 
     */
    @Import(name="connectionTrackingPolicy")
    private @Nullable Output<RegionBackendServiceConnectionTrackingPolicyArgs> connectionTrackingPolicy;

    /**
     * @return Connection Tracking configuration for this BackendService.
     * This is available only for Layer 4 Internal Load Balancing and
     * Network Load Balancing.
     * Structure is documented below.
     * 
     */
    public Optional<Output<RegionBackendServiceConnectionTrackingPolicyArgs>> connectionTrackingPolicy() {
        return Optional.ofNullable(this.connectionTrackingPolicy);
    }

    /**
     * Consistent Hash-based load balancing can be used to provide soft session
     * affinity based on HTTP headers, cookies or other properties. This load balancing
     * policy is applicable only for HTTP connections. The affinity to a particular
     * destination host will be lost when one or more hosts are added/removed from the
     * destination service. This field specifies parameters that control consistent
     * hashing.
     * This field only applies when all of the following are true -
     * 
     */
    @Import(name="consistentHash")
    private @Nullable Output<RegionBackendServiceConsistentHashArgs> consistentHash;

    /**
     * @return Consistent Hash-based load balancing can be used to provide soft session
     * affinity based on HTTP headers, cookies or other properties. This load balancing
     * policy is applicable only for HTTP connections. The affinity to a particular
     * destination host will be lost when one or more hosts are added/removed from the
     * destination service. This field specifies parameters that control consistent
     * hashing.
     * This field only applies when all of the following are true -
     * 
     */
    public Optional<Output<RegionBackendServiceConsistentHashArgs>> consistentHash() {
        return Optional.ofNullable(this.consistentHash);
    }

    /**
     * An optional description of this resource.
     * 
     */
    @Import(name="description")
    private @Nullable Output<String> description;

    /**
     * @return An optional description of this resource.
     * 
     */
    public Optional<Output<String>> description() {
        return Optional.ofNullable(this.description);
    }

    /**
     * If true, enable Cloud CDN for this RegionBackendService.
     * 
     */
    @Import(name="enableCdn")
    private @Nullable Output<Boolean> enableCdn;

    /**
     * @return If true, enable Cloud CDN for this RegionBackendService.
     * 
     */
    public Optional<Output<Boolean>> enableCdn() {
        return Optional.ofNullable(this.enableCdn);
    }

    /**
     * Policy for failovers.
     * Structure is documented below.
     * 
     */
    @Import(name="failoverPolicy")
    private @Nullable Output<RegionBackendServiceFailoverPolicyArgs> failoverPolicy;

    /**
     * @return Policy for failovers.
     * Structure is documented below.
     * 
     */
    public Optional<Output<RegionBackendServiceFailoverPolicyArgs>> failoverPolicy() {
        return Optional.ofNullable(this.failoverPolicy);
    }

    /**
     * The set of URLs to HealthCheck resources for health checking
     * this RegionBackendService. Currently at most one health
     * check can be specified.
     * A health check must be specified unless the backend service uses an internet
     * or serverless NEG as a backend.
     * 
     */
    @Import(name="healthChecks")
    private @Nullable Output<String> healthChecks;

    /**
     * @return The set of URLs to HealthCheck resources for health checking
     * this RegionBackendService. Currently at most one health
     * check can be specified.
     * A health check must be specified unless the backend service uses an internet
     * or serverless NEG as a backend.
     * 
     */
    public Optional<Output<String>> healthChecks() {
        return Optional.ofNullable(this.healthChecks);
    }

    /**
     * Settings for enabling Cloud Identity Aware Proxy
     * Structure is documented below.
     * 
     */
    @Import(name="iap")
    private @Nullable Output<RegionBackendServiceIapArgs> iap;

    /**
     * @return Settings for enabling Cloud Identity Aware Proxy
     * Structure is documented below.
     * 
     */
    public Optional<Output<RegionBackendServiceIapArgs>> iap() {
        return Optional.ofNullable(this.iap);
    }

    /**
     * Indicates what kind of load balancing this regional backend service
     * will be used for. A backend service created for one type of load
     * balancing cannot be used with the other(s). For more information, refer to
     * [Choosing a load balancer](https://cloud.google.com/load-balancing/docs/backend-service).
     * Default value is `INTERNAL`.
     * Possible values are: `EXTERNAL`, `EXTERNAL_MANAGED`, `INTERNAL`, `INTERNAL_MANAGED`.
     * 
     */
    @Import(name="loadBalancingScheme")
    private @Nullable Output<String> loadBalancingScheme;

    /**
     * @return Indicates what kind of load balancing this regional backend service
     * will be used for. A backend service created for one type of load
     * balancing cannot be used with the other(s). For more information, refer to
     * [Choosing a load balancer](https://cloud.google.com/load-balancing/docs/backend-service).
     * Default value is `INTERNAL`.
     * Possible values are: `EXTERNAL`, `EXTERNAL_MANAGED`, `INTERNAL`, `INTERNAL_MANAGED`.
     * 
     */
    public Optional<Output<String>> loadBalancingScheme() {
        return Optional.ofNullable(this.loadBalancingScheme);
    }

    /**
     * The load balancing algorithm used within the scope of the locality.
     * The possible values are:
     * 
     */
    @Import(name="localityLbPolicy")
    private @Nullable Output<String> localityLbPolicy;

    /**
     * @return The load balancing algorithm used within the scope of the locality.
     * The possible values are:
     * 
     */
    public Optional<Output<String>> localityLbPolicy() {
        return Optional.ofNullable(this.localityLbPolicy);
    }

    /**
     * This field denotes the logging options for the load balancer traffic served by this backend service.
     * If logging is enabled, logs will be exported to Stackdriver.
     * Structure is documented below.
     * 
     */
    @Import(name="logConfig")
    private @Nullable Output<RegionBackendServiceLogConfigArgs> logConfig;

    /**
     * @return This field denotes the logging options for the load balancer traffic served by this backend service.
     * If logging is enabled, logs will be exported to Stackdriver.
     * Structure is documented below.
     * 
     */
    public Optional<Output<RegionBackendServiceLogConfigArgs>> logConfig() {
        return Optional.ofNullable(this.logConfig);
    }

    /**
     * Name of the resource. Provided by the client when the resource is
     * created. The name must be 1-63 characters long, and comply with
     * RFC1035. Specifically, the name must be 1-63 characters long and match
     * the regular expression `a-z?` which means the
     * first character must be a lowercase letter, and all following
     * characters must be a dash, lowercase letter, or digit, except the last
     * character, which cannot be a dash.
     * 
     * ***
     * 
     */
    @Import(name="name")
    private @Nullable Output<String> name;

    /**
     * @return Name of the resource. Provided by the client when the resource is
     * created. The name must be 1-63 characters long, and comply with
     * RFC1035. Specifically, the name must be 1-63 characters long and match
     * the regular expression `a-z?` which means the
     * first character must be a lowercase letter, and all following
     * characters must be a dash, lowercase letter, or digit, except the last
     * character, which cannot be a dash.
     * 
     * ***
     * 
     */
    public Optional<Output<String>> name() {
        return Optional.ofNullable(this.name);
    }

    /**
     * The URL of the network to which this backend service belongs.
     * This field can only be specified when the load balancing scheme is set to INTERNAL.
     * 
     */
    @Import(name="network")
    private @Nullable Output<String> network;

    /**
     * @return The URL of the network to which this backend service belongs.
     * This field can only be specified when the load balancing scheme is set to INTERNAL.
     * 
     */
    public Optional<Output<String>> network() {
        return Optional.ofNullable(this.network);
    }

    /**
     * Settings controlling eviction of unhealthy hosts from the load balancing pool.
     * This field is applicable only when the `load_balancing_scheme` is set
     * to INTERNAL_MANAGED and the `protocol` is set to HTTP, HTTPS, or HTTP2.
     * Structure is documented below.
     * 
     */
    @Import(name="outlierDetection")
    private @Nullable Output<RegionBackendServiceOutlierDetectionArgs> outlierDetection;

    /**
     * @return Settings controlling eviction of unhealthy hosts from the load balancing pool.
     * This field is applicable only when the `load_balancing_scheme` is set
     * to INTERNAL_MANAGED and the `protocol` is set to HTTP, HTTPS, or HTTP2.
     * Structure is documented below.
     * 
     */
    public Optional<Output<RegionBackendServiceOutlierDetectionArgs>> outlierDetection() {
        return Optional.ofNullable(this.outlierDetection);
    }

    /**
     * A named port on a backend instance group representing the port for
     * communication to the backend VMs in that group. Required when the
     * loadBalancingScheme is EXTERNAL, EXTERNAL_MANAGED, INTERNAL_MANAGED, or INTERNAL_SELF_MANAGED
     * and the backends are instance groups. The named port must be defined on each
     * backend instance group. This parameter has no meaning if the backends are NEGs. API sets a
     * default of &#34;http&#34; if not given.
     * Must be omitted when the loadBalancingScheme is INTERNAL (Internal TCP/UDP Load Balancing).
     * 
     */
    @Import(name="portName")
    private @Nullable Output<String> portName;

    /**
     * @return A named port on a backend instance group representing the port for
     * communication to the backend VMs in that group. Required when the
     * loadBalancingScheme is EXTERNAL, EXTERNAL_MANAGED, INTERNAL_MANAGED, or INTERNAL_SELF_MANAGED
     * and the backends are instance groups. The named port must be defined on each
     * backend instance group. This parameter has no meaning if the backends are NEGs. API sets a
     * default of &#34;http&#34; if not given.
     * Must be omitted when the loadBalancingScheme is INTERNAL (Internal TCP/UDP Load Balancing).
     * 
     */
    public Optional<Output<String>> portName() {
        return Optional.ofNullable(this.portName);
    }

    /**
     * The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     * 
     */
    @Import(name="project")
    private @Nullable Output<String> project;

    /**
     * @return The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     * 
     */
    public Optional<Output<String>> project() {
        return Optional.ofNullable(this.project);
    }

    /**
     * The protocol this RegionBackendService uses to communicate with backends.
     * The default is HTTP. **NOTE**: HTTP2 is only valid for beta HTTP/2 load balancer
     * types and may result in errors if used with the GA API.
     * Possible values are: `HTTP`, `HTTPS`, `HTTP2`, `SSL`, `TCP`, `UDP`, `GRPC`, `UNSPECIFIED`.
     * 
     */
    @Import(name="protocol")
    private @Nullable Output<String> protocol;

    /**
     * @return The protocol this RegionBackendService uses to communicate with backends.
     * The default is HTTP. **NOTE**: HTTP2 is only valid for beta HTTP/2 load balancer
     * types and may result in errors if used with the GA API.
     * Possible values are: `HTTP`, `HTTPS`, `HTTP2`, `SSL`, `TCP`, `UDP`, `GRPC`, `UNSPECIFIED`.
     * 
     */
    public Optional<Output<String>> protocol() {
        return Optional.ofNullable(this.protocol);
    }

    /**
     * The Region in which the created backend service should reside.
     * If it is not provided, the provider region is used.
     * 
     */
    @Import(name="region")
    private @Nullable Output<String> region;

    /**
     * @return The Region in which the created backend service should reside.
     * If it is not provided, the provider region is used.
     * 
     */
    public Optional<Output<String>> region() {
        return Optional.ofNullable(this.region);
    }

    /**
     * The security policy associated with this backend service.
     * 
     */
    @Import(name="securityPolicy")
    private @Nullable Output<String> securityPolicy;

    /**
     * @return The security policy associated with this backend service.
     * 
     */
    public Optional<Output<String>> securityPolicy() {
        return Optional.ofNullable(this.securityPolicy);
    }

    /**
     * Type of session affinity to use. The default is NONE. Session affinity is
     * not applicable if the protocol is UDP.
     * Possible values are: `NONE`, `CLIENT_IP`, `CLIENT_IP_PORT_PROTO`, `CLIENT_IP_PROTO`, `GENERATED_COOKIE`, `HEADER_FIELD`, `HTTP_COOKIE`, `CLIENT_IP_NO_DESTINATION`.
     * 
     */
    @Import(name="sessionAffinity")
    private @Nullable Output<String> sessionAffinity;

    /**
     * @return Type of session affinity to use. The default is NONE. Session affinity is
     * not applicable if the protocol is UDP.
     * Possible values are: `NONE`, `CLIENT_IP`, `CLIENT_IP_PORT_PROTO`, `CLIENT_IP_PROTO`, `GENERATED_COOKIE`, `HEADER_FIELD`, `HTTP_COOKIE`, `CLIENT_IP_NO_DESTINATION`.
     * 
     */
    public Optional<Output<String>> sessionAffinity() {
        return Optional.ofNullable(this.sessionAffinity);
    }

    /**
     * Subsetting configuration for this BackendService. Currently this is applicable only for Internal TCP/UDP load balancing
     * and Internal HTTP(S) load balancing.
     * 
     */
    @Import(name="subsetting")
    private @Nullable Output<RegionBackendServiceSubsettingArgs> subsetting;

    /**
     * @return Subsetting configuration for this BackendService. Currently this is applicable only for Internal TCP/UDP load balancing
     * and Internal HTTP(S) load balancing.
     * 
     */
    public Optional<Output<RegionBackendServiceSubsettingArgs>> subsetting() {
        return Optional.ofNullable(this.subsetting);
    }

    /**
     * How many seconds to wait for the backend before considering it a
     * failed request. Default is 30 seconds. Valid range is [1, 86400].
     * 
     */
    @Import(name="timeoutSec")
    private @Nullable Output<Integer> timeoutSec;

    /**
     * @return How many seconds to wait for the backend before considering it a
     * failed request. Default is 30 seconds. Valid range is [1, 86400].
     * 
     */
    public Optional<Output<Integer>> timeoutSec() {
        return Optional.ofNullable(this.timeoutSec);
    }

    private RegionBackendServiceArgs() {}

    private RegionBackendServiceArgs(RegionBackendServiceArgs $) {
        this.affinityCookieTtlSec = $.affinityCookieTtlSec;
        this.backends = $.backends;
        this.cdnPolicy = $.cdnPolicy;
        this.circuitBreakers = $.circuitBreakers;
        this.connectionDrainingTimeoutSec = $.connectionDrainingTimeoutSec;
        this.connectionTrackingPolicy = $.connectionTrackingPolicy;
        this.consistentHash = $.consistentHash;
        this.description = $.description;
        this.enableCdn = $.enableCdn;
        this.failoverPolicy = $.failoverPolicy;
        this.healthChecks = $.healthChecks;
        this.iap = $.iap;
        this.loadBalancingScheme = $.loadBalancingScheme;
        this.localityLbPolicy = $.localityLbPolicy;
        this.logConfig = $.logConfig;
        this.name = $.name;
        this.network = $.network;
        this.outlierDetection = $.outlierDetection;
        this.portName = $.portName;
        this.project = $.project;
        this.protocol = $.protocol;
        this.region = $.region;
        this.securityPolicy = $.securityPolicy;
        this.sessionAffinity = $.sessionAffinity;
        this.subsetting = $.subsetting;
        this.timeoutSec = $.timeoutSec;
    }

    public static Builder builder() {
        return new Builder();
    }
    public static Builder builder(RegionBackendServiceArgs defaults) {
        return new Builder(defaults);
    }

    public static final class Builder {
        private RegionBackendServiceArgs $;

        public Builder() {
            $ = new RegionBackendServiceArgs();
        }

        public Builder(RegionBackendServiceArgs defaults) {
            $ = new RegionBackendServiceArgs(Objects.requireNonNull(defaults));
        }

        /**
         * @param affinityCookieTtlSec Lifetime of cookies in seconds if session_affinity is
         * GENERATED_COOKIE. If set to 0, the cookie is non-persistent and lasts
         * only until the end of the browser session (or equivalent). The
         * maximum allowed value for TTL is one day.
         * When the load balancing scheme is INTERNAL, this field is not used.
         * 
         * @return builder
         * 
         */
        public Builder affinityCookieTtlSec(@Nullable Output<Integer> affinityCookieTtlSec) {
            $.affinityCookieTtlSec = affinityCookieTtlSec;
            return this;
        }

        /**
         * @param affinityCookieTtlSec Lifetime of cookies in seconds if session_affinity is
         * GENERATED_COOKIE. If set to 0, the cookie is non-persistent and lasts
         * only until the end of the browser session (or equivalent). The
         * maximum allowed value for TTL is one day.
         * When the load balancing scheme is INTERNAL, this field is not used.
         * 
         * @return builder
         * 
         */
        public Builder affinityCookieTtlSec(Integer affinityCookieTtlSec) {
            return affinityCookieTtlSec(Output.of(affinityCookieTtlSec));
        }

        /**
         * @param backends The set of backends that serve this RegionBackendService.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder backends(@Nullable Output<List<RegionBackendServiceBackendArgs>> backends) {
            $.backends = backends;
            return this;
        }

        /**
         * @param backends The set of backends that serve this RegionBackendService.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder backends(List<RegionBackendServiceBackendArgs> backends) {
            return backends(Output.of(backends));
        }

        /**
         * @param backends The set of backends that serve this RegionBackendService.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder backends(RegionBackendServiceBackendArgs... backends) {
            return backends(List.of(backends));
        }

        /**
         * @param cdnPolicy Cloud CDN configuration for this BackendService.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder cdnPolicy(@Nullable Output<RegionBackendServiceCdnPolicyArgs> cdnPolicy) {
            $.cdnPolicy = cdnPolicy;
            return this;
        }

        /**
         * @param cdnPolicy Cloud CDN configuration for this BackendService.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder cdnPolicy(RegionBackendServiceCdnPolicyArgs cdnPolicy) {
            return cdnPolicy(Output.of(cdnPolicy));
        }

        /**
         * @param circuitBreakers Settings controlling the volume of connections to a backend service. This field
         * is applicable only when the `load_balancing_scheme` is set to INTERNAL_MANAGED
         * and the `protocol` is set to HTTP, HTTPS, or HTTP2.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder circuitBreakers(@Nullable Output<RegionBackendServiceCircuitBreakersArgs> circuitBreakers) {
            $.circuitBreakers = circuitBreakers;
            return this;
        }

        /**
         * @param circuitBreakers Settings controlling the volume of connections to a backend service. This field
         * is applicable only when the `load_balancing_scheme` is set to INTERNAL_MANAGED
         * and the `protocol` is set to HTTP, HTTPS, or HTTP2.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder circuitBreakers(RegionBackendServiceCircuitBreakersArgs circuitBreakers) {
            return circuitBreakers(Output.of(circuitBreakers));
        }

        /**
         * @param connectionDrainingTimeoutSec Time for which instance will be drained (not accept new
         * connections, but still work to finish started).
         * 
         * @return builder
         * 
         */
        public Builder connectionDrainingTimeoutSec(@Nullable Output<Integer> connectionDrainingTimeoutSec) {
            $.connectionDrainingTimeoutSec = connectionDrainingTimeoutSec;
            return this;
        }

        /**
         * @param connectionDrainingTimeoutSec Time for which instance will be drained (not accept new
         * connections, but still work to finish started).
         * 
         * @return builder
         * 
         */
        public Builder connectionDrainingTimeoutSec(Integer connectionDrainingTimeoutSec) {
            return connectionDrainingTimeoutSec(Output.of(connectionDrainingTimeoutSec));
        }

        /**
         * @param connectionTrackingPolicy Connection Tracking configuration for this BackendService.
         * This is available only for Layer 4 Internal Load Balancing and
         * Network Load Balancing.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder connectionTrackingPolicy(@Nullable Output<RegionBackendServiceConnectionTrackingPolicyArgs> connectionTrackingPolicy) {
            $.connectionTrackingPolicy = connectionTrackingPolicy;
            return this;
        }

        /**
         * @param connectionTrackingPolicy Connection Tracking configuration for this BackendService.
         * This is available only for Layer 4 Internal Load Balancing and
         * Network Load Balancing.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder connectionTrackingPolicy(RegionBackendServiceConnectionTrackingPolicyArgs connectionTrackingPolicy) {
            return connectionTrackingPolicy(Output.of(connectionTrackingPolicy));
        }

        /**
         * @param consistentHash Consistent Hash-based load balancing can be used to provide soft session
         * affinity based on HTTP headers, cookies or other properties. This load balancing
         * policy is applicable only for HTTP connections. The affinity to a particular
         * destination host will be lost when one or more hosts are added/removed from the
         * destination service. This field specifies parameters that control consistent
         * hashing.
         * This field only applies when all of the following are true -
         * 
         * @return builder
         * 
         */
        public Builder consistentHash(@Nullable Output<RegionBackendServiceConsistentHashArgs> consistentHash) {
            $.consistentHash = consistentHash;
            return this;
        }

        /**
         * @param consistentHash Consistent Hash-based load balancing can be used to provide soft session
         * affinity based on HTTP headers, cookies or other properties. This load balancing
         * policy is applicable only for HTTP connections. The affinity to a particular
         * destination host will be lost when one or more hosts are added/removed from the
         * destination service. This field specifies parameters that control consistent
         * hashing.
         * This field only applies when all of the following are true -
         * 
         * @return builder
         * 
         */
        public Builder consistentHash(RegionBackendServiceConsistentHashArgs consistentHash) {
            return consistentHash(Output.of(consistentHash));
        }

        /**
         * @param description An optional description of this resource.
         * 
         * @return builder
         * 
         */
        public Builder description(@Nullable Output<String> description) {
            $.description = description;
            return this;
        }

        /**
         * @param description An optional description of this resource.
         * 
         * @return builder
         * 
         */
        public Builder description(String description) {
            return description(Output.of(description));
        }

        /**
         * @param enableCdn If true, enable Cloud CDN for this RegionBackendService.
         * 
         * @return builder
         * 
         */
        public Builder enableCdn(@Nullable Output<Boolean> enableCdn) {
            $.enableCdn = enableCdn;
            return this;
        }

        /**
         * @param enableCdn If true, enable Cloud CDN for this RegionBackendService.
         * 
         * @return builder
         * 
         */
        public Builder enableCdn(Boolean enableCdn) {
            return enableCdn(Output.of(enableCdn));
        }

        /**
         * @param failoverPolicy Policy for failovers.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder failoverPolicy(@Nullable Output<RegionBackendServiceFailoverPolicyArgs> failoverPolicy) {
            $.failoverPolicy = failoverPolicy;
            return this;
        }

        /**
         * @param failoverPolicy Policy for failovers.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder failoverPolicy(RegionBackendServiceFailoverPolicyArgs failoverPolicy) {
            return failoverPolicy(Output.of(failoverPolicy));
        }

        /**
         * @param healthChecks The set of URLs to HealthCheck resources for health checking
         * this RegionBackendService. Currently at most one health
         * check can be specified.
         * A health check must be specified unless the backend service uses an internet
         * or serverless NEG as a backend.
         * 
         * @return builder
         * 
         */
        public Builder healthChecks(@Nullable Output<String> healthChecks) {
            $.healthChecks = healthChecks;
            return this;
        }

        /**
         * @param healthChecks The set of URLs to HealthCheck resources for health checking
         * this RegionBackendService. Currently at most one health
         * check can be specified.
         * A health check must be specified unless the backend service uses an internet
         * or serverless NEG as a backend.
         * 
         * @return builder
         * 
         */
        public Builder healthChecks(String healthChecks) {
            return healthChecks(Output.of(healthChecks));
        }

        /**
         * @param iap Settings for enabling Cloud Identity Aware Proxy
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder iap(@Nullable Output<RegionBackendServiceIapArgs> iap) {
            $.iap = iap;
            return this;
        }

        /**
         * @param iap Settings for enabling Cloud Identity Aware Proxy
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder iap(RegionBackendServiceIapArgs iap) {
            return iap(Output.of(iap));
        }

        /**
         * @param loadBalancingScheme Indicates what kind of load balancing this regional backend service
         * will be used for. A backend service created for one type of load
         * balancing cannot be used with the other(s). For more information, refer to
         * [Choosing a load balancer](https://cloud.google.com/load-balancing/docs/backend-service).
         * Default value is `INTERNAL`.
         * Possible values are: `EXTERNAL`, `EXTERNAL_MANAGED`, `INTERNAL`, `INTERNAL_MANAGED`.
         * 
         * @return builder
         * 
         */
        public Builder loadBalancingScheme(@Nullable Output<String> loadBalancingScheme) {
            $.loadBalancingScheme = loadBalancingScheme;
            return this;
        }

        /**
         * @param loadBalancingScheme Indicates what kind of load balancing this regional backend service
         * will be used for. A backend service created for one type of load
         * balancing cannot be used with the other(s). For more information, refer to
         * [Choosing a load balancer](https://cloud.google.com/load-balancing/docs/backend-service).
         * Default value is `INTERNAL`.
         * Possible values are: `EXTERNAL`, `EXTERNAL_MANAGED`, `INTERNAL`, `INTERNAL_MANAGED`.
         * 
         * @return builder
         * 
         */
        public Builder loadBalancingScheme(String loadBalancingScheme) {
            return loadBalancingScheme(Output.of(loadBalancingScheme));
        }

        /**
         * @param localityLbPolicy The load balancing algorithm used within the scope of the locality.
         * The possible values are:
         * 
         * @return builder
         * 
         */
        public Builder localityLbPolicy(@Nullable Output<String> localityLbPolicy) {
            $.localityLbPolicy = localityLbPolicy;
            return this;
        }

        /**
         * @param localityLbPolicy The load balancing algorithm used within the scope of the locality.
         * The possible values are:
         * 
         * @return builder
         * 
         */
        public Builder localityLbPolicy(String localityLbPolicy) {
            return localityLbPolicy(Output.of(localityLbPolicy));
        }

        /**
         * @param logConfig This field denotes the logging options for the load balancer traffic served by this backend service.
         * If logging is enabled, logs will be exported to Stackdriver.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder logConfig(@Nullable Output<RegionBackendServiceLogConfigArgs> logConfig) {
            $.logConfig = logConfig;
            return this;
        }

        /**
         * @param logConfig This field denotes the logging options for the load balancer traffic served by this backend service.
         * If logging is enabled, logs will be exported to Stackdriver.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder logConfig(RegionBackendServiceLogConfigArgs logConfig) {
            return logConfig(Output.of(logConfig));
        }

        /**
         * @param name Name of the resource. Provided by the client when the resource is
         * created. The name must be 1-63 characters long, and comply with
         * RFC1035. Specifically, the name must be 1-63 characters long and match
         * the regular expression `a-z?` which means the
         * first character must be a lowercase letter, and all following
         * characters must be a dash, lowercase letter, or digit, except the last
         * character, which cannot be a dash.
         * 
         * ***
         * 
         * @return builder
         * 
         */
        public Builder name(@Nullable Output<String> name) {
            $.name = name;
            return this;
        }

        /**
         * @param name Name of the resource. Provided by the client when the resource is
         * created. The name must be 1-63 characters long, and comply with
         * RFC1035. Specifically, the name must be 1-63 characters long and match
         * the regular expression `a-z?` which means the
         * first character must be a lowercase letter, and all following
         * characters must be a dash, lowercase letter, or digit, except the last
         * character, which cannot be a dash.
         * 
         * ***
         * 
         * @return builder
         * 
         */
        public Builder name(String name) {
            return name(Output.of(name));
        }

        /**
         * @param network The URL of the network to which this backend service belongs.
         * This field can only be specified when the load balancing scheme is set to INTERNAL.
         * 
         * @return builder
         * 
         */
        public Builder network(@Nullable Output<String> network) {
            $.network = network;
            return this;
        }

        /**
         * @param network The URL of the network to which this backend service belongs.
         * This field can only be specified when the load balancing scheme is set to INTERNAL.
         * 
         * @return builder
         * 
         */
        public Builder network(String network) {
            return network(Output.of(network));
        }

        /**
         * @param outlierDetection Settings controlling eviction of unhealthy hosts from the load balancing pool.
         * This field is applicable only when the `load_balancing_scheme` is set
         * to INTERNAL_MANAGED and the `protocol` is set to HTTP, HTTPS, or HTTP2.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder outlierDetection(@Nullable Output<RegionBackendServiceOutlierDetectionArgs> outlierDetection) {
            $.outlierDetection = outlierDetection;
            return this;
        }

        /**
         * @param outlierDetection Settings controlling eviction of unhealthy hosts from the load balancing pool.
         * This field is applicable only when the `load_balancing_scheme` is set
         * to INTERNAL_MANAGED and the `protocol` is set to HTTP, HTTPS, or HTTP2.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder outlierDetection(RegionBackendServiceOutlierDetectionArgs outlierDetection) {
            return outlierDetection(Output.of(outlierDetection));
        }

        /**
         * @param portName A named port on a backend instance group representing the port for
         * communication to the backend VMs in that group. Required when the
         * loadBalancingScheme is EXTERNAL, EXTERNAL_MANAGED, INTERNAL_MANAGED, or INTERNAL_SELF_MANAGED
         * and the backends are instance groups. The named port must be defined on each
         * backend instance group. This parameter has no meaning if the backends are NEGs. API sets a
         * default of &#34;http&#34; if not given.
         * Must be omitted when the loadBalancingScheme is INTERNAL (Internal TCP/UDP Load Balancing).
         * 
         * @return builder
         * 
         */
        public Builder portName(@Nullable Output<String> portName) {
            $.portName = portName;
            return this;
        }

        /**
         * @param portName A named port on a backend instance group representing the port for
         * communication to the backend VMs in that group. Required when the
         * loadBalancingScheme is EXTERNAL, EXTERNAL_MANAGED, INTERNAL_MANAGED, or INTERNAL_SELF_MANAGED
         * and the backends are instance groups. The named port must be defined on each
         * backend instance group. This parameter has no meaning if the backends are NEGs. API sets a
         * default of &#34;http&#34; if not given.
         * Must be omitted when the loadBalancingScheme is INTERNAL (Internal TCP/UDP Load Balancing).
         * 
         * @return builder
         * 
         */
        public Builder portName(String portName) {
            return portName(Output.of(portName));
        }

        /**
         * @param project The ID of the project in which the resource belongs.
         * If it is not provided, the provider project is used.
         * 
         * @return builder
         * 
         */
        public Builder project(@Nullable Output<String> project) {
            $.project = project;
            return this;
        }

        /**
         * @param project The ID of the project in which the resource belongs.
         * If it is not provided, the provider project is used.
         * 
         * @return builder
         * 
         */
        public Builder project(String project) {
            return project(Output.of(project));
        }

        /**
         * @param protocol The protocol this RegionBackendService uses to communicate with backends.
         * The default is HTTP. **NOTE**: HTTP2 is only valid for beta HTTP/2 load balancer
         * types and may result in errors if used with the GA API.
         * Possible values are: `HTTP`, `HTTPS`, `HTTP2`, `SSL`, `TCP`, `UDP`, `GRPC`, `UNSPECIFIED`.
         * 
         * @return builder
         * 
         */
        public Builder protocol(@Nullable Output<String> protocol) {
            $.protocol = protocol;
            return this;
        }

        /**
         * @param protocol The protocol this RegionBackendService uses to communicate with backends.
         * The default is HTTP. **NOTE**: HTTP2 is only valid for beta HTTP/2 load balancer
         * types and may result in errors if used with the GA API.
         * Possible values are: `HTTP`, `HTTPS`, `HTTP2`, `SSL`, `TCP`, `UDP`, `GRPC`, `UNSPECIFIED`.
         * 
         * @return builder
         * 
         */
        public Builder protocol(String protocol) {
            return protocol(Output.of(protocol));
        }

        /**
         * @param region The Region in which the created backend service should reside.
         * If it is not provided, the provider region is used.
         * 
         * @return builder
         * 
         */
        public Builder region(@Nullable Output<String> region) {
            $.region = region;
            return this;
        }

        /**
         * @param region The Region in which the created backend service should reside.
         * If it is not provided, the provider region is used.
         * 
         * @return builder
         * 
         */
        public Builder region(String region) {
            return region(Output.of(region));
        }

        /**
         * @param securityPolicy The security policy associated with this backend service.
         * 
         * @return builder
         * 
         */
        public Builder securityPolicy(@Nullable Output<String> securityPolicy) {
            $.securityPolicy = securityPolicy;
            return this;
        }

        /**
         * @param securityPolicy The security policy associated with this backend service.
         * 
         * @return builder
         * 
         */
        public Builder securityPolicy(String securityPolicy) {
            return securityPolicy(Output.of(securityPolicy));
        }

        /**
         * @param sessionAffinity Type of session affinity to use. The default is NONE. Session affinity is
         * not applicable if the protocol is UDP.
         * Possible values are: `NONE`, `CLIENT_IP`, `CLIENT_IP_PORT_PROTO`, `CLIENT_IP_PROTO`, `GENERATED_COOKIE`, `HEADER_FIELD`, `HTTP_COOKIE`, `CLIENT_IP_NO_DESTINATION`.
         * 
         * @return builder
         * 
         */
        public Builder sessionAffinity(@Nullable Output<String> sessionAffinity) {
            $.sessionAffinity = sessionAffinity;
            return this;
        }

        /**
         * @param sessionAffinity Type of session affinity to use. The default is NONE. Session affinity is
         * not applicable if the protocol is UDP.
         * Possible values are: `NONE`, `CLIENT_IP`, `CLIENT_IP_PORT_PROTO`, `CLIENT_IP_PROTO`, `GENERATED_COOKIE`, `HEADER_FIELD`, `HTTP_COOKIE`, `CLIENT_IP_NO_DESTINATION`.
         * 
         * @return builder
         * 
         */
        public Builder sessionAffinity(String sessionAffinity) {
            return sessionAffinity(Output.of(sessionAffinity));
        }

        /**
         * @param subsetting Subsetting configuration for this BackendService. Currently this is applicable only for Internal TCP/UDP load balancing
         * and Internal HTTP(S) load balancing.
         * 
         * @return builder
         * 
         */
        public Builder subsetting(@Nullable Output<RegionBackendServiceSubsettingArgs> subsetting) {
            $.subsetting = subsetting;
            return this;
        }

        /**
         * @param subsetting Subsetting configuration for this BackendService. Currently this is applicable only for Internal TCP/UDP load balancing
         * and Internal HTTP(S) load balancing.
         * 
         * @return builder
         * 
         */
        public Builder subsetting(RegionBackendServiceSubsettingArgs subsetting) {
            return subsetting(Output.of(subsetting));
        }

        /**
         * @param timeoutSec How many seconds to wait for the backend before considering it a
         * failed request. Default is 30 seconds. Valid range is [1, 86400].
         * 
         * @return builder
         * 
         */
        public Builder timeoutSec(@Nullable Output<Integer> timeoutSec) {
            $.timeoutSec = timeoutSec;
            return this;
        }

        /**
         * @param timeoutSec How many seconds to wait for the backend before considering it a
         * failed request. Default is 30 seconds. Valid range is [1, 86400].
         * 
         * @return builder
         * 
         */
        public Builder timeoutSec(Integer timeoutSec) {
            return timeoutSec(Output.of(timeoutSec));
        }

        public RegionBackendServiceArgs build() {
            return $;
        }
    }

}
