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

import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.gcp.networkservices.inputs.EdgeCacheServiceRoutingPathMatcherRouteRuleHeaderActionArgs;
import com.pulumi.gcp.networkservices.inputs.EdgeCacheServiceRoutingPathMatcherRouteRuleMatchRuleArgs;
import com.pulumi.gcp.networkservices.inputs.EdgeCacheServiceRoutingPathMatcherRouteRuleRouteActionArgs;
import com.pulumi.gcp.networkservices.inputs.EdgeCacheServiceRoutingPathMatcherRouteRuleUrlRedirectArgs;
import java.lang.String;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


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

    public static final EdgeCacheServiceRoutingPathMatcherRouteRuleArgs Empty = new EdgeCacheServiceRoutingPathMatcherRouteRuleArgs();

    /**
     * A human-readable description of the routeRule.
     * 
     */
    @Import(name="description")
    private @Nullable Output<String> description;

    /**
     * @return A human-readable description of the routeRule.
     * 
     */
    public Optional<Output<String>> description() {
        return Optional.ofNullable(this.description);
    }

    /**
     * The header actions, including adding &amp; removing headers, for requests that match this route.
     * Structure is documented below.
     * 
     */
    @Import(name="headerAction")
    private @Nullable Output<EdgeCacheServiceRoutingPathMatcherRouteRuleHeaderActionArgs> headerAction;

    /**
     * @return The header actions, including adding &amp; removing headers, for requests that match this route.
     * Structure is documented below.
     * 
     */
    public Optional<Output<EdgeCacheServiceRoutingPathMatcherRouteRuleHeaderActionArgs>> headerAction() {
        return Optional.ofNullable(this.headerAction);
    }

    /**
     * The list of criteria for matching attributes of a request to this routeRule. This list has OR semantics: the request matches this routeRule when any of the matchRules are satisfied. However predicates
     * within a given matchRule have AND semantics. All predicates within a matchRule must match for the request to match the rule.
     * Structure is documented below.
     * 
     */
    @Import(name="matchRules", required=true)
    private Output<List<EdgeCacheServiceRoutingPathMatcherRouteRuleMatchRuleArgs>> matchRules;

    /**
     * @return The list of criteria for matching attributes of a request to this routeRule. This list has OR semantics: the request matches this routeRule when any of the matchRules are satisfied. However predicates
     * within a given matchRule have AND semantics. All predicates within a matchRule must match for the request to match the rule.
     * Structure is documented below.
     * 
     */
    public Output<List<EdgeCacheServiceRoutingPathMatcherRouteRuleMatchRuleArgs>> matchRules() {
        return this.matchRules;
    }

    /**
     * The Origin resource that requests to this route should fetch from when a matching response is not in cache. Origins can be defined as short names (&#34;my-origin&#34;) or fully-qualified resource URLs - e.g. &#34;networkservices.googleapis.com/projects/my-project/global/edgecacheorigins/my-origin&#34;
     * Only one of origin or urlRedirect can be set.
     * 
     */
    @Import(name="origin")
    private @Nullable Output<String> origin;

    /**
     * @return The Origin resource that requests to this route should fetch from when a matching response is not in cache. Origins can be defined as short names (&#34;my-origin&#34;) or fully-qualified resource URLs - e.g. &#34;networkservices.googleapis.com/projects/my-project/global/edgecacheorigins/my-origin&#34;
     * Only one of origin or urlRedirect can be set.
     * 
     */
    public Optional<Output<String>> origin() {
        return Optional.ofNullable(this.origin);
    }

    /**
     * The priority of this route rule, where 1 is the highest priority.
     * You cannot configure two or more routeRules with the same priority. Priority for each rule must be set to a number between 1 and 999 inclusive.
     * Priority numbers can have gaps, which enable you to add or remove rules in the future without affecting the rest of the rules. For example, 1, 2, 3, 4, 5, 9, 12, 16 is a valid series of priority numbers
     * to which you could add rules numbered from 6 to 8, 10 to 11, and 13 to 15 in the future without any impact on existing rules.
     * 
     */
    @Import(name="priority", required=true)
    private Output<String> priority;

    /**
     * @return The priority of this route rule, where 1 is the highest priority.
     * You cannot configure two or more routeRules with the same priority. Priority for each rule must be set to a number between 1 and 999 inclusive.
     * Priority numbers can have gaps, which enable you to add or remove rules in the future without affecting the rest of the rules. For example, 1, 2, 3, 4, 5, 9, 12, 16 is a valid series of priority numbers
     * to which you could add rules numbered from 6 to 8, 10 to 11, and 13 to 15 in the future without any impact on existing rules.
     * 
     */
    public Output<String> priority() {
        return this.priority;
    }

    /**
     * In response to a matching path, the routeAction performs advanced routing actions like URL rewrites, header transformations, etc. prior to forwarding the request to the selected origin.
     * Structure is documented below.
     * 
     */
    @Import(name="routeAction")
    private @Nullable Output<EdgeCacheServiceRoutingPathMatcherRouteRuleRouteActionArgs> routeAction;

    /**
     * @return In response to a matching path, the routeAction performs advanced routing actions like URL rewrites, header transformations, etc. prior to forwarding the request to the selected origin.
     * Structure is documented below.
     * 
     */
    public Optional<Output<EdgeCacheServiceRoutingPathMatcherRouteRuleRouteActionArgs>> routeAction() {
        return Optional.ofNullable(this.routeAction);
    }

    /**
     * The URL redirect configuration for requests that match this route.
     * Structure is documented below.
     * 
     */
    @Import(name="urlRedirect")
    private @Nullable Output<EdgeCacheServiceRoutingPathMatcherRouteRuleUrlRedirectArgs> urlRedirect;

    /**
     * @return The URL redirect configuration for requests that match this route.
     * Structure is documented below.
     * 
     */
    public Optional<Output<EdgeCacheServiceRoutingPathMatcherRouteRuleUrlRedirectArgs>> urlRedirect() {
        return Optional.ofNullable(this.urlRedirect);
    }

    private EdgeCacheServiceRoutingPathMatcherRouteRuleArgs() {}

    private EdgeCacheServiceRoutingPathMatcherRouteRuleArgs(EdgeCacheServiceRoutingPathMatcherRouteRuleArgs $) {
        this.description = $.description;
        this.headerAction = $.headerAction;
        this.matchRules = $.matchRules;
        this.origin = $.origin;
        this.priority = $.priority;
        this.routeAction = $.routeAction;
        this.urlRedirect = $.urlRedirect;
    }

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

    public static final class Builder {
        private EdgeCacheServiceRoutingPathMatcherRouteRuleArgs $;

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

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

        /**
         * @param description A human-readable description of the routeRule.
         * 
         * @return builder
         * 
         */
        public Builder description(@Nullable Output<String> description) {
            $.description = description;
            return this;
        }

        /**
         * @param description A human-readable description of the routeRule.
         * 
         * @return builder
         * 
         */
        public Builder description(String description) {
            return description(Output.of(description));
        }

        /**
         * @param headerAction The header actions, including adding &amp; removing headers, for requests that match this route.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder headerAction(@Nullable Output<EdgeCacheServiceRoutingPathMatcherRouteRuleHeaderActionArgs> headerAction) {
            $.headerAction = headerAction;
            return this;
        }

        /**
         * @param headerAction The header actions, including adding &amp; removing headers, for requests that match this route.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder headerAction(EdgeCacheServiceRoutingPathMatcherRouteRuleHeaderActionArgs headerAction) {
            return headerAction(Output.of(headerAction));
        }

        /**
         * @param matchRules The list of criteria for matching attributes of a request to this routeRule. This list has OR semantics: the request matches this routeRule when any of the matchRules are satisfied. However predicates
         * within a given matchRule have AND semantics. All predicates within a matchRule must match for the request to match the rule.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder matchRules(Output<List<EdgeCacheServiceRoutingPathMatcherRouteRuleMatchRuleArgs>> matchRules) {
            $.matchRules = matchRules;
            return this;
        }

        /**
         * @param matchRules The list of criteria for matching attributes of a request to this routeRule. This list has OR semantics: the request matches this routeRule when any of the matchRules are satisfied. However predicates
         * within a given matchRule have AND semantics. All predicates within a matchRule must match for the request to match the rule.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder matchRules(List<EdgeCacheServiceRoutingPathMatcherRouteRuleMatchRuleArgs> matchRules) {
            return matchRules(Output.of(matchRules));
        }

        /**
         * @param matchRules The list of criteria for matching attributes of a request to this routeRule. This list has OR semantics: the request matches this routeRule when any of the matchRules are satisfied. However predicates
         * within a given matchRule have AND semantics. All predicates within a matchRule must match for the request to match the rule.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder matchRules(EdgeCacheServiceRoutingPathMatcherRouteRuleMatchRuleArgs... matchRules) {
            return matchRules(List.of(matchRules));
        }

        /**
         * @param origin The Origin resource that requests to this route should fetch from when a matching response is not in cache. Origins can be defined as short names (&#34;my-origin&#34;) or fully-qualified resource URLs - e.g. &#34;networkservices.googleapis.com/projects/my-project/global/edgecacheorigins/my-origin&#34;
         * Only one of origin or urlRedirect can be set.
         * 
         * @return builder
         * 
         */
        public Builder origin(@Nullable Output<String> origin) {
            $.origin = origin;
            return this;
        }

        /**
         * @param origin The Origin resource that requests to this route should fetch from when a matching response is not in cache. Origins can be defined as short names (&#34;my-origin&#34;) or fully-qualified resource URLs - e.g. &#34;networkservices.googleapis.com/projects/my-project/global/edgecacheorigins/my-origin&#34;
         * Only one of origin or urlRedirect can be set.
         * 
         * @return builder
         * 
         */
        public Builder origin(String origin) {
            return origin(Output.of(origin));
        }

        /**
         * @param priority The priority of this route rule, where 1 is the highest priority.
         * You cannot configure two or more routeRules with the same priority. Priority for each rule must be set to a number between 1 and 999 inclusive.
         * Priority numbers can have gaps, which enable you to add or remove rules in the future without affecting the rest of the rules. For example, 1, 2, 3, 4, 5, 9, 12, 16 is a valid series of priority numbers
         * to which you could add rules numbered from 6 to 8, 10 to 11, and 13 to 15 in the future without any impact on existing rules.
         * 
         * @return builder
         * 
         */
        public Builder priority(Output<String> priority) {
            $.priority = priority;
            return this;
        }

        /**
         * @param priority The priority of this route rule, where 1 is the highest priority.
         * You cannot configure two or more routeRules with the same priority. Priority for each rule must be set to a number between 1 and 999 inclusive.
         * Priority numbers can have gaps, which enable you to add or remove rules in the future without affecting the rest of the rules. For example, 1, 2, 3, 4, 5, 9, 12, 16 is a valid series of priority numbers
         * to which you could add rules numbered from 6 to 8, 10 to 11, and 13 to 15 in the future without any impact on existing rules.
         * 
         * @return builder
         * 
         */
        public Builder priority(String priority) {
            return priority(Output.of(priority));
        }

        /**
         * @param routeAction In response to a matching path, the routeAction performs advanced routing actions like URL rewrites, header transformations, etc. prior to forwarding the request to the selected origin.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder routeAction(@Nullable Output<EdgeCacheServiceRoutingPathMatcherRouteRuleRouteActionArgs> routeAction) {
            $.routeAction = routeAction;
            return this;
        }

        /**
         * @param routeAction In response to a matching path, the routeAction performs advanced routing actions like URL rewrites, header transformations, etc. prior to forwarding the request to the selected origin.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder routeAction(EdgeCacheServiceRoutingPathMatcherRouteRuleRouteActionArgs routeAction) {
            return routeAction(Output.of(routeAction));
        }

        /**
         * @param urlRedirect The URL redirect configuration for requests that match this route.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder urlRedirect(@Nullable Output<EdgeCacheServiceRoutingPathMatcherRouteRuleUrlRedirectArgs> urlRedirect) {
            $.urlRedirect = urlRedirect;
            return this;
        }

        /**
         * @param urlRedirect The URL redirect configuration for requests that match this route.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder urlRedirect(EdgeCacheServiceRoutingPathMatcherRouteRuleUrlRedirectArgs urlRedirect) {
            return urlRedirect(Output.of(urlRedirect));
        }

        public EdgeCacheServiceRoutingPathMatcherRouteRuleArgs build() {
            $.matchRules = Objects.requireNonNull($.matchRules, "expected parameter 'matchRules' to be non-null");
            $.priority = Objects.requireNonNull($.priority, "expected parameter 'priority' to be non-null");
            return $;
        }
    }

}
