/*
 * 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/sessions.proto

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

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

  private VodSessionAd() {
    activityEvents_ = java.util.Collections.emptyList();
  }

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

  @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.SessionsProto
        .internal_static_google_cloud_video_stitcher_v1_VodSessionAd_descriptor;
  }

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

  public static final int DURATION_FIELD_NUMBER = 1;
  private com.google.protobuf.Duration duration_;
  /**
   *
   *
   * <pre>
   * Duration in seconds of the ad.
   * </pre>
   *
   * <code>.google.protobuf.Duration duration = 1;</code>
   *
   * @return Whether the duration field is set.
   */
  @java.lang.Override
  public boolean hasDuration() {
    return duration_ != null;
  }
  /**
   *
   *
   * <pre>
   * Duration in seconds of the ad.
   * </pre>
   *
   * <code>.google.protobuf.Duration duration = 1;</code>
   *
   * @return The duration.
   */
  @java.lang.Override
  public com.google.protobuf.Duration getDuration() {
    return duration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : duration_;
  }
  /**
   *
   *
   * <pre>
   * Duration in seconds of the ad.
   * </pre>
   *
   * <code>.google.protobuf.Duration duration = 1;</code>
   */
  @java.lang.Override
  public com.google.protobuf.DurationOrBuilder getDurationOrBuilder() {
    return duration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : duration_;
  }

  public static final int COMPANION_ADS_FIELD_NUMBER = 2;
  private com.google.cloud.video.stitcher.v1.CompanionAds companionAds_;
  /**
   *
   *
   * <pre>
   * Metadata of companion ads associated with the ad.
   * </pre>
   *
   * <code>.google.cloud.video.stitcher.v1.CompanionAds companion_ads = 2;</code>
   *
   * @return Whether the companionAds field is set.
   */
  @java.lang.Override
  public boolean hasCompanionAds() {
    return companionAds_ != null;
  }
  /**
   *
   *
   * <pre>
   * Metadata of companion ads associated with the ad.
   * </pre>
   *
   * <code>.google.cloud.video.stitcher.v1.CompanionAds companion_ads = 2;</code>
   *
   * @return The companionAds.
   */
  @java.lang.Override
  public com.google.cloud.video.stitcher.v1.CompanionAds getCompanionAds() {
    return companionAds_ == null
        ? com.google.cloud.video.stitcher.v1.CompanionAds.getDefaultInstance()
        : companionAds_;
  }
  /**
   *
   *
   * <pre>
   * Metadata of companion ads associated with the ad.
   * </pre>
   *
   * <code>.google.cloud.video.stitcher.v1.CompanionAds companion_ads = 2;</code>
   */
  @java.lang.Override
  public com.google.cloud.video.stitcher.v1.CompanionAdsOrBuilder getCompanionAdsOrBuilder() {
    return companionAds_ == null
        ? com.google.cloud.video.stitcher.v1.CompanionAds.getDefaultInstance()
        : companionAds_;
  }

  public static final int ACTIVITY_EVENTS_FIELD_NUMBER = 3;

  @SuppressWarnings("serial")
  private java.util.List<com.google.cloud.video.stitcher.v1.Event> activityEvents_;
  /**
   *
   *
   * <pre>
   * The list of progress tracking events for the ad break. These can be of
   * the following IAB types: `MUTE`, `UNMUTE`, `PAUSE`, `CLICK`,
   * `CLICK_THROUGH`, `REWIND`, `RESUME`, `ERROR`, `FULLSCREEN`,
   * `EXIT_FULLSCREEN`, `EXPAND`, `COLLAPSE`, `ACCEPT_INVITATION_LINEAR`,
   * `CLOSE_LINEAR`, `SKIP`.
   * </pre>
   *
   * <code>repeated .google.cloud.video.stitcher.v1.Event activity_events = 3;</code>
   */
  @java.lang.Override
  public java.util.List<com.google.cloud.video.stitcher.v1.Event> getActivityEventsList() {
    return activityEvents_;
  }
  /**
   *
   *
   * <pre>
   * The list of progress tracking events for the ad break. These can be of
   * the following IAB types: `MUTE`, `UNMUTE`, `PAUSE`, `CLICK`,
   * `CLICK_THROUGH`, `REWIND`, `RESUME`, `ERROR`, `FULLSCREEN`,
   * `EXIT_FULLSCREEN`, `EXPAND`, `COLLAPSE`, `ACCEPT_INVITATION_LINEAR`,
   * `CLOSE_LINEAR`, `SKIP`.
   * </pre>
   *
   * <code>repeated .google.cloud.video.stitcher.v1.Event activity_events = 3;</code>
   */
  @java.lang.Override
  public java.util.List<? extends com.google.cloud.video.stitcher.v1.EventOrBuilder>
      getActivityEventsOrBuilderList() {
    return activityEvents_;
  }
  /**
   *
   *
   * <pre>
   * The list of progress tracking events for the ad break. These can be of
   * the following IAB types: `MUTE`, `UNMUTE`, `PAUSE`, `CLICK`,
   * `CLICK_THROUGH`, `REWIND`, `RESUME`, `ERROR`, `FULLSCREEN`,
   * `EXIT_FULLSCREEN`, `EXPAND`, `COLLAPSE`, `ACCEPT_INVITATION_LINEAR`,
   * `CLOSE_LINEAR`, `SKIP`.
   * </pre>
   *
   * <code>repeated .google.cloud.video.stitcher.v1.Event activity_events = 3;</code>
   */
  @java.lang.Override
  public int getActivityEventsCount() {
    return activityEvents_.size();
  }
  /**
   *
   *
   * <pre>
   * The list of progress tracking events for the ad break. These can be of
   * the following IAB types: `MUTE`, `UNMUTE`, `PAUSE`, `CLICK`,
   * `CLICK_THROUGH`, `REWIND`, `RESUME`, `ERROR`, `FULLSCREEN`,
   * `EXIT_FULLSCREEN`, `EXPAND`, `COLLAPSE`, `ACCEPT_INVITATION_LINEAR`,
   * `CLOSE_LINEAR`, `SKIP`.
   * </pre>
   *
   * <code>repeated .google.cloud.video.stitcher.v1.Event activity_events = 3;</code>
   */
  @java.lang.Override
  public com.google.cloud.video.stitcher.v1.Event getActivityEvents(int index) {
    return activityEvents_.get(index);
  }
  /**
   *
   *
   * <pre>
   * The list of progress tracking events for the ad break. These can be of
   * the following IAB types: `MUTE`, `UNMUTE`, `PAUSE`, `CLICK`,
   * `CLICK_THROUGH`, `REWIND`, `RESUME`, `ERROR`, `FULLSCREEN`,
   * `EXIT_FULLSCREEN`, `EXPAND`, `COLLAPSE`, `ACCEPT_INVITATION_LINEAR`,
   * `CLOSE_LINEAR`, `SKIP`.
   * </pre>
   *
   * <code>repeated .google.cloud.video.stitcher.v1.Event activity_events = 3;</code>
   */
  @java.lang.Override
  public com.google.cloud.video.stitcher.v1.EventOrBuilder getActivityEventsOrBuilder(int index) {
    return activityEvents_.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 (duration_ != null) {
      output.writeMessage(1, getDuration());
    }
    if (companionAds_ != null) {
      output.writeMessage(2, getCompanionAds());
    }
    for (int i = 0; i < activityEvents_.size(); i++) {
      output.writeMessage(3, activityEvents_.get(i));
    }
    getUnknownFields().writeTo(output);
  }

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

    size = 0;
    if (duration_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getDuration());
    }
    if (companionAds_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getCompanionAds());
    }
    for (int i = 0; i < activityEvents_.size(); i++) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, activityEvents_.get(i));
    }
    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.VodSessionAd)) {
      return super.equals(obj);
    }
    com.google.cloud.video.stitcher.v1.VodSessionAd other =
        (com.google.cloud.video.stitcher.v1.VodSessionAd) obj;

    if (hasDuration() != other.hasDuration()) return false;
    if (hasDuration()) {
      if (!getDuration().equals(other.getDuration())) return false;
    }
    if (hasCompanionAds() != other.hasCompanionAds()) return false;
    if (hasCompanionAds()) {
      if (!getCompanionAds().equals(other.getCompanionAds())) return false;
    }
    if (!getActivityEventsList().equals(other.getActivityEventsList())) return false;
    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();
    if (hasDuration()) {
      hash = (37 * hash) + DURATION_FIELD_NUMBER;
      hash = (53 * hash) + getDuration().hashCode();
    }
    if (hasCompanionAds()) {
      hash = (37 * hash) + COMPANION_ADS_FIELD_NUMBER;
      hash = (53 * hash) + getCompanionAds().hashCode();
    }
    if (getActivityEventsCount() > 0) {
      hash = (37 * hash) + ACTIVITY_EVENTS_FIELD_NUMBER;
      hash = (53 * hash) + getActivityEventsList().hashCode();
    }
    hash = (29 * hash) + getUnknownFields().hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

  public static com.google.cloud.video.stitcher.v1.VodSessionAd 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.VodSessionAd parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.video.stitcher.v1.VodSessionAd 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.VodSessionAd parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.video.stitcher.v1.VodSessionAd 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.VodSessionAd 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.VodSessionAd 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.VodSessionAd 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.VodSessionAd 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.VodSessionAd 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.VodSessionAd 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.VodSessionAd 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 an inserted ad in a VOD session.
   * </pre>
   *
   * Protobuf type {@code google.cloud.video.stitcher.v1.VodSessionAd}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.video.stitcher.v1.VodSessionAd)
      com.google.cloud.video.stitcher.v1.VodSessionAdOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.video.stitcher.v1.SessionsProto
          .internal_static_google_cloud_video_stitcher_v1_VodSessionAd_descriptor;
    }

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

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

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

    @java.lang.Override
    public Builder clear() {
      super.clear();
      bitField0_ = 0;
      duration_ = null;
      if (durationBuilder_ != null) {
        durationBuilder_.dispose();
        durationBuilder_ = null;
      }
      companionAds_ = null;
      if (companionAdsBuilder_ != null) {
        companionAdsBuilder_.dispose();
        companionAdsBuilder_ = null;
      }
      if (activityEventsBuilder_ == null) {
        activityEvents_ = java.util.Collections.emptyList();
      } else {
        activityEvents_ = null;
        activityEventsBuilder_.clear();
      }
      bitField0_ = (bitField0_ & ~0x00000004);
      return this;
    }

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

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

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

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

    private void buildPartialRepeatedFields(
        com.google.cloud.video.stitcher.v1.VodSessionAd result) {
      if (activityEventsBuilder_ == null) {
        if (((bitField0_ & 0x00000004) != 0)) {
          activityEvents_ = java.util.Collections.unmodifiableList(activityEvents_);
          bitField0_ = (bitField0_ & ~0x00000004);
        }
        result.activityEvents_ = activityEvents_;
      } else {
        result.activityEvents_ = activityEventsBuilder_.build();
      }
    }

    private void buildPartial0(com.google.cloud.video.stitcher.v1.VodSessionAd result) {
      int from_bitField0_ = bitField0_;
      if (((from_bitField0_ & 0x00000001) != 0)) {
        result.duration_ = durationBuilder_ == null ? duration_ : durationBuilder_.build();
      }
      if (((from_bitField0_ & 0x00000002) != 0)) {
        result.companionAds_ =
            companionAdsBuilder_ == null ? companionAds_ : companionAdsBuilder_.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.VodSessionAd) {
        return mergeFrom((com.google.cloud.video.stitcher.v1.VodSessionAd) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.video.stitcher.v1.VodSessionAd other) {
      if (other == com.google.cloud.video.stitcher.v1.VodSessionAd.getDefaultInstance())
        return this;
      if (other.hasDuration()) {
        mergeDuration(other.getDuration());
      }
      if (other.hasCompanionAds()) {
        mergeCompanionAds(other.getCompanionAds());
      }
      if (activityEventsBuilder_ == null) {
        if (!other.activityEvents_.isEmpty()) {
          if (activityEvents_.isEmpty()) {
            activityEvents_ = other.activityEvents_;
            bitField0_ = (bitField0_ & ~0x00000004);
          } else {
            ensureActivityEventsIsMutable();
            activityEvents_.addAll(other.activityEvents_);
          }
          onChanged();
        }
      } else {
        if (!other.activityEvents_.isEmpty()) {
          if (activityEventsBuilder_.isEmpty()) {
            activityEventsBuilder_.dispose();
            activityEventsBuilder_ = null;
            activityEvents_ = other.activityEvents_;
            bitField0_ = (bitField0_ & ~0x00000004);
            activityEventsBuilder_ =
                com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
                    ? getActivityEventsFieldBuilder()
                    : null;
          } else {
            activityEventsBuilder_.addAllMessages(other.activityEvents_);
          }
        }
      }
      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:
              {
                input.readMessage(getDurationFieldBuilder().getBuilder(), extensionRegistry);
                bitField0_ |= 0x00000001;
                break;
              } // case 10
            case 18:
              {
                input.readMessage(getCompanionAdsFieldBuilder().getBuilder(), extensionRegistry);
                bitField0_ |= 0x00000002;
                break;
              } // case 18
            case 26:
              {
                com.google.cloud.video.stitcher.v1.Event m =
                    input.readMessage(
                        com.google.cloud.video.stitcher.v1.Event.parser(), extensionRegistry);
                if (activityEventsBuilder_ == null) {
                  ensureActivityEventsIsMutable();
                  activityEvents_.add(m);
                } else {
                  activityEventsBuilder_.addMessage(m);
                }
                break;
              } // case 26
            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 bitField0_;

    private com.google.protobuf.Duration duration_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Duration,
            com.google.protobuf.Duration.Builder,
            com.google.protobuf.DurationOrBuilder>
        durationBuilder_;
    /**
     *
     *
     * <pre>
     * Duration in seconds of the ad.
     * </pre>
     *
     * <code>.google.protobuf.Duration duration = 1;</code>
     *
     * @return Whether the duration field is set.
     */
    public boolean hasDuration() {
      return ((bitField0_ & 0x00000001) != 0);
    }
    /**
     *
     *
     * <pre>
     * Duration in seconds of the ad.
     * </pre>
     *
     * <code>.google.protobuf.Duration duration = 1;</code>
     *
     * @return The duration.
     */
    public com.google.protobuf.Duration getDuration() {
      if (durationBuilder_ == null) {
        return duration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : duration_;
      } else {
        return durationBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Duration in seconds of the ad.
     * </pre>
     *
     * <code>.google.protobuf.Duration duration = 1;</code>
     */
    public Builder setDuration(com.google.protobuf.Duration value) {
      if (durationBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        duration_ = value;
      } else {
        durationBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Duration in seconds of the ad.
     * </pre>
     *
     * <code>.google.protobuf.Duration duration = 1;</code>
     */
    public Builder setDuration(com.google.protobuf.Duration.Builder builderForValue) {
      if (durationBuilder_ == null) {
        duration_ = builderForValue.build();
      } else {
        durationBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Duration in seconds of the ad.
     * </pre>
     *
     * <code>.google.protobuf.Duration duration = 1;</code>
     */
    public Builder mergeDuration(com.google.protobuf.Duration value) {
      if (durationBuilder_ == null) {
        if (((bitField0_ & 0x00000001) != 0)
            && duration_ != null
            && duration_ != com.google.protobuf.Duration.getDefaultInstance()) {
          getDurationBuilder().mergeFrom(value);
        } else {
          duration_ = value;
        }
      } else {
        durationBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Duration in seconds of the ad.
     * </pre>
     *
     * <code>.google.protobuf.Duration duration = 1;</code>
     */
    public Builder clearDuration() {
      bitField0_ = (bitField0_ & ~0x00000001);
      duration_ = null;
      if (durationBuilder_ != null) {
        durationBuilder_.dispose();
        durationBuilder_ = null;
      }
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Duration in seconds of the ad.
     * </pre>
     *
     * <code>.google.protobuf.Duration duration = 1;</code>
     */
    public com.google.protobuf.Duration.Builder getDurationBuilder() {
      bitField0_ |= 0x00000001;
      onChanged();
      return getDurationFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Duration in seconds of the ad.
     * </pre>
     *
     * <code>.google.protobuf.Duration duration = 1;</code>
     */
    public com.google.protobuf.DurationOrBuilder getDurationOrBuilder() {
      if (durationBuilder_ != null) {
        return durationBuilder_.getMessageOrBuilder();
      } else {
        return duration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : duration_;
      }
    }
    /**
     *
     *
     * <pre>
     * Duration in seconds of the ad.
     * </pre>
     *
     * <code>.google.protobuf.Duration duration = 1;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Duration,
            com.google.protobuf.Duration.Builder,
            com.google.protobuf.DurationOrBuilder>
        getDurationFieldBuilder() {
      if (durationBuilder_ == null) {
        durationBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.protobuf.Duration,
                com.google.protobuf.Duration.Builder,
                com.google.protobuf.DurationOrBuilder>(
                getDuration(), getParentForChildren(), isClean());
        duration_ = null;
      }
      return durationBuilder_;
    }

    private com.google.cloud.video.stitcher.v1.CompanionAds companionAds_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.video.stitcher.v1.CompanionAds,
            com.google.cloud.video.stitcher.v1.CompanionAds.Builder,
            com.google.cloud.video.stitcher.v1.CompanionAdsOrBuilder>
        companionAdsBuilder_;
    /**
     *
     *
     * <pre>
     * Metadata of companion ads associated with the ad.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.CompanionAds companion_ads = 2;</code>
     *
     * @return Whether the companionAds field is set.
     */
    public boolean hasCompanionAds() {
      return ((bitField0_ & 0x00000002) != 0);
    }
    /**
     *
     *
     * <pre>
     * Metadata of companion ads associated with the ad.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.CompanionAds companion_ads = 2;</code>
     *
     * @return The companionAds.
     */
    public com.google.cloud.video.stitcher.v1.CompanionAds getCompanionAds() {
      if (companionAdsBuilder_ == null) {
        return companionAds_ == null
            ? com.google.cloud.video.stitcher.v1.CompanionAds.getDefaultInstance()
            : companionAds_;
      } else {
        return companionAdsBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Metadata of companion ads associated with the ad.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.CompanionAds companion_ads = 2;</code>
     */
    public Builder setCompanionAds(com.google.cloud.video.stitcher.v1.CompanionAds value) {
      if (companionAdsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        companionAds_ = value;
      } else {
        companionAdsBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Metadata of companion ads associated with the ad.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.CompanionAds companion_ads = 2;</code>
     */
    public Builder setCompanionAds(
        com.google.cloud.video.stitcher.v1.CompanionAds.Builder builderForValue) {
      if (companionAdsBuilder_ == null) {
        companionAds_ = builderForValue.build();
      } else {
        companionAdsBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Metadata of companion ads associated with the ad.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.CompanionAds companion_ads = 2;</code>
     */
    public Builder mergeCompanionAds(com.google.cloud.video.stitcher.v1.CompanionAds value) {
      if (companionAdsBuilder_ == null) {
        if (((bitField0_ & 0x00000002) != 0)
            && companionAds_ != null
            && companionAds_
                != com.google.cloud.video.stitcher.v1.CompanionAds.getDefaultInstance()) {
          getCompanionAdsBuilder().mergeFrom(value);
        } else {
          companionAds_ = value;
        }
      } else {
        companionAdsBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Metadata of companion ads associated with the ad.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.CompanionAds companion_ads = 2;</code>
     */
    public Builder clearCompanionAds() {
      bitField0_ = (bitField0_ & ~0x00000002);
      companionAds_ = null;
      if (companionAdsBuilder_ != null) {
        companionAdsBuilder_.dispose();
        companionAdsBuilder_ = null;
      }
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Metadata of companion ads associated with the ad.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.CompanionAds companion_ads = 2;</code>
     */
    public com.google.cloud.video.stitcher.v1.CompanionAds.Builder getCompanionAdsBuilder() {
      bitField0_ |= 0x00000002;
      onChanged();
      return getCompanionAdsFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Metadata of companion ads associated with the ad.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.CompanionAds companion_ads = 2;</code>
     */
    public com.google.cloud.video.stitcher.v1.CompanionAdsOrBuilder getCompanionAdsOrBuilder() {
      if (companionAdsBuilder_ != null) {
        return companionAdsBuilder_.getMessageOrBuilder();
      } else {
        return companionAds_ == null
            ? com.google.cloud.video.stitcher.v1.CompanionAds.getDefaultInstance()
            : companionAds_;
      }
    }
    /**
     *
     *
     * <pre>
     * Metadata of companion ads associated with the ad.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.CompanionAds companion_ads = 2;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.video.stitcher.v1.CompanionAds,
            com.google.cloud.video.stitcher.v1.CompanionAds.Builder,
            com.google.cloud.video.stitcher.v1.CompanionAdsOrBuilder>
        getCompanionAdsFieldBuilder() {
      if (companionAdsBuilder_ == null) {
        companionAdsBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.cloud.video.stitcher.v1.CompanionAds,
                com.google.cloud.video.stitcher.v1.CompanionAds.Builder,
                com.google.cloud.video.stitcher.v1.CompanionAdsOrBuilder>(
                getCompanionAds(), getParentForChildren(), isClean());
        companionAds_ = null;
      }
      return companionAdsBuilder_;
    }

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

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

    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>
        activityEventsBuilder_;

    /**
     *
     *
     * <pre>
     * The list of progress tracking events for the ad break. These can be of
     * the following IAB types: `MUTE`, `UNMUTE`, `PAUSE`, `CLICK`,
     * `CLICK_THROUGH`, `REWIND`, `RESUME`, `ERROR`, `FULLSCREEN`,
     * `EXIT_FULLSCREEN`, `EXPAND`, `COLLAPSE`, `ACCEPT_INVITATION_LINEAR`,
     * `CLOSE_LINEAR`, `SKIP`.
     * </pre>
     *
     * <code>repeated .google.cloud.video.stitcher.v1.Event activity_events = 3;</code>
     */
    public java.util.List<com.google.cloud.video.stitcher.v1.Event> getActivityEventsList() {
      if (activityEventsBuilder_ == null) {
        return java.util.Collections.unmodifiableList(activityEvents_);
      } else {
        return activityEventsBuilder_.getMessageList();
      }
    }
    /**
     *
     *
     * <pre>
     * The list of progress tracking events for the ad break. These can be of
     * the following IAB types: `MUTE`, `UNMUTE`, `PAUSE`, `CLICK`,
     * `CLICK_THROUGH`, `REWIND`, `RESUME`, `ERROR`, `FULLSCREEN`,
     * `EXIT_FULLSCREEN`, `EXPAND`, `COLLAPSE`, `ACCEPT_INVITATION_LINEAR`,
     * `CLOSE_LINEAR`, `SKIP`.
     * </pre>
     *
     * <code>repeated .google.cloud.video.stitcher.v1.Event activity_events = 3;</code>
     */
    public int getActivityEventsCount() {
      if (activityEventsBuilder_ == null) {
        return activityEvents_.size();
      } else {
        return activityEventsBuilder_.getCount();
      }
    }
    /**
     *
     *
     * <pre>
     * The list of progress tracking events for the ad break. These can be of
     * the following IAB types: `MUTE`, `UNMUTE`, `PAUSE`, `CLICK`,
     * `CLICK_THROUGH`, `REWIND`, `RESUME`, `ERROR`, `FULLSCREEN`,
     * `EXIT_FULLSCREEN`, `EXPAND`, `COLLAPSE`, `ACCEPT_INVITATION_LINEAR`,
     * `CLOSE_LINEAR`, `SKIP`.
     * </pre>
     *
     * <code>repeated .google.cloud.video.stitcher.v1.Event activity_events = 3;</code>
     */
    public com.google.cloud.video.stitcher.v1.Event getActivityEvents(int index) {
      if (activityEventsBuilder_ == null) {
        return activityEvents_.get(index);
      } else {
        return activityEventsBuilder_.getMessage(index);
      }
    }
    /**
     *
     *
     * <pre>
     * The list of progress tracking events for the ad break. These can be of
     * the following IAB types: `MUTE`, `UNMUTE`, `PAUSE`, `CLICK`,
     * `CLICK_THROUGH`, `REWIND`, `RESUME`, `ERROR`, `FULLSCREEN`,
     * `EXIT_FULLSCREEN`, `EXPAND`, `COLLAPSE`, `ACCEPT_INVITATION_LINEAR`,
     * `CLOSE_LINEAR`, `SKIP`.
     * </pre>
     *
     * <code>repeated .google.cloud.video.stitcher.v1.Event activity_events = 3;</code>
     */
    public Builder setActivityEvents(int index, com.google.cloud.video.stitcher.v1.Event value) {
      if (activityEventsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureActivityEventsIsMutable();
        activityEvents_.set(index, value);
        onChanged();
      } else {
        activityEventsBuilder_.setMessage(index, value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The list of progress tracking events for the ad break. These can be of
     * the following IAB types: `MUTE`, `UNMUTE`, `PAUSE`, `CLICK`,
     * `CLICK_THROUGH`, `REWIND`, `RESUME`, `ERROR`, `FULLSCREEN`,
     * `EXIT_FULLSCREEN`, `EXPAND`, `COLLAPSE`, `ACCEPT_INVITATION_LINEAR`,
     * `CLOSE_LINEAR`, `SKIP`.
     * </pre>
     *
     * <code>repeated .google.cloud.video.stitcher.v1.Event activity_events = 3;</code>
     */
    public Builder setActivityEvents(
        int index, com.google.cloud.video.stitcher.v1.Event.Builder builderForValue) {
      if (activityEventsBuilder_ == null) {
        ensureActivityEventsIsMutable();
        activityEvents_.set(index, builderForValue.build());
        onChanged();
      } else {
        activityEventsBuilder_.setMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The list of progress tracking events for the ad break. These can be of
     * the following IAB types: `MUTE`, `UNMUTE`, `PAUSE`, `CLICK`,
     * `CLICK_THROUGH`, `REWIND`, `RESUME`, `ERROR`, `FULLSCREEN`,
     * `EXIT_FULLSCREEN`, `EXPAND`, `COLLAPSE`, `ACCEPT_INVITATION_LINEAR`,
     * `CLOSE_LINEAR`, `SKIP`.
     * </pre>
     *
     * <code>repeated .google.cloud.video.stitcher.v1.Event activity_events = 3;</code>
     */
    public Builder addActivityEvents(com.google.cloud.video.stitcher.v1.Event value) {
      if (activityEventsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureActivityEventsIsMutable();
        activityEvents_.add(value);
        onChanged();
      } else {
        activityEventsBuilder_.addMessage(value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The list of progress tracking events for the ad break. These can be of
     * the following IAB types: `MUTE`, `UNMUTE`, `PAUSE`, `CLICK`,
     * `CLICK_THROUGH`, `REWIND`, `RESUME`, `ERROR`, `FULLSCREEN`,
     * `EXIT_FULLSCREEN`, `EXPAND`, `COLLAPSE`, `ACCEPT_INVITATION_LINEAR`,
     * `CLOSE_LINEAR`, `SKIP`.
     * </pre>
     *
     * <code>repeated .google.cloud.video.stitcher.v1.Event activity_events = 3;</code>
     */
    public Builder addActivityEvents(int index, com.google.cloud.video.stitcher.v1.Event value) {
      if (activityEventsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureActivityEventsIsMutable();
        activityEvents_.add(index, value);
        onChanged();
      } else {
        activityEventsBuilder_.addMessage(index, value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The list of progress tracking events for the ad break. These can be of
     * the following IAB types: `MUTE`, `UNMUTE`, `PAUSE`, `CLICK`,
     * `CLICK_THROUGH`, `REWIND`, `RESUME`, `ERROR`, `FULLSCREEN`,
     * `EXIT_FULLSCREEN`, `EXPAND`, `COLLAPSE`, `ACCEPT_INVITATION_LINEAR`,
     * `CLOSE_LINEAR`, `SKIP`.
     * </pre>
     *
     * <code>repeated .google.cloud.video.stitcher.v1.Event activity_events = 3;</code>
     */
    public Builder addActivityEvents(
        com.google.cloud.video.stitcher.v1.Event.Builder builderForValue) {
      if (activityEventsBuilder_ == null) {
        ensureActivityEventsIsMutable();
        activityEvents_.add(builderForValue.build());
        onChanged();
      } else {
        activityEventsBuilder_.addMessage(builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The list of progress tracking events for the ad break. These can be of
     * the following IAB types: `MUTE`, `UNMUTE`, `PAUSE`, `CLICK`,
     * `CLICK_THROUGH`, `REWIND`, `RESUME`, `ERROR`, `FULLSCREEN`,
     * `EXIT_FULLSCREEN`, `EXPAND`, `COLLAPSE`, `ACCEPT_INVITATION_LINEAR`,
     * `CLOSE_LINEAR`, `SKIP`.
     * </pre>
     *
     * <code>repeated .google.cloud.video.stitcher.v1.Event activity_events = 3;</code>
     */
    public Builder addActivityEvents(
        int index, com.google.cloud.video.stitcher.v1.Event.Builder builderForValue) {
      if (activityEventsBuilder_ == null) {
        ensureActivityEventsIsMutable();
        activityEvents_.add(index, builderForValue.build());
        onChanged();
      } else {
        activityEventsBuilder_.addMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The list of progress tracking events for the ad break. These can be of
     * the following IAB types: `MUTE`, `UNMUTE`, `PAUSE`, `CLICK`,
     * `CLICK_THROUGH`, `REWIND`, `RESUME`, `ERROR`, `FULLSCREEN`,
     * `EXIT_FULLSCREEN`, `EXPAND`, `COLLAPSE`, `ACCEPT_INVITATION_LINEAR`,
     * `CLOSE_LINEAR`, `SKIP`.
     * </pre>
     *
     * <code>repeated .google.cloud.video.stitcher.v1.Event activity_events = 3;</code>
     */
    public Builder addAllActivityEvents(
        java.lang.Iterable<? extends com.google.cloud.video.stitcher.v1.Event> values) {
      if (activityEventsBuilder_ == null) {
        ensureActivityEventsIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(values, activityEvents_);
        onChanged();
      } else {
        activityEventsBuilder_.addAllMessages(values);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The list of progress tracking events for the ad break. These can be of
     * the following IAB types: `MUTE`, `UNMUTE`, `PAUSE`, `CLICK`,
     * `CLICK_THROUGH`, `REWIND`, `RESUME`, `ERROR`, `FULLSCREEN`,
     * `EXIT_FULLSCREEN`, `EXPAND`, `COLLAPSE`, `ACCEPT_INVITATION_LINEAR`,
     * `CLOSE_LINEAR`, `SKIP`.
     * </pre>
     *
     * <code>repeated .google.cloud.video.stitcher.v1.Event activity_events = 3;</code>
     */
    public Builder clearActivityEvents() {
      if (activityEventsBuilder_ == null) {
        activityEvents_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000004);
        onChanged();
      } else {
        activityEventsBuilder_.clear();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The list of progress tracking events for the ad break. These can be of
     * the following IAB types: `MUTE`, `UNMUTE`, `PAUSE`, `CLICK`,
     * `CLICK_THROUGH`, `REWIND`, `RESUME`, `ERROR`, `FULLSCREEN`,
     * `EXIT_FULLSCREEN`, `EXPAND`, `COLLAPSE`, `ACCEPT_INVITATION_LINEAR`,
     * `CLOSE_LINEAR`, `SKIP`.
     * </pre>
     *
     * <code>repeated .google.cloud.video.stitcher.v1.Event activity_events = 3;</code>
     */
    public Builder removeActivityEvents(int index) {
      if (activityEventsBuilder_ == null) {
        ensureActivityEventsIsMutable();
        activityEvents_.remove(index);
        onChanged();
      } else {
        activityEventsBuilder_.remove(index);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The list of progress tracking events for the ad break. These can be of
     * the following IAB types: `MUTE`, `UNMUTE`, `PAUSE`, `CLICK`,
     * `CLICK_THROUGH`, `REWIND`, `RESUME`, `ERROR`, `FULLSCREEN`,
     * `EXIT_FULLSCREEN`, `EXPAND`, `COLLAPSE`, `ACCEPT_INVITATION_LINEAR`,
     * `CLOSE_LINEAR`, `SKIP`.
     * </pre>
     *
     * <code>repeated .google.cloud.video.stitcher.v1.Event activity_events = 3;</code>
     */
    public com.google.cloud.video.stitcher.v1.Event.Builder getActivityEventsBuilder(int index) {
      return getActivityEventsFieldBuilder().getBuilder(index);
    }
    /**
     *
     *
     * <pre>
     * The list of progress tracking events for the ad break. These can be of
     * the following IAB types: `MUTE`, `UNMUTE`, `PAUSE`, `CLICK`,
     * `CLICK_THROUGH`, `REWIND`, `RESUME`, `ERROR`, `FULLSCREEN`,
     * `EXIT_FULLSCREEN`, `EXPAND`, `COLLAPSE`, `ACCEPT_INVITATION_LINEAR`,
     * `CLOSE_LINEAR`, `SKIP`.
     * </pre>
     *
     * <code>repeated .google.cloud.video.stitcher.v1.Event activity_events = 3;</code>
     */
    public com.google.cloud.video.stitcher.v1.EventOrBuilder getActivityEventsOrBuilder(int index) {
      if (activityEventsBuilder_ == null) {
        return activityEvents_.get(index);
      } else {
        return activityEventsBuilder_.getMessageOrBuilder(index);
      }
    }
    /**
     *
     *
     * <pre>
     * The list of progress tracking events for the ad break. These can be of
     * the following IAB types: `MUTE`, `UNMUTE`, `PAUSE`, `CLICK`,
     * `CLICK_THROUGH`, `REWIND`, `RESUME`, `ERROR`, `FULLSCREEN`,
     * `EXIT_FULLSCREEN`, `EXPAND`, `COLLAPSE`, `ACCEPT_INVITATION_LINEAR`,
     * `CLOSE_LINEAR`, `SKIP`.
     * </pre>
     *
     * <code>repeated .google.cloud.video.stitcher.v1.Event activity_events = 3;</code>
     */
    public java.util.List<? extends com.google.cloud.video.stitcher.v1.EventOrBuilder>
        getActivityEventsOrBuilderList() {
      if (activityEventsBuilder_ != null) {
        return activityEventsBuilder_.getMessageOrBuilderList();
      } else {
        return java.util.Collections.unmodifiableList(activityEvents_);
      }
    }
    /**
     *
     *
     * <pre>
     * The list of progress tracking events for the ad break. These can be of
     * the following IAB types: `MUTE`, `UNMUTE`, `PAUSE`, `CLICK`,
     * `CLICK_THROUGH`, `REWIND`, `RESUME`, `ERROR`, `FULLSCREEN`,
     * `EXIT_FULLSCREEN`, `EXPAND`, `COLLAPSE`, `ACCEPT_INVITATION_LINEAR`,
     * `CLOSE_LINEAR`, `SKIP`.
     * </pre>
     *
     * <code>repeated .google.cloud.video.stitcher.v1.Event activity_events = 3;</code>
     */
    public com.google.cloud.video.stitcher.v1.Event.Builder addActivityEventsBuilder() {
      return getActivityEventsFieldBuilder()
          .addBuilder(com.google.cloud.video.stitcher.v1.Event.getDefaultInstance());
    }
    /**
     *
     *
     * <pre>
     * The list of progress tracking events for the ad break. These can be of
     * the following IAB types: `MUTE`, `UNMUTE`, `PAUSE`, `CLICK`,
     * `CLICK_THROUGH`, `REWIND`, `RESUME`, `ERROR`, `FULLSCREEN`,
     * `EXIT_FULLSCREEN`, `EXPAND`, `COLLAPSE`, `ACCEPT_INVITATION_LINEAR`,
     * `CLOSE_LINEAR`, `SKIP`.
     * </pre>
     *
     * <code>repeated .google.cloud.video.stitcher.v1.Event activity_events = 3;</code>
     */
    public com.google.cloud.video.stitcher.v1.Event.Builder addActivityEventsBuilder(int index) {
      return getActivityEventsFieldBuilder()
          .addBuilder(index, com.google.cloud.video.stitcher.v1.Event.getDefaultInstance());
    }
    /**
     *
     *
     * <pre>
     * The list of progress tracking events for the ad break. These can be of
     * the following IAB types: `MUTE`, `UNMUTE`, `PAUSE`, `CLICK`,
     * `CLICK_THROUGH`, `REWIND`, `RESUME`, `ERROR`, `FULLSCREEN`,
     * `EXIT_FULLSCREEN`, `EXPAND`, `COLLAPSE`, `ACCEPT_INVITATION_LINEAR`,
     * `CLOSE_LINEAR`, `SKIP`.
     * </pre>
     *
     * <code>repeated .google.cloud.video.stitcher.v1.Event activity_events = 3;</code>
     */
    public java.util.List<com.google.cloud.video.stitcher.v1.Event.Builder>
        getActivityEventsBuilderList() {
      return getActivityEventsFieldBuilder().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>
        getActivityEventsFieldBuilder() {
      if (activityEventsBuilder_ == null) {
        activityEventsBuilder_ =
            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>(
                activityEvents_,
                ((bitField0_ & 0x00000004) != 0),
                getParentForChildren(),
                isClean());
        activityEvents_ = null;
      }
      return activityEventsBuilder_;
    }

    @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.VodSessionAd)
  }

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

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

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

  private static final com.google.protobuf.Parser<VodSessionAd> PARSER =
      new com.google.protobuf.AbstractParser<VodSessionAd>() {
        @java.lang.Override
        public VodSessionAd 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<VodSessionAd> parser() {
    return PARSER;
  }

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

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