// *** 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.inputs;

import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.gcp.compute.inputs.BackendServiceCircuitBreakersConnectTimeoutArgs;
import java.lang.Integer;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


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

    public static final BackendServiceCircuitBreakersArgs Empty = new BackendServiceCircuitBreakersArgs();

    /**
     * The timeout for new network connections to hosts.
     * Structure is documented below.
     * 
     */
    @Import(name="connectTimeout")
    private @Nullable Output<BackendServiceCircuitBreakersConnectTimeoutArgs> connectTimeout;

    /**
     * @return The timeout for new network connections to hosts.
     * Structure is documented below.
     * 
     */
    public Optional<Output<BackendServiceCircuitBreakersConnectTimeoutArgs>> connectTimeout() {
        return Optional.ofNullable(this.connectTimeout);
    }

    /**
     * The maximum number of connections to the backend cluster.
     * Defaults to 1024.
     * 
     */
    @Import(name="maxConnections")
    private @Nullable Output<Integer> maxConnections;

    /**
     * @return The maximum number of connections to the backend cluster.
     * Defaults to 1024.
     * 
     */
    public Optional<Output<Integer>> maxConnections() {
        return Optional.ofNullable(this.maxConnections);
    }

    /**
     * The maximum number of pending requests to the backend cluster.
     * Defaults to 1024.
     * 
     */
    @Import(name="maxPendingRequests")
    private @Nullable Output<Integer> maxPendingRequests;

    /**
     * @return The maximum number of pending requests to the backend cluster.
     * Defaults to 1024.
     * 
     */
    public Optional<Output<Integer>> maxPendingRequests() {
        return Optional.ofNullable(this.maxPendingRequests);
    }

    /**
     * The maximum number of parallel requests to the backend cluster.
     * Defaults to 1024.
     * 
     */
    @Import(name="maxRequests")
    private @Nullable Output<Integer> maxRequests;

    /**
     * @return The maximum number of parallel requests to the backend cluster.
     * Defaults to 1024.
     * 
     */
    public Optional<Output<Integer>> maxRequests() {
        return Optional.ofNullable(this.maxRequests);
    }

    /**
     * Maximum requests for a single backend connection. This parameter
     * is respected by both the HTTP/1.1 and HTTP/2 implementations. If
     * not specified, there is no limit. Setting this parameter to 1
     * will effectively disable keep alive.
     * 
     */
    @Import(name="maxRequestsPerConnection")
    private @Nullable Output<Integer> maxRequestsPerConnection;

    /**
     * @return Maximum requests for a single backend connection. This parameter
     * is respected by both the HTTP/1.1 and HTTP/2 implementations. If
     * not specified, there is no limit. Setting this parameter to 1
     * will effectively disable keep alive.
     * 
     */
    public Optional<Output<Integer>> maxRequestsPerConnection() {
        return Optional.ofNullable(this.maxRequestsPerConnection);
    }

    /**
     * The maximum number of parallel retries to the backend cluster.
     * Defaults to 3.
     * 
     */
    @Import(name="maxRetries")
    private @Nullable Output<Integer> maxRetries;

    /**
     * @return The maximum number of parallel retries to the backend cluster.
     * Defaults to 3.
     * 
     */
    public Optional<Output<Integer>> maxRetries() {
        return Optional.ofNullable(this.maxRetries);
    }

    private BackendServiceCircuitBreakersArgs() {}

    private BackendServiceCircuitBreakersArgs(BackendServiceCircuitBreakersArgs $) {
        this.connectTimeout = $.connectTimeout;
        this.maxConnections = $.maxConnections;
        this.maxPendingRequests = $.maxPendingRequests;
        this.maxRequests = $.maxRequests;
        this.maxRequestsPerConnection = $.maxRequestsPerConnection;
        this.maxRetries = $.maxRetries;
    }

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

    public static final class Builder {
        private BackendServiceCircuitBreakersArgs $;

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

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

        /**
         * @param connectTimeout The timeout for new network connections to hosts.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder connectTimeout(@Nullable Output<BackendServiceCircuitBreakersConnectTimeoutArgs> connectTimeout) {
            $.connectTimeout = connectTimeout;
            return this;
        }

        /**
         * @param connectTimeout The timeout for new network connections to hosts.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder connectTimeout(BackendServiceCircuitBreakersConnectTimeoutArgs connectTimeout) {
            return connectTimeout(Output.of(connectTimeout));
        }

        /**
         * @param maxConnections The maximum number of connections to the backend cluster.
         * Defaults to 1024.
         * 
         * @return builder
         * 
         */
        public Builder maxConnections(@Nullable Output<Integer> maxConnections) {
            $.maxConnections = maxConnections;
            return this;
        }

        /**
         * @param maxConnections The maximum number of connections to the backend cluster.
         * Defaults to 1024.
         * 
         * @return builder
         * 
         */
        public Builder maxConnections(Integer maxConnections) {
            return maxConnections(Output.of(maxConnections));
        }

        /**
         * @param maxPendingRequests The maximum number of pending requests to the backend cluster.
         * Defaults to 1024.
         * 
         * @return builder
         * 
         */
        public Builder maxPendingRequests(@Nullable Output<Integer> maxPendingRequests) {
            $.maxPendingRequests = maxPendingRequests;
            return this;
        }

        /**
         * @param maxPendingRequests The maximum number of pending requests to the backend cluster.
         * Defaults to 1024.
         * 
         * @return builder
         * 
         */
        public Builder maxPendingRequests(Integer maxPendingRequests) {
            return maxPendingRequests(Output.of(maxPendingRequests));
        }

        /**
         * @param maxRequests The maximum number of parallel requests to the backend cluster.
         * Defaults to 1024.
         * 
         * @return builder
         * 
         */
        public Builder maxRequests(@Nullable Output<Integer> maxRequests) {
            $.maxRequests = maxRequests;
            return this;
        }

        /**
         * @param maxRequests The maximum number of parallel requests to the backend cluster.
         * Defaults to 1024.
         * 
         * @return builder
         * 
         */
        public Builder maxRequests(Integer maxRequests) {
            return maxRequests(Output.of(maxRequests));
        }

        /**
         * @param maxRequestsPerConnection Maximum requests for a single backend connection. This parameter
         * is respected by both the HTTP/1.1 and HTTP/2 implementations. If
         * not specified, there is no limit. Setting this parameter to 1
         * will effectively disable keep alive.
         * 
         * @return builder
         * 
         */
        public Builder maxRequestsPerConnection(@Nullable Output<Integer> maxRequestsPerConnection) {
            $.maxRequestsPerConnection = maxRequestsPerConnection;
            return this;
        }

        /**
         * @param maxRequestsPerConnection Maximum requests for a single backend connection. This parameter
         * is respected by both the HTTP/1.1 and HTTP/2 implementations. If
         * not specified, there is no limit. Setting this parameter to 1
         * will effectively disable keep alive.
         * 
         * @return builder
         * 
         */
        public Builder maxRequestsPerConnection(Integer maxRequestsPerConnection) {
            return maxRequestsPerConnection(Output.of(maxRequestsPerConnection));
        }

        /**
         * @param maxRetries The maximum number of parallel retries to the backend cluster.
         * Defaults to 3.
         * 
         * @return builder
         * 
         */
        public Builder maxRetries(@Nullable Output<Integer> maxRetries) {
            $.maxRetries = maxRetries;
            return this;
        }

        /**
         * @param maxRetries The maximum number of parallel retries to the backend cluster.
         * Defaults to 3.
         * 
         * @return builder
         * 
         */
        public Builder maxRetries(Integer maxRetries) {
            return maxRetries(Output.of(maxRetries));
        }

        public BackendServiceCircuitBreakersArgs build() {
            return $;
        }
    }

}
