// *** 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.core.annotations.CustomType;
import java.lang.Integer;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;

@CustomType
public final class ListenerDefaultActionForwardTargetGroup {
    /**
     * @return ID or Amazon Resource Name (ARN) of the target group.
     * 
     */
    private @Nullable String targetGroupIdentifier;
    /**
     * @return Determines how requests are distributed to the target group. Only required if you specify multiple target groups for a forward action. For example, if you specify two target groups, one with a
     * weight of 10 and the other with a weight of 20, the target group with a weight of 20 receives twice as many requests as the other target group. See [Listener rules](https://docs.aws.amazon.com/vpc-lattice/latest/ug/listeners.html#listener-rules) in the AWS documentation for additional examples. Default: `100`.
     * 
     */
    private @Nullable Integer weight;

    private ListenerDefaultActionForwardTargetGroup() {}
    /**
     * @return ID or Amazon Resource Name (ARN) of the target group.
     * 
     */
    public Optional<String> targetGroupIdentifier() {
        return Optional.ofNullable(this.targetGroupIdentifier);
    }
    /**
     * @return Determines how requests are distributed to the target group. Only required if you specify multiple target groups for a forward action. For example, if you specify two target groups, one with a
     * weight of 10 and the other with a weight of 20, the target group with a weight of 20 receives twice as many requests as the other target group. See [Listener rules](https://docs.aws.amazon.com/vpc-lattice/latest/ug/listeners.html#listener-rules) in the AWS documentation for additional examples. Default: `100`.
     * 
     */
    public Optional<Integer> weight() {
        return Optional.ofNullable(this.weight);
    }

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

    public static Builder builder(ListenerDefaultActionForwardTargetGroup defaults) {
        return new Builder(defaults);
    }
    @CustomType.Builder
    public static final class Builder {
        private @Nullable String targetGroupIdentifier;
        private @Nullable Integer weight;
        public Builder() {}
        public Builder(ListenerDefaultActionForwardTargetGroup defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.targetGroupIdentifier = defaults.targetGroupIdentifier;
    	      this.weight = defaults.weight;
        }

        @CustomType.Setter
        public Builder targetGroupIdentifier(@Nullable String targetGroupIdentifier) {
            this.targetGroupIdentifier = targetGroupIdentifier;
            return this;
        }
        @CustomType.Setter
        public Builder weight(@Nullable Integer weight) {
            this.weight = weight;
            return this;
        }
        public ListenerDefaultActionForwardTargetGroup build() {
            final var o = new ListenerDefaultActionForwardTargetGroup();
            o.targetGroupIdentifier = targetGroupIdentifier;
            o.weight = weight;
            return o;
        }
    }
}
