// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/cloud/videointelligence/v1beta2/video_intelligence.proto

package com.google.cloud.videointelligence.v1beta2;

/**
 * <pre>
 * Video context and/or feature-specific parameters.
 * </pre>
 *
 * Protobuf type {@code google.cloud.videointelligence.v1beta2.VideoContext}
 */
public  final class VideoContext extends
    com.google.protobuf.GeneratedMessageV3 implements
    // @@protoc_insertion_point(message_implements:google.cloud.videointelligence.v1beta2.VideoContext)
    VideoContextOrBuilder {
private static final long serialVersionUID = 0L;
  // Use VideoContext.newBuilder() to construct.
  private VideoContext(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }
  private VideoContext() {
    segments_ = java.util.Collections.emptyList();
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet
  getUnknownFields() {
    return this.unknownFields;
  }
  private VideoContext(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    int mutable_bitField0_ = 0;
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          case 10: {
            if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
              segments_ = new java.util.ArrayList<com.google.cloud.videointelligence.v1beta2.VideoSegment>();
              mutable_bitField0_ |= 0x00000001;
            }
            segments_.add(
                input.readMessage(com.google.cloud.videointelligence.v1beta2.VideoSegment.parser(), extensionRegistry));
            break;
          }
          case 18: {
            com.google.cloud.videointelligence.v1beta2.LabelDetectionConfig.Builder subBuilder = null;
            if (labelDetectionConfig_ != null) {
              subBuilder = labelDetectionConfig_.toBuilder();
            }
            labelDetectionConfig_ = input.readMessage(com.google.cloud.videointelligence.v1beta2.LabelDetectionConfig.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(labelDetectionConfig_);
              labelDetectionConfig_ = subBuilder.buildPartial();
            }

            break;
          }
          case 26: {
            com.google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig.Builder subBuilder = null;
            if (shotChangeDetectionConfig_ != null) {
              subBuilder = shotChangeDetectionConfig_.toBuilder();
            }
            shotChangeDetectionConfig_ = input.readMessage(com.google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(shotChangeDetectionConfig_);
              shotChangeDetectionConfig_ = subBuilder.buildPartial();
            }

            break;
          }
          case 34: {
            com.google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig.Builder subBuilder = null;
            if (explicitContentDetectionConfig_ != null) {
              subBuilder = explicitContentDetectionConfig_.toBuilder();
            }
            explicitContentDetectionConfig_ = input.readMessage(com.google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(explicitContentDetectionConfig_);
              explicitContentDetectionConfig_ = subBuilder.buildPartial();
            }

            break;
          }
          case 42: {
            com.google.cloud.videointelligence.v1beta2.FaceDetectionConfig.Builder subBuilder = null;
            if (faceDetectionConfig_ != null) {
              subBuilder = faceDetectionConfig_.toBuilder();
            }
            faceDetectionConfig_ = input.readMessage(com.google.cloud.videointelligence.v1beta2.FaceDetectionConfig.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(faceDetectionConfig_);
              faceDetectionConfig_ = subBuilder.buildPartial();
            }

            break;
          }
          default: {
            if (!parseUnknownFieldProto3(
                input, unknownFields, extensionRegistry, tag)) {
              done = true;
            }
            break;
          }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(
          e).setUnfinishedMessage(this);
    } finally {
      if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
        segments_ = java.util.Collections.unmodifiableList(segments_);
      }
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }
  public static final com.google.protobuf.Descriptors.Descriptor
      getDescriptor() {
    return com.google.cloud.videointelligence.v1beta2.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1beta2_VideoContext_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.cloud.videointelligence.v1beta2.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1beta2_VideoContext_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.cloud.videointelligence.v1beta2.VideoContext.class, com.google.cloud.videointelligence.v1beta2.VideoContext.Builder.class);
  }

  private int bitField0_;
  public static final int SEGMENTS_FIELD_NUMBER = 1;
  private java.util.List<com.google.cloud.videointelligence.v1beta2.VideoSegment> segments_;
  /**
   * <pre>
   * Video segments to annotate. The segments may overlap and are not required
   * to be contiguous or span the whole video. If unspecified, each video
   * is treated as a single segment.
   * </pre>
   *
   * <code>repeated .google.cloud.videointelligence.v1beta2.VideoSegment segments = 1;</code>
   */
  public java.util.List<com.google.cloud.videointelligence.v1beta2.VideoSegment> getSegmentsList() {
    return segments_;
  }
  /**
   * <pre>
   * Video segments to annotate. The segments may overlap and are not required
   * to be contiguous or span the whole video. If unspecified, each video
   * is treated as a single segment.
   * </pre>
   *
   * <code>repeated .google.cloud.videointelligence.v1beta2.VideoSegment segments = 1;</code>
   */
  public java.util.List<? extends com.google.cloud.videointelligence.v1beta2.VideoSegmentOrBuilder> 
      getSegmentsOrBuilderList() {
    return segments_;
  }
  /**
   * <pre>
   * Video segments to annotate. The segments may overlap and are not required
   * to be contiguous or span the whole video. If unspecified, each video
   * is treated as a single segment.
   * </pre>
   *
   * <code>repeated .google.cloud.videointelligence.v1beta2.VideoSegment segments = 1;</code>
   */
  public int getSegmentsCount() {
    return segments_.size();
  }
  /**
   * <pre>
   * Video segments to annotate. The segments may overlap and are not required
   * to be contiguous or span the whole video. If unspecified, each video
   * is treated as a single segment.
   * </pre>
   *
   * <code>repeated .google.cloud.videointelligence.v1beta2.VideoSegment segments = 1;</code>
   */
  public com.google.cloud.videointelligence.v1beta2.VideoSegment getSegments(int index) {
    return segments_.get(index);
  }
  /**
   * <pre>
   * Video segments to annotate. The segments may overlap and are not required
   * to be contiguous or span the whole video. If unspecified, each video
   * is treated as a single segment.
   * </pre>
   *
   * <code>repeated .google.cloud.videointelligence.v1beta2.VideoSegment segments = 1;</code>
   */
  public com.google.cloud.videointelligence.v1beta2.VideoSegmentOrBuilder getSegmentsOrBuilder(
      int index) {
    return segments_.get(index);
  }

  public static final int LABEL_DETECTION_CONFIG_FIELD_NUMBER = 2;
  private com.google.cloud.videointelligence.v1beta2.LabelDetectionConfig labelDetectionConfig_;
  /**
   * <pre>
   * Config for LABEL_DETECTION.
   * </pre>
   *
   * <code>.google.cloud.videointelligence.v1beta2.LabelDetectionConfig label_detection_config = 2;</code>
   */
  public boolean hasLabelDetectionConfig() {
    return labelDetectionConfig_ != null;
  }
  /**
   * <pre>
   * Config for LABEL_DETECTION.
   * </pre>
   *
   * <code>.google.cloud.videointelligence.v1beta2.LabelDetectionConfig label_detection_config = 2;</code>
   */
  public com.google.cloud.videointelligence.v1beta2.LabelDetectionConfig getLabelDetectionConfig() {
    return labelDetectionConfig_ == null ? com.google.cloud.videointelligence.v1beta2.LabelDetectionConfig.getDefaultInstance() : labelDetectionConfig_;
  }
  /**
   * <pre>
   * Config for LABEL_DETECTION.
   * </pre>
   *
   * <code>.google.cloud.videointelligence.v1beta2.LabelDetectionConfig label_detection_config = 2;</code>
   */
  public com.google.cloud.videointelligence.v1beta2.LabelDetectionConfigOrBuilder getLabelDetectionConfigOrBuilder() {
    return getLabelDetectionConfig();
  }

  public static final int SHOT_CHANGE_DETECTION_CONFIG_FIELD_NUMBER = 3;
  private com.google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig shotChangeDetectionConfig_;
  /**
   * <pre>
   * Config for SHOT_CHANGE_DETECTION.
   * </pre>
   *
   * <code>.google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig shot_change_detection_config = 3;</code>
   */
  public boolean hasShotChangeDetectionConfig() {
    return shotChangeDetectionConfig_ != null;
  }
  /**
   * <pre>
   * Config for SHOT_CHANGE_DETECTION.
   * </pre>
   *
   * <code>.google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig shot_change_detection_config = 3;</code>
   */
  public com.google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig getShotChangeDetectionConfig() {
    return shotChangeDetectionConfig_ == null ? com.google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig.getDefaultInstance() : shotChangeDetectionConfig_;
  }
  /**
   * <pre>
   * Config for SHOT_CHANGE_DETECTION.
   * </pre>
   *
   * <code>.google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig shot_change_detection_config = 3;</code>
   */
  public com.google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfigOrBuilder getShotChangeDetectionConfigOrBuilder() {
    return getShotChangeDetectionConfig();
  }

  public static final int EXPLICIT_CONTENT_DETECTION_CONFIG_FIELD_NUMBER = 4;
  private com.google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig explicitContentDetectionConfig_;
  /**
   * <pre>
   * Config for EXPLICIT_CONTENT_DETECTION.
   * </pre>
   *
   * <code>.google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig explicit_content_detection_config = 4;</code>
   */
  public boolean hasExplicitContentDetectionConfig() {
    return explicitContentDetectionConfig_ != null;
  }
  /**
   * <pre>
   * Config for EXPLICIT_CONTENT_DETECTION.
   * </pre>
   *
   * <code>.google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig explicit_content_detection_config = 4;</code>
   */
  public com.google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig getExplicitContentDetectionConfig() {
    return explicitContentDetectionConfig_ == null ? com.google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig.getDefaultInstance() : explicitContentDetectionConfig_;
  }
  /**
   * <pre>
   * Config for EXPLICIT_CONTENT_DETECTION.
   * </pre>
   *
   * <code>.google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig explicit_content_detection_config = 4;</code>
   */
  public com.google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfigOrBuilder getExplicitContentDetectionConfigOrBuilder() {
    return getExplicitContentDetectionConfig();
  }

  public static final int FACE_DETECTION_CONFIG_FIELD_NUMBER = 5;
  private com.google.cloud.videointelligence.v1beta2.FaceDetectionConfig faceDetectionConfig_;
  /**
   * <pre>
   * Config for FACE_DETECTION.
   * </pre>
   *
   * <code>.google.cloud.videointelligence.v1beta2.FaceDetectionConfig face_detection_config = 5;</code>
   */
  public boolean hasFaceDetectionConfig() {
    return faceDetectionConfig_ != null;
  }
  /**
   * <pre>
   * Config for FACE_DETECTION.
   * </pre>
   *
   * <code>.google.cloud.videointelligence.v1beta2.FaceDetectionConfig face_detection_config = 5;</code>
   */
  public com.google.cloud.videointelligence.v1beta2.FaceDetectionConfig getFaceDetectionConfig() {
    return faceDetectionConfig_ == null ? com.google.cloud.videointelligence.v1beta2.FaceDetectionConfig.getDefaultInstance() : faceDetectionConfig_;
  }
  /**
   * <pre>
   * Config for FACE_DETECTION.
   * </pre>
   *
   * <code>.google.cloud.videointelligence.v1beta2.FaceDetectionConfig face_detection_config = 5;</code>
   */
  public com.google.cloud.videointelligence.v1beta2.FaceDetectionConfigOrBuilder getFaceDetectionConfigOrBuilder() {
    return getFaceDetectionConfig();
  }

  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 {
    for (int i = 0; i < segments_.size(); i++) {
      output.writeMessage(1, segments_.get(i));
    }
    if (labelDetectionConfig_ != null) {
      output.writeMessage(2, getLabelDetectionConfig());
    }
    if (shotChangeDetectionConfig_ != null) {
      output.writeMessage(3, getShotChangeDetectionConfig());
    }
    if (explicitContentDetectionConfig_ != null) {
      output.writeMessage(4, getExplicitContentDetectionConfig());
    }
    if (faceDetectionConfig_ != null) {
      output.writeMessage(5, getFaceDetectionConfig());
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    for (int i = 0; i < segments_.size(); i++) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(1, segments_.get(i));
    }
    if (labelDetectionConfig_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(2, getLabelDetectionConfig());
    }
    if (shotChangeDetectionConfig_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(3, getShotChangeDetectionConfig());
    }
    if (explicitContentDetectionConfig_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(4, getExplicitContentDetectionConfig());
    }
    if (faceDetectionConfig_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(5, getFaceDetectionConfig());
    }
    size += unknownFields.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.videointelligence.v1beta2.VideoContext)) {
      return super.equals(obj);
    }
    com.google.cloud.videointelligence.v1beta2.VideoContext other = (com.google.cloud.videointelligence.v1beta2.VideoContext) obj;

    boolean result = true;
    result = result && getSegmentsList()
        .equals(other.getSegmentsList());
    result = result && (hasLabelDetectionConfig() == other.hasLabelDetectionConfig());
    if (hasLabelDetectionConfig()) {
      result = result && getLabelDetectionConfig()
          .equals(other.getLabelDetectionConfig());
    }
    result = result && (hasShotChangeDetectionConfig() == other.hasShotChangeDetectionConfig());
    if (hasShotChangeDetectionConfig()) {
      result = result && getShotChangeDetectionConfig()
          .equals(other.getShotChangeDetectionConfig());
    }
    result = result && (hasExplicitContentDetectionConfig() == other.hasExplicitContentDetectionConfig());
    if (hasExplicitContentDetectionConfig()) {
      result = result && getExplicitContentDetectionConfig()
          .equals(other.getExplicitContentDetectionConfig());
    }
    result = result && (hasFaceDetectionConfig() == other.hasFaceDetectionConfig());
    if (hasFaceDetectionConfig()) {
      result = result && getFaceDetectionConfig()
          .equals(other.getFaceDetectionConfig());
    }
    result = result && unknownFields.equals(other.unknownFields);
    return result;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    if (getSegmentsCount() > 0) {
      hash = (37 * hash) + SEGMENTS_FIELD_NUMBER;
      hash = (53 * hash) + getSegmentsList().hashCode();
    }
    if (hasLabelDetectionConfig()) {
      hash = (37 * hash) + LABEL_DETECTION_CONFIG_FIELD_NUMBER;
      hash = (53 * hash) + getLabelDetectionConfig().hashCode();
    }
    if (hasShotChangeDetectionConfig()) {
      hash = (37 * hash) + SHOT_CHANGE_DETECTION_CONFIG_FIELD_NUMBER;
      hash = (53 * hash) + getShotChangeDetectionConfig().hashCode();
    }
    if (hasExplicitContentDetectionConfig()) {
      hash = (37 * hash) + EXPLICIT_CONTENT_DETECTION_CONFIG_FIELD_NUMBER;
      hash = (53 * hash) + getExplicitContentDetectionConfig().hashCode();
    }
    if (hasFaceDetectionConfig()) {
      hash = (37 * hash) + FACE_DETECTION_CONFIG_FIELD_NUMBER;
      hash = (53 * hash) + getFaceDetectionConfig().hashCode();
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.cloud.videointelligence.v1beta2.VideoContext parseFrom(
      java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.google.cloud.videointelligence.v1beta2.VideoContext 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.videointelligence.v1beta2.VideoContext parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.google.cloud.videointelligence.v1beta2.VideoContext 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.videointelligence.v1beta2.VideoContext parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.google.cloud.videointelligence.v1beta2.VideoContext parseFrom(
      byte[] data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.google.cloud.videointelligence.v1beta2.VideoContext parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static com.google.cloud.videointelligence.v1beta2.VideoContext 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.videointelligence.v1beta2.VideoContext parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input);
  }
  public static com.google.cloud.videointelligence.v1beta2.VideoContext 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.videointelligence.v1beta2.VideoContext parseFrom(
      com.google.protobuf.CodedInputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static com.google.cloud.videointelligence.v1beta2.VideoContext 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.videointelligence.v1beta2.VideoContext 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>
   * Video context and/or feature-specific parameters.
   * </pre>
   *
   * Protobuf type {@code google.cloud.videointelligence.v1beta2.VideoContext}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
      // @@protoc_insertion_point(builder_implements:google.cloud.videointelligence.v1beta2.VideoContext)
      com.google.cloud.videointelligence.v1beta2.VideoContextOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return com.google.cloud.videointelligence.v1beta2.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1beta2_VideoContext_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloud.videointelligence.v1beta2.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1beta2_VideoContext_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.videointelligence.v1beta2.VideoContext.class, com.google.cloud.videointelligence.v1beta2.VideoContext.Builder.class);
    }

    // Construct using com.google.cloud.videointelligence.v1beta2.VideoContext.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

    private Builder(
        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
      maybeForceBuilderInitialization();
    }
    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3
              .alwaysUseFieldBuilders) {
        getSegmentsFieldBuilder();
      }
    }
    @java.lang.Override
    public Builder clear() {
      super.clear();
      if (segmentsBuilder_ == null) {
        segments_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000001);
      } else {
        segmentsBuilder_.clear();
      }
      if (labelDetectionConfigBuilder_ == null) {
        labelDetectionConfig_ = null;
      } else {
        labelDetectionConfig_ = null;
        labelDetectionConfigBuilder_ = null;
      }
      if (shotChangeDetectionConfigBuilder_ == null) {
        shotChangeDetectionConfig_ = null;
      } else {
        shotChangeDetectionConfig_ = null;
        shotChangeDetectionConfigBuilder_ = null;
      }
      if (explicitContentDetectionConfigBuilder_ == null) {
        explicitContentDetectionConfig_ = null;
      } else {
        explicitContentDetectionConfig_ = null;
        explicitContentDetectionConfigBuilder_ = null;
      }
      if (faceDetectionConfigBuilder_ == null) {
        faceDetectionConfig_ = null;
      } else {
        faceDetectionConfig_ = null;
        faceDetectionConfigBuilder_ = null;
      }
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor
        getDescriptorForType() {
      return com.google.cloud.videointelligence.v1beta2.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1beta2_VideoContext_descriptor;
    }

    @java.lang.Override
    public com.google.cloud.videointelligence.v1beta2.VideoContext getDefaultInstanceForType() {
      return com.google.cloud.videointelligence.v1beta2.VideoContext.getDefaultInstance();
    }

    @java.lang.Override
    public com.google.cloud.videointelligence.v1beta2.VideoContext build() {
      com.google.cloud.videointelligence.v1beta2.VideoContext result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public com.google.cloud.videointelligence.v1beta2.VideoContext buildPartial() {
      com.google.cloud.videointelligence.v1beta2.VideoContext result = new com.google.cloud.videointelligence.v1beta2.VideoContext(this);
      int from_bitField0_ = bitField0_;
      int to_bitField0_ = 0;
      if (segmentsBuilder_ == null) {
        if (((bitField0_ & 0x00000001) == 0x00000001)) {
          segments_ = java.util.Collections.unmodifiableList(segments_);
          bitField0_ = (bitField0_ & ~0x00000001);
        }
        result.segments_ = segments_;
      } else {
        result.segments_ = segmentsBuilder_.build();
      }
      if (labelDetectionConfigBuilder_ == null) {
        result.labelDetectionConfig_ = labelDetectionConfig_;
      } else {
        result.labelDetectionConfig_ = labelDetectionConfigBuilder_.build();
      }
      if (shotChangeDetectionConfigBuilder_ == null) {
        result.shotChangeDetectionConfig_ = shotChangeDetectionConfig_;
      } else {
        result.shotChangeDetectionConfig_ = shotChangeDetectionConfigBuilder_.build();
      }
      if (explicitContentDetectionConfigBuilder_ == null) {
        result.explicitContentDetectionConfig_ = explicitContentDetectionConfig_;
      } else {
        result.explicitContentDetectionConfig_ = explicitContentDetectionConfigBuilder_.build();
      }
      if (faceDetectionConfigBuilder_ == null) {
        result.faceDetectionConfig_ = faceDetectionConfig_;
      } else {
        result.faceDetectionConfig_ = faceDetectionConfigBuilder_.build();
      }
      result.bitField0_ = to_bitField0_;
      onBuilt();
      return result;
    }

    @java.lang.Override
    public Builder clone() {
      return (Builder) super.clone();
    }
    @java.lang.Override
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        java.lang.Object value) {
      return (Builder) super.setField(field, value);
    }
    @java.lang.Override
    public Builder clearField(
        com.google.protobuf.Descriptors.FieldDescriptor field) {
      return (Builder) super.clearField(field);
    }
    @java.lang.Override
    public Builder clearOneof(
        com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return (Builder) super.clearOneof(oneof);
    }
    @java.lang.Override
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        int index, java.lang.Object value) {
      return (Builder) super.setRepeatedField(field, index, value);
    }
    @java.lang.Override
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        java.lang.Object value) {
      return (Builder) super.addRepeatedField(field, value);
    }
    @java.lang.Override
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof com.google.cloud.videointelligence.v1beta2.VideoContext) {
        return mergeFrom((com.google.cloud.videointelligence.v1beta2.VideoContext)other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.videointelligence.v1beta2.VideoContext other) {
      if (other == com.google.cloud.videointelligence.v1beta2.VideoContext.getDefaultInstance()) return this;
      if (segmentsBuilder_ == null) {
        if (!other.segments_.isEmpty()) {
          if (segments_.isEmpty()) {
            segments_ = other.segments_;
            bitField0_ = (bitField0_ & ~0x00000001);
          } else {
            ensureSegmentsIsMutable();
            segments_.addAll(other.segments_);
          }
          onChanged();
        }
      } else {
        if (!other.segments_.isEmpty()) {
          if (segmentsBuilder_.isEmpty()) {
            segmentsBuilder_.dispose();
            segmentsBuilder_ = null;
            segments_ = other.segments_;
            bitField0_ = (bitField0_ & ~0x00000001);
            segmentsBuilder_ = 
              com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
                 getSegmentsFieldBuilder() : null;
          } else {
            segmentsBuilder_.addAllMessages(other.segments_);
          }
        }
      }
      if (other.hasLabelDetectionConfig()) {
        mergeLabelDetectionConfig(other.getLabelDetectionConfig());
      }
      if (other.hasShotChangeDetectionConfig()) {
        mergeShotChangeDetectionConfig(other.getShotChangeDetectionConfig());
      }
      if (other.hasExplicitContentDetectionConfig()) {
        mergeExplicitContentDetectionConfig(other.getExplicitContentDetectionConfig());
      }
      if (other.hasFaceDetectionConfig()) {
        mergeFaceDetectionConfig(other.getFaceDetectionConfig());
      }
      this.mergeUnknownFields(other.unknownFields);
      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 {
      com.google.cloud.videointelligence.v1beta2.VideoContext parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (com.google.cloud.videointelligence.v1beta2.VideoContext) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }
    private int bitField0_;

    private java.util.List<com.google.cloud.videointelligence.v1beta2.VideoSegment> segments_ =
      java.util.Collections.emptyList();
    private void ensureSegmentsIsMutable() {
      if (!((bitField0_ & 0x00000001) == 0x00000001)) {
        segments_ = new java.util.ArrayList<com.google.cloud.videointelligence.v1beta2.VideoSegment>(segments_);
        bitField0_ |= 0x00000001;
       }
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
        com.google.cloud.videointelligence.v1beta2.VideoSegment, com.google.cloud.videointelligence.v1beta2.VideoSegment.Builder, com.google.cloud.videointelligence.v1beta2.VideoSegmentOrBuilder> segmentsBuilder_;

    /**
     * <pre>
     * Video segments to annotate. The segments may overlap and are not required
     * to be contiguous or span the whole video. If unspecified, each video
     * is treated as a single segment.
     * </pre>
     *
     * <code>repeated .google.cloud.videointelligence.v1beta2.VideoSegment segments = 1;</code>
     */
    public java.util.List<com.google.cloud.videointelligence.v1beta2.VideoSegment> getSegmentsList() {
      if (segmentsBuilder_ == null) {
        return java.util.Collections.unmodifiableList(segments_);
      } else {
        return segmentsBuilder_.getMessageList();
      }
    }
    /**
     * <pre>
     * Video segments to annotate. The segments may overlap and are not required
     * to be contiguous or span the whole video. If unspecified, each video
     * is treated as a single segment.
     * </pre>
     *
     * <code>repeated .google.cloud.videointelligence.v1beta2.VideoSegment segments = 1;</code>
     */
    public int getSegmentsCount() {
      if (segmentsBuilder_ == null) {
        return segments_.size();
      } else {
        return segmentsBuilder_.getCount();
      }
    }
    /**
     * <pre>
     * Video segments to annotate. The segments may overlap and are not required
     * to be contiguous or span the whole video. If unspecified, each video
     * is treated as a single segment.
     * </pre>
     *
     * <code>repeated .google.cloud.videointelligence.v1beta2.VideoSegment segments = 1;</code>
     */
    public com.google.cloud.videointelligence.v1beta2.VideoSegment getSegments(int index) {
      if (segmentsBuilder_ == null) {
        return segments_.get(index);
      } else {
        return segmentsBuilder_.getMessage(index);
      }
    }
    /**
     * <pre>
     * Video segments to annotate. The segments may overlap and are not required
     * to be contiguous or span the whole video. If unspecified, each video
     * is treated as a single segment.
     * </pre>
     *
     * <code>repeated .google.cloud.videointelligence.v1beta2.VideoSegment segments = 1;</code>
     */
    public Builder setSegments(
        int index, com.google.cloud.videointelligence.v1beta2.VideoSegment value) {
      if (segmentsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureSegmentsIsMutable();
        segments_.set(index, value);
        onChanged();
      } else {
        segmentsBuilder_.setMessage(index, value);
      }
      return this;
    }
    /**
     * <pre>
     * Video segments to annotate. The segments may overlap and are not required
     * to be contiguous or span the whole video. If unspecified, each video
     * is treated as a single segment.
     * </pre>
     *
     * <code>repeated .google.cloud.videointelligence.v1beta2.VideoSegment segments = 1;</code>
     */
    public Builder setSegments(
        int index, com.google.cloud.videointelligence.v1beta2.VideoSegment.Builder builderForValue) {
      if (segmentsBuilder_ == null) {
        ensureSegmentsIsMutable();
        segments_.set(index, builderForValue.build());
        onChanged();
      } else {
        segmentsBuilder_.setMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     * <pre>
     * Video segments to annotate. The segments may overlap and are not required
     * to be contiguous or span the whole video. If unspecified, each video
     * is treated as a single segment.
     * </pre>
     *
     * <code>repeated .google.cloud.videointelligence.v1beta2.VideoSegment segments = 1;</code>
     */
    public Builder addSegments(com.google.cloud.videointelligence.v1beta2.VideoSegment value) {
      if (segmentsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureSegmentsIsMutable();
        segments_.add(value);
        onChanged();
      } else {
        segmentsBuilder_.addMessage(value);
      }
      return this;
    }
    /**
     * <pre>
     * Video segments to annotate. The segments may overlap and are not required
     * to be contiguous or span the whole video. If unspecified, each video
     * is treated as a single segment.
     * </pre>
     *
     * <code>repeated .google.cloud.videointelligence.v1beta2.VideoSegment segments = 1;</code>
     */
    public Builder addSegments(
        int index, com.google.cloud.videointelligence.v1beta2.VideoSegment value) {
      if (segmentsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureSegmentsIsMutable();
        segments_.add(index, value);
        onChanged();
      } else {
        segmentsBuilder_.addMessage(index, value);
      }
      return this;
    }
    /**
     * <pre>
     * Video segments to annotate. The segments may overlap and are not required
     * to be contiguous or span the whole video. If unspecified, each video
     * is treated as a single segment.
     * </pre>
     *
     * <code>repeated .google.cloud.videointelligence.v1beta2.VideoSegment segments = 1;</code>
     */
    public Builder addSegments(
        com.google.cloud.videointelligence.v1beta2.VideoSegment.Builder builderForValue) {
      if (segmentsBuilder_ == null) {
        ensureSegmentsIsMutable();
        segments_.add(builderForValue.build());
        onChanged();
      } else {
        segmentsBuilder_.addMessage(builderForValue.build());
      }
      return this;
    }
    /**
     * <pre>
     * Video segments to annotate. The segments may overlap and are not required
     * to be contiguous or span the whole video. If unspecified, each video
     * is treated as a single segment.
     * </pre>
     *
     * <code>repeated .google.cloud.videointelligence.v1beta2.VideoSegment segments = 1;</code>
     */
    public Builder addSegments(
        int index, com.google.cloud.videointelligence.v1beta2.VideoSegment.Builder builderForValue) {
      if (segmentsBuilder_ == null) {
        ensureSegmentsIsMutable();
        segments_.add(index, builderForValue.build());
        onChanged();
      } else {
        segmentsBuilder_.addMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     * <pre>
     * Video segments to annotate. The segments may overlap and are not required
     * to be contiguous or span the whole video. If unspecified, each video
     * is treated as a single segment.
     * </pre>
     *
     * <code>repeated .google.cloud.videointelligence.v1beta2.VideoSegment segments = 1;</code>
     */
    public Builder addAllSegments(
        java.lang.Iterable<? extends com.google.cloud.videointelligence.v1beta2.VideoSegment> values) {
      if (segmentsBuilder_ == null) {
        ensureSegmentsIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(
            values, segments_);
        onChanged();
      } else {
        segmentsBuilder_.addAllMessages(values);
      }
      return this;
    }
    /**
     * <pre>
     * Video segments to annotate. The segments may overlap and are not required
     * to be contiguous or span the whole video. If unspecified, each video
     * is treated as a single segment.
     * </pre>
     *
     * <code>repeated .google.cloud.videointelligence.v1beta2.VideoSegment segments = 1;</code>
     */
    public Builder clearSegments() {
      if (segmentsBuilder_ == null) {
        segments_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000001);
        onChanged();
      } else {
        segmentsBuilder_.clear();
      }
      return this;
    }
    /**
     * <pre>
     * Video segments to annotate. The segments may overlap and are not required
     * to be contiguous or span the whole video. If unspecified, each video
     * is treated as a single segment.
     * </pre>
     *
     * <code>repeated .google.cloud.videointelligence.v1beta2.VideoSegment segments = 1;</code>
     */
    public Builder removeSegments(int index) {
      if (segmentsBuilder_ == null) {
        ensureSegmentsIsMutable();
        segments_.remove(index);
        onChanged();
      } else {
        segmentsBuilder_.remove(index);
      }
      return this;
    }
    /**
     * <pre>
     * Video segments to annotate. The segments may overlap and are not required
     * to be contiguous or span the whole video. If unspecified, each video
     * is treated as a single segment.
     * </pre>
     *
     * <code>repeated .google.cloud.videointelligence.v1beta2.VideoSegment segments = 1;</code>
     */
    public com.google.cloud.videointelligence.v1beta2.VideoSegment.Builder getSegmentsBuilder(
        int index) {
      return getSegmentsFieldBuilder().getBuilder(index);
    }
    /**
     * <pre>
     * Video segments to annotate. The segments may overlap and are not required
     * to be contiguous or span the whole video. If unspecified, each video
     * is treated as a single segment.
     * </pre>
     *
     * <code>repeated .google.cloud.videointelligence.v1beta2.VideoSegment segments = 1;</code>
     */
    public com.google.cloud.videointelligence.v1beta2.VideoSegmentOrBuilder getSegmentsOrBuilder(
        int index) {
      if (segmentsBuilder_ == null) {
        return segments_.get(index);  } else {
        return segmentsBuilder_.getMessageOrBuilder(index);
      }
    }
    /**
     * <pre>
     * Video segments to annotate. The segments may overlap and are not required
     * to be contiguous or span the whole video. If unspecified, each video
     * is treated as a single segment.
     * </pre>
     *
     * <code>repeated .google.cloud.videointelligence.v1beta2.VideoSegment segments = 1;</code>
     */
    public java.util.List<? extends com.google.cloud.videointelligence.v1beta2.VideoSegmentOrBuilder> 
         getSegmentsOrBuilderList() {
      if (segmentsBuilder_ != null) {
        return segmentsBuilder_.getMessageOrBuilderList();
      } else {
        return java.util.Collections.unmodifiableList(segments_);
      }
    }
    /**
     * <pre>
     * Video segments to annotate. The segments may overlap and are not required
     * to be contiguous or span the whole video. If unspecified, each video
     * is treated as a single segment.
     * </pre>
     *
     * <code>repeated .google.cloud.videointelligence.v1beta2.VideoSegment segments = 1;</code>
     */
    public com.google.cloud.videointelligence.v1beta2.VideoSegment.Builder addSegmentsBuilder() {
      return getSegmentsFieldBuilder().addBuilder(
          com.google.cloud.videointelligence.v1beta2.VideoSegment.getDefaultInstance());
    }
    /**
     * <pre>
     * Video segments to annotate. The segments may overlap and are not required
     * to be contiguous or span the whole video. If unspecified, each video
     * is treated as a single segment.
     * </pre>
     *
     * <code>repeated .google.cloud.videointelligence.v1beta2.VideoSegment segments = 1;</code>
     */
    public com.google.cloud.videointelligence.v1beta2.VideoSegment.Builder addSegmentsBuilder(
        int index) {
      return getSegmentsFieldBuilder().addBuilder(
          index, com.google.cloud.videointelligence.v1beta2.VideoSegment.getDefaultInstance());
    }
    /**
     * <pre>
     * Video segments to annotate. The segments may overlap and are not required
     * to be contiguous or span the whole video. If unspecified, each video
     * is treated as a single segment.
     * </pre>
     *
     * <code>repeated .google.cloud.videointelligence.v1beta2.VideoSegment segments = 1;</code>
     */
    public java.util.List<com.google.cloud.videointelligence.v1beta2.VideoSegment.Builder> 
         getSegmentsBuilderList() {
      return getSegmentsFieldBuilder().getBuilderList();
    }
    private com.google.protobuf.RepeatedFieldBuilderV3<
        com.google.cloud.videointelligence.v1beta2.VideoSegment, com.google.cloud.videointelligence.v1beta2.VideoSegment.Builder, com.google.cloud.videointelligence.v1beta2.VideoSegmentOrBuilder> 
        getSegmentsFieldBuilder() {
      if (segmentsBuilder_ == null) {
        segmentsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.cloud.videointelligence.v1beta2.VideoSegment, com.google.cloud.videointelligence.v1beta2.VideoSegment.Builder, com.google.cloud.videointelligence.v1beta2.VideoSegmentOrBuilder>(
                segments_,
                ((bitField0_ & 0x00000001) == 0x00000001),
                getParentForChildren(),
                isClean());
        segments_ = null;
      }
      return segmentsBuilder_;
    }

    private com.google.cloud.videointelligence.v1beta2.LabelDetectionConfig labelDetectionConfig_ = null;
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.cloud.videointelligence.v1beta2.LabelDetectionConfig, com.google.cloud.videointelligence.v1beta2.LabelDetectionConfig.Builder, com.google.cloud.videointelligence.v1beta2.LabelDetectionConfigOrBuilder> labelDetectionConfigBuilder_;
    /**
     * <pre>
     * Config for LABEL_DETECTION.
     * </pre>
     *
     * <code>.google.cloud.videointelligence.v1beta2.LabelDetectionConfig label_detection_config = 2;</code>
     */
    public boolean hasLabelDetectionConfig() {
      return labelDetectionConfigBuilder_ != null || labelDetectionConfig_ != null;
    }
    /**
     * <pre>
     * Config for LABEL_DETECTION.
     * </pre>
     *
     * <code>.google.cloud.videointelligence.v1beta2.LabelDetectionConfig label_detection_config = 2;</code>
     */
    public com.google.cloud.videointelligence.v1beta2.LabelDetectionConfig getLabelDetectionConfig() {
      if (labelDetectionConfigBuilder_ == null) {
        return labelDetectionConfig_ == null ? com.google.cloud.videointelligence.v1beta2.LabelDetectionConfig.getDefaultInstance() : labelDetectionConfig_;
      } else {
        return labelDetectionConfigBuilder_.getMessage();
      }
    }
    /**
     * <pre>
     * Config for LABEL_DETECTION.
     * </pre>
     *
     * <code>.google.cloud.videointelligence.v1beta2.LabelDetectionConfig label_detection_config = 2;</code>
     */
    public Builder setLabelDetectionConfig(com.google.cloud.videointelligence.v1beta2.LabelDetectionConfig value) {
      if (labelDetectionConfigBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        labelDetectionConfig_ = value;
        onChanged();
      } else {
        labelDetectionConfigBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     * <pre>
     * Config for LABEL_DETECTION.
     * </pre>
     *
     * <code>.google.cloud.videointelligence.v1beta2.LabelDetectionConfig label_detection_config = 2;</code>
     */
    public Builder setLabelDetectionConfig(
        com.google.cloud.videointelligence.v1beta2.LabelDetectionConfig.Builder builderForValue) {
      if (labelDetectionConfigBuilder_ == null) {
        labelDetectionConfig_ = builderForValue.build();
        onChanged();
      } else {
        labelDetectionConfigBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     * <pre>
     * Config for LABEL_DETECTION.
     * </pre>
     *
     * <code>.google.cloud.videointelligence.v1beta2.LabelDetectionConfig label_detection_config = 2;</code>
     */
    public Builder mergeLabelDetectionConfig(com.google.cloud.videointelligence.v1beta2.LabelDetectionConfig value) {
      if (labelDetectionConfigBuilder_ == null) {
        if (labelDetectionConfig_ != null) {
          labelDetectionConfig_ =
            com.google.cloud.videointelligence.v1beta2.LabelDetectionConfig.newBuilder(labelDetectionConfig_).mergeFrom(value).buildPartial();
        } else {
          labelDetectionConfig_ = value;
        }
        onChanged();
      } else {
        labelDetectionConfigBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     * <pre>
     * Config for LABEL_DETECTION.
     * </pre>
     *
     * <code>.google.cloud.videointelligence.v1beta2.LabelDetectionConfig label_detection_config = 2;</code>
     */
    public Builder clearLabelDetectionConfig() {
      if (labelDetectionConfigBuilder_ == null) {
        labelDetectionConfig_ = null;
        onChanged();
      } else {
        labelDetectionConfig_ = null;
        labelDetectionConfigBuilder_ = null;
      }

      return this;
    }
    /**
     * <pre>
     * Config for LABEL_DETECTION.
     * </pre>
     *
     * <code>.google.cloud.videointelligence.v1beta2.LabelDetectionConfig label_detection_config = 2;</code>
     */
    public com.google.cloud.videointelligence.v1beta2.LabelDetectionConfig.Builder getLabelDetectionConfigBuilder() {
      
      onChanged();
      return getLabelDetectionConfigFieldBuilder().getBuilder();
    }
    /**
     * <pre>
     * Config for LABEL_DETECTION.
     * </pre>
     *
     * <code>.google.cloud.videointelligence.v1beta2.LabelDetectionConfig label_detection_config = 2;</code>
     */
    public com.google.cloud.videointelligence.v1beta2.LabelDetectionConfigOrBuilder getLabelDetectionConfigOrBuilder() {
      if (labelDetectionConfigBuilder_ != null) {
        return labelDetectionConfigBuilder_.getMessageOrBuilder();
      } else {
        return labelDetectionConfig_ == null ?
            com.google.cloud.videointelligence.v1beta2.LabelDetectionConfig.getDefaultInstance() : labelDetectionConfig_;
      }
    }
    /**
     * <pre>
     * Config for LABEL_DETECTION.
     * </pre>
     *
     * <code>.google.cloud.videointelligence.v1beta2.LabelDetectionConfig label_detection_config = 2;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.cloud.videointelligence.v1beta2.LabelDetectionConfig, com.google.cloud.videointelligence.v1beta2.LabelDetectionConfig.Builder, com.google.cloud.videointelligence.v1beta2.LabelDetectionConfigOrBuilder> 
        getLabelDetectionConfigFieldBuilder() {
      if (labelDetectionConfigBuilder_ == null) {
        labelDetectionConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.videointelligence.v1beta2.LabelDetectionConfig, com.google.cloud.videointelligence.v1beta2.LabelDetectionConfig.Builder, com.google.cloud.videointelligence.v1beta2.LabelDetectionConfigOrBuilder>(
                getLabelDetectionConfig(),
                getParentForChildren(),
                isClean());
        labelDetectionConfig_ = null;
      }
      return labelDetectionConfigBuilder_;
    }

    private com.google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig shotChangeDetectionConfig_ = null;
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig, com.google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig.Builder, com.google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfigOrBuilder> shotChangeDetectionConfigBuilder_;
    /**
     * <pre>
     * Config for SHOT_CHANGE_DETECTION.
     * </pre>
     *
     * <code>.google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig shot_change_detection_config = 3;</code>
     */
    public boolean hasShotChangeDetectionConfig() {
      return shotChangeDetectionConfigBuilder_ != null || shotChangeDetectionConfig_ != null;
    }
    /**
     * <pre>
     * Config for SHOT_CHANGE_DETECTION.
     * </pre>
     *
     * <code>.google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig shot_change_detection_config = 3;</code>
     */
    public com.google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig getShotChangeDetectionConfig() {
      if (shotChangeDetectionConfigBuilder_ == null) {
        return shotChangeDetectionConfig_ == null ? com.google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig.getDefaultInstance() : shotChangeDetectionConfig_;
      } else {
        return shotChangeDetectionConfigBuilder_.getMessage();
      }
    }
    /**
     * <pre>
     * Config for SHOT_CHANGE_DETECTION.
     * </pre>
     *
     * <code>.google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig shot_change_detection_config = 3;</code>
     */
    public Builder setShotChangeDetectionConfig(com.google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig value) {
      if (shotChangeDetectionConfigBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        shotChangeDetectionConfig_ = value;
        onChanged();
      } else {
        shotChangeDetectionConfigBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     * <pre>
     * Config for SHOT_CHANGE_DETECTION.
     * </pre>
     *
     * <code>.google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig shot_change_detection_config = 3;</code>
     */
    public Builder setShotChangeDetectionConfig(
        com.google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig.Builder builderForValue) {
      if (shotChangeDetectionConfigBuilder_ == null) {
        shotChangeDetectionConfig_ = builderForValue.build();
        onChanged();
      } else {
        shotChangeDetectionConfigBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     * <pre>
     * Config for SHOT_CHANGE_DETECTION.
     * </pre>
     *
     * <code>.google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig shot_change_detection_config = 3;</code>
     */
    public Builder mergeShotChangeDetectionConfig(com.google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig value) {
      if (shotChangeDetectionConfigBuilder_ == null) {
        if (shotChangeDetectionConfig_ != null) {
          shotChangeDetectionConfig_ =
            com.google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig.newBuilder(shotChangeDetectionConfig_).mergeFrom(value).buildPartial();
        } else {
          shotChangeDetectionConfig_ = value;
        }
        onChanged();
      } else {
        shotChangeDetectionConfigBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     * <pre>
     * Config for SHOT_CHANGE_DETECTION.
     * </pre>
     *
     * <code>.google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig shot_change_detection_config = 3;</code>
     */
    public Builder clearShotChangeDetectionConfig() {
      if (shotChangeDetectionConfigBuilder_ == null) {
        shotChangeDetectionConfig_ = null;
        onChanged();
      } else {
        shotChangeDetectionConfig_ = null;
        shotChangeDetectionConfigBuilder_ = null;
      }

      return this;
    }
    /**
     * <pre>
     * Config for SHOT_CHANGE_DETECTION.
     * </pre>
     *
     * <code>.google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig shot_change_detection_config = 3;</code>
     */
    public com.google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig.Builder getShotChangeDetectionConfigBuilder() {
      
      onChanged();
      return getShotChangeDetectionConfigFieldBuilder().getBuilder();
    }
    /**
     * <pre>
     * Config for SHOT_CHANGE_DETECTION.
     * </pre>
     *
     * <code>.google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig shot_change_detection_config = 3;</code>
     */
    public com.google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfigOrBuilder getShotChangeDetectionConfigOrBuilder() {
      if (shotChangeDetectionConfigBuilder_ != null) {
        return shotChangeDetectionConfigBuilder_.getMessageOrBuilder();
      } else {
        return shotChangeDetectionConfig_ == null ?
            com.google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig.getDefaultInstance() : shotChangeDetectionConfig_;
      }
    }
    /**
     * <pre>
     * Config for SHOT_CHANGE_DETECTION.
     * </pre>
     *
     * <code>.google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig shot_change_detection_config = 3;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig, com.google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig.Builder, com.google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfigOrBuilder> 
        getShotChangeDetectionConfigFieldBuilder() {
      if (shotChangeDetectionConfigBuilder_ == null) {
        shotChangeDetectionConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig, com.google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig.Builder, com.google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfigOrBuilder>(
                getShotChangeDetectionConfig(),
                getParentForChildren(),
                isClean());
        shotChangeDetectionConfig_ = null;
      }
      return shotChangeDetectionConfigBuilder_;
    }

    private com.google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig explicitContentDetectionConfig_ = null;
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig, com.google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig.Builder, com.google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfigOrBuilder> explicitContentDetectionConfigBuilder_;
    /**
     * <pre>
     * Config for EXPLICIT_CONTENT_DETECTION.
     * </pre>
     *
     * <code>.google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig explicit_content_detection_config = 4;</code>
     */
    public boolean hasExplicitContentDetectionConfig() {
      return explicitContentDetectionConfigBuilder_ != null || explicitContentDetectionConfig_ != null;
    }
    /**
     * <pre>
     * Config for EXPLICIT_CONTENT_DETECTION.
     * </pre>
     *
     * <code>.google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig explicit_content_detection_config = 4;</code>
     */
    public com.google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig getExplicitContentDetectionConfig() {
      if (explicitContentDetectionConfigBuilder_ == null) {
        return explicitContentDetectionConfig_ == null ? com.google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig.getDefaultInstance() : explicitContentDetectionConfig_;
      } else {
        return explicitContentDetectionConfigBuilder_.getMessage();
      }
    }
    /**
     * <pre>
     * Config for EXPLICIT_CONTENT_DETECTION.
     * </pre>
     *
     * <code>.google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig explicit_content_detection_config = 4;</code>
     */
    public Builder setExplicitContentDetectionConfig(com.google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig value) {
      if (explicitContentDetectionConfigBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        explicitContentDetectionConfig_ = value;
        onChanged();
      } else {
        explicitContentDetectionConfigBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     * <pre>
     * Config for EXPLICIT_CONTENT_DETECTION.
     * </pre>
     *
     * <code>.google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig explicit_content_detection_config = 4;</code>
     */
    public Builder setExplicitContentDetectionConfig(
        com.google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig.Builder builderForValue) {
      if (explicitContentDetectionConfigBuilder_ == null) {
        explicitContentDetectionConfig_ = builderForValue.build();
        onChanged();
      } else {
        explicitContentDetectionConfigBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     * <pre>
     * Config for EXPLICIT_CONTENT_DETECTION.
     * </pre>
     *
     * <code>.google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig explicit_content_detection_config = 4;</code>
     */
    public Builder mergeExplicitContentDetectionConfig(com.google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig value) {
      if (explicitContentDetectionConfigBuilder_ == null) {
        if (explicitContentDetectionConfig_ != null) {
          explicitContentDetectionConfig_ =
            com.google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig.newBuilder(explicitContentDetectionConfig_).mergeFrom(value).buildPartial();
        } else {
          explicitContentDetectionConfig_ = value;
        }
        onChanged();
      } else {
        explicitContentDetectionConfigBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     * <pre>
     * Config for EXPLICIT_CONTENT_DETECTION.
     * </pre>
     *
     * <code>.google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig explicit_content_detection_config = 4;</code>
     */
    public Builder clearExplicitContentDetectionConfig() {
      if (explicitContentDetectionConfigBuilder_ == null) {
        explicitContentDetectionConfig_ = null;
        onChanged();
      } else {
        explicitContentDetectionConfig_ = null;
        explicitContentDetectionConfigBuilder_ = null;
      }

      return this;
    }
    /**
     * <pre>
     * Config for EXPLICIT_CONTENT_DETECTION.
     * </pre>
     *
     * <code>.google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig explicit_content_detection_config = 4;</code>
     */
    public com.google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig.Builder getExplicitContentDetectionConfigBuilder() {
      
      onChanged();
      return getExplicitContentDetectionConfigFieldBuilder().getBuilder();
    }
    /**
     * <pre>
     * Config for EXPLICIT_CONTENT_DETECTION.
     * </pre>
     *
     * <code>.google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig explicit_content_detection_config = 4;</code>
     */
    public com.google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfigOrBuilder getExplicitContentDetectionConfigOrBuilder() {
      if (explicitContentDetectionConfigBuilder_ != null) {
        return explicitContentDetectionConfigBuilder_.getMessageOrBuilder();
      } else {
        return explicitContentDetectionConfig_ == null ?
            com.google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig.getDefaultInstance() : explicitContentDetectionConfig_;
      }
    }
    /**
     * <pre>
     * Config for EXPLICIT_CONTENT_DETECTION.
     * </pre>
     *
     * <code>.google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig explicit_content_detection_config = 4;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig, com.google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig.Builder, com.google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfigOrBuilder> 
        getExplicitContentDetectionConfigFieldBuilder() {
      if (explicitContentDetectionConfigBuilder_ == null) {
        explicitContentDetectionConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig, com.google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig.Builder, com.google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfigOrBuilder>(
                getExplicitContentDetectionConfig(),
                getParentForChildren(),
                isClean());
        explicitContentDetectionConfig_ = null;
      }
      return explicitContentDetectionConfigBuilder_;
    }

    private com.google.cloud.videointelligence.v1beta2.FaceDetectionConfig faceDetectionConfig_ = null;
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.cloud.videointelligence.v1beta2.FaceDetectionConfig, com.google.cloud.videointelligence.v1beta2.FaceDetectionConfig.Builder, com.google.cloud.videointelligence.v1beta2.FaceDetectionConfigOrBuilder> faceDetectionConfigBuilder_;
    /**
     * <pre>
     * Config for FACE_DETECTION.
     * </pre>
     *
     * <code>.google.cloud.videointelligence.v1beta2.FaceDetectionConfig face_detection_config = 5;</code>
     */
    public boolean hasFaceDetectionConfig() {
      return faceDetectionConfigBuilder_ != null || faceDetectionConfig_ != null;
    }
    /**
     * <pre>
     * Config for FACE_DETECTION.
     * </pre>
     *
     * <code>.google.cloud.videointelligence.v1beta2.FaceDetectionConfig face_detection_config = 5;</code>
     */
    public com.google.cloud.videointelligence.v1beta2.FaceDetectionConfig getFaceDetectionConfig() {
      if (faceDetectionConfigBuilder_ == null) {
        return faceDetectionConfig_ == null ? com.google.cloud.videointelligence.v1beta2.FaceDetectionConfig.getDefaultInstance() : faceDetectionConfig_;
      } else {
        return faceDetectionConfigBuilder_.getMessage();
      }
    }
    /**
     * <pre>
     * Config for FACE_DETECTION.
     * </pre>
     *
     * <code>.google.cloud.videointelligence.v1beta2.FaceDetectionConfig face_detection_config = 5;</code>
     */
    public Builder setFaceDetectionConfig(com.google.cloud.videointelligence.v1beta2.FaceDetectionConfig value) {
      if (faceDetectionConfigBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        faceDetectionConfig_ = value;
        onChanged();
      } else {
        faceDetectionConfigBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     * <pre>
     * Config for FACE_DETECTION.
     * </pre>
     *
     * <code>.google.cloud.videointelligence.v1beta2.FaceDetectionConfig face_detection_config = 5;</code>
     */
    public Builder setFaceDetectionConfig(
        com.google.cloud.videointelligence.v1beta2.FaceDetectionConfig.Builder builderForValue) {
      if (faceDetectionConfigBuilder_ == null) {
        faceDetectionConfig_ = builderForValue.build();
        onChanged();
      } else {
        faceDetectionConfigBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     * <pre>
     * Config for FACE_DETECTION.
     * </pre>
     *
     * <code>.google.cloud.videointelligence.v1beta2.FaceDetectionConfig face_detection_config = 5;</code>
     */
    public Builder mergeFaceDetectionConfig(com.google.cloud.videointelligence.v1beta2.FaceDetectionConfig value) {
      if (faceDetectionConfigBuilder_ == null) {
        if (faceDetectionConfig_ != null) {
          faceDetectionConfig_ =
            com.google.cloud.videointelligence.v1beta2.FaceDetectionConfig.newBuilder(faceDetectionConfig_).mergeFrom(value).buildPartial();
        } else {
          faceDetectionConfig_ = value;
        }
        onChanged();
      } else {
        faceDetectionConfigBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     * <pre>
     * Config for FACE_DETECTION.
     * </pre>
     *
     * <code>.google.cloud.videointelligence.v1beta2.FaceDetectionConfig face_detection_config = 5;</code>
     */
    public Builder clearFaceDetectionConfig() {
      if (faceDetectionConfigBuilder_ == null) {
        faceDetectionConfig_ = null;
        onChanged();
      } else {
        faceDetectionConfig_ = null;
        faceDetectionConfigBuilder_ = null;
      }

      return this;
    }
    /**
     * <pre>
     * Config for FACE_DETECTION.
     * </pre>
     *
     * <code>.google.cloud.videointelligence.v1beta2.FaceDetectionConfig face_detection_config = 5;</code>
     */
    public com.google.cloud.videointelligence.v1beta2.FaceDetectionConfig.Builder getFaceDetectionConfigBuilder() {
      
      onChanged();
      return getFaceDetectionConfigFieldBuilder().getBuilder();
    }
    /**
     * <pre>
     * Config for FACE_DETECTION.
     * </pre>
     *
     * <code>.google.cloud.videointelligence.v1beta2.FaceDetectionConfig face_detection_config = 5;</code>
     */
    public com.google.cloud.videointelligence.v1beta2.FaceDetectionConfigOrBuilder getFaceDetectionConfigOrBuilder() {
      if (faceDetectionConfigBuilder_ != null) {
        return faceDetectionConfigBuilder_.getMessageOrBuilder();
      } else {
        return faceDetectionConfig_ == null ?
            com.google.cloud.videointelligence.v1beta2.FaceDetectionConfig.getDefaultInstance() : faceDetectionConfig_;
      }
    }
    /**
     * <pre>
     * Config for FACE_DETECTION.
     * </pre>
     *
     * <code>.google.cloud.videointelligence.v1beta2.FaceDetectionConfig face_detection_config = 5;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.cloud.videointelligence.v1beta2.FaceDetectionConfig, com.google.cloud.videointelligence.v1beta2.FaceDetectionConfig.Builder, com.google.cloud.videointelligence.v1beta2.FaceDetectionConfigOrBuilder> 
        getFaceDetectionConfigFieldBuilder() {
      if (faceDetectionConfigBuilder_ == null) {
        faceDetectionConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.videointelligence.v1beta2.FaceDetectionConfig, com.google.cloud.videointelligence.v1beta2.FaceDetectionConfig.Builder, com.google.cloud.videointelligence.v1beta2.FaceDetectionConfigOrBuilder>(
                getFaceDetectionConfig(),
                getParentForChildren(),
                isClean());
        faceDetectionConfig_ = null;
      }
      return faceDetectionConfigBuilder_;
    }
    @java.lang.Override
    public final Builder setUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFieldsProto3(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.videointelligence.v1beta2.VideoContext)
  }

  // @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1beta2.VideoContext)
  private static final com.google.cloud.videointelligence.v1beta2.VideoContext DEFAULT_INSTANCE;
  static {
    DEFAULT_INSTANCE = new com.google.cloud.videointelligence.v1beta2.VideoContext();
  }

  public static com.google.cloud.videointelligence.v1beta2.VideoContext getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<VideoContext>
      PARSER = new com.google.protobuf.AbstractParser<VideoContext>() {
    @java.lang.Override
    public VideoContext parsePartialFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return new VideoContext(input, extensionRegistry);
    }
  };

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

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

  @java.lang.Override
  public com.google.cloud.videointelligence.v1beta2.VideoContext getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }

}

