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

import com.pulumi.aws.vpclattice.outputs.ListenerRuleActionForwardTargetGroup;
import com.pulumi.core.annotations.CustomType;
import java.util.List;
import java.util.Objects;

@CustomType
public final class ListenerRuleActionForward {
    /**
     * @return The target groups. Traffic matching the rule is forwarded to the specified target groups. With forward actions, you can assign a weight that controls the prioritization and selection of each target group. This means that requests are distributed to individual target groups based on their weights. For example, if two target groups have the same weight, each target group receives half of the traffic.
     * 
     * The default value is 1 with maximum number of 2. If only one target group is provided, there is no need to set the weight; 100% of traffic will go to that target group.
     * 
     */
    private List<ListenerRuleActionForwardTargetGroup> targetGroups;

    private ListenerRuleActionForward() {}
    /**
     * @return The target groups. Traffic matching the rule is forwarded to the specified target groups. With forward actions, you can assign a weight that controls the prioritization and selection of each target group. This means that requests are distributed to individual target groups based on their weights. For example, if two target groups have the same weight, each target group receives half of the traffic.
     * 
     * The default value is 1 with maximum number of 2. If only one target group is provided, there is no need to set the weight; 100% of traffic will go to that target group.
     * 
     */
    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 List<ListenerRuleActionForwardTargetGroup> targetGroups;
        public Builder() {}
        public Builder(ListenerRuleActionForward defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.targetGroups = defaults.targetGroups;
        }

        @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.targetGroups = targetGroups;
            return o;
        }
    }
}
