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

import com.pulumi.azure.frontdoor.outputs.FrontdoorRoutingRuleForwardingConfiguration;
import com.pulumi.azure.frontdoor.outputs.FrontdoorRoutingRuleRedirectConfiguration;
import com.pulumi.core.annotations.CustomType;
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 FrontdoorRoutingRule {
    /**
     * @return Protocol schemes to match for the Backend Routing Rule. Possible values are `Http` and `Https`.
     * 
     */
    private List<String> acceptedProtocols;
    /**
     * @return `Enable` or `Disable` use of this Backend Routing Rule. Permitted values are `true` or `false`. Defaults to `true`.
     * 
     */
    private @Nullable Boolean enabled;
    /**
     * @return A `forwarding_configuration` block as defined below.
     * 
     */
    private @Nullable FrontdoorRoutingRuleForwardingConfiguration forwardingConfiguration;
    /**
     * @return The names of the `frontend_endpoint` blocks within this resource to associate with this `routing_rule`.
     * 
     */
    private List<String> frontendEndpoints;
    /**
     * @return The ID of the FrontDoor.
     * 
     */
    private @Nullable String id;
    /**
     * @return Specifies the name of the Routing Rule.
     * 
     */
    private String name;
    /**
     * @return The route patterns for the Backend Routing Rule.
     * 
     */
    private List<String> patternsToMatches;
    /**
     * @return A `redirect_configuration` block as defined below.
     * 
     */
    private @Nullable FrontdoorRoutingRuleRedirectConfiguration redirectConfiguration;

    private FrontdoorRoutingRule() {}
    /**
     * @return Protocol schemes to match for the Backend Routing Rule. Possible values are `Http` and `Https`.
     * 
     */
    public List<String> acceptedProtocols() {
        return this.acceptedProtocols;
    }
    /**
     * @return `Enable` or `Disable` use of this Backend Routing Rule. Permitted values are `true` or `false`. Defaults to `true`.
     * 
     */
    public Optional<Boolean> enabled() {
        return Optional.ofNullable(this.enabled);
    }
    /**
     * @return A `forwarding_configuration` block as defined below.
     * 
     */
    public Optional<FrontdoorRoutingRuleForwardingConfiguration> forwardingConfiguration() {
        return Optional.ofNullable(this.forwardingConfiguration);
    }
    /**
     * @return The names of the `frontend_endpoint` blocks within this resource to associate with this `routing_rule`.
     * 
     */
    public List<String> frontendEndpoints() {
        return this.frontendEndpoints;
    }
    /**
     * @return The ID of the FrontDoor.
     * 
     */
    public Optional<String> id() {
        return Optional.ofNullable(this.id);
    }
    /**
     * @return Specifies the name of the Routing Rule.
     * 
     */
    public String name() {
        return this.name;
    }
    /**
     * @return The route patterns for the Backend Routing Rule.
     * 
     */
    public List<String> patternsToMatches() {
        return this.patternsToMatches;
    }
    /**
     * @return A `redirect_configuration` block as defined below.
     * 
     */
    public Optional<FrontdoorRoutingRuleRedirectConfiguration> redirectConfiguration() {
        return Optional.ofNullable(this.redirectConfiguration);
    }

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

    public static Builder builder(FrontdoorRoutingRule defaults) {
        return new Builder(defaults);
    }
    @CustomType.Builder
    public static final class Builder {
        private List<String> acceptedProtocols;
        private @Nullable Boolean enabled;
        private @Nullable FrontdoorRoutingRuleForwardingConfiguration forwardingConfiguration;
        private List<String> frontendEndpoints;
        private @Nullable String id;
        private String name;
        private List<String> patternsToMatches;
        private @Nullable FrontdoorRoutingRuleRedirectConfiguration redirectConfiguration;
        public Builder() {}
        public Builder(FrontdoorRoutingRule defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.acceptedProtocols = defaults.acceptedProtocols;
    	      this.enabled = defaults.enabled;
    	      this.forwardingConfiguration = defaults.forwardingConfiguration;
    	      this.frontendEndpoints = defaults.frontendEndpoints;
    	      this.id = defaults.id;
    	      this.name = defaults.name;
    	      this.patternsToMatches = defaults.patternsToMatches;
    	      this.redirectConfiguration = defaults.redirectConfiguration;
        }

        @CustomType.Setter
        public Builder acceptedProtocols(List<String> acceptedProtocols) {
            this.acceptedProtocols = Objects.requireNonNull(acceptedProtocols);
            return this;
        }
        public Builder acceptedProtocols(String... acceptedProtocols) {
            return acceptedProtocols(List.of(acceptedProtocols));
        }
        @CustomType.Setter
        public Builder enabled(@Nullable Boolean enabled) {
            this.enabled = enabled;
            return this;
        }
        @CustomType.Setter
        public Builder forwardingConfiguration(@Nullable FrontdoorRoutingRuleForwardingConfiguration forwardingConfiguration) {
            this.forwardingConfiguration = forwardingConfiguration;
            return this;
        }
        @CustomType.Setter
        public Builder frontendEndpoints(List<String> frontendEndpoints) {
            this.frontendEndpoints = Objects.requireNonNull(frontendEndpoints);
            return this;
        }
        public Builder frontendEndpoints(String... frontendEndpoints) {
            return frontendEndpoints(List.of(frontendEndpoints));
        }
        @CustomType.Setter
        public Builder id(@Nullable String id) {
            this.id = id;
            return this;
        }
        @CustomType.Setter
        public Builder name(String name) {
            this.name = Objects.requireNonNull(name);
            return this;
        }
        @CustomType.Setter
        public Builder patternsToMatches(List<String> patternsToMatches) {
            this.patternsToMatches = Objects.requireNonNull(patternsToMatches);
            return this;
        }
        public Builder patternsToMatches(String... patternsToMatches) {
            return patternsToMatches(List.of(patternsToMatches));
        }
        @CustomType.Setter
        public Builder redirectConfiguration(@Nullable FrontdoorRoutingRuleRedirectConfiguration redirectConfiguration) {
            this.redirectConfiguration = redirectConfiguration;
            return this;
        }
        public FrontdoorRoutingRule build() {
            final var o = new FrontdoorRoutingRule();
            o.acceptedProtocols = acceptedProtocols;
            o.enabled = enabled;
            o.forwardingConfiguration = forwardingConfiguration;
            o.frontendEndpoints = frontendEndpoints;
            o.id = id;
            o.name = name;
            o.patternsToMatches = patternsToMatches;
            o.redirectConfiguration = redirectConfiguration;
            return o;
        }
    }
}
