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

import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.gcp.networksecurity.inputs.AuthorizationPolicyRuleDestinationArgs;
import com.pulumi.gcp.networksecurity.inputs.AuthorizationPolicyRuleSourceArgs;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


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

    public static final AuthorizationPolicyRuleArgs Empty = new AuthorizationPolicyRuleArgs();

    /**
     * List of attributes for the traffic destination. All of the destinations must match. A destination is a match if a request matches all the specified hosts, ports, methods and headers.
     * If not set, the action specified in the &#39;action&#39; field will be applied without any rule checks for the destination.
     * Structure is documented below.
     * 
     */
    @Import(name="destinations")
    private @Nullable Output<List<AuthorizationPolicyRuleDestinationArgs>> destinations;

    /**
     * @return List of attributes for the traffic destination. All of the destinations must match. A destination is a match if a request matches all the specified hosts, ports, methods and headers.
     * If not set, the action specified in the &#39;action&#39; field will be applied without any rule checks for the destination.
     * Structure is documented below.
     * 
     */
    public Optional<Output<List<AuthorizationPolicyRuleDestinationArgs>>> destinations() {
        return Optional.ofNullable(this.destinations);
    }

    /**
     * List of attributes for the traffic source. All of the sources must match. A source is a match if both principals and ipBlocks match.
     * If not set, the action specified in the &#39;action&#39; field will be applied without any rule checks for the source.
     * Structure is documented below.
     * 
     */
    @Import(name="sources")
    private @Nullable Output<List<AuthorizationPolicyRuleSourceArgs>> sources;

    /**
     * @return List of attributes for the traffic source. All of the sources must match. A source is a match if both principals and ipBlocks match.
     * If not set, the action specified in the &#39;action&#39; field will be applied without any rule checks for the source.
     * Structure is documented below.
     * 
     */
    public Optional<Output<List<AuthorizationPolicyRuleSourceArgs>>> sources() {
        return Optional.ofNullable(this.sources);
    }

    private AuthorizationPolicyRuleArgs() {}

    private AuthorizationPolicyRuleArgs(AuthorizationPolicyRuleArgs $) {
        this.destinations = $.destinations;
        this.sources = $.sources;
    }

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

    public static final class Builder {
        private AuthorizationPolicyRuleArgs $;

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

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

        /**
         * @param destinations List of attributes for the traffic destination. All of the destinations must match. A destination is a match if a request matches all the specified hosts, ports, methods and headers.
         * If not set, the action specified in the &#39;action&#39; field will be applied without any rule checks for the destination.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder destinations(@Nullable Output<List<AuthorizationPolicyRuleDestinationArgs>> destinations) {
            $.destinations = destinations;
            return this;
        }

        /**
         * @param destinations List of attributes for the traffic destination. All of the destinations must match. A destination is a match if a request matches all the specified hosts, ports, methods and headers.
         * If not set, the action specified in the &#39;action&#39; field will be applied without any rule checks for the destination.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder destinations(List<AuthorizationPolicyRuleDestinationArgs> destinations) {
            return destinations(Output.of(destinations));
        }

        /**
         * @param destinations List of attributes for the traffic destination. All of the destinations must match. A destination is a match if a request matches all the specified hosts, ports, methods and headers.
         * If not set, the action specified in the &#39;action&#39; field will be applied without any rule checks for the destination.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder destinations(AuthorizationPolicyRuleDestinationArgs... destinations) {
            return destinations(List.of(destinations));
        }

        /**
         * @param sources List of attributes for the traffic source. All of the sources must match. A source is a match if both principals and ipBlocks match.
         * If not set, the action specified in the &#39;action&#39; field will be applied without any rule checks for the source.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder sources(@Nullable Output<List<AuthorizationPolicyRuleSourceArgs>> sources) {
            $.sources = sources;
            return this;
        }

        /**
         * @param sources List of attributes for the traffic source. All of the sources must match. A source is a match if both principals and ipBlocks match.
         * If not set, the action specified in the &#39;action&#39; field will be applied without any rule checks for the source.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder sources(List<AuthorizationPolicyRuleSourceArgs> sources) {
            return sources(Output.of(sources));
        }

        /**
         * @param sources List of attributes for the traffic source. All of the sources must match. A source is a match if both principals and ipBlocks match.
         * If not set, the action specified in the &#39;action&#39; field will be applied without any rule checks for the source.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder sources(AuthorizationPolicyRuleSourceArgs... sources) {
            return sources(List.of(sources));
        }

        public AuthorizationPolicyRuleArgs build() {
            return $;
        }
    }

}
