// *** 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 java.lang.Boolean;
import java.lang.Double;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


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

    public static final RegionBackendServiceLogConfigArgs Empty = new RegionBackendServiceLogConfigArgs();

    /**
     * Whether to enable logging for the load balancer traffic served by this backend service.
     * 
     */
    @Import(name="enable")
    private @Nullable Output<Boolean> enable;

    /**
     * @return Whether to enable logging for the load balancer traffic served by this backend service.
     * 
     */
    public Optional<Output<Boolean>> enable() {
        return Optional.ofNullable(this.enable);
    }

    /**
     * This field can only be specified if logging is enabled for this backend service. The value of
     * the field must be in [0, 1]. This configures the sampling rate of requests to the load balancer
     * where 1.0 means all logged requests are reported and 0.0 means no logged requests are reported.
     * The default value is 1.0.
     * 
     */
    @Import(name="sampleRate")
    private @Nullable Output<Double> sampleRate;

    /**
     * @return This field can only be specified if logging is enabled for this backend service. The value of
     * the field must be in [0, 1]. This configures the sampling rate of requests to the load balancer
     * where 1.0 means all logged requests are reported and 0.0 means no logged requests are reported.
     * The default value is 1.0.
     * 
     */
    public Optional<Output<Double>> sampleRate() {
        return Optional.ofNullable(this.sampleRate);
    }

    private RegionBackendServiceLogConfigArgs() {}

    private RegionBackendServiceLogConfigArgs(RegionBackendServiceLogConfigArgs $) {
        this.enable = $.enable;
        this.sampleRate = $.sampleRate;
    }

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

    public static final class Builder {
        private RegionBackendServiceLogConfigArgs $;

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

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

        /**
         * @param enable Whether to enable logging for the load balancer traffic served by this backend service.
         * 
         * @return builder
         * 
         */
        public Builder enable(@Nullable Output<Boolean> enable) {
            $.enable = enable;
            return this;
        }

        /**
         * @param enable Whether to enable logging for the load balancer traffic served by this backend service.
         * 
         * @return builder
         * 
         */
        public Builder enable(Boolean enable) {
            return enable(Output.of(enable));
        }

        /**
         * @param sampleRate This field can only be specified if logging is enabled for this backend service. The value of
         * the field must be in [0, 1]. This configures the sampling rate of requests to the load balancer
         * where 1.0 means all logged requests are reported and 0.0 means no logged requests are reported.
         * The default value is 1.0.
         * 
         * @return builder
         * 
         */
        public Builder sampleRate(@Nullable Output<Double> sampleRate) {
            $.sampleRate = sampleRate;
            return this;
        }

        /**
         * @param sampleRate This field can only be specified if logging is enabled for this backend service. The value of
         * the field must be in [0, 1]. This configures the sampling rate of requests to the load balancer
         * where 1.0 means all logged requests are reported and 0.0 means no logged requests are reported.
         * The default value is 1.0.
         * 
         * @return builder
         * 
         */
        public Builder sampleRate(Double sampleRate) {
            return sampleRate(Output.of(sampleRate));
        }

        public RegionBackendServiceLogConfigArgs build() {
            return $;
        }
    }

}
