/*
 * 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.pubsublite.v1.model;

/**
 * Configuration for a Pub/Sub Lite subscription that writes messages to a destination. User
 * subscriber clients must not connect to this subscription.
 *
 * <p> 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 Pub/Sub Lite API. For a detailed explanation see:
 * <a href="https://developers.google.com/api-client-library/java/google-http-java-client/json">https://developers.google.com/api-client-library/java/google-http-java-client/json</a>
 * </p>
 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class ExportConfig extends com.google.api.client.json.GenericJson {

  /**
   * Output only. The current state of the export, which may be different to the desired state due
   * to errors. This field is output only.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String currentState;

  /**
   * Optional. The name of an optional Pub/Sub Lite topic to publish messages that can not be
   * exported to the destination. For example, the message can not be published to the Pub/Sub
   * service because it does not satisfy the constraints documented at
   * https://cloud.google.com/pubsub/docs/publisher. Structured like:
   * projects/{project_number}/locations/{location}/topics/{topic_id}. Must be within the same
   * project and location as the subscription. The topic may be changed or removed.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String deadLetterTopic;

  /**
   * The desired state of this export. Setting this to values other than `ACTIVE` and `PAUSED` will
   * result in an error.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String desiredState;

  /**
   * Messages are automatically written from the Pub/Sub Lite topic associated with this
   * subscription to a Pub/Sub topic.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private PubSubConfig pubsubConfig;

  /**
   * Output only. The current state of the export, which may be different to the desired state due
   * to errors. This field is output only.
   * @return value or {@code null} for none
   */
  public java.lang.String getCurrentState() {
    return currentState;
  }

  /**
   * Output only. The current state of the export, which may be different to the desired state due
   * to errors. This field is output only.
   * @param currentState currentState or {@code null} for none
   */
  public ExportConfig setCurrentState(java.lang.String currentState) {
    this.currentState = currentState;
    return this;
  }

  /**
   * Optional. The name of an optional Pub/Sub Lite topic to publish messages that can not be
   * exported to the destination. For example, the message can not be published to the Pub/Sub
   * service because it does not satisfy the constraints documented at
   * https://cloud.google.com/pubsub/docs/publisher. Structured like:
   * projects/{project_number}/locations/{location}/topics/{topic_id}. Must be within the same
   * project and location as the subscription. The topic may be changed or removed.
   * @return value or {@code null} for none
   */
  public java.lang.String getDeadLetterTopic() {
    return deadLetterTopic;
  }

  /**
   * Optional. The name of an optional Pub/Sub Lite topic to publish messages that can not be
   * exported to the destination. For example, the message can not be published to the Pub/Sub
   * service because it does not satisfy the constraints documented at
   * https://cloud.google.com/pubsub/docs/publisher. Structured like:
   * projects/{project_number}/locations/{location}/topics/{topic_id}. Must be within the same
   * project and location as the subscription. The topic may be changed or removed.
   * @param deadLetterTopic deadLetterTopic or {@code null} for none
   */
  public ExportConfig setDeadLetterTopic(java.lang.String deadLetterTopic) {
    this.deadLetterTopic = deadLetterTopic;
    return this;
  }

  /**
   * The desired state of this export. Setting this to values other than `ACTIVE` and `PAUSED` will
   * result in an error.
   * @return value or {@code null} for none
   */
  public java.lang.String getDesiredState() {
    return desiredState;
  }

  /**
   * The desired state of this export. Setting this to values other than `ACTIVE` and `PAUSED` will
   * result in an error.
   * @param desiredState desiredState or {@code null} for none
   */
  public ExportConfig setDesiredState(java.lang.String desiredState) {
    this.desiredState = desiredState;
    return this;
  }

  /**
   * Messages are automatically written from the Pub/Sub Lite topic associated with this
   * subscription to a Pub/Sub topic.
   * @return value or {@code null} for none
   */
  public PubSubConfig getPubsubConfig() {
    return pubsubConfig;
  }

  /**
   * Messages are automatically written from the Pub/Sub Lite topic associated with this
   * subscription to a Pub/Sub topic.
   * @param pubsubConfig pubsubConfig or {@code null} for none
   */
  public ExportConfig setPubsubConfig(PubSubConfig pubsubConfig) {
    this.pubsubConfig = pubsubConfig;
    return this;
  }

  @Override
  public ExportConfig set(String fieldName, Object value) {
    return (ExportConfig) super.set(fieldName, value);
  }

  @Override
  public ExportConfig clone() {
    return (ExportConfig) super.clone();
  }

}
