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

com.pulumi.googlenative.cloudscheduler.v1.inputs.PubsubTargetArgs Maven / Gradle / Ivy

// *** 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.googlenative.cloudscheduler.v1.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;


/**
 * Pub/Sub target. The job will be delivered by publishing a message to the given Pub/Sub topic.
 * 
 */
public final class PubsubTargetArgs extends com.pulumi.resources.ResourceArgs {

    public static final PubsubTargetArgs Empty = new PubsubTargetArgs();

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

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

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

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

    /**
     * The name of the Cloud Pub/Sub topic to which messages will be published when a job is delivered. The topic name must be in the same format as required by Pub/Sub's [PublishRequest.name](https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#publishrequest), for example `projects/PROJECT_ID/topics/TOPIC_ID`. The topic must be in the same project as the Cloud Scheduler job.
     * 
     */
    @Import(name="topicName", required=true)
    private Output topicName;

    /**
     * @return The name of the Cloud Pub/Sub topic to which messages will be published when a job is delivered. The topic name must be in the same format as required by Pub/Sub's [PublishRequest.name](https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#publishrequest), for example `projects/PROJECT_ID/topics/TOPIC_ID`. The topic must be in the same project as the Cloud Scheduler job.
     * 
     */
    public Output topicName() {
        return this.topicName;
    }

    private PubsubTargetArgs() {}

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

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

    public static final class Builder {
        private PubsubTargetArgs $;

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

        public Builder(PubsubTargetArgs defaults) {
            $ = new PubsubTargetArgs(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> 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 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.
         * 
         * @return builder
         * 
         */
        public Builder data(@Nullable Output 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.
         * 
         * @return builder
         * 
         */
        public Builder data(String data) {
            return data(Output.of(data));
        }

        /**
         * @param topicName The name of the Cloud Pub/Sub topic to which messages will be published when a job is delivered. The topic name must be in the same format as required by Pub/Sub's [PublishRequest.name](https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#publishrequest), for example `projects/PROJECT_ID/topics/TOPIC_ID`. The topic must be in the same project as the Cloud Scheduler job.
         * 
         * @return builder
         * 
         */
        public Builder topicName(Output topicName) {
            $.topicName = topicName;
            return this;
        }

        /**
         * @param topicName The name of the Cloud Pub/Sub topic to which messages will be published when a job is delivered. The topic name must be in the same format as required by Pub/Sub's [PublishRequest.name](https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#publishrequest), for example `projects/PROJECT_ID/topics/TOPIC_ID`. The topic must be in the same project as the Cloud Scheduler job.
         * 
         * @return builder
         * 
         */
        public Builder topicName(String topicName) {
            return topicName(Output.of(topicName));
        }

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

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy