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

import com.pulumi.core.annotations.CustomType;
import com.pulumi.gcp.networkservices.outputs.EdgeCacheServiceRoutingPathMatcherRouteRuleMatchRuleHeaderMatch;
import com.pulumi.gcp.networkservices.outputs.EdgeCacheServiceRoutingPathMatcherRouteRuleMatchRuleQueryParameterMatch;
import java.lang.Boolean;
import java.lang.String;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;

@CustomType
public final class EdgeCacheServiceRoutingPathMatcherRouteRuleMatchRule {
    /**
     * @return For satisfying the matchRule condition, the path of the request must exactly match the value specified in fullPathMatch after removing any query parameters and anchor that may be part of the original URL.
     * 
     */
    private @Nullable String fullPathMatch;
    /**
     * @return Specifies a list of header match criteria, all of which must match corresponding headers in the request.
     * Structure is documented below.
     * 
     */
    private @Nullable List<EdgeCacheServiceRoutingPathMatcherRouteRuleMatchRuleHeaderMatch> headerMatches;
    /**
     * @return Specifies that prefixMatch and fullPathMatch matches are case sensitive.
     * 
     */
    private @Nullable Boolean ignoreCase;
    /**
     * @return For satisfying the matchRule condition, the path of the request
     * must match the wildcard pattern specified in pathTemplateMatch
     * after removing any query parameters and anchor that may be part
     * of the original URL.
     * pathTemplateMatch must be between 1 and 255 characters
     * (inclusive).  The pattern specified by pathTemplateMatch may
     * have at most 5 wildcard operators and at most 5 variable
     * captures in total.
     * 
     */
    private @Nullable String pathTemplateMatch;
    /**
     * @return For satisfying the matchRule condition, the request&#39;s path must begin with the specified prefixMatch. prefixMatch must begin with a /.
     * 
     */
    private @Nullable String prefixMatch;
    /**
     * @return Specifies a list of query parameter match criteria, all of which must match corresponding query parameters in the request.
     * Structure is documented below.
     * 
     */
    private @Nullable List<EdgeCacheServiceRoutingPathMatcherRouteRuleMatchRuleQueryParameterMatch> queryParameterMatches;

    private EdgeCacheServiceRoutingPathMatcherRouteRuleMatchRule() {}
    /**
     * @return For satisfying the matchRule condition, the path of the request must exactly match the value specified in fullPathMatch after removing any query parameters and anchor that may be part of the original URL.
     * 
     */
    public Optional<String> fullPathMatch() {
        return Optional.ofNullable(this.fullPathMatch);
    }
    /**
     * @return Specifies a list of header match criteria, all of which must match corresponding headers in the request.
     * Structure is documented below.
     * 
     */
    public List<EdgeCacheServiceRoutingPathMatcherRouteRuleMatchRuleHeaderMatch> headerMatches() {
        return this.headerMatches == null ? List.of() : this.headerMatches;
    }
    /**
     * @return Specifies that prefixMatch and fullPathMatch matches are case sensitive.
     * 
     */
    public Optional<Boolean> ignoreCase() {
        return Optional.ofNullable(this.ignoreCase);
    }
    /**
     * @return For satisfying the matchRule condition, the path of the request
     * must match the wildcard pattern specified in pathTemplateMatch
     * after removing any query parameters and anchor that may be part
     * of the original URL.
     * pathTemplateMatch must be between 1 and 255 characters
     * (inclusive).  The pattern specified by pathTemplateMatch may
     * have at most 5 wildcard operators and at most 5 variable
     * captures in total.
     * 
     */
    public Optional<String> pathTemplateMatch() {
        return Optional.ofNullable(this.pathTemplateMatch);
    }
    /**
     * @return For satisfying the matchRule condition, the request&#39;s path must begin with the specified prefixMatch. prefixMatch must begin with a /.
     * 
     */
    public Optional<String> prefixMatch() {
        return Optional.ofNullable(this.prefixMatch);
    }
    /**
     * @return Specifies a list of query parameter match criteria, all of which must match corresponding query parameters in the request.
     * Structure is documented below.
     * 
     */
    public List<EdgeCacheServiceRoutingPathMatcherRouteRuleMatchRuleQueryParameterMatch> queryParameterMatches() {
        return this.queryParameterMatches == null ? List.of() : this.queryParameterMatches;
    }

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

    public static Builder builder(EdgeCacheServiceRoutingPathMatcherRouteRuleMatchRule defaults) {
        return new Builder(defaults);
    }
    @CustomType.Builder
    public static final class Builder {
        private @Nullable String fullPathMatch;
        private @Nullable List<EdgeCacheServiceRoutingPathMatcherRouteRuleMatchRuleHeaderMatch> headerMatches;
        private @Nullable Boolean ignoreCase;
        private @Nullable String pathTemplateMatch;
        private @Nullable String prefixMatch;
        private @Nullable List<EdgeCacheServiceRoutingPathMatcherRouteRuleMatchRuleQueryParameterMatch> queryParameterMatches;
        public Builder() {}
        public Builder(EdgeCacheServiceRoutingPathMatcherRouteRuleMatchRule defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.fullPathMatch = defaults.fullPathMatch;
    	      this.headerMatches = defaults.headerMatches;
    	      this.ignoreCase = defaults.ignoreCase;
    	      this.pathTemplateMatch = defaults.pathTemplateMatch;
    	      this.prefixMatch = defaults.prefixMatch;
    	      this.queryParameterMatches = defaults.queryParameterMatches;
        }

        @CustomType.Setter
        public Builder fullPathMatch(@Nullable String fullPathMatch) {
            this.fullPathMatch = fullPathMatch;
            return this;
        }
        @CustomType.Setter
        public Builder headerMatches(@Nullable List<EdgeCacheServiceRoutingPathMatcherRouteRuleMatchRuleHeaderMatch> headerMatches) {
            this.headerMatches = headerMatches;
            return this;
        }
        public Builder headerMatches(EdgeCacheServiceRoutingPathMatcherRouteRuleMatchRuleHeaderMatch... headerMatches) {
            return headerMatches(List.of(headerMatches));
        }
        @CustomType.Setter
        public Builder ignoreCase(@Nullable Boolean ignoreCase) {
            this.ignoreCase = ignoreCase;
            return this;
        }
        @CustomType.Setter
        public Builder pathTemplateMatch(@Nullable String pathTemplateMatch) {
            this.pathTemplateMatch = pathTemplateMatch;
            return this;
        }
        @CustomType.Setter
        public Builder prefixMatch(@Nullable String prefixMatch) {
            this.prefixMatch = prefixMatch;
            return this;
        }
        @CustomType.Setter
        public Builder queryParameterMatches(@Nullable List<EdgeCacheServiceRoutingPathMatcherRouteRuleMatchRuleQueryParameterMatch> queryParameterMatches) {
            this.queryParameterMatches = queryParameterMatches;
            return this;
        }
        public Builder queryParameterMatches(EdgeCacheServiceRoutingPathMatcherRouteRuleMatchRuleQueryParameterMatch... queryParameterMatches) {
            return queryParameterMatches(List.of(queryParameterMatches));
        }
        public EdgeCacheServiceRoutingPathMatcherRouteRuleMatchRule build() {
            final var o = new EdgeCacheServiceRoutingPathMatcherRouteRuleMatchRule();
            o.fullPathMatch = fullPathMatch;
            o.headerMatches = headerMatches;
            o.ignoreCase = ignoreCase;
            o.pathTemplateMatch = pathTemplateMatch;
            o.prefixMatch = prefixMatch;
            o.queryParameterMatches = queryParameterMatches;
            return o;
        }
    }
}
