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

com.pulumi.azurenative.deviceregistry.inputs.TopicArgs 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.deviceregistry.inputs;

import com.pulumi.azurenative.deviceregistry.enums.TopicRetainType;
import com.pulumi.core.Either;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.core.internal.Codegen;
import com.pulumi.exceptions.MissingRequiredPropertyException;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


/**
 * Object that describes the topic information.
 * 
 */
public final class TopicArgs extends com.pulumi.resources.ResourceArgs {

    public static final TopicArgs Empty = new TopicArgs();

    /**
     * The topic path for messages published to an MQTT broker.
     * 
     */
    @Import(name="path", required=true)
    private Output path;

    /**
     * @return The topic path for messages published to an MQTT broker.
     * 
     */
    public Output path() {
        return this.path;
    }

    /**
     * When set to 'Keep', messages published to an MQTT broker will have the retain flag set. Default: 'Never'.
     * 
     */
    @Import(name="retain")
    private @Nullable Output> retain;

    /**
     * @return When set to 'Keep', messages published to an MQTT broker will have the retain flag set. Default: 'Never'.
     * 
     */
    public Optional>> retain() {
        return Optional.ofNullable(this.retain);
    }

    private TopicArgs() {}

    private TopicArgs(TopicArgs $) {
        this.path = $.path;
        this.retain = $.retain;
    }

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

    public static final class Builder {
        private TopicArgs $;

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

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

        /**
         * @param path The topic path for messages published to an MQTT broker.
         * 
         * @return builder
         * 
         */
        public Builder path(Output path) {
            $.path = path;
            return this;
        }

        /**
         * @param path The topic path for messages published to an MQTT broker.
         * 
         * @return builder
         * 
         */
        public Builder path(String path) {
            return path(Output.of(path));
        }

        /**
         * @param retain When set to 'Keep', messages published to an MQTT broker will have the retain flag set. Default: 'Never'.
         * 
         * @return builder
         * 
         */
        public Builder retain(@Nullable Output> retain) {
            $.retain = retain;
            return this;
        }

        /**
         * @param retain When set to 'Keep', messages published to an MQTT broker will have the retain flag set. Default: 'Never'.
         * 
         * @return builder
         * 
         */
        public Builder retain(Either retain) {
            return retain(Output.of(retain));
        }

        /**
         * @param retain When set to 'Keep', messages published to an MQTT broker will have the retain flag set. Default: 'Never'.
         * 
         * @return builder
         * 
         */
        public Builder retain(String retain) {
            return retain(Either.ofLeft(retain));
        }

        /**
         * @param retain When set to 'Keep', messages published to an MQTT broker will have the retain flag set. Default: 'Never'.
         * 
         * @return builder
         * 
         */
        public Builder retain(TopicRetainType retain) {
            return retain(Either.ofRight(retain));
        }

        public TopicArgs build() {
            if ($.path == null) {
                throw new MissingRequiredPropertyException("TopicArgs", "path");
            }
            $.retain = Codegen.stringProp("retain").left(TopicRetainType.class).output().arg($.retain).def("Never").getNullable();
            return $;
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy