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

com.pulumi.kubernetes.extensions.v1beta1.inputs.NetworkPolicyPortArgs Maven / Gradle / Ivy

There is a newer version: 4.19.0-alpha.1730750641
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.extensions.v1beta1.inputs;

import com.pulumi.core.Either;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import java.lang.Integer;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


/**
 * DEPRECATED 1.9 - This group version of NetworkPolicyPort is deprecated by networking/v1/NetworkPolicyPort.
 * 
 */
public final class NetworkPolicyPortArgs extends com.pulumi.resources.ResourceArgs {

    public static final NetworkPolicyPortArgs Empty = new NetworkPolicyPortArgs();

    /**
     * If specified, the port on the given protocol.  This can either be a numerical or named port on a pod.  If this field is not provided, this matches all port names and numbers. If present, only traffic on the specified protocol AND port will be matched.
     * 
     */
    @Import(name="port")
    private @Nullable Output> port;

    /**
     * @return If specified, the port on the given protocol.  This can either be a numerical or named port on a pod.  If this field is not provided, this matches all port names and numbers. If present, only traffic on the specified protocol AND port will be matched.
     * 
     */
    public Optional>> port() {
        return Optional.ofNullable(this.port);
    }

    /**
     * Optional.  The protocol (TCP, UDP, or SCTP) which traffic must match. If not specified, this field defaults to TCP.
     * 
     */
    @Import(name="protocol")
    private @Nullable Output protocol;

    /**
     * @return Optional.  The protocol (TCP, UDP, or SCTP) which traffic must match. If not specified, this field defaults to TCP.
     * 
     */
    public Optional> protocol() {
        return Optional.ofNullable(this.protocol);
    }

    private NetworkPolicyPortArgs() {}

    private NetworkPolicyPortArgs(NetworkPolicyPortArgs $) {
        this.port = $.port;
        this.protocol = $.protocol;
    }

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

    public static final class Builder {
        private NetworkPolicyPortArgs $;

        public Builder() {
            $ = new NetworkPolicyPortArgs();
        }

        public Builder(NetworkPolicyPortArgs defaults) {
            $ = new NetworkPolicyPortArgs(Objects.requireNonNull(defaults));
        }

        /**
         * @param port If specified, the port on the given protocol.  This can either be a numerical or named port on a pod.  If this field is not provided, this matches all port names and numbers. If present, only traffic on the specified protocol AND port will be matched.
         * 
         * @return builder
         * 
         */
        public Builder port(@Nullable Output> port) {
            $.port = port;
            return this;
        }

        /**
         * @param port If specified, the port on the given protocol.  This can either be a numerical or named port on a pod.  If this field is not provided, this matches all port names and numbers. If present, only traffic on the specified protocol AND port will be matched.
         * 
         * @return builder
         * 
         */
        public Builder port(Either port) {
            return port(Output.of(port));
        }

        /**
         * @param port If specified, the port on the given protocol.  This can either be a numerical or named port on a pod.  If this field is not provided, this matches all port names and numbers. If present, only traffic on the specified protocol AND port will be matched.
         * 
         * @return builder
         * 
         */
        public Builder port(Integer port) {
            return port(Either.ofLeft(port));
        }

        /**
         * @param port If specified, the port on the given protocol.  This can either be a numerical or named port on a pod.  If this field is not provided, this matches all port names and numbers. If present, only traffic on the specified protocol AND port will be matched.
         * 
         * @return builder
         * 
         */
        public Builder port(String port) {
            return port(Either.ofRight(port));
        }

        /**
         * @param protocol Optional.  The protocol (TCP, UDP, or SCTP) which traffic must match. If not specified, this field defaults to TCP.
         * 
         * @return builder
         * 
         */
        public Builder protocol(@Nullable Output protocol) {
            $.protocol = protocol;
            return this;
        }

        /**
         * @param protocol Optional.  The protocol (TCP, UDP, or SCTP) which traffic must match. If not specified, this field defaults to TCP.
         * 
         * @return builder
         * 
         */
        public Builder protocol(String protocol) {
            return protocol(Output.of(protocol));
        }

        public NetworkPolicyPortArgs build() {
            return $;
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy