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

com.pulumi.kubernetes.flowcontrol.v1alpha1.outputs.FlowSchemaSpec Maven / Gradle / Ivy

There is a newer version: 4.19.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.kubernetes.flowcontrol.v1alpha1.outputs;

import com.pulumi.core.annotations.CustomType;
import com.pulumi.exceptions.MissingRequiredPropertyException;
import com.pulumi.kubernetes.flowcontrol.v1alpha1.outputs.FlowDistinguisherMethod;
import com.pulumi.kubernetes.flowcontrol.v1alpha1.outputs.PolicyRulesWithSubjects;
import com.pulumi.kubernetes.flowcontrol.v1alpha1.outputs.PriorityLevelConfigurationReference;
import java.lang.Integer;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;

@CustomType
public final class FlowSchemaSpec {
    /**
     * @return `distinguisherMethod` defines how to compute the flow distinguisher for requests that match this schema. `nil` specifies that the distinguisher is disabled and thus will always be the empty string.
     * 
     */
    private @Nullable FlowDistinguisherMethod distinguisherMethod;
    /**
     * @return `matchingPrecedence` is used to choose among the FlowSchemas that match a given request. The chosen FlowSchema is among those with the numerically lowest (which we take to be logically highest) MatchingPrecedence.  Each MatchingPrecedence value must be non-negative. Note that if the precedence is not specified or zero, it will be set to 1000 as default.
     * 
     */
    private @Nullable Integer matchingPrecedence;
    /**
     * @return `priorityLevelConfiguration` should reference a PriorityLevelConfiguration in the cluster. If the reference cannot be resolved, the FlowSchema will be ignored and marked as invalid in its status. Required.
     * 
     */
    private PriorityLevelConfigurationReference priorityLevelConfiguration;
    /**
     * @return `rules` describes which requests will match this flow schema. This FlowSchema matches a request if and only if at least one member of rules matches the request. if it is an empty slice, there will be no requests matching the FlowSchema.
     * 
     */
    private @Nullable List rules;

    private FlowSchemaSpec() {}
    /**
     * @return `distinguisherMethod` defines how to compute the flow distinguisher for requests that match this schema. `nil` specifies that the distinguisher is disabled and thus will always be the empty string.
     * 
     */
    public Optional distinguisherMethod() {
        return Optional.ofNullable(this.distinguisherMethod);
    }
    /**
     * @return `matchingPrecedence` is used to choose among the FlowSchemas that match a given request. The chosen FlowSchema is among those with the numerically lowest (which we take to be logically highest) MatchingPrecedence.  Each MatchingPrecedence value must be non-negative. Note that if the precedence is not specified or zero, it will be set to 1000 as default.
     * 
     */
    public Optional matchingPrecedence() {
        return Optional.ofNullable(this.matchingPrecedence);
    }
    /**
     * @return `priorityLevelConfiguration` should reference a PriorityLevelConfiguration in the cluster. If the reference cannot be resolved, the FlowSchema will be ignored and marked as invalid in its status. Required.
     * 
     */
    public PriorityLevelConfigurationReference priorityLevelConfiguration() {
        return this.priorityLevelConfiguration;
    }
    /**
     * @return `rules` describes which requests will match this flow schema. This FlowSchema matches a request if and only if at least one member of rules matches the request. if it is an empty slice, there will be no requests matching the FlowSchema.
     * 
     */
    public List rules() {
        return this.rules == null ? List.of() : this.rules;
    }

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

    public static Builder builder(FlowSchemaSpec defaults) {
        return new Builder(defaults);
    }
    @CustomType.Builder
    public static final class Builder {
        private @Nullable FlowDistinguisherMethod distinguisherMethod;
        private @Nullable Integer matchingPrecedence;
        private PriorityLevelConfigurationReference priorityLevelConfiguration;
        private @Nullable List rules;
        public Builder() {}
        public Builder(FlowSchemaSpec defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.distinguisherMethod = defaults.distinguisherMethod;
    	      this.matchingPrecedence = defaults.matchingPrecedence;
    	      this.priorityLevelConfiguration = defaults.priorityLevelConfiguration;
    	      this.rules = defaults.rules;
        }

        @CustomType.Setter
        public Builder distinguisherMethod(@Nullable FlowDistinguisherMethod distinguisherMethod) {

            this.distinguisherMethod = distinguisherMethod;
            return this;
        }
        @CustomType.Setter
        public Builder matchingPrecedence(@Nullable Integer matchingPrecedence) {

            this.matchingPrecedence = matchingPrecedence;
            return this;
        }
        @CustomType.Setter
        public Builder priorityLevelConfiguration(PriorityLevelConfigurationReference priorityLevelConfiguration) {
            if (priorityLevelConfiguration == null) {
              throw new MissingRequiredPropertyException("FlowSchemaSpec", "priorityLevelConfiguration");
            }
            this.priorityLevelConfiguration = priorityLevelConfiguration;
            return this;
        }
        @CustomType.Setter
        public Builder rules(@Nullable List rules) {

            this.rules = rules;
            return this;
        }
        public Builder rules(PolicyRulesWithSubjects... rules) {
            return rules(List.of(rules));
        }
        public FlowSchemaSpec build() {
            final var _resultValue = new FlowSchemaSpec();
            _resultValue.distinguisherMethod = distinguisherMethod;
            _resultValue.matchingPrecedence = matchingPrecedence;
            _resultValue.priorityLevelConfiguration = priorityLevelConfiguration;
            _resultValue.rules = rules;
            return _resultValue;
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy