// *** 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.BackendServiceLocalityLbPolicyCustomPolicyArgs;
import com.pulumi.gcp.compute.inputs.BackendServiceLocalityLbPolicyPolicyArgs;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


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

    public static final BackendServiceLocalityLbPolicyArgs Empty = new BackendServiceLocalityLbPolicyArgs();

    /**
     * The configuration for a custom policy implemented by the user and
     * deployed with the client.
     * Structure is documented below.
     * 
     */
    @Import(name="customPolicy")
    private @Nullable Output<BackendServiceLocalityLbPolicyCustomPolicyArgs> customPolicy;

    /**
     * @return The configuration for a custom policy implemented by the user and
     * deployed with the client.
     * Structure is documented below.
     * 
     */
    public Optional<Output<BackendServiceLocalityLbPolicyCustomPolicyArgs>> customPolicy() {
        return Optional.ofNullable(this.customPolicy);
    }

    /**
     * The configuration for a built-in load balancing policy.
     * Structure is documented below.
     * 
     */
    @Import(name="policy")
    private @Nullable Output<BackendServiceLocalityLbPolicyPolicyArgs> policy;

    /**
     * @return The configuration for a built-in load balancing policy.
     * Structure is documented below.
     * 
     */
    public Optional<Output<BackendServiceLocalityLbPolicyPolicyArgs>> policy() {
        return Optional.ofNullable(this.policy);
    }

    private BackendServiceLocalityLbPolicyArgs() {}

    private BackendServiceLocalityLbPolicyArgs(BackendServiceLocalityLbPolicyArgs $) {
        this.customPolicy = $.customPolicy;
        this.policy = $.policy;
    }

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

    public static final class Builder {
        private BackendServiceLocalityLbPolicyArgs $;

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

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

        /**
         * @param customPolicy The configuration for a custom policy implemented by the user and
         * deployed with the client.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder customPolicy(@Nullable Output<BackendServiceLocalityLbPolicyCustomPolicyArgs> customPolicy) {
            $.customPolicy = customPolicy;
            return this;
        }

        /**
         * @param customPolicy The configuration for a custom policy implemented by the user and
         * deployed with the client.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder customPolicy(BackendServiceLocalityLbPolicyCustomPolicyArgs customPolicy) {
            return customPolicy(Output.of(customPolicy));
        }

        /**
         * @param policy The configuration for a built-in load balancing policy.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder policy(@Nullable Output<BackendServiceLocalityLbPolicyPolicyArgs> policy) {
            $.policy = policy;
            return this;
        }

        /**
         * @param policy The configuration for a built-in load balancing policy.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder policy(BackendServiceLocalityLbPolicyPolicyArgs policy) {
            return policy(Output.of(policy));
        }

        public BackendServiceLocalityLbPolicyArgs build() {
            return $;
        }
    }

}
