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

import com.pulumi.aws.applicationloadbalancing.outputs.ListenerRuleActionForwardStickiness;
import com.pulumi.aws.applicationloadbalancing.outputs.ListenerRuleActionForwardTargetGroup;
import com.pulumi.core.annotations.CustomType;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;

@CustomType
public final class ListenerRuleActionForward {
    /**
     * @return The target group stickiness for the rule.
     * 
     */
    private @Nullable ListenerRuleActionForwardStickiness stickiness;
    /**
     * @return One or more target groups block.
     * 
     */
    private List<ListenerRuleActionForwardTargetGroup> targetGroups;

    private ListenerRuleActionForward() {}
    /**
     * @return The target group stickiness for the rule.
     * 
     */
    public Optional<ListenerRuleActionForwardStickiness> stickiness() {
        return Optional.ofNullable(this.stickiness);
    }
    /**
     * @return One or more target groups block.
     * 
     */
    public List<ListenerRuleActionForwardTargetGroup> targetGroups() {
        return this.targetGroups;
    }

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

    public static Builder builder(ListenerRuleActionForward defaults) {
        return new Builder(defaults);
    }
    @CustomType.Builder
    public static final class Builder {
        private @Nullable ListenerRuleActionForwardStickiness stickiness;
        private List<ListenerRuleActionForwardTargetGroup> targetGroups;
        public Builder() {}
        public Builder(ListenerRuleActionForward defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.stickiness = defaults.stickiness;
    	      this.targetGroups = defaults.targetGroups;
        }

        @CustomType.Setter
        public Builder stickiness(@Nullable ListenerRuleActionForwardStickiness stickiness) {
            this.stickiness = stickiness;
            return this;
        }
        @CustomType.Setter
        public Builder targetGroups(List<ListenerRuleActionForwardTargetGroup> targetGroups) {
            this.targetGroups = Objects.requireNonNull(targetGroups);
            return this;
        }
        public Builder targetGroups(ListenerRuleActionForwardTargetGroup... targetGroups) {
            return targetGroups(List.of(targetGroups));
        }
        public ListenerRuleActionForward build() {
            final var o = new ListenerRuleActionForward();
            o.stickiness = stickiness;
            o.targetGroups = targetGroups;
            return o;
        }
    }
}
