com.google.api.services.pubsub.model.Topic Maven / Gradle / Ivy
/*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
/*
* This code was generated by https://github.com/googleapis/google-api-java-client-services/
* Modify at your own risk.
*/
package com.google.api.services.pubsub.model;
/**
* A topic resource.
*
* This is the Java data model class that specifies how to parse/serialize into the JSON that is
* transmitted over HTTP when working with the Cloud Pub/Sub API. For a detailed explanation see:
* https://developers.google.com/api-client-library/java/google-http-java-client/json
*
*
* @author Google, Inc.
*/
@SuppressWarnings("javadoc")
public final class Topic extends com.google.api.client.json.GenericJson {
/**
* Optional. Settings for ingestion from a data source into this topic.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private IngestionDataSourceSettings ingestionDataSourceSettings;
/**
* Optional. The resource name of the Cloud KMS CryptoKey to be used to protect access to messages
* published on this topic. The expected format is `projects/locations/keyRings/cryptoKeys`.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String kmsKeyName;
/**
* Optional. See [Creating and managing labels] (https://cloud.google.com/pubsub/docs/labels).
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.util.Map labels;
/**
* Optional. Indicates the minimum duration to retain a message after it is published to the
* topic. If this field is set, messages published to the topic in the last
* `message_retention_duration` are always available to subscribers. For instance, it allows any
* attached subscription to [seek to a timestamp](https://cloud.google.com/pubsub/docs/replay-
* overview#seek_to_a_time) that is up to `message_retention_duration` in the past. If this field
* is not set, message retention is controlled by settings on individual subscriptions. Cannot be
* more than 31 days or less than 10 minutes.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private String messageRetentionDuration;
/**
* Optional. Policy constraining the set of Google Cloud Platform regions where messages published
* to the topic may be stored. If not present, then no constraints are in effect.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private MessageStoragePolicy messageStoragePolicy;
/**
* Required. The name of the topic. It must have the format `"projects/{project}/topics/{topic}"`.
* `{topic}` must start with a letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`),
* dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent signs
* (`%`). It must be between 3 and 255 characters in length, and it must not start with `"goog"`.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String name;
/**
* Optional. Reserved for future use. This field is set only in responses from the server; it is
* ignored if it is set in any requests.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.Boolean satisfiesPzs;
/**
* Optional. Settings for validating messages published against a schema.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private SchemaSettings schemaSettings;
/**
* Output only. An output-only field indicating the state of the topic.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String state;
/**
* Optional. Settings for ingestion from a data source into this topic.
* @return value or {@code null} for none
*/
public IngestionDataSourceSettings getIngestionDataSourceSettings() {
return ingestionDataSourceSettings;
}
/**
* Optional. Settings for ingestion from a data source into this topic.
* @param ingestionDataSourceSettings ingestionDataSourceSettings or {@code null} for none
*/
public Topic setIngestionDataSourceSettings(IngestionDataSourceSettings ingestionDataSourceSettings) {
this.ingestionDataSourceSettings = ingestionDataSourceSettings;
return this;
}
/**
* Optional. The resource name of the Cloud KMS CryptoKey to be used to protect access to messages
* published on this topic. The expected format is `projects/locations/keyRings/cryptoKeys`.
* @return value or {@code null} for none
*/
public java.lang.String getKmsKeyName() {
return kmsKeyName;
}
/**
* Optional. The resource name of the Cloud KMS CryptoKey to be used to protect access to messages
* published on this topic. The expected format is `projects/locations/keyRings/cryptoKeys`.
* @param kmsKeyName kmsKeyName or {@code null} for none
*/
public Topic setKmsKeyName(java.lang.String kmsKeyName) {
this.kmsKeyName = kmsKeyName;
return this;
}
/**
* Optional. See [Creating and managing labels] (https://cloud.google.com/pubsub/docs/labels).
* @return value or {@code null} for none
*/
public java.util.Map getLabels() {
return labels;
}
/**
* Optional. See [Creating and managing labels] (https://cloud.google.com/pubsub/docs/labels).
* @param labels labels or {@code null} for none
*/
public Topic setLabels(java.util.Map labels) {
this.labels = labels;
return this;
}
/**
* Optional. Indicates the minimum duration to retain a message after it is published to the
* topic. If this field is set, messages published to the topic in the last
* `message_retention_duration` are always available to subscribers. For instance, it allows any
* attached subscription to [seek to a timestamp](https://cloud.google.com/pubsub/docs/replay-
* overview#seek_to_a_time) that is up to `message_retention_duration` in the past. If this field
* is not set, message retention is controlled by settings on individual subscriptions. Cannot be
* more than 31 days or less than 10 minutes.
* @return value or {@code null} for none
*/
public String getMessageRetentionDuration() {
return messageRetentionDuration;
}
/**
* Optional. Indicates the minimum duration to retain a message after it is published to the
* topic. If this field is set, messages published to the topic in the last
* `message_retention_duration` are always available to subscribers. For instance, it allows any
* attached subscription to [seek to a timestamp](https://cloud.google.com/pubsub/docs/replay-
* overview#seek_to_a_time) that is up to `message_retention_duration` in the past. If this field
* is not set, message retention is controlled by settings on individual subscriptions. Cannot be
* more than 31 days or less than 10 minutes.
* @param messageRetentionDuration messageRetentionDuration or {@code null} for none
*/
public Topic setMessageRetentionDuration(String messageRetentionDuration) {
this.messageRetentionDuration = messageRetentionDuration;
return this;
}
/**
* Optional. Policy constraining the set of Google Cloud Platform regions where messages published
* to the topic may be stored. If not present, then no constraints are in effect.
* @return value or {@code null} for none
*/
public MessageStoragePolicy getMessageStoragePolicy() {
return messageStoragePolicy;
}
/**
* Optional. Policy constraining the set of Google Cloud Platform regions where messages published
* to the topic may be stored. If not present, then no constraints are in effect.
* @param messageStoragePolicy messageStoragePolicy or {@code null} for none
*/
public Topic setMessageStoragePolicy(MessageStoragePolicy messageStoragePolicy) {
this.messageStoragePolicy = messageStoragePolicy;
return this;
}
/**
* Required. The name of the topic. It must have the format `"projects/{project}/topics/{topic}"`.
* `{topic}` must start with a letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`),
* dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent signs
* (`%`). It must be between 3 and 255 characters in length, and it must not start with `"goog"`.
* @return value or {@code null} for none
*/
public java.lang.String getName() {
return name;
}
/**
* Required. The name of the topic. It must have the format `"projects/{project}/topics/{topic}"`.
* `{topic}` must start with a letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`),
* dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent signs
* (`%`). It must be between 3 and 255 characters in length, and it must not start with `"goog"`.
* @param name name or {@code null} for none
*/
public Topic setName(java.lang.String name) {
this.name = name;
return this;
}
/**
* Optional. Reserved for future use. This field is set only in responses from the server; it is
* ignored if it is set in any requests.
* @return value or {@code null} for none
*/
public java.lang.Boolean getSatisfiesPzs() {
return satisfiesPzs;
}
/**
* Optional. Reserved for future use. This field is set only in responses from the server; it is
* ignored if it is set in any requests.
* @param satisfiesPzs satisfiesPzs or {@code null} for none
*/
public Topic setSatisfiesPzs(java.lang.Boolean satisfiesPzs) {
this.satisfiesPzs = satisfiesPzs;
return this;
}
/**
* Optional. Settings for validating messages published against a schema.
* @return value or {@code null} for none
*/
public SchemaSettings getSchemaSettings() {
return schemaSettings;
}
/**
* Optional. Settings for validating messages published against a schema.
* @param schemaSettings schemaSettings or {@code null} for none
*/
public Topic setSchemaSettings(SchemaSettings schemaSettings) {
this.schemaSettings = schemaSettings;
return this;
}
/**
* Output only. An output-only field indicating the state of the topic.
* @return value or {@code null} for none
*/
public java.lang.String getState() {
return state;
}
/**
* Output only. An output-only field indicating the state of the topic.
* @param state state or {@code null} for none
*/
public Topic setState(java.lang.String state) {
this.state = state;
return this;
}
@Override
public Topic set(String fieldName, Object value) {
return (Topic) super.set(fieldName, value);
}
@Override
public Topic clone() {
return (Topic) super.clone();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy