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

@CustomType
public final class EdgeCacheServiceRoutingPathMatcherRouteRuleRouteActionUrlRewrite {
    /**
     * @return Prior to forwarding the request to the selected origin, the request&#39;s host header is replaced with contents of hostRewrite.
     * 
     */
    private @Nullable String hostRewrite;
    /**
     * @return Prior to forwarding the request to the selected origin, the matching portion of the request&#39;s path is replaced by pathPrefixRewrite.
     * 
     */
    private @Nullable String pathPrefixRewrite;
    /**
     * @return Prior to forwarding the request to the selected origin, if the
     * request matched a pathTemplateMatch, the matching portion of the
     * request&#39;s path is replaced re-written using the pattern specified
     * by pathTemplateRewrite.
     * pathTemplateRewrite must be between 1 and 255 characters
     * (inclusive), must start with a &#39;/&#39;, and must only use variables
     * captured by the route&#39;s pathTemplate matchers.
     * pathTemplateRewrite may only be used when all of a route&#39;s
     * MatchRules specify pathTemplate.
     * Only one of pathPrefixRewrite and pathTemplateRewrite may be
     * specified.
     * 
     */
    private @Nullable String pathTemplateRewrite;

    private EdgeCacheServiceRoutingPathMatcherRouteRuleRouteActionUrlRewrite() {}
    /**
     * @return Prior to forwarding the request to the selected origin, the request&#39;s host header is replaced with contents of hostRewrite.
     * 
     */
    public Optional<String> hostRewrite() {
        return Optional.ofNullable(this.hostRewrite);
    }
    /**
     * @return Prior to forwarding the request to the selected origin, the matching portion of the request&#39;s path is replaced by pathPrefixRewrite.
     * 
     */
    public Optional<String> pathPrefixRewrite() {
        return Optional.ofNullable(this.pathPrefixRewrite);
    }
    /**
     * @return Prior to forwarding the request to the selected origin, if the
     * request matched a pathTemplateMatch, the matching portion of the
     * request&#39;s path is replaced re-written using the pattern specified
     * by pathTemplateRewrite.
     * pathTemplateRewrite must be between 1 and 255 characters
     * (inclusive), must start with a &#39;/&#39;, and must only use variables
     * captured by the route&#39;s pathTemplate matchers.
     * pathTemplateRewrite may only be used when all of a route&#39;s
     * MatchRules specify pathTemplate.
     * Only one of pathPrefixRewrite and pathTemplateRewrite may be
     * specified.
     * 
     */
    public Optional<String> pathTemplateRewrite() {
        return Optional.ofNullable(this.pathTemplateRewrite);
    }

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

    public static Builder builder(EdgeCacheServiceRoutingPathMatcherRouteRuleRouteActionUrlRewrite defaults) {
        return new Builder(defaults);
    }
    @CustomType.Builder
    public static final class Builder {
        private @Nullable String hostRewrite;
        private @Nullable String pathPrefixRewrite;
        private @Nullable String pathTemplateRewrite;
        public Builder() {}
        public Builder(EdgeCacheServiceRoutingPathMatcherRouteRuleRouteActionUrlRewrite defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.hostRewrite = defaults.hostRewrite;
    	      this.pathPrefixRewrite = defaults.pathPrefixRewrite;
    	      this.pathTemplateRewrite = defaults.pathTemplateRewrite;
        }

        @CustomType.Setter
        public Builder hostRewrite(@Nullable String hostRewrite) {
            this.hostRewrite = hostRewrite;
            return this;
        }
        @CustomType.Setter
        public Builder pathPrefixRewrite(@Nullable String pathPrefixRewrite) {
            this.pathPrefixRewrite = pathPrefixRewrite;
            return this;
        }
        @CustomType.Setter
        public Builder pathTemplateRewrite(@Nullable String pathTemplateRewrite) {
            this.pathTemplateRewrite = pathTemplateRewrite;
            return this;
        }
        public EdgeCacheServiceRoutingPathMatcherRouteRuleRouteActionUrlRewrite build() {
            final var o = new EdgeCacheServiceRoutingPathMatcherRouteRuleRouteActionUrlRewrite();
            o.hostRewrite = hostRewrite;
            o.pathPrefixRewrite = pathPrefixRewrite;
            o.pathTemplateRewrite = pathTemplateRewrite;
            return o;
        }
    }
}
