// *** 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.gcp.cloudscheduler.inputs;

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


public final class JobPubsubTargetArgs extends com.pulumi.resources.ResourceArgs {

    public static final JobPubsubTargetArgs Empty = new JobPubsubTargetArgs();

    /**
     * Attributes for PubsubMessage.
     * Pubsub message must contain either non-empty data, or at least one attribute.
     * 
     */
    @Import(name="attributes")
    private @Nullable Output<Map<String,String>> attributes;

    /**
     * @return Attributes for PubsubMessage.
     * Pubsub message must contain either non-empty data, or at least one attribute.
     * 
     */
    public Optional<Output<Map<String,String>>> attributes() {
        return Optional.ofNullable(this.attributes);
    }

    /**
     * The message payload for PubsubMessage.
     * Pubsub message must contain either non-empty data, or at least one attribute.
     * A base64-encoded string.
     * 
     */
    @Import(name="data")
    private @Nullable Output<String> data;

    /**
     * @return The message payload for PubsubMessage.
     * Pubsub message must contain either non-empty data, or at least one attribute.
     * A base64-encoded string.
     * 
     */
    public Optional<Output<String>> data() {
        return Optional.ofNullable(this.data);
    }

    /**
     * The full resource name for the Cloud Pub/Sub topic to which
     * messages will be published when a job is delivered. ~&gt;**NOTE:**
     * The topic name must be in the same format as required by PubSub&#39;s
     * PublishRequest.name, e.g. `projects/my-project/topics/my-topic`.
     * 
     */
    @Import(name="topicName", required=true)
    private Output<String> topicName;

    /**
     * @return The full resource name for the Cloud Pub/Sub topic to which
     * messages will be published when a job is delivered. ~&gt;**NOTE:**
     * The topic name must be in the same format as required by PubSub&#39;s
     * PublishRequest.name, e.g. `projects/my-project/topics/my-topic`.
     * 
     */
    public Output<String> topicName() {
        return this.topicName;
    }

    private JobPubsubTargetArgs() {}

    private JobPubsubTargetArgs(JobPubsubTargetArgs $) {
        this.attributes = $.attributes;
        this.data = $.data;
        this.topicName = $.topicName;
    }

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

    public static final class Builder {
        private JobPubsubTargetArgs $;

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

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

        /**
         * @param attributes Attributes for PubsubMessage.
         * Pubsub message must contain either non-empty data, or at least one attribute.
         * 
         * @return builder
         * 
         */
        public Builder attributes(@Nullable Output<Map<String,String>> attributes) {
            $.attributes = attributes;
            return this;
        }

        /**
         * @param attributes Attributes for PubsubMessage.
         * Pubsub message must contain either non-empty data, or at least one attribute.
         * 
         * @return builder
         * 
         */
        public Builder attributes(Map<String,String> attributes) {
            return attributes(Output.of(attributes));
        }

        /**
         * @param data The message payload for PubsubMessage.
         * Pubsub message must contain either non-empty data, or at least one attribute.
         * A base64-encoded string.
         * 
         * @return builder
         * 
         */
        public Builder data(@Nullable Output<String> data) {
            $.data = data;
            return this;
        }

        /**
         * @param data The message payload for PubsubMessage.
         * Pubsub message must contain either non-empty data, or at least one attribute.
         * A base64-encoded string.
         * 
         * @return builder
         * 
         */
        public Builder data(String data) {
            return data(Output.of(data));
        }

        /**
         * @param topicName The full resource name for the Cloud Pub/Sub topic to which
         * messages will be published when a job is delivered. ~&gt;**NOTE:**
         * The topic name must be in the same format as required by PubSub&#39;s
         * PublishRequest.name, e.g. `projects/my-project/topics/my-topic`.
         * 
         * @return builder
         * 
         */
        public Builder topicName(Output<String> topicName) {
            $.topicName = topicName;
            return this;
        }

        /**
         * @param topicName The full resource name for the Cloud Pub/Sub topic to which
         * messages will be published when a job is delivered. ~&gt;**NOTE:**
         * The topic name must be in the same format as required by PubSub&#39;s
         * PublishRequest.name, e.g. `projects/my-project/topics/my-topic`.
         * 
         * @return builder
         * 
         */
        public Builder topicName(String topicName) {
            return topicName(Output.of(topicName));
        }

        public JobPubsubTargetArgs build() {
            $.topicName = Objects.requireNonNull($.topicName, "expected parameter 'topicName' to be non-null");
            return $;
        }
    }

}
