/*
 * Copyright 2023 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/events.proto

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

/**
 *
 *
 * <pre>
 * Describes an event and a trigger URI.
 * </pre>
 *
 * Protobuf type {@code google.cloud.video.stitcher.v1.Event}
 */
public final class Event extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.video.stitcher.v1.Event)
    EventOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use Event.newBuilder() to construct.
  private Event(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private Event() {
    type_ = 0;
    uri_ = "";
    id_ = "";
  }

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

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

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

  /**
   *
   *
   * <pre>
   * Describes the event that occurred.
   * </pre>
   *
   * Protobuf enum {@code google.cloud.video.stitcher.v1.Event.EventType}
   */
  public enum EventType implements com.google.protobuf.ProtocolMessageEnum {
    /**
     *
     *
     * <pre>
     * The event type is unspecified.
     * </pre>
     *
     * <code>EVENT_TYPE_UNSPECIFIED = 0;</code>
     */
    EVENT_TYPE_UNSPECIFIED(0),
    /**
     *
     *
     * <pre>
     * First frame of creative ad viewed.
     * </pre>
     *
     * <code>CREATIVE_VIEW = 1;</code>
     */
    CREATIVE_VIEW(1),
    /**
     *
     *
     * <pre>
     * Creative ad started.
     * </pre>
     *
     * <code>START = 2;</code>
     */
    START(2),
    /**
     *
     *
     * <pre>
     * Start of an ad break.
     * </pre>
     *
     * <code>BREAK_START = 3;</code>
     */
    BREAK_START(3),
    /**
     *
     *
     * <pre>
     * End of an ad break.
     * </pre>
     *
     * <code>BREAK_END = 4;</code>
     */
    BREAK_END(4),
    /**
     *
     *
     * <pre>
     * Impression.
     * </pre>
     *
     * <code>IMPRESSION = 5;</code>
     */
    IMPRESSION(5),
    /**
     *
     *
     * <pre>
     * First quartile progress.
     * </pre>
     *
     * <code>FIRST_QUARTILE = 6;</code>
     */
    FIRST_QUARTILE(6),
    /**
     *
     *
     * <pre>
     * Midpoint progress.
     * </pre>
     *
     * <code>MIDPOINT = 7;</code>
     */
    MIDPOINT(7),
    /**
     *
     *
     * <pre>
     * Third quartile progress.
     * </pre>
     *
     * <code>THIRD_QUARTILE = 8;</code>
     */
    THIRD_QUARTILE(8),
    /**
     *
     *
     * <pre>
     * Ad progress completed.
     * </pre>
     *
     * <code>COMPLETE = 9;</code>
     */
    COMPLETE(9),
    /**
     *
     *
     * <pre>
     * Specific progress event with an offset.
     * </pre>
     *
     * <code>PROGRESS = 10;</code>
     */
    PROGRESS(10),
    /**
     *
     *
     * <pre>
     * Player muted.
     * </pre>
     *
     * <code>MUTE = 11;</code>
     */
    MUTE(11),
    /**
     *
     *
     * <pre>
     * Player unmuted.
     * </pre>
     *
     * <code>UNMUTE = 12;</code>
     */
    UNMUTE(12),
    /**
     *
     *
     * <pre>
     * Player paused.
     * </pre>
     *
     * <code>PAUSE = 13;</code>
     */
    PAUSE(13),
    /**
     *
     *
     * <pre>
     * Click event.
     * </pre>
     *
     * <code>CLICK = 14;</code>
     */
    CLICK(14),
    /**
     *
     *
     * <pre>
     * Click-through event.
     * </pre>
     *
     * <code>CLICK_THROUGH = 15;</code>
     */
    CLICK_THROUGH(15),
    /**
     *
     *
     * <pre>
     * Player rewinding.
     * </pre>
     *
     * <code>REWIND = 16;</code>
     */
    REWIND(16),
    /**
     *
     *
     * <pre>
     * Player resumed.
     * </pre>
     *
     * <code>RESUME = 17;</code>
     */
    RESUME(17),
    /**
     *
     *
     * <pre>
     * Error event.
     * </pre>
     *
     * <code>ERROR = 18;</code>
     */
    ERROR(18),
    /**
     *
     *
     * <pre>
     * Ad expanded to a larger size.
     * </pre>
     *
     * <code>EXPAND = 21;</code>
     */
    EXPAND(21),
    /**
     *
     *
     * <pre>
     * Ad collapsed to a smaller size.
     * </pre>
     *
     * <code>COLLAPSE = 22;</code>
     */
    COLLAPSE(22),
    /**
     *
     *
     * <pre>
     * Non-linear ad closed.
     * </pre>
     *
     * <code>CLOSE = 24;</code>
     */
    CLOSE(24),
    /**
     *
     *
     * <pre>
     * Linear ad closed.
     * </pre>
     *
     * <code>CLOSE_LINEAR = 25;</code>
     */
    CLOSE_LINEAR(25),
    /**
     *
     *
     * <pre>
     * Ad skipped.
     * </pre>
     *
     * <code>SKIP = 26;</code>
     */
    SKIP(26),
    /**
     *
     *
     * <pre>
     * Accept invitation event.
     * </pre>
     *
     * <code>ACCEPT_INVITATION = 27;</code>
     */
    ACCEPT_INVITATION(27),
    UNRECOGNIZED(-1),
    ;

    /**
     *
     *
     * <pre>
     * The event type is unspecified.
     * </pre>
     *
     * <code>EVENT_TYPE_UNSPECIFIED = 0;</code>
     */
    public static final int EVENT_TYPE_UNSPECIFIED_VALUE = 0;
    /**
     *
     *
     * <pre>
     * First frame of creative ad viewed.
     * </pre>
     *
     * <code>CREATIVE_VIEW = 1;</code>
     */
    public static final int CREATIVE_VIEW_VALUE = 1;
    /**
     *
     *
     * <pre>
     * Creative ad started.
     * </pre>
     *
     * <code>START = 2;</code>
     */
    public static final int START_VALUE = 2;
    /**
     *
     *
     * <pre>
     * Start of an ad break.
     * </pre>
     *
     * <code>BREAK_START = 3;</code>
     */
    public static final int BREAK_START_VALUE = 3;
    /**
     *
     *
     * <pre>
     * End of an ad break.
     * </pre>
     *
     * <code>BREAK_END = 4;</code>
     */
    public static final int BREAK_END_VALUE = 4;
    /**
     *
     *
     * <pre>
     * Impression.
     * </pre>
     *
     * <code>IMPRESSION = 5;</code>
     */
    public static final int IMPRESSION_VALUE = 5;
    /**
     *
     *
     * <pre>
     * First quartile progress.
     * </pre>
     *
     * <code>FIRST_QUARTILE = 6;</code>
     */
    public static final int FIRST_QUARTILE_VALUE = 6;
    /**
     *
     *
     * <pre>
     * Midpoint progress.
     * </pre>
     *
     * <code>MIDPOINT = 7;</code>
     */
    public static final int MIDPOINT_VALUE = 7;
    /**
     *
     *
     * <pre>
     * Third quartile progress.
     * </pre>
     *
     * <code>THIRD_QUARTILE = 8;</code>
     */
    public static final int THIRD_QUARTILE_VALUE = 8;
    /**
     *
     *
     * <pre>
     * Ad progress completed.
     * </pre>
     *
     * <code>COMPLETE = 9;</code>
     */
    public static final int COMPLETE_VALUE = 9;
    /**
     *
     *
     * <pre>
     * Specific progress event with an offset.
     * </pre>
     *
     * <code>PROGRESS = 10;</code>
     */
    public static final int PROGRESS_VALUE = 10;
    /**
     *
     *
     * <pre>
     * Player muted.
     * </pre>
     *
     * <code>MUTE = 11;</code>
     */
    public static final int MUTE_VALUE = 11;
    /**
     *
     *
     * <pre>
     * Player unmuted.
     * </pre>
     *
     * <code>UNMUTE = 12;</code>
     */
    public static final int UNMUTE_VALUE = 12;
    /**
     *
     *
     * <pre>
     * Player paused.
     * </pre>
     *
     * <code>PAUSE = 13;</code>
     */
    public static final int PAUSE_VALUE = 13;
    /**
     *
     *
     * <pre>
     * Click event.
     * </pre>
     *
     * <code>CLICK = 14;</code>
     */
    public static final int CLICK_VALUE = 14;
    /**
     *
     *
     * <pre>
     * Click-through event.
     * </pre>
     *
     * <code>CLICK_THROUGH = 15;</code>
     */
    public static final int CLICK_THROUGH_VALUE = 15;
    /**
     *
     *
     * <pre>
     * Player rewinding.
     * </pre>
     *
     * <code>REWIND = 16;</code>
     */
    public static final int REWIND_VALUE = 16;
    /**
     *
     *
     * <pre>
     * Player resumed.
     * </pre>
     *
     * <code>RESUME = 17;</code>
     */
    public static final int RESUME_VALUE = 17;
    /**
     *
     *
     * <pre>
     * Error event.
     * </pre>
     *
     * <code>ERROR = 18;</code>
     */
    public static final int ERROR_VALUE = 18;
    /**
     *
     *
     * <pre>
     * Ad expanded to a larger size.
     * </pre>
     *
     * <code>EXPAND = 21;</code>
     */
    public static final int EXPAND_VALUE = 21;
    /**
     *
     *
     * <pre>
     * Ad collapsed to a smaller size.
     * </pre>
     *
     * <code>COLLAPSE = 22;</code>
     */
    public static final int COLLAPSE_VALUE = 22;
    /**
     *
     *
     * <pre>
     * Non-linear ad closed.
     * </pre>
     *
     * <code>CLOSE = 24;</code>
     */
    public static final int CLOSE_VALUE = 24;
    /**
     *
     *
     * <pre>
     * Linear ad closed.
     * </pre>
     *
     * <code>CLOSE_LINEAR = 25;</code>
     */
    public static final int CLOSE_LINEAR_VALUE = 25;
    /**
     *
     *
     * <pre>
     * Ad skipped.
     * </pre>
     *
     * <code>SKIP = 26;</code>
     */
    public static final int SKIP_VALUE = 26;
    /**
     *
     *
     * <pre>
     * Accept invitation event.
     * </pre>
     *
     * <code>ACCEPT_INVITATION = 27;</code>
     */
    public static final int ACCEPT_INVITATION_VALUE = 27;

    public final int getNumber() {
      if (this == UNRECOGNIZED) {
        throw new java.lang.IllegalArgumentException(
            "Can't get the number of an unknown enum value.");
      }
      return value;
    }

    /**
     * @param value The numeric wire value of the corresponding enum entry.
     * @return The enum associated with the given numeric wire value.
     * @deprecated Use {@link #forNumber(int)} instead.
     */
    @java.lang.Deprecated
    public static EventType valueOf(int value) {
      return forNumber(value);
    }

    /**
     * @param value The numeric wire value of the corresponding enum entry.
     * @return The enum associated with the given numeric wire value.
     */
    public static EventType forNumber(int value) {
      switch (value) {
        case 0:
          return EVENT_TYPE_UNSPECIFIED;
        case 1:
          return CREATIVE_VIEW;
        case 2:
          return START;
        case 3:
          return BREAK_START;
        case 4:
          return BREAK_END;
        case 5:
          return IMPRESSION;
        case 6:
          return FIRST_QUARTILE;
        case 7:
          return MIDPOINT;
        case 8:
          return THIRD_QUARTILE;
        case 9:
          return COMPLETE;
        case 10:
          return PROGRESS;
        case 11:
          return MUTE;
        case 12:
          return UNMUTE;
        case 13:
          return PAUSE;
        case 14:
          return CLICK;
        case 15:
          return CLICK_THROUGH;
        case 16:
          return REWIND;
        case 17:
          return RESUME;
        case 18:
          return ERROR;
        case 21:
          return EXPAND;
        case 22:
          return COLLAPSE;
        case 24:
          return CLOSE;
        case 25:
          return CLOSE_LINEAR;
        case 26:
          return SKIP;
        case 27:
          return ACCEPT_INVITATION;
        default:
          return null;
      }
    }

    public static com.google.protobuf.Internal.EnumLiteMap<EventType> internalGetValueMap() {
      return internalValueMap;
    }

    private static final com.google.protobuf.Internal.EnumLiteMap<EventType> internalValueMap =
        new com.google.protobuf.Internal.EnumLiteMap<EventType>() {
          public EventType findValueByNumber(int number) {
            return EventType.forNumber(number);
          }
        };

    public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() {
      if (this == UNRECOGNIZED) {
        throw new java.lang.IllegalStateException(
            "Can't get the descriptor of an unrecognized enum value.");
      }
      return getDescriptor().getValues().get(ordinal());
    }

    public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() {
      return getDescriptor();
    }

    public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() {
      return com.google.cloud.video.stitcher.v1.Event.getDescriptor().getEnumTypes().get(0);
    }

    private static final EventType[] VALUES = values();

    public static EventType valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
      if (desc.getType() != getDescriptor()) {
        throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type.");
      }
      if (desc.getIndex() == -1) {
        return UNRECOGNIZED;
      }
      return VALUES[desc.getIndex()];
    }

    private final int value;

    private EventType(int value) {
      this.value = value;
    }

    // @@protoc_insertion_point(enum_scope:google.cloud.video.stitcher.v1.Event.EventType)
  }

  public static final int TYPE_FIELD_NUMBER = 1;
  private int type_ = 0;
  /**
   *
   *
   * <pre>
   * Describes the event that occurred.
   * </pre>
   *
   * <code>.google.cloud.video.stitcher.v1.Event.EventType type = 1;</code>
   *
   * @return The enum numeric value on the wire for type.
   */
  @java.lang.Override
  public int getTypeValue() {
    return type_;
  }
  /**
   *
   *
   * <pre>
   * Describes the event that occurred.
   * </pre>
   *
   * <code>.google.cloud.video.stitcher.v1.Event.EventType type = 1;</code>
   *
   * @return The type.
   */
  @java.lang.Override
  public com.google.cloud.video.stitcher.v1.Event.EventType getType() {
    com.google.cloud.video.stitcher.v1.Event.EventType result =
        com.google.cloud.video.stitcher.v1.Event.EventType.forNumber(type_);
    return result == null
        ? com.google.cloud.video.stitcher.v1.Event.EventType.UNRECOGNIZED
        : result;
  }

  public static final int URI_FIELD_NUMBER = 2;

  @SuppressWarnings("serial")
  private volatile java.lang.Object uri_ = "";
  /**
   *
   *
   * <pre>
   * The URI to trigger for this event.
   * </pre>
   *
   * <code>string uri = 2;</code>
   *
   * @return The uri.
   */
  @java.lang.Override
  public java.lang.String getUri() {
    java.lang.Object ref = uri_;
    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();
      uri_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * The URI to trigger for this event.
   * </pre>
   *
   * <code>string uri = 2;</code>
   *
   * @return The bytes for uri.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getUriBytes() {
    java.lang.Object ref = uri_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      uri_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int ID_FIELD_NUMBER = 3;

  @SuppressWarnings("serial")
  private volatile java.lang.Object id_ = "";
  /**
   *
   *
   * <pre>
   * The ID of the event.
   * </pre>
   *
   * <code>string id = 3;</code>
   *
   * @return The id.
   */
  @java.lang.Override
  public java.lang.String getId() {
    java.lang.Object ref = id_;
    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();
      id_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * The ID of the event.
   * </pre>
   *
   * <code>string id = 3;</code>
   *
   * @return The bytes for id.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getIdBytes() {
    java.lang.Object ref = id_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      id_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int OFFSET_FIELD_NUMBER = 4;
  private com.google.protobuf.Duration offset_;
  /**
   *
   *
   * <pre>
   * The offset in seconds if the event type is `PROGRESS`.
   * </pre>
   *
   * <code>.google.protobuf.Duration offset = 4;</code>
   *
   * @return Whether the offset field is set.
   */
  @java.lang.Override
  public boolean hasOffset() {
    return offset_ != null;
  }
  /**
   *
   *
   * <pre>
   * The offset in seconds if the event type is `PROGRESS`.
   * </pre>
   *
   * <code>.google.protobuf.Duration offset = 4;</code>
   *
   * @return The offset.
   */
  @java.lang.Override
  public com.google.protobuf.Duration getOffset() {
    return offset_ == null ? com.google.protobuf.Duration.getDefaultInstance() : offset_;
  }
  /**
   *
   *
   * <pre>
   * The offset in seconds if the event type is `PROGRESS`.
   * </pre>
   *
   * <code>.google.protobuf.Duration offset = 4;</code>
   */
  @java.lang.Override
  public com.google.protobuf.DurationOrBuilder getOffsetOrBuilder() {
    return offset_ == null ? com.google.protobuf.Duration.getDefaultInstance() : offset_;
  }

  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 (type_
        != com.google.cloud.video.stitcher.v1.Event.EventType.EVENT_TYPE_UNSPECIFIED.getNumber()) {
      output.writeEnum(1, type_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uri_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, uri_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 3, id_);
    }
    if (offset_ != null) {
      output.writeMessage(4, getOffset());
    }
    getUnknownFields().writeTo(output);
  }

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

    size = 0;
    if (type_
        != com.google.cloud.video.stitcher.v1.Event.EventType.EVENT_TYPE_UNSPECIFIED.getNumber()) {
      size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, type_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uri_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, uri_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, id_);
    }
    if (offset_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getOffset());
    }
    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.Event)) {
      return super.equals(obj);
    }
    com.google.cloud.video.stitcher.v1.Event other = (com.google.cloud.video.stitcher.v1.Event) obj;

    if (type_ != other.type_) return false;
    if (!getUri().equals(other.getUri())) return false;
    if (!getId().equals(other.getId())) return false;
    if (hasOffset() != other.hasOffset()) return false;
    if (hasOffset()) {
      if (!getOffset().equals(other.getOffset())) 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();
    hash = (37 * hash) + TYPE_FIELD_NUMBER;
    hash = (53 * hash) + type_;
    hash = (37 * hash) + URI_FIELD_NUMBER;
    hash = (53 * hash) + getUri().hashCode();
    hash = (37 * hash) + ID_FIELD_NUMBER;
    hash = (53 * hash) + getId().hashCode();
    if (hasOffset()) {
      hash = (37 * hash) + OFFSET_FIELD_NUMBER;
      hash = (53 * hash) + getOffset().hashCode();
    }
    hash = (29 * hash) + getUnknownFields().hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

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

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

  public static com.google.cloud.video.stitcher.v1.Event 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.Event 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.Event 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.Event 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.Event 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.Event 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.Event 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.Event 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>
   * Describes an event and a trigger URI.
   * </pre>
   *
   * Protobuf type {@code google.cloud.video.stitcher.v1.Event}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.video.stitcher.v1.Event)
      com.google.cloud.video.stitcher.v1.EventOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.video.stitcher.v1.EventsProto
          .internal_static_google_cloud_video_stitcher_v1_Event_descriptor;
    }

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

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

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

    @java.lang.Override
    public Builder clear() {
      super.clear();
      bitField0_ = 0;
      type_ = 0;
      uri_ = "";
      id_ = "";
      offset_ = null;
      if (offsetBuilder_ != null) {
        offsetBuilder_.dispose();
        offsetBuilder_ = null;
      }
      return this;
    }

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

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

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

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

    private void buildPartial0(com.google.cloud.video.stitcher.v1.Event result) {
      int from_bitField0_ = bitField0_;
      if (((from_bitField0_ & 0x00000001) != 0)) {
        result.type_ = type_;
      }
      if (((from_bitField0_ & 0x00000002) != 0)) {
        result.uri_ = uri_;
      }
      if (((from_bitField0_ & 0x00000004) != 0)) {
        result.id_ = id_;
      }
      if (((from_bitField0_ & 0x00000008) != 0)) {
        result.offset_ = offsetBuilder_ == null ? offset_ : offsetBuilder_.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.Event) {
        return mergeFrom((com.google.cloud.video.stitcher.v1.Event) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.video.stitcher.v1.Event other) {
      if (other == com.google.cloud.video.stitcher.v1.Event.getDefaultInstance()) return this;
      if (other.type_ != 0) {
        setTypeValue(other.getTypeValue());
      }
      if (!other.getUri().isEmpty()) {
        uri_ = other.uri_;
        bitField0_ |= 0x00000002;
        onChanged();
      }
      if (!other.getId().isEmpty()) {
        id_ = other.id_;
        bitField0_ |= 0x00000004;
        onChanged();
      }
      if (other.hasOffset()) {
        mergeOffset(other.getOffset());
      }
      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 8:
              {
                type_ = input.readEnum();
                bitField0_ |= 0x00000001;
                break;
              } // case 8
            case 18:
              {
                uri_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000002;
                break;
              } // case 18
            case 26:
              {
                id_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000004;
                break;
              } // case 26
            case 34:
              {
                input.readMessage(getOffsetFieldBuilder().getBuilder(), extensionRegistry);
                bitField0_ |= 0x00000008;
                break;
              } // case 34
            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 int type_ = 0;
    /**
     *
     *
     * <pre>
     * Describes the event that occurred.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.Event.EventType type = 1;</code>
     *
     * @return The enum numeric value on the wire for type.
     */
    @java.lang.Override
    public int getTypeValue() {
      return type_;
    }
    /**
     *
     *
     * <pre>
     * Describes the event that occurred.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.Event.EventType type = 1;</code>
     *
     * @param value The enum numeric value on the wire for type to set.
     * @return This builder for chaining.
     */
    public Builder setTypeValue(int value) {
      type_ = value;
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Describes the event that occurred.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.Event.EventType type = 1;</code>
     *
     * @return The type.
     */
    @java.lang.Override
    public com.google.cloud.video.stitcher.v1.Event.EventType getType() {
      com.google.cloud.video.stitcher.v1.Event.EventType result =
          com.google.cloud.video.stitcher.v1.Event.EventType.forNumber(type_);
      return result == null
          ? com.google.cloud.video.stitcher.v1.Event.EventType.UNRECOGNIZED
          : result;
    }
    /**
     *
     *
     * <pre>
     * Describes the event that occurred.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.Event.EventType type = 1;</code>
     *
     * @param value The type to set.
     * @return This builder for chaining.
     */
    public Builder setType(com.google.cloud.video.stitcher.v1.Event.EventType value) {
      if (value == null) {
        throw new NullPointerException();
      }
      bitField0_ |= 0x00000001;
      type_ = value.getNumber();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Describes the event that occurred.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.Event.EventType type = 1;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearType() {
      bitField0_ = (bitField0_ & ~0x00000001);
      type_ = 0;
      onChanged();
      return this;
    }

    private java.lang.Object uri_ = "";
    /**
     *
     *
     * <pre>
     * The URI to trigger for this event.
     * </pre>
     *
     * <code>string uri = 2;</code>
     *
     * @return The uri.
     */
    public java.lang.String getUri() {
      java.lang.Object ref = uri_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        uri_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The URI to trigger for this event.
     * </pre>
     *
     * <code>string uri = 2;</code>
     *
     * @return The bytes for uri.
     */
    public com.google.protobuf.ByteString getUriBytes() {
      java.lang.Object ref = uri_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        uri_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The URI to trigger for this event.
     * </pre>
     *
     * <code>string uri = 2;</code>
     *
     * @param value The uri to set.
     * @return This builder for chaining.
     */
    public Builder setUri(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      uri_ = value;
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The URI to trigger for this event.
     * </pre>
     *
     * <code>string uri = 2;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearUri() {
      uri_ = getDefaultInstance().getUri();
      bitField0_ = (bitField0_ & ~0x00000002);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The URI to trigger for this event.
     * </pre>
     *
     * <code>string uri = 2;</code>
     *
     * @param value The bytes for uri to set.
     * @return This builder for chaining.
     */
    public Builder setUriBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      uri_ = value;
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }

    private java.lang.Object id_ = "";
    /**
     *
     *
     * <pre>
     * The ID of the event.
     * </pre>
     *
     * <code>string id = 3;</code>
     *
     * @return The id.
     */
    public java.lang.String getId() {
      java.lang.Object ref = id_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        id_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The ID of the event.
     * </pre>
     *
     * <code>string id = 3;</code>
     *
     * @return The bytes for id.
     */
    public com.google.protobuf.ByteString getIdBytes() {
      java.lang.Object ref = id_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        id_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The ID of the event.
     * </pre>
     *
     * <code>string id = 3;</code>
     *
     * @param value The id to set.
     * @return This builder for chaining.
     */
    public Builder setId(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      id_ = value;
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The ID of the event.
     * </pre>
     *
     * <code>string id = 3;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearId() {
      id_ = getDefaultInstance().getId();
      bitField0_ = (bitField0_ & ~0x00000004);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The ID of the event.
     * </pre>
     *
     * <code>string id = 3;</code>
     *
     * @param value The bytes for id to set.
     * @return This builder for chaining.
     */
    public Builder setIdBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      id_ = value;
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }

    private com.google.protobuf.Duration offset_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Duration,
            com.google.protobuf.Duration.Builder,
            com.google.protobuf.DurationOrBuilder>
        offsetBuilder_;
    /**
     *
     *
     * <pre>
     * The offset in seconds if the event type is `PROGRESS`.
     * </pre>
     *
     * <code>.google.protobuf.Duration offset = 4;</code>
     *
     * @return Whether the offset field is set.
     */
    public boolean hasOffset() {
      return ((bitField0_ & 0x00000008) != 0);
    }
    /**
     *
     *
     * <pre>
     * The offset in seconds if the event type is `PROGRESS`.
     * </pre>
     *
     * <code>.google.protobuf.Duration offset = 4;</code>
     *
     * @return The offset.
     */
    public com.google.protobuf.Duration getOffset() {
      if (offsetBuilder_ == null) {
        return offset_ == null ? com.google.protobuf.Duration.getDefaultInstance() : offset_;
      } else {
        return offsetBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * The offset in seconds if the event type is `PROGRESS`.
     * </pre>
     *
     * <code>.google.protobuf.Duration offset = 4;</code>
     */
    public Builder setOffset(com.google.protobuf.Duration value) {
      if (offsetBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        offset_ = value;
      } else {
        offsetBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The offset in seconds if the event type is `PROGRESS`.
     * </pre>
     *
     * <code>.google.protobuf.Duration offset = 4;</code>
     */
    public Builder setOffset(com.google.protobuf.Duration.Builder builderForValue) {
      if (offsetBuilder_ == null) {
        offset_ = builderForValue.build();
      } else {
        offsetBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The offset in seconds if the event type is `PROGRESS`.
     * </pre>
     *
     * <code>.google.protobuf.Duration offset = 4;</code>
     */
    public Builder mergeOffset(com.google.protobuf.Duration value) {
      if (offsetBuilder_ == null) {
        if (((bitField0_ & 0x00000008) != 0)
            && offset_ != null
            && offset_ != com.google.protobuf.Duration.getDefaultInstance()) {
          getOffsetBuilder().mergeFrom(value);
        } else {
          offset_ = value;
        }
      } else {
        offsetBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The offset in seconds if the event type is `PROGRESS`.
     * </pre>
     *
     * <code>.google.protobuf.Duration offset = 4;</code>
     */
    public Builder clearOffset() {
      bitField0_ = (bitField0_ & ~0x00000008);
      offset_ = null;
      if (offsetBuilder_ != null) {
        offsetBuilder_.dispose();
        offsetBuilder_ = null;
      }
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The offset in seconds if the event type is `PROGRESS`.
     * </pre>
     *
     * <code>.google.protobuf.Duration offset = 4;</code>
     */
    public com.google.protobuf.Duration.Builder getOffsetBuilder() {
      bitField0_ |= 0x00000008;
      onChanged();
      return getOffsetFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * The offset in seconds if the event type is `PROGRESS`.
     * </pre>
     *
     * <code>.google.protobuf.Duration offset = 4;</code>
     */
    public com.google.protobuf.DurationOrBuilder getOffsetOrBuilder() {
      if (offsetBuilder_ != null) {
        return offsetBuilder_.getMessageOrBuilder();
      } else {
        return offset_ == null ? com.google.protobuf.Duration.getDefaultInstance() : offset_;
      }
    }
    /**
     *
     *
     * <pre>
     * The offset in seconds if the event type is `PROGRESS`.
     * </pre>
     *
     * <code>.google.protobuf.Duration offset = 4;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Duration,
            com.google.protobuf.Duration.Builder,
            com.google.protobuf.DurationOrBuilder>
        getOffsetFieldBuilder() {
      if (offsetBuilder_ == null) {
        offsetBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.protobuf.Duration,
                com.google.protobuf.Duration.Builder,
                com.google.protobuf.DurationOrBuilder>(
                getOffset(), getParentForChildren(), isClean());
        offset_ = null;
      }
      return offsetBuilder_;
    }

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

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

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

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

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

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

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