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

/**
 * A guaranteed order. Guaranteed orders are parent entity of guaranteed inventory sources. When
 * creating a guaranteed inventory source, a guaranteed order ID must be assigned to the inventory
 * source.
 *
 * <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 Display & Video 360 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 GuaranteedOrder extends com.google.api.client.json.GenericJson {

  /**
   * Output only. The ID of default advertiser of the guaranteed order. The default advertiser is
   * either the read_write_advertiser_id or, if that is not set, the first advertiser listed in
   * read_advertiser_ids. Otherwise, there is no default advertiser.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key @com.google.api.client.json.JsonString
  private java.lang.Long defaultAdvertiserId;

  /**
   * The ID of the default campaign that is assigned to the guaranteed order. The default campaign
   * must belong to the default advertiser.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key @com.google.api.client.json.JsonString
  private java.lang.Long defaultCampaignId;

  /**
   * Required. The display name of the guaranteed order. Must be UTF-8 encoded with a maximum size
   * of 240 bytes.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String displayName;

  /**
   * Required. Immutable. The exchange where the guaranteed order originated.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String exchange;

  /**
   * Output only. The unique identifier of the guaranteed order. The guaranteed order IDs have the
   * format `{exchange}-{legacy_guaranteed_order_id}`.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String guaranteedOrderId;

  /**
   * Output only. The legacy ID of the guaranteed order. Assigned by the original exchange. The
   * legacy ID is unique within one exchange, but is not guaranteed to be unique across all
   * guaranteed orders. This ID is used in SDF and UI.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String legacyGuaranteedOrderId;

  /**
   * Output only. The resource name of the guaranteed order.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String name;

  /**
   * Required. The publisher name of the guaranteed order. Must be UTF-8 encoded with a maximum size
   * of 240 bytes.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String publisherName;

  /**
   * Whether all advertisers of read_write_partner_id have read access to the guaranteed order. Only
   * applicable if read_write_partner_id is set. If True, overrides read_advertiser_ids.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Boolean readAccessInherited;

  /**
   * The IDs of advertisers with read access to the guaranteed order. This field must not include
   * the advertiser assigned to read_write_advertiser_id if it is set. All advertisers in this field
   * must belong to read_write_partner_id or the same partner as read_write_advertiser_id.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key @com.google.api.client.json.JsonString
  private java.util.List<java.lang.Long> readAdvertiserIds;

  /**
   * The advertiser with read/write access to the guaranteed order. This is also the default
   * advertiser of the guaranteed order.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key @com.google.api.client.json.JsonString
  private java.lang.Long readWriteAdvertiserId;

  /**
   * The partner with read/write access to the guaranteed order.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key @com.google.api.client.json.JsonString
  private java.lang.Long readWritePartnerId;

  /**
   * The status settings of the guaranteed order.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private GuaranteedOrderStatus status;

  /**
   * Output only. The timestamp when the guaranteed order was last updated. Assigned by the system.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private String updateTime;

  /**
   * Output only. The ID of default advertiser of the guaranteed order. The default advertiser is
   * either the read_write_advertiser_id or, if that is not set, the first advertiser listed in
   * read_advertiser_ids. Otherwise, there is no default advertiser.
   * @return value or {@code null} for none
   */
  public java.lang.Long getDefaultAdvertiserId() {
    return defaultAdvertiserId;
  }

  /**
   * Output only. The ID of default advertiser of the guaranteed order. The default advertiser is
   * either the read_write_advertiser_id or, if that is not set, the first advertiser listed in
   * read_advertiser_ids. Otherwise, there is no default advertiser.
   * @param defaultAdvertiserId defaultAdvertiserId or {@code null} for none
   */
  public GuaranteedOrder setDefaultAdvertiserId(java.lang.Long defaultAdvertiserId) {
    this.defaultAdvertiserId = defaultAdvertiserId;
    return this;
  }

  /**
   * The ID of the default campaign that is assigned to the guaranteed order. The default campaign
   * must belong to the default advertiser.
   * @return value or {@code null} for none
   */
  public java.lang.Long getDefaultCampaignId() {
    return defaultCampaignId;
  }

  /**
   * The ID of the default campaign that is assigned to the guaranteed order. The default campaign
   * must belong to the default advertiser.
   * @param defaultCampaignId defaultCampaignId or {@code null} for none
   */
  public GuaranteedOrder setDefaultCampaignId(java.lang.Long defaultCampaignId) {
    this.defaultCampaignId = defaultCampaignId;
    return this;
  }

  /**
   * Required. The display name of the guaranteed order. Must be UTF-8 encoded with a maximum size
   * of 240 bytes.
   * @return value or {@code null} for none
   */
  public java.lang.String getDisplayName() {
    return displayName;
  }

  /**
   * Required. The display name of the guaranteed order. Must be UTF-8 encoded with a maximum size
   * of 240 bytes.
   * @param displayName displayName or {@code null} for none
   */
  public GuaranteedOrder setDisplayName(java.lang.String displayName) {
    this.displayName = displayName;
    return this;
  }

  /**
   * Required. Immutable. The exchange where the guaranteed order originated.
   * @return value or {@code null} for none
   */
  public java.lang.String getExchange() {
    return exchange;
  }

  /**
   * Required. Immutable. The exchange where the guaranteed order originated.
   * @param exchange exchange or {@code null} for none
   */
  public GuaranteedOrder setExchange(java.lang.String exchange) {
    this.exchange = exchange;
    return this;
  }

  /**
   * Output only. The unique identifier of the guaranteed order. The guaranteed order IDs have the
   * format `{exchange}-{legacy_guaranteed_order_id}`.
   * @return value or {@code null} for none
   */
  public java.lang.String getGuaranteedOrderId() {
    return guaranteedOrderId;
  }

  /**
   * Output only. The unique identifier of the guaranteed order. The guaranteed order IDs have the
   * format `{exchange}-{legacy_guaranteed_order_id}`.
   * @param guaranteedOrderId guaranteedOrderId or {@code null} for none
   */
  public GuaranteedOrder setGuaranteedOrderId(java.lang.String guaranteedOrderId) {
    this.guaranteedOrderId = guaranteedOrderId;
    return this;
  }

  /**
   * Output only. The legacy ID of the guaranteed order. Assigned by the original exchange. The
   * legacy ID is unique within one exchange, but is not guaranteed to be unique across all
   * guaranteed orders. This ID is used in SDF and UI.
   * @return value or {@code null} for none
   */
  public java.lang.String getLegacyGuaranteedOrderId() {
    return legacyGuaranteedOrderId;
  }

  /**
   * Output only. The legacy ID of the guaranteed order. Assigned by the original exchange. The
   * legacy ID is unique within one exchange, but is not guaranteed to be unique across all
   * guaranteed orders. This ID is used in SDF and UI.
   * @param legacyGuaranteedOrderId legacyGuaranteedOrderId or {@code null} for none
   */
  public GuaranteedOrder setLegacyGuaranteedOrderId(java.lang.String legacyGuaranteedOrderId) {
    this.legacyGuaranteedOrderId = legacyGuaranteedOrderId;
    return this;
  }

  /**
   * Output only. The resource name of the guaranteed order.
   * @return value or {@code null} for none
   */
  public java.lang.String getName() {
    return name;
  }

  /**
   * Output only. The resource name of the guaranteed order.
   * @param name name or {@code null} for none
   */
  public GuaranteedOrder setName(java.lang.String name) {
    this.name = name;
    return this;
  }

  /**
   * Required. The publisher name of the guaranteed order. Must be UTF-8 encoded with a maximum size
   * of 240 bytes.
   * @return value or {@code null} for none
   */
  public java.lang.String getPublisherName() {
    return publisherName;
  }

  /**
   * Required. The publisher name of the guaranteed order. Must be UTF-8 encoded with a maximum size
   * of 240 bytes.
   * @param publisherName publisherName or {@code null} for none
   */
  public GuaranteedOrder setPublisherName(java.lang.String publisherName) {
    this.publisherName = publisherName;
    return this;
  }

  /**
   * Whether all advertisers of read_write_partner_id have read access to the guaranteed order. Only
   * applicable if read_write_partner_id is set. If True, overrides read_advertiser_ids.
   * @return value or {@code null} for none
   */
  public java.lang.Boolean getReadAccessInherited() {
    return readAccessInherited;
  }

  /**
   * Whether all advertisers of read_write_partner_id have read access to the guaranteed order. Only
   * applicable if read_write_partner_id is set. If True, overrides read_advertiser_ids.
   * @param readAccessInherited readAccessInherited or {@code null} for none
   */
  public GuaranteedOrder setReadAccessInherited(java.lang.Boolean readAccessInherited) {
    this.readAccessInherited = readAccessInherited;
    return this;
  }

  /**
   * The IDs of advertisers with read access to the guaranteed order. This field must not include
   * the advertiser assigned to read_write_advertiser_id if it is set. All advertisers in this field
   * must belong to read_write_partner_id or the same partner as read_write_advertiser_id.
   * @return value or {@code null} for none
   */
  public java.util.List<java.lang.Long> getReadAdvertiserIds() {
    return readAdvertiserIds;
  }

  /**
   * The IDs of advertisers with read access to the guaranteed order. This field must not include
   * the advertiser assigned to read_write_advertiser_id if it is set. All advertisers in this field
   * must belong to read_write_partner_id or the same partner as read_write_advertiser_id.
   * @param readAdvertiserIds readAdvertiserIds or {@code null} for none
   */
  public GuaranteedOrder setReadAdvertiserIds(java.util.List<java.lang.Long> readAdvertiserIds) {
    this.readAdvertiserIds = readAdvertiserIds;
    return this;
  }

  /**
   * The advertiser with read/write access to the guaranteed order. This is also the default
   * advertiser of the guaranteed order.
   * @return value or {@code null} for none
   */
  public java.lang.Long getReadWriteAdvertiserId() {
    return readWriteAdvertiserId;
  }

  /**
   * The advertiser with read/write access to the guaranteed order. This is also the default
   * advertiser of the guaranteed order.
   * @param readWriteAdvertiserId readWriteAdvertiserId or {@code null} for none
   */
  public GuaranteedOrder setReadWriteAdvertiserId(java.lang.Long readWriteAdvertiserId) {
    this.readWriteAdvertiserId = readWriteAdvertiserId;
    return this;
  }

  /**
   * The partner with read/write access to the guaranteed order.
   * @return value or {@code null} for none
   */
  public java.lang.Long getReadWritePartnerId() {
    return readWritePartnerId;
  }

  /**
   * The partner with read/write access to the guaranteed order.
   * @param readWritePartnerId readWritePartnerId or {@code null} for none
   */
  public GuaranteedOrder setReadWritePartnerId(java.lang.Long readWritePartnerId) {
    this.readWritePartnerId = readWritePartnerId;
    return this;
  }

  /**
   * The status settings of the guaranteed order.
   * @return value or {@code null} for none
   */
  public GuaranteedOrderStatus getStatus() {
    return status;
  }

  /**
   * The status settings of the guaranteed order.
   * @param status status or {@code null} for none
   */
  public GuaranteedOrder setStatus(GuaranteedOrderStatus status) {
    this.status = status;
    return this;
  }

  /**
   * Output only. The timestamp when the guaranteed order was last updated. Assigned by the system.
   * @return value or {@code null} for none
   */
  public String getUpdateTime() {
    return updateTime;
  }

  /**
   * Output only. The timestamp when the guaranteed order was last updated. Assigned by the system.
   * @param updateTime updateTime or {@code null} for none
   */
  public GuaranteedOrder setUpdateTime(String updateTime) {
    this.updateTime = updateTime;
    return this;
  }

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

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

}
