/*
 * Copyright 2020 Google LLC
 *
 * 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
 *
 *     https://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.
 */
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/cloud/video/stitcher/v1/companions.proto

package com.google.cloud.video.stitcher.v1;

/**
 *
 *
 * <pre>
 * Metadata for a companion.
 * </pre>
 *
 * Protobuf type {@code google.cloud.video.stitcher.v1.Companion}
 */
public final class Companion extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.video.stitcher.v1.Companion)
    CompanionOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use Companion.newBuilder() to construct.
  private Companion(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private Companion() {
    apiFramework_ = "";
    adSlotId_ = "";
    events_ = java.util.Collections.emptyList();
  }

  @java.lang.Override
  @SuppressWarnings({"unused"})
  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
    return new Companion();
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
    return this.unknownFields;
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.video.stitcher.v1.CompanionsProto
        .internal_static_google_cloud_video_stitcher_v1_Companion_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.cloud.video.stitcher.v1.CompanionsProto
        .internal_static_google_cloud_video_stitcher_v1_Companion_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.cloud.video.stitcher.v1.Companion.class,
            com.google.cloud.video.stitcher.v1.Companion.Builder.class);
  }

  private int adResourceCase_ = 0;
  private java.lang.Object adResource_;

  public enum AdResourceCase
      implements
          com.google.protobuf.Internal.EnumLite,
          com.google.protobuf.AbstractMessage.InternalOneOfEnum {
    IFRAME_AD_RESOURCE(10),
    STATIC_AD_RESOURCE(11),
    HTML_AD_RESOURCE(12),
    ADRESOURCE_NOT_SET(0);
    private final int value;

    private AdResourceCase(int value) {
      this.value = value;
    }
    /**
     * @param value The number of the enum to look for.
     * @return The enum associated with the given number.
     * @deprecated Use {@link #forNumber(int)} instead.
     */
    @java.lang.Deprecated
    public static AdResourceCase valueOf(int value) {
      return forNumber(value);
    }

    public static AdResourceCase forNumber(int value) {
      switch (value) {
        case 10:
          return IFRAME_AD_RESOURCE;
        case 11:
          return STATIC_AD_RESOURCE;
        case 12:
          return HTML_AD_RESOURCE;
        case 0:
          return ADRESOURCE_NOT_SET;
        default:
          return null;
      }
    }

    public int getNumber() {
      return this.value;
    }
  };

  public AdResourceCase getAdResourceCase() {
    return AdResourceCase.forNumber(adResourceCase_);
  }

  public static final int IFRAME_AD_RESOURCE_FIELD_NUMBER = 10;
  /**
   *
   *
   * <pre>
   * The IFrame ad resource associated with the companion ad.
   * </pre>
   *
   * <code>.google.cloud.video.stitcher.v1.IframeAdResource iframe_ad_resource = 10;</code>
   *
   * @return Whether the iframeAdResource field is set.
   */
  @java.lang.Override
  public boolean hasIframeAdResource() {
    return adResourceCase_ == 10;
  }
  /**
   *
   *
   * <pre>
   * The IFrame ad resource associated with the companion ad.
   * </pre>
   *
   * <code>.google.cloud.video.stitcher.v1.IframeAdResource iframe_ad_resource = 10;</code>
   *
   * @return The iframeAdResource.
   */
  @java.lang.Override
  public com.google.cloud.video.stitcher.v1.IframeAdResource getIframeAdResource() {
    if (adResourceCase_ == 10) {
      return (com.google.cloud.video.stitcher.v1.IframeAdResource) adResource_;
    }
    return com.google.cloud.video.stitcher.v1.IframeAdResource.getDefaultInstance();
  }
  /**
   *
   *
   * <pre>
   * The IFrame ad resource associated with the companion ad.
   * </pre>
   *
   * <code>.google.cloud.video.stitcher.v1.IframeAdResource iframe_ad_resource = 10;</code>
   */
  @java.lang.Override
  public com.google.cloud.video.stitcher.v1.IframeAdResourceOrBuilder
      getIframeAdResourceOrBuilder() {
    if (adResourceCase_ == 10) {
      return (com.google.cloud.video.stitcher.v1.IframeAdResource) adResource_;
    }
    return com.google.cloud.video.stitcher.v1.IframeAdResource.getDefaultInstance();
  }

  public static final int STATIC_AD_RESOURCE_FIELD_NUMBER = 11;
  /**
   *
   *
   * <pre>
   * The static ad resource associated with the companion ad.
   * </pre>
   *
   * <code>.google.cloud.video.stitcher.v1.StaticAdResource static_ad_resource = 11;</code>
   *
   * @return Whether the staticAdResource field is set.
   */
  @java.lang.Override
  public boolean hasStaticAdResource() {
    return adResourceCase_ == 11;
  }
  /**
   *
   *
   * <pre>
   * The static ad resource associated with the companion ad.
   * </pre>
   *
   * <code>.google.cloud.video.stitcher.v1.StaticAdResource static_ad_resource = 11;</code>
   *
   * @return The staticAdResource.
   */
  @java.lang.Override
  public com.google.cloud.video.stitcher.v1.StaticAdResource getStaticAdResource() {
    if (adResourceCase_ == 11) {
      return (com.google.cloud.video.stitcher.v1.StaticAdResource) adResource_;
    }
    return com.google.cloud.video.stitcher.v1.StaticAdResource.getDefaultInstance();
  }
  /**
   *
   *
   * <pre>
   * The static ad resource associated with the companion ad.
   * </pre>
   *
   * <code>.google.cloud.video.stitcher.v1.StaticAdResource static_ad_resource = 11;</code>
   */
  @java.lang.Override
  public com.google.cloud.video.stitcher.v1.StaticAdResourceOrBuilder
      getStaticAdResourceOrBuilder() {
    if (adResourceCase_ == 11) {
      return (com.google.cloud.video.stitcher.v1.StaticAdResource) adResource_;
    }
    return com.google.cloud.video.stitcher.v1.StaticAdResource.getDefaultInstance();
  }

  public static final int HTML_AD_RESOURCE_FIELD_NUMBER = 12;
  /**
   *
   *
   * <pre>
   * The HTML ad resource associated with the companion ad.
   * </pre>
   *
   * <code>.google.cloud.video.stitcher.v1.HtmlAdResource html_ad_resource = 12;</code>
   *
   * @return Whether the htmlAdResource field is set.
   */
  @java.lang.Override
  public boolean hasHtmlAdResource() {
    return adResourceCase_ == 12;
  }
  /**
   *
   *
   * <pre>
   * The HTML ad resource associated with the companion ad.
   * </pre>
   *
   * <code>.google.cloud.video.stitcher.v1.HtmlAdResource html_ad_resource = 12;</code>
   *
   * @return The htmlAdResource.
   */
  @java.lang.Override
  public com.google.cloud.video.stitcher.v1.HtmlAdResource getHtmlAdResource() {
    if (adResourceCase_ == 12) {
      return (com.google.cloud.video.stitcher.v1.HtmlAdResource) adResource_;
    }
    return com.google.cloud.video.stitcher.v1.HtmlAdResource.getDefaultInstance();
  }
  /**
   *
   *
   * <pre>
   * The HTML ad resource associated with the companion ad.
   * </pre>
   *
   * <code>.google.cloud.video.stitcher.v1.HtmlAdResource html_ad_resource = 12;</code>
   */
  @java.lang.Override
  public com.google.cloud.video.stitcher.v1.HtmlAdResourceOrBuilder getHtmlAdResourceOrBuilder() {
    if (adResourceCase_ == 12) {
      return (com.google.cloud.video.stitcher.v1.HtmlAdResource) adResource_;
    }
    return com.google.cloud.video.stitcher.v1.HtmlAdResource.getDefaultInstance();
  }

  public static final int API_FRAMEWORK_FIELD_NUMBER = 1;

  @SuppressWarnings("serial")
  private volatile java.lang.Object apiFramework_ = "";
  /**
   *
   *
   * <pre>
   * The API necessary to communicate with the creative if available.
   * </pre>
   *
   * <code>string api_framework = 1;</code>
   *
   * @return The apiFramework.
   */
  @java.lang.Override
  public java.lang.String getApiFramework() {
    java.lang.Object ref = apiFramework_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      apiFramework_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * The API necessary to communicate with the creative if available.
   * </pre>
   *
   * <code>string api_framework = 1;</code>
   *
   * @return The bytes for apiFramework.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getApiFrameworkBytes() {
    java.lang.Object ref = apiFramework_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      apiFramework_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int HEIGHT_PX_FIELD_NUMBER = 2;
  private int heightPx_ = 0;
  /**
   *
   *
   * <pre>
   * The pixel height of the placement slot for the intended creative.
   * </pre>
   *
   * <code>int32 height_px = 2;</code>
   *
   * @return The heightPx.
   */
  @java.lang.Override
  public int getHeightPx() {
    return heightPx_;
  }

  public static final int WIDTH_PX_FIELD_NUMBER = 3;
  private int widthPx_ = 0;
  /**
   *
   *
   * <pre>
   * The pixel width of the placement slot for the intended creative.
   * </pre>
   *
   * <code>int32 width_px = 3;</code>
   *
   * @return The widthPx.
   */
  @java.lang.Override
  public int getWidthPx() {
    return widthPx_;
  }

  public static final int ASSET_HEIGHT_PX_FIELD_NUMBER = 4;
  private int assetHeightPx_ = 0;
  /**
   *
   *
   * <pre>
   * The pixel height of the creative.
   * </pre>
   *
   * <code>int32 asset_height_px = 4;</code>
   *
   * @return The assetHeightPx.
   */
  @java.lang.Override
  public int getAssetHeightPx() {
    return assetHeightPx_;
  }

  public static final int EXPANDED_HEIGHT_PX_FIELD_NUMBER = 5;
  private int expandedHeightPx_ = 0;
  /**
   *
   *
   * <pre>
   * The maximum pixel height of the creative in its expanded state.
   * </pre>
   *
   * <code>int32 expanded_height_px = 5;</code>
   *
   * @return The expandedHeightPx.
   */
  @java.lang.Override
  public int getExpandedHeightPx() {
    return expandedHeightPx_;
  }

  public static final int ASSET_WIDTH_PX_FIELD_NUMBER = 6;
  private int assetWidthPx_ = 0;
  /**
   *
   *
   * <pre>
   * The pixel width of the creative.
   * </pre>
   *
   * <code>int32 asset_width_px = 6;</code>
   *
   * @return The assetWidthPx.
   */
  @java.lang.Override
  public int getAssetWidthPx() {
    return assetWidthPx_;
  }

  public static final int EXPANDED_WIDTH_PX_FIELD_NUMBER = 7;
  private int expandedWidthPx_ = 0;
  /**
   *
   *
   * <pre>
   * The maximum pixel width of the creative in its expanded state.
   * </pre>
   *
   * <code>int32 expanded_width_px = 7;</code>
   *
   * @return The expandedWidthPx.
   */
  @java.lang.Override
  public int getExpandedWidthPx() {
    return expandedWidthPx_;
  }

  public static final int AD_SLOT_ID_FIELD_NUMBER = 8;

  @SuppressWarnings("serial")
  private volatile java.lang.Object adSlotId_ = "";
  /**
   *
   *
   * <pre>
   * The ID used to identify the desired placement on a publisher's page.
   * Values to be used should be discussed between publishers and
   * advertisers.
   * </pre>
   *
   * <code>string ad_slot_id = 8;</code>
   *
   * @return The adSlotId.
   */
  @java.lang.Override
  public java.lang.String getAdSlotId() {
    java.lang.Object ref = adSlotId_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      adSlotId_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * The ID used to identify the desired placement on a publisher's page.
   * Values to be used should be discussed between publishers and
   * advertisers.
   * </pre>
   *
   * <code>string ad_slot_id = 8;</code>
   *
   * @return The bytes for adSlotId.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getAdSlotIdBytes() {
    java.lang.Object ref = adSlotId_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      adSlotId_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int EVENTS_FIELD_NUMBER = 9;

  @SuppressWarnings("serial")
  private java.util.List<com.google.cloud.video.stitcher.v1.Event> events_;
  /**
   *
   *
   * <pre>
   * The list of tracking events for the companion.
   * </pre>
   *
   * <code>repeated .google.cloud.video.stitcher.v1.Event events = 9;</code>
   */
  @java.lang.Override
  public java.util.List<com.google.cloud.video.stitcher.v1.Event> getEventsList() {
    return events_;
  }
  /**
   *
   *
   * <pre>
   * The list of tracking events for the companion.
   * </pre>
   *
   * <code>repeated .google.cloud.video.stitcher.v1.Event events = 9;</code>
   */
  @java.lang.Override
  public java.util.List<? extends com.google.cloud.video.stitcher.v1.EventOrBuilder>
      getEventsOrBuilderList() {
    return events_;
  }
  /**
   *
   *
   * <pre>
   * The list of tracking events for the companion.
   * </pre>
   *
   * <code>repeated .google.cloud.video.stitcher.v1.Event events = 9;</code>
   */
  @java.lang.Override
  public int getEventsCount() {
    return events_.size();
  }
  /**
   *
   *
   * <pre>
   * The list of tracking events for the companion.
   * </pre>
   *
   * <code>repeated .google.cloud.video.stitcher.v1.Event events = 9;</code>
   */
  @java.lang.Override
  public com.google.cloud.video.stitcher.v1.Event getEvents(int index) {
    return events_.get(index);
  }
  /**
   *
   *
   * <pre>
   * The list of tracking events for the companion.
   * </pre>
   *
   * <code>repeated .google.cloud.video.stitcher.v1.Event events = 9;</code>
   */
  @java.lang.Override
  public com.google.cloud.video.stitcher.v1.EventOrBuilder getEventsOrBuilder(int index) {
    return events_.get(index);
  }

  private byte memoizedIsInitialized = -1;

  @java.lang.Override
  public final boolean isInitialized() {
    byte isInitialized = memoizedIsInitialized;
    if (isInitialized == 1) return true;
    if (isInitialized == 0) return false;

    memoizedIsInitialized = 1;
    return true;
  }

  @java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(apiFramework_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, apiFramework_);
    }
    if (heightPx_ != 0) {
      output.writeInt32(2, heightPx_);
    }
    if (widthPx_ != 0) {
      output.writeInt32(3, widthPx_);
    }
    if (assetHeightPx_ != 0) {
      output.writeInt32(4, assetHeightPx_);
    }
    if (expandedHeightPx_ != 0) {
      output.writeInt32(5, expandedHeightPx_);
    }
    if (assetWidthPx_ != 0) {
      output.writeInt32(6, assetWidthPx_);
    }
    if (expandedWidthPx_ != 0) {
      output.writeInt32(7, expandedWidthPx_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(adSlotId_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 8, adSlotId_);
    }
    for (int i = 0; i < events_.size(); i++) {
      output.writeMessage(9, events_.get(i));
    }
    if (adResourceCase_ == 10) {
      output.writeMessage(10, (com.google.cloud.video.stitcher.v1.IframeAdResource) adResource_);
    }
    if (adResourceCase_ == 11) {
      output.writeMessage(11, (com.google.cloud.video.stitcher.v1.StaticAdResource) adResource_);
    }
    if (adResourceCase_ == 12) {
      output.writeMessage(12, (com.google.cloud.video.stitcher.v1.HtmlAdResource) adResource_);
    }
    getUnknownFields().writeTo(output);
  }

  @java.lang.Override
  public int getSerializedSize() {
    int size = memoizedSize;
    if (size != -1) return size;

    size = 0;
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(apiFramework_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, apiFramework_);
    }
    if (heightPx_ != 0) {
      size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, heightPx_);
    }
    if (widthPx_ != 0) {
      size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, widthPx_);
    }
    if (assetHeightPx_ != 0) {
      size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, assetHeightPx_);
    }
    if (expandedHeightPx_ != 0) {
      size += com.google.protobuf.CodedOutputStream.computeInt32Size(5, expandedHeightPx_);
    }
    if (assetWidthPx_ != 0) {
      size += com.google.protobuf.CodedOutputStream.computeInt32Size(6, assetWidthPx_);
    }
    if (expandedWidthPx_ != 0) {
      size += com.google.protobuf.CodedOutputStream.computeInt32Size(7, expandedWidthPx_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(adSlotId_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, adSlotId_);
    }
    for (int i = 0; i < events_.size(); i++) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, events_.get(i));
    }
    if (adResourceCase_ == 10) {
      size +=
          com.google.protobuf.CodedOutputStream.computeMessageSize(
              10, (com.google.cloud.video.stitcher.v1.IframeAdResource) adResource_);
    }
    if (adResourceCase_ == 11) {
      size +=
          com.google.protobuf.CodedOutputStream.computeMessageSize(
              11, (com.google.cloud.video.stitcher.v1.StaticAdResource) adResource_);
    }
    if (adResourceCase_ == 12) {
      size +=
          com.google.protobuf.CodedOutputStream.computeMessageSize(
              12, (com.google.cloud.video.stitcher.v1.HtmlAdResource) adResource_);
    }
    size += getUnknownFields().getSerializedSize();
    memoizedSize = size;
    return size;
  }

  @java.lang.Override
  public boolean equals(final java.lang.Object obj) {
    if (obj == this) {
      return true;
    }
    if (!(obj instanceof com.google.cloud.video.stitcher.v1.Companion)) {
      return super.equals(obj);
    }
    com.google.cloud.video.stitcher.v1.Companion other =
        (com.google.cloud.video.stitcher.v1.Companion) obj;

    if (!getApiFramework().equals(other.getApiFramework())) return false;
    if (getHeightPx() != other.getHeightPx()) return false;
    if (getWidthPx() != other.getWidthPx()) return false;
    if (getAssetHeightPx() != other.getAssetHeightPx()) return false;
    if (getExpandedHeightPx() != other.getExpandedHeightPx()) return false;
    if (getAssetWidthPx() != other.getAssetWidthPx()) return false;
    if (getExpandedWidthPx() != other.getExpandedWidthPx()) return false;
    if (!getAdSlotId().equals(other.getAdSlotId())) return false;
    if (!getEventsList().equals(other.getEventsList())) return false;
    if (!getAdResourceCase().equals(other.getAdResourceCase())) return false;
    switch (adResourceCase_) {
      case 10:
        if (!getIframeAdResource().equals(other.getIframeAdResource())) return false;
        break;
      case 11:
        if (!getStaticAdResource().equals(other.getStaticAdResource())) return false;
        break;
      case 12:
        if (!getHtmlAdResource().equals(other.getHtmlAdResource())) return false;
        break;
      case 0:
      default:
    }
    if (!getUnknownFields().equals(other.getUnknownFields())) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    hash = (37 * hash) + API_FRAMEWORK_FIELD_NUMBER;
    hash = (53 * hash) + getApiFramework().hashCode();
    hash = (37 * hash) + HEIGHT_PX_FIELD_NUMBER;
    hash = (53 * hash) + getHeightPx();
    hash = (37 * hash) + WIDTH_PX_FIELD_NUMBER;
    hash = (53 * hash) + getWidthPx();
    hash = (37 * hash) + ASSET_HEIGHT_PX_FIELD_NUMBER;
    hash = (53 * hash) + getAssetHeightPx();
    hash = (37 * hash) + EXPANDED_HEIGHT_PX_FIELD_NUMBER;
    hash = (53 * hash) + getExpandedHeightPx();
    hash = (37 * hash) + ASSET_WIDTH_PX_FIELD_NUMBER;
    hash = (53 * hash) + getAssetWidthPx();
    hash = (37 * hash) + EXPANDED_WIDTH_PX_FIELD_NUMBER;
    hash = (53 * hash) + getExpandedWidthPx();
    hash = (37 * hash) + AD_SLOT_ID_FIELD_NUMBER;
    hash = (53 * hash) + getAdSlotId().hashCode();
    if (getEventsCount() > 0) {
      hash = (37 * hash) + EVENTS_FIELD_NUMBER;
      hash = (53 * hash) + getEventsList().hashCode();
    }
    switch (adResourceCase_) {
      case 10:
        hash = (37 * hash) + IFRAME_AD_RESOURCE_FIELD_NUMBER;
        hash = (53 * hash) + getIframeAdResource().hashCode();
        break;
      case 11:
        hash = (37 * hash) + STATIC_AD_RESOURCE_FIELD_NUMBER;
        hash = (53 * hash) + getStaticAdResource().hashCode();
        break;
      case 12:
        hash = (37 * hash) + HTML_AD_RESOURCE_FIELD_NUMBER;
        hash = (53 * hash) + getHtmlAdResource().hashCode();
        break;
      case 0:
      default:
    }
    hash = (29 * hash) + getUnknownFields().hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.cloud.video.stitcher.v1.Companion parseFrom(java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.video.stitcher.v1.Companion parseFrom(
      java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.video.stitcher.v1.Companion parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.video.stitcher.v1.Companion parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.video.stitcher.v1.Companion parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.video.stitcher.v1.Companion parseFrom(
      byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.video.stitcher.v1.Companion parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.cloud.video.stitcher.v1.Companion parseFrom(
      java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        PARSER, input, extensionRegistry);
  }

  public static com.google.cloud.video.stitcher.v1.Companion parseDelimitedFrom(
      java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
  }

  public static com.google.cloud.video.stitcher.v1.Companion parseDelimitedFrom(
      java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
        PARSER, input, extensionRegistry);
  }

  public static com.google.cloud.video.stitcher.v1.Companion parseFrom(
      com.google.protobuf.CodedInputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.cloud.video.stitcher.v1.Companion parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        PARSER, input, extensionRegistry);
  }

  @java.lang.Override
  public Builder newBuilderForType() {
    return newBuilder();
  }

  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }

  public static Builder newBuilder(com.google.cloud.video.stitcher.v1.Companion prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }

  @java.lang.Override
  public Builder toBuilder() {
    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
  }

  @java.lang.Override
  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }
  /**
   *
   *
   * <pre>
   * Metadata for a companion.
   * </pre>
   *
   * Protobuf type {@code google.cloud.video.stitcher.v1.Companion}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.video.stitcher.v1.Companion)
      com.google.cloud.video.stitcher.v1.CompanionOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.video.stitcher.v1.CompanionsProto
          .internal_static_google_cloud_video_stitcher_v1_Companion_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloud.video.stitcher.v1.CompanionsProto
          .internal_static_google_cloud_video_stitcher_v1_Companion_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.video.stitcher.v1.Companion.class,
              com.google.cloud.video.stitcher.v1.Companion.Builder.class);
    }

    // Construct using com.google.cloud.video.stitcher.v1.Companion.newBuilder()
    private Builder() {}

    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
    }

    @java.lang.Override
    public Builder clear() {
      super.clear();
      bitField0_ = 0;
      if (iframeAdResourceBuilder_ != null) {
        iframeAdResourceBuilder_.clear();
      }
      if (staticAdResourceBuilder_ != null) {
        staticAdResourceBuilder_.clear();
      }
      if (htmlAdResourceBuilder_ != null) {
        htmlAdResourceBuilder_.clear();
      }
      apiFramework_ = "";
      heightPx_ = 0;
      widthPx_ = 0;
      assetHeightPx_ = 0;
      expandedHeightPx_ = 0;
      assetWidthPx_ = 0;
      expandedWidthPx_ = 0;
      adSlotId_ = "";
      if (eventsBuilder_ == null) {
        events_ = java.util.Collections.emptyList();
      } else {
        events_ = null;
        eventsBuilder_.clear();
      }
      bitField0_ = (bitField0_ & ~0x00000800);
      adResourceCase_ = 0;
      adResource_ = null;
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.cloud.video.stitcher.v1.CompanionsProto
          .internal_static_google_cloud_video_stitcher_v1_Companion_descriptor;
    }

    @java.lang.Override
    public com.google.cloud.video.stitcher.v1.Companion getDefaultInstanceForType() {
      return com.google.cloud.video.stitcher.v1.Companion.getDefaultInstance();
    }

    @java.lang.Override
    public com.google.cloud.video.stitcher.v1.Companion build() {
      com.google.cloud.video.stitcher.v1.Companion result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public com.google.cloud.video.stitcher.v1.Companion buildPartial() {
      com.google.cloud.video.stitcher.v1.Companion result =
          new com.google.cloud.video.stitcher.v1.Companion(this);
      buildPartialRepeatedFields(result);
      if (bitField0_ != 0) {
        buildPartial0(result);
      }
      buildPartialOneofs(result);
      onBuilt();
      return result;
    }

    private void buildPartialRepeatedFields(com.google.cloud.video.stitcher.v1.Companion result) {
      if (eventsBuilder_ == null) {
        if (((bitField0_ & 0x00000800) != 0)) {
          events_ = java.util.Collections.unmodifiableList(events_);
          bitField0_ = (bitField0_ & ~0x00000800);
        }
        result.events_ = events_;
      } else {
        result.events_ = eventsBuilder_.build();
      }
    }

    private void buildPartial0(com.google.cloud.video.stitcher.v1.Companion result) {
      int from_bitField0_ = bitField0_;
      if (((from_bitField0_ & 0x00000008) != 0)) {
        result.apiFramework_ = apiFramework_;
      }
      if (((from_bitField0_ & 0x00000010) != 0)) {
        result.heightPx_ = heightPx_;
      }
      if (((from_bitField0_ & 0x00000020) != 0)) {
        result.widthPx_ = widthPx_;
      }
      if (((from_bitField0_ & 0x00000040) != 0)) {
        result.assetHeightPx_ = assetHeightPx_;
      }
      if (((from_bitField0_ & 0x00000080) != 0)) {
        result.expandedHeightPx_ = expandedHeightPx_;
      }
      if (((from_bitField0_ & 0x00000100) != 0)) {
        result.assetWidthPx_ = assetWidthPx_;
      }
      if (((from_bitField0_ & 0x00000200) != 0)) {
        result.expandedWidthPx_ = expandedWidthPx_;
      }
      if (((from_bitField0_ & 0x00000400) != 0)) {
        result.adSlotId_ = adSlotId_;
      }
    }

    private void buildPartialOneofs(com.google.cloud.video.stitcher.v1.Companion result) {
      result.adResourceCase_ = adResourceCase_;
      result.adResource_ = this.adResource_;
      if (adResourceCase_ == 10 && iframeAdResourceBuilder_ != null) {
        result.adResource_ = iframeAdResourceBuilder_.build();
      }
      if (adResourceCase_ == 11 && staticAdResourceBuilder_ != null) {
        result.adResource_ = staticAdResourceBuilder_.build();
      }
      if (adResourceCase_ == 12 && htmlAdResourceBuilder_ != null) {
        result.adResource_ = htmlAdResourceBuilder_.build();
      }
    }

    @java.lang.Override
    public Builder clone() {
      return super.clone();
    }

    @java.lang.Override
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.setField(field, value);
    }

    @java.lang.Override
    public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
      return super.clearField(field);
    }

    @java.lang.Override
    public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return super.clearOneof(oneof);
    }

    @java.lang.Override
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
      return super.setRepeatedField(field, index, value);
    }

    @java.lang.Override
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.addRepeatedField(field, value);
    }

    @java.lang.Override
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof com.google.cloud.video.stitcher.v1.Companion) {
        return mergeFrom((com.google.cloud.video.stitcher.v1.Companion) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.video.stitcher.v1.Companion other) {
      if (other == com.google.cloud.video.stitcher.v1.Companion.getDefaultInstance()) return this;
      if (!other.getApiFramework().isEmpty()) {
        apiFramework_ = other.apiFramework_;
        bitField0_ |= 0x00000008;
        onChanged();
      }
      if (other.getHeightPx() != 0) {
        setHeightPx(other.getHeightPx());
      }
      if (other.getWidthPx() != 0) {
        setWidthPx(other.getWidthPx());
      }
      if (other.getAssetHeightPx() != 0) {
        setAssetHeightPx(other.getAssetHeightPx());
      }
      if (other.getExpandedHeightPx() != 0) {
        setExpandedHeightPx(other.getExpandedHeightPx());
      }
      if (other.getAssetWidthPx() != 0) {
        setAssetWidthPx(other.getAssetWidthPx());
      }
      if (other.getExpandedWidthPx() != 0) {
        setExpandedWidthPx(other.getExpandedWidthPx());
      }
      if (!other.getAdSlotId().isEmpty()) {
        adSlotId_ = other.adSlotId_;
        bitField0_ |= 0x00000400;
        onChanged();
      }
      if (eventsBuilder_ == null) {
        if (!other.events_.isEmpty()) {
          if (events_.isEmpty()) {
            events_ = other.events_;
            bitField0_ = (bitField0_ & ~0x00000800);
          } else {
            ensureEventsIsMutable();
            events_.addAll(other.events_);
          }
          onChanged();
        }
      } else {
        if (!other.events_.isEmpty()) {
          if (eventsBuilder_.isEmpty()) {
            eventsBuilder_.dispose();
            eventsBuilder_ = null;
            events_ = other.events_;
            bitField0_ = (bitField0_ & ~0x00000800);
            eventsBuilder_ =
                com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
                    ? getEventsFieldBuilder()
                    : null;
          } else {
            eventsBuilder_.addAllMessages(other.events_);
          }
        }
      }
      switch (other.getAdResourceCase()) {
        case IFRAME_AD_RESOURCE:
          {
            mergeIframeAdResource(other.getIframeAdResource());
            break;
          }
        case STATIC_AD_RESOURCE:
          {
            mergeStaticAdResource(other.getStaticAdResource());
            break;
          }
        case HTML_AD_RESOURCE:
          {
            mergeHtmlAdResource(other.getHtmlAdResource());
            break;
          }
        case ADRESOURCE_NOT_SET:
          {
            break;
          }
      }
      this.mergeUnknownFields(other.getUnknownFields());
      onChanged();
      return this;
    }

    @java.lang.Override
    public final boolean isInitialized() {
      return true;
    }

    @java.lang.Override
    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      if (extensionRegistry == null) {
        throw new java.lang.NullPointerException();
      }
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            case 10:
              {
                apiFramework_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000008;
                break;
              } // case 10
            case 16:
              {
                heightPx_ = input.readInt32();
                bitField0_ |= 0x00000010;
                break;
              } // case 16
            case 24:
              {
                widthPx_ = input.readInt32();
                bitField0_ |= 0x00000020;
                break;
              } // case 24
            case 32:
              {
                assetHeightPx_ = input.readInt32();
                bitField0_ |= 0x00000040;
                break;
              } // case 32
            case 40:
              {
                expandedHeightPx_ = input.readInt32();
                bitField0_ |= 0x00000080;
                break;
              } // case 40
            case 48:
              {
                assetWidthPx_ = input.readInt32();
                bitField0_ |= 0x00000100;
                break;
              } // case 48
            case 56:
              {
                expandedWidthPx_ = input.readInt32();
                bitField0_ |= 0x00000200;
                break;
              } // case 56
            case 66:
              {
                adSlotId_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000400;
                break;
              } // case 66
            case 74:
              {
                com.google.cloud.video.stitcher.v1.Event m =
                    input.readMessage(
                        com.google.cloud.video.stitcher.v1.Event.parser(), extensionRegistry);
                if (eventsBuilder_ == null) {
                  ensureEventsIsMutable();
                  events_.add(m);
                } else {
                  eventsBuilder_.addMessage(m);
                }
                break;
              } // case 74
            case 82:
              {
                input.readMessage(
                    getIframeAdResourceFieldBuilder().getBuilder(), extensionRegistry);
                adResourceCase_ = 10;
                break;
              } // case 82
            case 90:
              {
                input.readMessage(
                    getStaticAdResourceFieldBuilder().getBuilder(), extensionRegistry);
                adResourceCase_ = 11;
                break;
              } // case 90
            case 98:
              {
                input.readMessage(getHtmlAdResourceFieldBuilder().getBuilder(), extensionRegistry);
                adResourceCase_ = 12;
                break;
              } // case 98
            default:
              {
                if (!super.parseUnknownField(input, extensionRegistry, tag)) {
                  done = true; // was an endgroup tag
                }
                break;
              } // default:
          } // switch (tag)
        } // while (!done)
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.unwrapIOException();
      } finally {
        onChanged();
      } // finally
      return this;
    }

    private int adResourceCase_ = 0;
    private java.lang.Object adResource_;

    public AdResourceCase getAdResourceCase() {
      return AdResourceCase.forNumber(adResourceCase_);
    }

    public Builder clearAdResource() {
      adResourceCase_ = 0;
      adResource_ = null;
      onChanged();
      return this;
    }

    private int bitField0_;

    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.video.stitcher.v1.IframeAdResource,
            com.google.cloud.video.stitcher.v1.IframeAdResource.Builder,
            com.google.cloud.video.stitcher.v1.IframeAdResourceOrBuilder>
        iframeAdResourceBuilder_;
    /**
     *
     *
     * <pre>
     * The IFrame ad resource associated with the companion ad.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.IframeAdResource iframe_ad_resource = 10;</code>
     *
     * @return Whether the iframeAdResource field is set.
     */
    @java.lang.Override
    public boolean hasIframeAdResource() {
      return adResourceCase_ == 10;
    }
    /**
     *
     *
     * <pre>
     * The IFrame ad resource associated with the companion ad.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.IframeAdResource iframe_ad_resource = 10;</code>
     *
     * @return The iframeAdResource.
     */
    @java.lang.Override
    public com.google.cloud.video.stitcher.v1.IframeAdResource getIframeAdResource() {
      if (iframeAdResourceBuilder_ == null) {
        if (adResourceCase_ == 10) {
          return (com.google.cloud.video.stitcher.v1.IframeAdResource) adResource_;
        }
        return com.google.cloud.video.stitcher.v1.IframeAdResource.getDefaultInstance();
      } else {
        if (adResourceCase_ == 10) {
          return iframeAdResourceBuilder_.getMessage();
        }
        return com.google.cloud.video.stitcher.v1.IframeAdResource.getDefaultInstance();
      }
    }
    /**
     *
     *
     * <pre>
     * The IFrame ad resource associated with the companion ad.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.IframeAdResource iframe_ad_resource = 10;</code>
     */
    public Builder setIframeAdResource(com.google.cloud.video.stitcher.v1.IframeAdResource value) {
      if (iframeAdResourceBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        adResource_ = value;
        onChanged();
      } else {
        iframeAdResourceBuilder_.setMessage(value);
      }
      adResourceCase_ = 10;
      return this;
    }
    /**
     *
     *
     * <pre>
     * The IFrame ad resource associated with the companion ad.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.IframeAdResource iframe_ad_resource = 10;</code>
     */
    public Builder setIframeAdResource(
        com.google.cloud.video.stitcher.v1.IframeAdResource.Builder builderForValue) {
      if (iframeAdResourceBuilder_ == null) {
        adResource_ = builderForValue.build();
        onChanged();
      } else {
        iframeAdResourceBuilder_.setMessage(builderForValue.build());
      }
      adResourceCase_ = 10;
      return this;
    }
    /**
     *
     *
     * <pre>
     * The IFrame ad resource associated with the companion ad.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.IframeAdResource iframe_ad_resource = 10;</code>
     */
    public Builder mergeIframeAdResource(
        com.google.cloud.video.stitcher.v1.IframeAdResource value) {
      if (iframeAdResourceBuilder_ == null) {
        if (adResourceCase_ == 10
            && adResource_
                != com.google.cloud.video.stitcher.v1.IframeAdResource.getDefaultInstance()) {
          adResource_ =
              com.google.cloud.video.stitcher.v1.IframeAdResource.newBuilder(
                      (com.google.cloud.video.stitcher.v1.IframeAdResource) adResource_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          adResource_ = value;
        }
        onChanged();
      } else {
        if (adResourceCase_ == 10) {
          iframeAdResourceBuilder_.mergeFrom(value);
        } else {
          iframeAdResourceBuilder_.setMessage(value);
        }
      }
      adResourceCase_ = 10;
      return this;
    }
    /**
     *
     *
     * <pre>
     * The IFrame ad resource associated with the companion ad.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.IframeAdResource iframe_ad_resource = 10;</code>
     */
    public Builder clearIframeAdResource() {
      if (iframeAdResourceBuilder_ == null) {
        if (adResourceCase_ == 10) {
          adResourceCase_ = 0;
          adResource_ = null;
          onChanged();
        }
      } else {
        if (adResourceCase_ == 10) {
          adResourceCase_ = 0;
          adResource_ = null;
        }
        iframeAdResourceBuilder_.clear();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The IFrame ad resource associated with the companion ad.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.IframeAdResource iframe_ad_resource = 10;</code>
     */
    public com.google.cloud.video.stitcher.v1.IframeAdResource.Builder
        getIframeAdResourceBuilder() {
      return getIframeAdResourceFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * The IFrame ad resource associated with the companion ad.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.IframeAdResource iframe_ad_resource = 10;</code>
     */
    @java.lang.Override
    public com.google.cloud.video.stitcher.v1.IframeAdResourceOrBuilder
        getIframeAdResourceOrBuilder() {
      if ((adResourceCase_ == 10) && (iframeAdResourceBuilder_ != null)) {
        return iframeAdResourceBuilder_.getMessageOrBuilder();
      } else {
        if (adResourceCase_ == 10) {
          return (com.google.cloud.video.stitcher.v1.IframeAdResource) adResource_;
        }
        return com.google.cloud.video.stitcher.v1.IframeAdResource.getDefaultInstance();
      }
    }
    /**
     *
     *
     * <pre>
     * The IFrame ad resource associated with the companion ad.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.IframeAdResource iframe_ad_resource = 10;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.video.stitcher.v1.IframeAdResource,
            com.google.cloud.video.stitcher.v1.IframeAdResource.Builder,
            com.google.cloud.video.stitcher.v1.IframeAdResourceOrBuilder>
        getIframeAdResourceFieldBuilder() {
      if (iframeAdResourceBuilder_ == null) {
        if (!(adResourceCase_ == 10)) {
          adResource_ = com.google.cloud.video.stitcher.v1.IframeAdResource.getDefaultInstance();
        }
        iframeAdResourceBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.cloud.video.stitcher.v1.IframeAdResource,
                com.google.cloud.video.stitcher.v1.IframeAdResource.Builder,
                com.google.cloud.video.stitcher.v1.IframeAdResourceOrBuilder>(
                (com.google.cloud.video.stitcher.v1.IframeAdResource) adResource_,
                getParentForChildren(),
                isClean());
        adResource_ = null;
      }
      adResourceCase_ = 10;
      onChanged();
      return iframeAdResourceBuilder_;
    }

    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.video.stitcher.v1.StaticAdResource,
            com.google.cloud.video.stitcher.v1.StaticAdResource.Builder,
            com.google.cloud.video.stitcher.v1.StaticAdResourceOrBuilder>
        staticAdResourceBuilder_;
    /**
     *
     *
     * <pre>
     * The static ad resource associated with the companion ad.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.StaticAdResource static_ad_resource = 11;</code>
     *
     * @return Whether the staticAdResource field is set.
     */
    @java.lang.Override
    public boolean hasStaticAdResource() {
      return adResourceCase_ == 11;
    }
    /**
     *
     *
     * <pre>
     * The static ad resource associated with the companion ad.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.StaticAdResource static_ad_resource = 11;</code>
     *
     * @return The staticAdResource.
     */
    @java.lang.Override
    public com.google.cloud.video.stitcher.v1.StaticAdResource getStaticAdResource() {
      if (staticAdResourceBuilder_ == null) {
        if (adResourceCase_ == 11) {
          return (com.google.cloud.video.stitcher.v1.StaticAdResource) adResource_;
        }
        return com.google.cloud.video.stitcher.v1.StaticAdResource.getDefaultInstance();
      } else {
        if (adResourceCase_ == 11) {
          return staticAdResourceBuilder_.getMessage();
        }
        return com.google.cloud.video.stitcher.v1.StaticAdResource.getDefaultInstance();
      }
    }
    /**
     *
     *
     * <pre>
     * The static ad resource associated with the companion ad.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.StaticAdResource static_ad_resource = 11;</code>
     */
    public Builder setStaticAdResource(com.google.cloud.video.stitcher.v1.StaticAdResource value) {
      if (staticAdResourceBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        adResource_ = value;
        onChanged();
      } else {
        staticAdResourceBuilder_.setMessage(value);
      }
      adResourceCase_ = 11;
      return this;
    }
    /**
     *
     *
     * <pre>
     * The static ad resource associated with the companion ad.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.StaticAdResource static_ad_resource = 11;</code>
     */
    public Builder setStaticAdResource(
        com.google.cloud.video.stitcher.v1.StaticAdResource.Builder builderForValue) {
      if (staticAdResourceBuilder_ == null) {
        adResource_ = builderForValue.build();
        onChanged();
      } else {
        staticAdResourceBuilder_.setMessage(builderForValue.build());
      }
      adResourceCase_ = 11;
      return this;
    }
    /**
     *
     *
     * <pre>
     * The static ad resource associated with the companion ad.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.StaticAdResource static_ad_resource = 11;</code>
     */
    public Builder mergeStaticAdResource(
        com.google.cloud.video.stitcher.v1.StaticAdResource value) {
      if (staticAdResourceBuilder_ == null) {
        if (adResourceCase_ == 11
            && adResource_
                != com.google.cloud.video.stitcher.v1.StaticAdResource.getDefaultInstance()) {
          adResource_ =
              com.google.cloud.video.stitcher.v1.StaticAdResource.newBuilder(
                      (com.google.cloud.video.stitcher.v1.StaticAdResource) adResource_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          adResource_ = value;
        }
        onChanged();
      } else {
        if (adResourceCase_ == 11) {
          staticAdResourceBuilder_.mergeFrom(value);
        } else {
          staticAdResourceBuilder_.setMessage(value);
        }
      }
      adResourceCase_ = 11;
      return this;
    }
    /**
     *
     *
     * <pre>
     * The static ad resource associated with the companion ad.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.StaticAdResource static_ad_resource = 11;</code>
     */
    public Builder clearStaticAdResource() {
      if (staticAdResourceBuilder_ == null) {
        if (adResourceCase_ == 11) {
          adResourceCase_ = 0;
          adResource_ = null;
          onChanged();
        }
      } else {
        if (adResourceCase_ == 11) {
          adResourceCase_ = 0;
          adResource_ = null;
        }
        staticAdResourceBuilder_.clear();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The static ad resource associated with the companion ad.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.StaticAdResource static_ad_resource = 11;</code>
     */
    public com.google.cloud.video.stitcher.v1.StaticAdResource.Builder
        getStaticAdResourceBuilder() {
      return getStaticAdResourceFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * The static ad resource associated with the companion ad.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.StaticAdResource static_ad_resource = 11;</code>
     */
    @java.lang.Override
    public com.google.cloud.video.stitcher.v1.StaticAdResourceOrBuilder
        getStaticAdResourceOrBuilder() {
      if ((adResourceCase_ == 11) && (staticAdResourceBuilder_ != null)) {
        return staticAdResourceBuilder_.getMessageOrBuilder();
      } else {
        if (adResourceCase_ == 11) {
          return (com.google.cloud.video.stitcher.v1.StaticAdResource) adResource_;
        }
        return com.google.cloud.video.stitcher.v1.StaticAdResource.getDefaultInstance();
      }
    }
    /**
     *
     *
     * <pre>
     * The static ad resource associated with the companion ad.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.StaticAdResource static_ad_resource = 11;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.video.stitcher.v1.StaticAdResource,
            com.google.cloud.video.stitcher.v1.StaticAdResource.Builder,
            com.google.cloud.video.stitcher.v1.StaticAdResourceOrBuilder>
        getStaticAdResourceFieldBuilder() {
      if (staticAdResourceBuilder_ == null) {
        if (!(adResourceCase_ == 11)) {
          adResource_ = com.google.cloud.video.stitcher.v1.StaticAdResource.getDefaultInstance();
        }
        staticAdResourceBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.cloud.video.stitcher.v1.StaticAdResource,
                com.google.cloud.video.stitcher.v1.StaticAdResource.Builder,
                com.google.cloud.video.stitcher.v1.StaticAdResourceOrBuilder>(
                (com.google.cloud.video.stitcher.v1.StaticAdResource) adResource_,
                getParentForChildren(),
                isClean());
        adResource_ = null;
      }
      adResourceCase_ = 11;
      onChanged();
      return staticAdResourceBuilder_;
    }

    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.video.stitcher.v1.HtmlAdResource,
            com.google.cloud.video.stitcher.v1.HtmlAdResource.Builder,
            com.google.cloud.video.stitcher.v1.HtmlAdResourceOrBuilder>
        htmlAdResourceBuilder_;
    /**
     *
     *
     * <pre>
     * The HTML ad resource associated with the companion ad.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.HtmlAdResource html_ad_resource = 12;</code>
     *
     * @return Whether the htmlAdResource field is set.
     */
    @java.lang.Override
    public boolean hasHtmlAdResource() {
      return adResourceCase_ == 12;
    }
    /**
     *
     *
     * <pre>
     * The HTML ad resource associated with the companion ad.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.HtmlAdResource html_ad_resource = 12;</code>
     *
     * @return The htmlAdResource.
     */
    @java.lang.Override
    public com.google.cloud.video.stitcher.v1.HtmlAdResource getHtmlAdResource() {
      if (htmlAdResourceBuilder_ == null) {
        if (adResourceCase_ == 12) {
          return (com.google.cloud.video.stitcher.v1.HtmlAdResource) adResource_;
        }
        return com.google.cloud.video.stitcher.v1.HtmlAdResource.getDefaultInstance();
      } else {
        if (adResourceCase_ == 12) {
          return htmlAdResourceBuilder_.getMessage();
        }
        return com.google.cloud.video.stitcher.v1.HtmlAdResource.getDefaultInstance();
      }
    }
    /**
     *
     *
     * <pre>
     * The HTML ad resource associated with the companion ad.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.HtmlAdResource html_ad_resource = 12;</code>
     */
    public Builder setHtmlAdResource(com.google.cloud.video.stitcher.v1.HtmlAdResource value) {
      if (htmlAdResourceBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        adResource_ = value;
        onChanged();
      } else {
        htmlAdResourceBuilder_.setMessage(value);
      }
      adResourceCase_ = 12;
      return this;
    }
    /**
     *
     *
     * <pre>
     * The HTML ad resource associated with the companion ad.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.HtmlAdResource html_ad_resource = 12;</code>
     */
    public Builder setHtmlAdResource(
        com.google.cloud.video.stitcher.v1.HtmlAdResource.Builder builderForValue) {
      if (htmlAdResourceBuilder_ == null) {
        adResource_ = builderForValue.build();
        onChanged();
      } else {
        htmlAdResourceBuilder_.setMessage(builderForValue.build());
      }
      adResourceCase_ = 12;
      return this;
    }
    /**
     *
     *
     * <pre>
     * The HTML ad resource associated with the companion ad.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.HtmlAdResource html_ad_resource = 12;</code>
     */
    public Builder mergeHtmlAdResource(com.google.cloud.video.stitcher.v1.HtmlAdResource value) {
      if (htmlAdResourceBuilder_ == null) {
        if (adResourceCase_ == 12
            && adResource_
                != com.google.cloud.video.stitcher.v1.HtmlAdResource.getDefaultInstance()) {
          adResource_ =
              com.google.cloud.video.stitcher.v1.HtmlAdResource.newBuilder(
                      (com.google.cloud.video.stitcher.v1.HtmlAdResource) adResource_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          adResource_ = value;
        }
        onChanged();
      } else {
        if (adResourceCase_ == 12) {
          htmlAdResourceBuilder_.mergeFrom(value);
        } else {
          htmlAdResourceBuilder_.setMessage(value);
        }
      }
      adResourceCase_ = 12;
      return this;
    }
    /**
     *
     *
     * <pre>
     * The HTML ad resource associated with the companion ad.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.HtmlAdResource html_ad_resource = 12;</code>
     */
    public Builder clearHtmlAdResource() {
      if (htmlAdResourceBuilder_ == null) {
        if (adResourceCase_ == 12) {
          adResourceCase_ = 0;
          adResource_ = null;
          onChanged();
        }
      } else {
        if (adResourceCase_ == 12) {
          adResourceCase_ = 0;
          adResource_ = null;
        }
        htmlAdResourceBuilder_.clear();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The HTML ad resource associated with the companion ad.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.HtmlAdResource html_ad_resource = 12;</code>
     */
    public com.google.cloud.video.stitcher.v1.HtmlAdResource.Builder getHtmlAdResourceBuilder() {
      return getHtmlAdResourceFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * The HTML ad resource associated with the companion ad.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.HtmlAdResource html_ad_resource = 12;</code>
     */
    @java.lang.Override
    public com.google.cloud.video.stitcher.v1.HtmlAdResourceOrBuilder getHtmlAdResourceOrBuilder() {
      if ((adResourceCase_ == 12) && (htmlAdResourceBuilder_ != null)) {
        return htmlAdResourceBuilder_.getMessageOrBuilder();
      } else {
        if (adResourceCase_ == 12) {
          return (com.google.cloud.video.stitcher.v1.HtmlAdResource) adResource_;
        }
        return com.google.cloud.video.stitcher.v1.HtmlAdResource.getDefaultInstance();
      }
    }
    /**
     *
     *
     * <pre>
     * The HTML ad resource associated with the companion ad.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.HtmlAdResource html_ad_resource = 12;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.video.stitcher.v1.HtmlAdResource,
            com.google.cloud.video.stitcher.v1.HtmlAdResource.Builder,
            com.google.cloud.video.stitcher.v1.HtmlAdResourceOrBuilder>
        getHtmlAdResourceFieldBuilder() {
      if (htmlAdResourceBuilder_ == null) {
        if (!(adResourceCase_ == 12)) {
          adResource_ = com.google.cloud.video.stitcher.v1.HtmlAdResource.getDefaultInstance();
        }
        htmlAdResourceBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.cloud.video.stitcher.v1.HtmlAdResource,
                com.google.cloud.video.stitcher.v1.HtmlAdResource.Builder,
                com.google.cloud.video.stitcher.v1.HtmlAdResourceOrBuilder>(
                (com.google.cloud.video.stitcher.v1.HtmlAdResource) adResource_,
                getParentForChildren(),
                isClean());
        adResource_ = null;
      }
      adResourceCase_ = 12;
      onChanged();
      return htmlAdResourceBuilder_;
    }

    private java.lang.Object apiFramework_ = "";
    /**
     *
     *
     * <pre>
     * The API necessary to communicate with the creative if available.
     * </pre>
     *
     * <code>string api_framework = 1;</code>
     *
     * @return The apiFramework.
     */
    public java.lang.String getApiFramework() {
      java.lang.Object ref = apiFramework_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        apiFramework_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The API necessary to communicate with the creative if available.
     * </pre>
     *
     * <code>string api_framework = 1;</code>
     *
     * @return The bytes for apiFramework.
     */
    public com.google.protobuf.ByteString getApiFrameworkBytes() {
      java.lang.Object ref = apiFramework_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        apiFramework_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The API necessary to communicate with the creative if available.
     * </pre>
     *
     * <code>string api_framework = 1;</code>
     *
     * @param value The apiFramework to set.
     * @return This builder for chaining.
     */
    public Builder setApiFramework(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      apiFramework_ = value;
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The API necessary to communicate with the creative if available.
     * </pre>
     *
     * <code>string api_framework = 1;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearApiFramework() {
      apiFramework_ = getDefaultInstance().getApiFramework();
      bitField0_ = (bitField0_ & ~0x00000008);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The API necessary to communicate with the creative if available.
     * </pre>
     *
     * <code>string api_framework = 1;</code>
     *
     * @param value The bytes for apiFramework to set.
     * @return This builder for chaining.
     */
    public Builder setApiFrameworkBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      apiFramework_ = value;
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }

    private int heightPx_;
    /**
     *
     *
     * <pre>
     * The pixel height of the placement slot for the intended creative.
     * </pre>
     *
     * <code>int32 height_px = 2;</code>
     *
     * @return The heightPx.
     */
    @java.lang.Override
    public int getHeightPx() {
      return heightPx_;
    }
    /**
     *
     *
     * <pre>
     * The pixel height of the placement slot for the intended creative.
     * </pre>
     *
     * <code>int32 height_px = 2;</code>
     *
     * @param value The heightPx to set.
     * @return This builder for chaining.
     */
    public Builder setHeightPx(int value) {

      heightPx_ = value;
      bitField0_ |= 0x00000010;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The pixel height of the placement slot for the intended creative.
     * </pre>
     *
     * <code>int32 height_px = 2;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearHeightPx() {
      bitField0_ = (bitField0_ & ~0x00000010);
      heightPx_ = 0;
      onChanged();
      return this;
    }

    private int widthPx_;
    /**
     *
     *
     * <pre>
     * The pixel width of the placement slot for the intended creative.
     * </pre>
     *
     * <code>int32 width_px = 3;</code>
     *
     * @return The widthPx.
     */
    @java.lang.Override
    public int getWidthPx() {
      return widthPx_;
    }
    /**
     *
     *
     * <pre>
     * The pixel width of the placement slot for the intended creative.
     * </pre>
     *
     * <code>int32 width_px = 3;</code>
     *
     * @param value The widthPx to set.
     * @return This builder for chaining.
     */
    public Builder setWidthPx(int value) {

      widthPx_ = value;
      bitField0_ |= 0x00000020;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The pixel width of the placement slot for the intended creative.
     * </pre>
     *
     * <code>int32 width_px = 3;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearWidthPx() {
      bitField0_ = (bitField0_ & ~0x00000020);
      widthPx_ = 0;
      onChanged();
      return this;
    }

    private int assetHeightPx_;
    /**
     *
     *
     * <pre>
     * The pixel height of the creative.
     * </pre>
     *
     * <code>int32 asset_height_px = 4;</code>
     *
     * @return The assetHeightPx.
     */
    @java.lang.Override
    public int getAssetHeightPx() {
      return assetHeightPx_;
    }
    /**
     *
     *
     * <pre>
     * The pixel height of the creative.
     * </pre>
     *
     * <code>int32 asset_height_px = 4;</code>
     *
     * @param value The assetHeightPx to set.
     * @return This builder for chaining.
     */
    public Builder setAssetHeightPx(int value) {

      assetHeightPx_ = value;
      bitField0_ |= 0x00000040;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The pixel height of the creative.
     * </pre>
     *
     * <code>int32 asset_height_px = 4;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearAssetHeightPx() {
      bitField0_ = (bitField0_ & ~0x00000040);
      assetHeightPx_ = 0;
      onChanged();
      return this;
    }

    private int expandedHeightPx_;
    /**
     *
     *
     * <pre>
     * The maximum pixel height of the creative in its expanded state.
     * </pre>
     *
     * <code>int32 expanded_height_px = 5;</code>
     *
     * @return The expandedHeightPx.
     */
    @java.lang.Override
    public int getExpandedHeightPx() {
      return expandedHeightPx_;
    }
    /**
     *
     *
     * <pre>
     * The maximum pixel height of the creative in its expanded state.
     * </pre>
     *
     * <code>int32 expanded_height_px = 5;</code>
     *
     * @param value The expandedHeightPx to set.
     * @return This builder for chaining.
     */
    public Builder setExpandedHeightPx(int value) {

      expandedHeightPx_ = value;
      bitField0_ |= 0x00000080;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The maximum pixel height of the creative in its expanded state.
     * </pre>
     *
     * <code>int32 expanded_height_px = 5;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearExpandedHeightPx() {
      bitField0_ = (bitField0_ & ~0x00000080);
      expandedHeightPx_ = 0;
      onChanged();
      return this;
    }

    private int assetWidthPx_;
    /**
     *
     *
     * <pre>
     * The pixel width of the creative.
     * </pre>
     *
     * <code>int32 asset_width_px = 6;</code>
     *
     * @return The assetWidthPx.
     */
    @java.lang.Override
    public int getAssetWidthPx() {
      return assetWidthPx_;
    }
    /**
     *
     *
     * <pre>
     * The pixel width of the creative.
     * </pre>
     *
     * <code>int32 asset_width_px = 6;</code>
     *
     * @param value The assetWidthPx to set.
     * @return This builder for chaining.
     */
    public Builder setAssetWidthPx(int value) {

      assetWidthPx_ = value;
      bitField0_ |= 0x00000100;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The pixel width of the creative.
     * </pre>
     *
     * <code>int32 asset_width_px = 6;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearAssetWidthPx() {
      bitField0_ = (bitField0_ & ~0x00000100);
      assetWidthPx_ = 0;
      onChanged();
      return this;
    }

    private int expandedWidthPx_;
    /**
     *
     *
     * <pre>
     * The maximum pixel width of the creative in its expanded state.
     * </pre>
     *
     * <code>int32 expanded_width_px = 7;</code>
     *
     * @return The expandedWidthPx.
     */
    @java.lang.Override
    public int getExpandedWidthPx() {
      return expandedWidthPx_;
    }
    /**
     *
     *
     * <pre>
     * The maximum pixel width of the creative in its expanded state.
     * </pre>
     *
     * <code>int32 expanded_width_px = 7;</code>
     *
     * @param value The expandedWidthPx to set.
     * @return This builder for chaining.
     */
    public Builder setExpandedWidthPx(int value) {

      expandedWidthPx_ = value;
      bitField0_ |= 0x00000200;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The maximum pixel width of the creative in its expanded state.
     * </pre>
     *
     * <code>int32 expanded_width_px = 7;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearExpandedWidthPx() {
      bitField0_ = (bitField0_ & ~0x00000200);
      expandedWidthPx_ = 0;
      onChanged();
      return this;
    }

    private java.lang.Object adSlotId_ = "";
    /**
     *
     *
     * <pre>
     * The ID used to identify the desired placement on a publisher's page.
     * Values to be used should be discussed between publishers and
     * advertisers.
     * </pre>
     *
     * <code>string ad_slot_id = 8;</code>
     *
     * @return The adSlotId.
     */
    public java.lang.String getAdSlotId() {
      java.lang.Object ref = adSlotId_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        adSlotId_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The ID used to identify the desired placement on a publisher's page.
     * Values to be used should be discussed between publishers and
     * advertisers.
     * </pre>
     *
     * <code>string ad_slot_id = 8;</code>
     *
     * @return The bytes for adSlotId.
     */
    public com.google.protobuf.ByteString getAdSlotIdBytes() {
      java.lang.Object ref = adSlotId_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        adSlotId_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The ID used to identify the desired placement on a publisher's page.
     * Values to be used should be discussed between publishers and
     * advertisers.
     * </pre>
     *
     * <code>string ad_slot_id = 8;</code>
     *
     * @param value The adSlotId to set.
     * @return This builder for chaining.
     */
    public Builder setAdSlotId(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      adSlotId_ = value;
      bitField0_ |= 0x00000400;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The ID used to identify the desired placement on a publisher's page.
     * Values to be used should be discussed between publishers and
     * advertisers.
     * </pre>
     *
     * <code>string ad_slot_id = 8;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearAdSlotId() {
      adSlotId_ = getDefaultInstance().getAdSlotId();
      bitField0_ = (bitField0_ & ~0x00000400);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The ID used to identify the desired placement on a publisher's page.
     * Values to be used should be discussed between publishers and
     * advertisers.
     * </pre>
     *
     * <code>string ad_slot_id = 8;</code>
     *
     * @param value The bytes for adSlotId to set.
     * @return This builder for chaining.
     */
    public Builder setAdSlotIdBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      adSlotId_ = value;
      bitField0_ |= 0x00000400;
      onChanged();
      return this;
    }

    private java.util.List<com.google.cloud.video.stitcher.v1.Event> events_ =
        java.util.Collections.emptyList();

    private void ensureEventsIsMutable() {
      if (!((bitField0_ & 0x00000800) != 0)) {
        events_ = new java.util.ArrayList<com.google.cloud.video.stitcher.v1.Event>(events_);
        bitField0_ |= 0x00000800;
      }
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.cloud.video.stitcher.v1.Event,
            com.google.cloud.video.stitcher.v1.Event.Builder,
            com.google.cloud.video.stitcher.v1.EventOrBuilder>
        eventsBuilder_;

    /**
     *
     *
     * <pre>
     * The list of tracking events for the companion.
     * </pre>
     *
     * <code>repeated .google.cloud.video.stitcher.v1.Event events = 9;</code>
     */
    public java.util.List<com.google.cloud.video.stitcher.v1.Event> getEventsList() {
      if (eventsBuilder_ == null) {
        return java.util.Collections.unmodifiableList(events_);
      } else {
        return eventsBuilder_.getMessageList();
      }
    }
    /**
     *
     *
     * <pre>
     * The list of tracking events for the companion.
     * </pre>
     *
     * <code>repeated .google.cloud.video.stitcher.v1.Event events = 9;</code>
     */
    public int getEventsCount() {
      if (eventsBuilder_ == null) {
        return events_.size();
      } else {
        return eventsBuilder_.getCount();
      }
    }
    /**
     *
     *
     * <pre>
     * The list of tracking events for the companion.
     * </pre>
     *
     * <code>repeated .google.cloud.video.stitcher.v1.Event events = 9;</code>
     */
    public com.google.cloud.video.stitcher.v1.Event getEvents(int index) {
      if (eventsBuilder_ == null) {
        return events_.get(index);
      } else {
        return eventsBuilder_.getMessage(index);
      }
    }
    /**
     *
     *
     * <pre>
     * The list of tracking events for the companion.
     * </pre>
     *
     * <code>repeated .google.cloud.video.stitcher.v1.Event events = 9;</code>
     */
    public Builder setEvents(int index, com.google.cloud.video.stitcher.v1.Event value) {
      if (eventsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureEventsIsMutable();
        events_.set(index, value);
        onChanged();
      } else {
        eventsBuilder_.setMessage(index, value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The list of tracking events for the companion.
     * </pre>
     *
     * <code>repeated .google.cloud.video.stitcher.v1.Event events = 9;</code>
     */
    public Builder setEvents(
        int index, com.google.cloud.video.stitcher.v1.Event.Builder builderForValue) {
      if (eventsBuilder_ == null) {
        ensureEventsIsMutable();
        events_.set(index, builderForValue.build());
        onChanged();
      } else {
        eventsBuilder_.setMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The list of tracking events for the companion.
     * </pre>
     *
     * <code>repeated .google.cloud.video.stitcher.v1.Event events = 9;</code>
     */
    public Builder addEvents(com.google.cloud.video.stitcher.v1.Event value) {
      if (eventsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureEventsIsMutable();
        events_.add(value);
        onChanged();
      } else {
        eventsBuilder_.addMessage(value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The list of tracking events for the companion.
     * </pre>
     *
     * <code>repeated .google.cloud.video.stitcher.v1.Event events = 9;</code>
     */
    public Builder addEvents(int index, com.google.cloud.video.stitcher.v1.Event value) {
      if (eventsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureEventsIsMutable();
        events_.add(index, value);
        onChanged();
      } else {
        eventsBuilder_.addMessage(index, value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The list of tracking events for the companion.
     * </pre>
     *
     * <code>repeated .google.cloud.video.stitcher.v1.Event events = 9;</code>
     */
    public Builder addEvents(com.google.cloud.video.stitcher.v1.Event.Builder builderForValue) {
      if (eventsBuilder_ == null) {
        ensureEventsIsMutable();
        events_.add(builderForValue.build());
        onChanged();
      } else {
        eventsBuilder_.addMessage(builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The list of tracking events for the companion.
     * </pre>
     *
     * <code>repeated .google.cloud.video.stitcher.v1.Event events = 9;</code>
     */
    public Builder addEvents(
        int index, com.google.cloud.video.stitcher.v1.Event.Builder builderForValue) {
      if (eventsBuilder_ == null) {
        ensureEventsIsMutable();
        events_.add(index, builderForValue.build());
        onChanged();
      } else {
        eventsBuilder_.addMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The list of tracking events for the companion.
     * </pre>
     *
     * <code>repeated .google.cloud.video.stitcher.v1.Event events = 9;</code>
     */
    public Builder addAllEvents(
        java.lang.Iterable<? extends com.google.cloud.video.stitcher.v1.Event> values) {
      if (eventsBuilder_ == null) {
        ensureEventsIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(values, events_);
        onChanged();
      } else {
        eventsBuilder_.addAllMessages(values);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The list of tracking events for the companion.
     * </pre>
     *
     * <code>repeated .google.cloud.video.stitcher.v1.Event events = 9;</code>
     */
    public Builder clearEvents() {
      if (eventsBuilder_ == null) {
        events_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000800);
        onChanged();
      } else {
        eventsBuilder_.clear();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The list of tracking events for the companion.
     * </pre>
     *
     * <code>repeated .google.cloud.video.stitcher.v1.Event events = 9;</code>
     */
    public Builder removeEvents(int index) {
      if (eventsBuilder_ == null) {
        ensureEventsIsMutable();
        events_.remove(index);
        onChanged();
      } else {
        eventsBuilder_.remove(index);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The list of tracking events for the companion.
     * </pre>
     *
     * <code>repeated .google.cloud.video.stitcher.v1.Event events = 9;</code>
     */
    public com.google.cloud.video.stitcher.v1.Event.Builder getEventsBuilder(int index) {
      return getEventsFieldBuilder().getBuilder(index);
    }
    /**
     *
     *
     * <pre>
     * The list of tracking events for the companion.
     * </pre>
     *
     * <code>repeated .google.cloud.video.stitcher.v1.Event events = 9;</code>
     */
    public com.google.cloud.video.stitcher.v1.EventOrBuilder getEventsOrBuilder(int index) {
      if (eventsBuilder_ == null) {
        return events_.get(index);
      } else {
        return eventsBuilder_.getMessageOrBuilder(index);
      }
    }
    /**
     *
     *
     * <pre>
     * The list of tracking events for the companion.
     * </pre>
     *
     * <code>repeated .google.cloud.video.stitcher.v1.Event events = 9;</code>
     */
    public java.util.List<? extends com.google.cloud.video.stitcher.v1.EventOrBuilder>
        getEventsOrBuilderList() {
      if (eventsBuilder_ != null) {
        return eventsBuilder_.getMessageOrBuilderList();
      } else {
        return java.util.Collections.unmodifiableList(events_);
      }
    }
    /**
     *
     *
     * <pre>
     * The list of tracking events for the companion.
     * </pre>
     *
     * <code>repeated .google.cloud.video.stitcher.v1.Event events = 9;</code>
     */
    public com.google.cloud.video.stitcher.v1.Event.Builder addEventsBuilder() {
      return getEventsFieldBuilder()
          .addBuilder(com.google.cloud.video.stitcher.v1.Event.getDefaultInstance());
    }
    /**
     *
     *
     * <pre>
     * The list of tracking events for the companion.
     * </pre>
     *
     * <code>repeated .google.cloud.video.stitcher.v1.Event events = 9;</code>
     */
    public com.google.cloud.video.stitcher.v1.Event.Builder addEventsBuilder(int index) {
      return getEventsFieldBuilder()
          .addBuilder(index, com.google.cloud.video.stitcher.v1.Event.getDefaultInstance());
    }
    /**
     *
     *
     * <pre>
     * The list of tracking events for the companion.
     * </pre>
     *
     * <code>repeated .google.cloud.video.stitcher.v1.Event events = 9;</code>
     */
    public java.util.List<com.google.cloud.video.stitcher.v1.Event.Builder> getEventsBuilderList() {
      return getEventsFieldBuilder().getBuilderList();
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.cloud.video.stitcher.v1.Event,
            com.google.cloud.video.stitcher.v1.Event.Builder,
            com.google.cloud.video.stitcher.v1.EventOrBuilder>
        getEventsFieldBuilder() {
      if (eventsBuilder_ == null) {
        eventsBuilder_ =
            new com.google.protobuf.RepeatedFieldBuilderV3<
                com.google.cloud.video.stitcher.v1.Event,
                com.google.cloud.video.stitcher.v1.Event.Builder,
                com.google.cloud.video.stitcher.v1.EventOrBuilder>(
                events_, ((bitField0_ & 0x00000800) != 0), getParentForChildren(), isClean());
        events_ = null;
      }
      return eventsBuilder_;
    }

    @java.lang.Override
    public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFields(unknownFields);
    }

    @java.lang.Override
    public final Builder mergeUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.mergeUnknownFields(unknownFields);
    }

    // @@protoc_insertion_point(builder_scope:google.cloud.video.stitcher.v1.Companion)
  }

  // @@protoc_insertion_point(class_scope:google.cloud.video.stitcher.v1.Companion)
  private static final com.google.cloud.video.stitcher.v1.Companion DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.cloud.video.stitcher.v1.Companion();
  }

  public static com.google.cloud.video.stitcher.v1.Companion getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<Companion> PARSER =
      new com.google.protobuf.AbstractParser<Companion>() {
        @java.lang.Override
        public Companion parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          Builder builder = newBuilder();
          try {
            builder.mergeFrom(input, extensionRegistry);
          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
            throw e.setUnfinishedMessage(builder.buildPartial());
          } catch (com.google.protobuf.UninitializedMessageException e) {
            throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
          } catch (java.io.IOException e) {
            throw new com.google.protobuf.InvalidProtocolBufferException(e)
                .setUnfinishedMessage(builder.buildPartial());
          }
          return builder.buildPartial();
        }
      };

  public static com.google.protobuf.Parser<Companion> parser() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.protobuf.Parser<Companion> getParserForType() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.cloud.video.stitcher.v1.Companion getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
}
