All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.azurenative.cdn.RouteArgs Maven / Gradle / Ivy

There is a newer version: 2.72.0
Show newest version
// *** 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.azurenative.cdn;

import com.pulumi.azurenative.cdn.enums.AFDEndpointProtocols;
import com.pulumi.azurenative.cdn.enums.EnabledState;
import com.pulumi.azurenative.cdn.enums.ForwardingProtocol;
import com.pulumi.azurenative.cdn.enums.HttpsRedirect;
import com.pulumi.azurenative.cdn.enums.LinkToDefaultDomain;
import com.pulumi.azurenative.cdn.inputs.ActivatedResourceReferenceArgs;
import com.pulumi.azurenative.cdn.inputs.AfdRouteCacheConfigurationArgs;
import com.pulumi.azurenative.cdn.inputs.ResourceReferenceArgs;
import com.pulumi.core.Either;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.core.internal.Codegen;
import com.pulumi.exceptions.MissingRequiredPropertyException;
import java.lang.String;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


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

    public static final RouteArgs Empty = new RouteArgs();

    /**
     * The caching configuration for this route. To disable caching, do not provide a cacheConfiguration object.
     * 
     */
    @Import(name="cacheConfiguration")
    private @Nullable Output cacheConfiguration;

    /**
     * @return The caching configuration for this route. To disable caching, do not provide a cacheConfiguration object.
     * 
     */
    public Optional> cacheConfiguration() {
        return Optional.ofNullable(this.cacheConfiguration);
    }

    /**
     * Domains referenced by this endpoint.
     * 
     */
    @Import(name="customDomains")
    private @Nullable Output> customDomains;

    /**
     * @return Domains referenced by this endpoint.
     * 
     */
    public Optional>> customDomains() {
        return Optional.ofNullable(this.customDomains);
    }

    /**
     * Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'
     * 
     */
    @Import(name="enabledState")
    private @Nullable Output> enabledState;

    /**
     * @return Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'
     * 
     */
    public Optional>> enabledState() {
        return Optional.ofNullable(this.enabledState);
    }

    /**
     * Name of the endpoint under the profile which is unique globally.
     * 
     */
    @Import(name="endpointName", required=true)
    private Output endpointName;

    /**
     * @return Name of the endpoint under the profile which is unique globally.
     * 
     */
    public Output endpointName() {
        return this.endpointName;
    }

    /**
     * Protocol this rule will use when forwarding traffic to backends.
     * 
     */
    @Import(name="forwardingProtocol")
    private @Nullable Output> forwardingProtocol;

    /**
     * @return Protocol this rule will use when forwarding traffic to backends.
     * 
     */
    public Optional>> forwardingProtocol() {
        return Optional.ofNullable(this.forwardingProtocol);
    }

    /**
     * Whether to automatically redirect HTTP traffic to HTTPS traffic. Note that this is a easy way to set up this rule and it will be the first rule that gets executed.
     * 
     */
    @Import(name="httpsRedirect")
    private @Nullable Output> httpsRedirect;

    /**
     * @return Whether to automatically redirect HTTP traffic to HTTPS traffic. Note that this is a easy way to set up this rule and it will be the first rule that gets executed.
     * 
     */
    public Optional>> httpsRedirect() {
        return Optional.ofNullable(this.httpsRedirect);
    }

    /**
     * whether this route will be linked to the default endpoint domain.
     * 
     */
    @Import(name="linkToDefaultDomain")
    private @Nullable Output> linkToDefaultDomain;

    /**
     * @return whether this route will be linked to the default endpoint domain.
     * 
     */
    public Optional>> linkToDefaultDomain() {
        return Optional.ofNullable(this.linkToDefaultDomain);
    }

    /**
     * A reference to the origin group.
     * 
     */
    @Import(name="originGroup", required=true)
    private Output originGroup;

    /**
     * @return A reference to the origin group.
     * 
     */
    public Output originGroup() {
        return this.originGroup;
    }

    /**
     * A directory path on the origin that AzureFrontDoor can use to retrieve content from, e.g. contoso.cloudapp.net/originpath.
     * 
     */
    @Import(name="originPath")
    private @Nullable Output originPath;

    /**
     * @return A directory path on the origin that AzureFrontDoor can use to retrieve content from, e.g. contoso.cloudapp.net/originpath.
     * 
     */
    public Optional> originPath() {
        return Optional.ofNullable(this.originPath);
    }

    /**
     * The route patterns of the rule.
     * 
     */
    @Import(name="patternsToMatch")
    private @Nullable Output> patternsToMatch;

    /**
     * @return The route patterns of the rule.
     * 
     */
    public Optional>> patternsToMatch() {
        return Optional.ofNullable(this.patternsToMatch);
    }

    /**
     * Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource group.
     * 
     */
    @Import(name="profileName", required=true)
    private Output profileName;

    /**
     * @return Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource group.
     * 
     */
    public Output profileName() {
        return this.profileName;
    }

    /**
     * Name of the Resource group within the Azure subscription.
     * 
     */
    @Import(name="resourceGroupName", required=true)
    private Output resourceGroupName;

    /**
     * @return Name of the Resource group within the Azure subscription.
     * 
     */
    public Output resourceGroupName() {
        return this.resourceGroupName;
    }

    /**
     * Name of the routing rule.
     * 
     */
    @Import(name="routeName")
    private @Nullable Output routeName;

    /**
     * @return Name of the routing rule.
     * 
     */
    public Optional> routeName() {
        return Optional.ofNullable(this.routeName);
    }

    /**
     * rule sets referenced by this endpoint.
     * 
     */
    @Import(name="ruleSets")
    private @Nullable Output> ruleSets;

    /**
     * @return rule sets referenced by this endpoint.
     * 
     */
    public Optional>> ruleSets() {
        return Optional.ofNullable(this.ruleSets);
    }

    /**
     * List of supported protocols for this route.
     * 
     */
    @Import(name="supportedProtocols")
    private @Nullable Output>> supportedProtocols;

    /**
     * @return List of supported protocols for this route.
     * 
     */
    public Optional>>> supportedProtocols() {
        return Optional.ofNullable(this.supportedProtocols);
    }

    private RouteArgs() {}

    private RouteArgs(RouteArgs $) {
        this.cacheConfiguration = $.cacheConfiguration;
        this.customDomains = $.customDomains;
        this.enabledState = $.enabledState;
        this.endpointName = $.endpointName;
        this.forwardingProtocol = $.forwardingProtocol;
        this.httpsRedirect = $.httpsRedirect;
        this.linkToDefaultDomain = $.linkToDefaultDomain;
        this.originGroup = $.originGroup;
        this.originPath = $.originPath;
        this.patternsToMatch = $.patternsToMatch;
        this.profileName = $.profileName;
        this.resourceGroupName = $.resourceGroupName;
        this.routeName = $.routeName;
        this.ruleSets = $.ruleSets;
        this.supportedProtocols = $.supportedProtocols;
    }

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

    public static final class Builder {
        private RouteArgs $;

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

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

        /**
         * @param cacheConfiguration The caching configuration for this route. To disable caching, do not provide a cacheConfiguration object.
         * 
         * @return builder
         * 
         */
        public Builder cacheConfiguration(@Nullable Output cacheConfiguration) {
            $.cacheConfiguration = cacheConfiguration;
            return this;
        }

        /**
         * @param cacheConfiguration The caching configuration for this route. To disable caching, do not provide a cacheConfiguration object.
         * 
         * @return builder
         * 
         */
        public Builder cacheConfiguration(AfdRouteCacheConfigurationArgs cacheConfiguration) {
            return cacheConfiguration(Output.of(cacheConfiguration));
        }

        /**
         * @param customDomains Domains referenced by this endpoint.
         * 
         * @return builder
         * 
         */
        public Builder customDomains(@Nullable Output> customDomains) {
            $.customDomains = customDomains;
            return this;
        }

        /**
         * @param customDomains Domains referenced by this endpoint.
         * 
         * @return builder
         * 
         */
        public Builder customDomains(List customDomains) {
            return customDomains(Output.of(customDomains));
        }

        /**
         * @param customDomains Domains referenced by this endpoint.
         * 
         * @return builder
         * 
         */
        public Builder customDomains(ActivatedResourceReferenceArgs... customDomains) {
            return customDomains(List.of(customDomains));
        }

        /**
         * @param enabledState Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'
         * 
         * @return builder
         * 
         */
        public Builder enabledState(@Nullable Output> enabledState) {
            $.enabledState = enabledState;
            return this;
        }

        /**
         * @param enabledState Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'
         * 
         * @return builder
         * 
         */
        public Builder enabledState(Either enabledState) {
            return enabledState(Output.of(enabledState));
        }

        /**
         * @param enabledState Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'
         * 
         * @return builder
         * 
         */
        public Builder enabledState(String enabledState) {
            return enabledState(Either.ofLeft(enabledState));
        }

        /**
         * @param enabledState Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'
         * 
         * @return builder
         * 
         */
        public Builder enabledState(EnabledState enabledState) {
            return enabledState(Either.ofRight(enabledState));
        }

        /**
         * @param endpointName Name of the endpoint under the profile which is unique globally.
         * 
         * @return builder
         * 
         */
        public Builder endpointName(Output endpointName) {
            $.endpointName = endpointName;
            return this;
        }

        /**
         * @param endpointName Name of the endpoint under the profile which is unique globally.
         * 
         * @return builder
         * 
         */
        public Builder endpointName(String endpointName) {
            return endpointName(Output.of(endpointName));
        }

        /**
         * @param forwardingProtocol Protocol this rule will use when forwarding traffic to backends.
         * 
         * @return builder
         * 
         */
        public Builder forwardingProtocol(@Nullable Output> forwardingProtocol) {
            $.forwardingProtocol = forwardingProtocol;
            return this;
        }

        /**
         * @param forwardingProtocol Protocol this rule will use when forwarding traffic to backends.
         * 
         * @return builder
         * 
         */
        public Builder forwardingProtocol(Either forwardingProtocol) {
            return forwardingProtocol(Output.of(forwardingProtocol));
        }

        /**
         * @param forwardingProtocol Protocol this rule will use when forwarding traffic to backends.
         * 
         * @return builder
         * 
         */
        public Builder forwardingProtocol(String forwardingProtocol) {
            return forwardingProtocol(Either.ofLeft(forwardingProtocol));
        }

        /**
         * @param forwardingProtocol Protocol this rule will use when forwarding traffic to backends.
         * 
         * @return builder
         * 
         */
        public Builder forwardingProtocol(ForwardingProtocol forwardingProtocol) {
            return forwardingProtocol(Either.ofRight(forwardingProtocol));
        }

        /**
         * @param httpsRedirect Whether to automatically redirect HTTP traffic to HTTPS traffic. Note that this is a easy way to set up this rule and it will be the first rule that gets executed.
         * 
         * @return builder
         * 
         */
        public Builder httpsRedirect(@Nullable Output> httpsRedirect) {
            $.httpsRedirect = httpsRedirect;
            return this;
        }

        /**
         * @param httpsRedirect Whether to automatically redirect HTTP traffic to HTTPS traffic. Note that this is a easy way to set up this rule and it will be the first rule that gets executed.
         * 
         * @return builder
         * 
         */
        public Builder httpsRedirect(Either httpsRedirect) {
            return httpsRedirect(Output.of(httpsRedirect));
        }

        /**
         * @param httpsRedirect Whether to automatically redirect HTTP traffic to HTTPS traffic. Note that this is a easy way to set up this rule and it will be the first rule that gets executed.
         * 
         * @return builder
         * 
         */
        public Builder httpsRedirect(String httpsRedirect) {
            return httpsRedirect(Either.ofLeft(httpsRedirect));
        }

        /**
         * @param httpsRedirect Whether to automatically redirect HTTP traffic to HTTPS traffic. Note that this is a easy way to set up this rule and it will be the first rule that gets executed.
         * 
         * @return builder
         * 
         */
        public Builder httpsRedirect(HttpsRedirect httpsRedirect) {
            return httpsRedirect(Either.ofRight(httpsRedirect));
        }

        /**
         * @param linkToDefaultDomain whether this route will be linked to the default endpoint domain.
         * 
         * @return builder
         * 
         */
        public Builder linkToDefaultDomain(@Nullable Output> linkToDefaultDomain) {
            $.linkToDefaultDomain = linkToDefaultDomain;
            return this;
        }

        /**
         * @param linkToDefaultDomain whether this route will be linked to the default endpoint domain.
         * 
         * @return builder
         * 
         */
        public Builder linkToDefaultDomain(Either linkToDefaultDomain) {
            return linkToDefaultDomain(Output.of(linkToDefaultDomain));
        }

        /**
         * @param linkToDefaultDomain whether this route will be linked to the default endpoint domain.
         * 
         * @return builder
         * 
         */
        public Builder linkToDefaultDomain(String linkToDefaultDomain) {
            return linkToDefaultDomain(Either.ofLeft(linkToDefaultDomain));
        }

        /**
         * @param linkToDefaultDomain whether this route will be linked to the default endpoint domain.
         * 
         * @return builder
         * 
         */
        public Builder linkToDefaultDomain(LinkToDefaultDomain linkToDefaultDomain) {
            return linkToDefaultDomain(Either.ofRight(linkToDefaultDomain));
        }

        /**
         * @param originGroup A reference to the origin group.
         * 
         * @return builder
         * 
         */
        public Builder originGroup(Output originGroup) {
            $.originGroup = originGroup;
            return this;
        }

        /**
         * @param originGroup A reference to the origin group.
         * 
         * @return builder
         * 
         */
        public Builder originGroup(ResourceReferenceArgs originGroup) {
            return originGroup(Output.of(originGroup));
        }

        /**
         * @param originPath A directory path on the origin that AzureFrontDoor can use to retrieve content from, e.g. contoso.cloudapp.net/originpath.
         * 
         * @return builder
         * 
         */
        public Builder originPath(@Nullable Output originPath) {
            $.originPath = originPath;
            return this;
        }

        /**
         * @param originPath A directory path on the origin that AzureFrontDoor can use to retrieve content from, e.g. contoso.cloudapp.net/originpath.
         * 
         * @return builder
         * 
         */
        public Builder originPath(String originPath) {
            return originPath(Output.of(originPath));
        }

        /**
         * @param patternsToMatch The route patterns of the rule.
         * 
         * @return builder
         * 
         */
        public Builder patternsToMatch(@Nullable Output> patternsToMatch) {
            $.patternsToMatch = patternsToMatch;
            return this;
        }

        /**
         * @param patternsToMatch The route patterns of the rule.
         * 
         * @return builder
         * 
         */
        public Builder patternsToMatch(List patternsToMatch) {
            return patternsToMatch(Output.of(patternsToMatch));
        }

        /**
         * @param patternsToMatch The route patterns of the rule.
         * 
         * @return builder
         * 
         */
        public Builder patternsToMatch(String... patternsToMatch) {
            return patternsToMatch(List.of(patternsToMatch));
        }

        /**
         * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource group.
         * 
         * @return builder
         * 
         */
        public Builder profileName(Output profileName) {
            $.profileName = profileName;
            return this;
        }

        /**
         * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource group.
         * 
         * @return builder
         * 
         */
        public Builder profileName(String profileName) {
            return profileName(Output.of(profileName));
        }

        /**
         * @param resourceGroupName Name of the Resource group within the Azure subscription.
         * 
         * @return builder
         * 
         */
        public Builder resourceGroupName(Output resourceGroupName) {
            $.resourceGroupName = resourceGroupName;
            return this;
        }

        /**
         * @param resourceGroupName Name of the Resource group within the Azure subscription.
         * 
         * @return builder
         * 
         */
        public Builder resourceGroupName(String resourceGroupName) {
            return resourceGroupName(Output.of(resourceGroupName));
        }

        /**
         * @param routeName Name of the routing rule.
         * 
         * @return builder
         * 
         */
        public Builder routeName(@Nullable Output routeName) {
            $.routeName = routeName;
            return this;
        }

        /**
         * @param routeName Name of the routing rule.
         * 
         * @return builder
         * 
         */
        public Builder routeName(String routeName) {
            return routeName(Output.of(routeName));
        }

        /**
         * @param ruleSets rule sets referenced by this endpoint.
         * 
         * @return builder
         * 
         */
        public Builder ruleSets(@Nullable Output> ruleSets) {
            $.ruleSets = ruleSets;
            return this;
        }

        /**
         * @param ruleSets rule sets referenced by this endpoint.
         * 
         * @return builder
         * 
         */
        public Builder ruleSets(List ruleSets) {
            return ruleSets(Output.of(ruleSets));
        }

        /**
         * @param ruleSets rule sets referenced by this endpoint.
         * 
         * @return builder
         * 
         */
        public Builder ruleSets(ResourceReferenceArgs... ruleSets) {
            return ruleSets(List.of(ruleSets));
        }

        /**
         * @param supportedProtocols List of supported protocols for this route.
         * 
         * @return builder
         * 
         */
        public Builder supportedProtocols(@Nullable Output>> supportedProtocols) {
            $.supportedProtocols = supportedProtocols;
            return this;
        }

        /**
         * @param supportedProtocols List of supported protocols for this route.
         * 
         * @return builder
         * 
         */
        public Builder supportedProtocols(List> supportedProtocols) {
            return supportedProtocols(Output.of(supportedProtocols));
        }

        /**
         * @param supportedProtocols List of supported protocols for this route.
         * 
         * @return builder
         * 
         */
        public Builder supportedProtocols(Either... supportedProtocols) {
            return supportedProtocols(List.of(supportedProtocols));
        }

        public RouteArgs build() {
            if ($.endpointName == null) {
                throw new MissingRequiredPropertyException("RouteArgs", "endpointName");
            }
            $.forwardingProtocol = Codegen.stringProp("forwardingProtocol").left(ForwardingProtocol.class).output().arg($.forwardingProtocol).def("MatchRequest").getNullable();
            $.httpsRedirect = Codegen.stringProp("httpsRedirect").left(HttpsRedirect.class).output().arg($.httpsRedirect).def("Disabled").getNullable();
            $.linkToDefaultDomain = Codegen.stringProp("linkToDefaultDomain").left(LinkToDefaultDomain.class).output().arg($.linkToDefaultDomain).def("Disabled").getNullable();
            if ($.originGroup == null) {
                throw new MissingRequiredPropertyException("RouteArgs", "originGroup");
            }
            if ($.profileName == null) {
                throw new MissingRequiredPropertyException("RouteArgs", "profileName");
            }
            if ($.resourceGroupName == null) {
                throw new MissingRequiredPropertyException("RouteArgs", "resourceGroupName");
            }
            return $;
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy