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

com.pulumi.azurenative.containerinstance.inputs.PortArgs Maven / Gradle / Ivy

There is a newer version: 2.78.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.azurenative.containerinstance.inputs;

import com.pulumi.azurenative.containerinstance.enums.ContainerGroupNetworkProtocol;
import com.pulumi.core.Either;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.exceptions.MissingRequiredPropertyException;
import java.lang.Integer;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


/**
 * The port exposed on the container group.
 * 
 */
public final class PortArgs extends com.pulumi.resources.ResourceArgs {

    public static final PortArgs Empty = new PortArgs();

    /**
     * The port number.
     * 
     */
    @Import(name="port", required=true)
    private Output port;

    /**
     * @return The port number.
     * 
     */
    public Output port() {
        return this.port;
    }

    /**
     * The protocol associated with the port.
     * 
     */
    @Import(name="protocol")
    private @Nullable Output> protocol;

    /**
     * @return The protocol associated with the port.
     * 
     */
    public Optional>> protocol() {
        return Optional.ofNullable(this.protocol);
    }

    private PortArgs() {}

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

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

    public static final class Builder {
        private PortArgs $;

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

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

        /**
         * @param port The port number.
         * 
         * @return builder
         * 
         */
        public Builder port(Output port) {
            $.port = port;
            return this;
        }

        /**
         * @param port The port number.
         * 
         * @return builder
         * 
         */
        public Builder port(Integer port) {
            return port(Output.of(port));
        }

        /**
         * @param protocol The protocol associated with the port.
         * 
         * @return builder
         * 
         */
        public Builder protocol(@Nullable Output> protocol) {
            $.protocol = protocol;
            return this;
        }

        /**
         * @param protocol The protocol associated with the port.
         * 
         * @return builder
         * 
         */
        public Builder protocol(Either protocol) {
            return protocol(Output.of(protocol));
        }

        /**
         * @param protocol The protocol associated with the port.
         * 
         * @return builder
         * 
         */
        public Builder protocol(String protocol) {
            return protocol(Either.ofLeft(protocol));
        }

        /**
         * @param protocol The protocol associated with the port.
         * 
         * @return builder
         * 
         */
        public Builder protocol(ContainerGroupNetworkProtocol protocol) {
            return protocol(Either.ofRight(protocol));
        }

        public PortArgs build() {
            if ($.port == null) {
                throw new MissingRequiredPropertyException("PortArgs", "port");
            }
            return $;
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy