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

import com.pulumi.aws.s3.outputs.BucketWebsiteConfigurationV2RoutingRuleCondition;
import com.pulumi.aws.s3.outputs.BucketWebsiteConfigurationV2RoutingRuleRedirect;
import com.pulumi.core.annotations.CustomType;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;

@CustomType
public final class BucketWebsiteConfigurationV2RoutingRule {
    /**
     * @return Configuration block for describing a condition that must be met for the specified redirect to apply. See below.
     * 
     */
    private @Nullable BucketWebsiteConfigurationV2RoutingRuleCondition condition;
    /**
     * @return Configuration block for redirect information. See below.
     * 
     */
    private BucketWebsiteConfigurationV2RoutingRuleRedirect redirect;

    private BucketWebsiteConfigurationV2RoutingRule() {}
    /**
     * @return Configuration block for describing a condition that must be met for the specified redirect to apply. See below.
     * 
     */
    public Optional<BucketWebsiteConfigurationV2RoutingRuleCondition> condition() {
        return Optional.ofNullable(this.condition);
    }
    /**
     * @return Configuration block for redirect information. See below.
     * 
     */
    public BucketWebsiteConfigurationV2RoutingRuleRedirect redirect() {
        return this.redirect;
    }

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

    public static Builder builder(BucketWebsiteConfigurationV2RoutingRule defaults) {
        return new Builder(defaults);
    }
    @CustomType.Builder
    public static final class Builder {
        private @Nullable BucketWebsiteConfigurationV2RoutingRuleCondition condition;
        private BucketWebsiteConfigurationV2RoutingRuleRedirect redirect;
        public Builder() {}
        public Builder(BucketWebsiteConfigurationV2RoutingRule defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.condition = defaults.condition;
    	      this.redirect = defaults.redirect;
        }

        @CustomType.Setter
        public Builder condition(@Nullable BucketWebsiteConfigurationV2RoutingRuleCondition condition) {
            this.condition = condition;
            return this;
        }
        @CustomType.Setter
        public Builder redirect(BucketWebsiteConfigurationV2RoutingRuleRedirect redirect) {
            this.redirect = Objects.requireNonNull(redirect);
            return this;
        }
        public BucketWebsiteConfigurationV2RoutingRule build() {
            final var o = new BucketWebsiteConfigurationV2RoutingRule();
            o.condition = condition;
            o.redirect = redirect;
            return o;
        }
    }
}
