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

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

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

  private AdStitchDetail() {
    adBreakId_ = "";
    adId_ = "";
    skipReason_ = "";
  }

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

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

  @SuppressWarnings({"rawtypes"})
  @java.lang.Override
  protected com.google.protobuf.MapField internalGetMapField(int number) {
    switch (number) {
      case 5:
        return internalGetMedia();
      default:
        throw new RuntimeException("Invalid map field number: " + number);
    }
  }

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

  public static final int AD_BREAK_ID_FIELD_NUMBER = 1;

  @SuppressWarnings("serial")
  private volatile java.lang.Object adBreakId_ = "";
  /**
   *
   *
   * <pre>
   * Required. The ad break ID of the processed ad.
   * </pre>
   *
   * <code>string ad_break_id = 1 [(.google.api.field_behavior) = REQUIRED];</code>
   *
   * @return The adBreakId.
   */
  @java.lang.Override
  public java.lang.String getAdBreakId() {
    java.lang.Object ref = adBreakId_;
    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();
      adBreakId_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Required. The ad break ID of the processed ad.
   * </pre>
   *
   * <code>string ad_break_id = 1 [(.google.api.field_behavior) = REQUIRED];</code>
   *
   * @return The bytes for adBreakId.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getAdBreakIdBytes() {
    java.lang.Object ref = adBreakId_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      adBreakId_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int AD_ID_FIELD_NUMBER = 2;

  @SuppressWarnings("serial")
  private volatile java.lang.Object adId_ = "";
  /**
   *
   *
   * <pre>
   * Required. The ad ID of the processed ad.
   * </pre>
   *
   * <code>string ad_id = 2 [(.google.api.field_behavior) = REQUIRED];</code>
   *
   * @return The adId.
   */
  @java.lang.Override
  public java.lang.String getAdId() {
    java.lang.Object ref = adId_;
    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();
      adId_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Required. The ad ID of the processed ad.
   * </pre>
   *
   * <code>string ad_id = 2 [(.google.api.field_behavior) = REQUIRED];</code>
   *
   * @return The bytes for adId.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getAdIdBytes() {
    java.lang.Object ref = adId_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      adId_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int AD_TIME_OFFSET_FIELD_NUMBER = 3;
  private com.google.protobuf.Duration adTimeOffset_;
  /**
   *
   *
   * <pre>
   * Required. The time offset of the processed ad.
   * </pre>
   *
   * <code>.google.protobuf.Duration ad_time_offset = 3 [(.google.api.field_behavior) = REQUIRED];
   * </code>
   *
   * @return Whether the adTimeOffset field is set.
   */
  @java.lang.Override
  public boolean hasAdTimeOffset() {
    return adTimeOffset_ != null;
  }
  /**
   *
   *
   * <pre>
   * Required. The time offset of the processed ad.
   * </pre>
   *
   * <code>.google.protobuf.Duration ad_time_offset = 3 [(.google.api.field_behavior) = REQUIRED];
   * </code>
   *
   * @return The adTimeOffset.
   */
  @java.lang.Override
  public com.google.protobuf.Duration getAdTimeOffset() {
    return adTimeOffset_ == null
        ? com.google.protobuf.Duration.getDefaultInstance()
        : adTimeOffset_;
  }
  /**
   *
   *
   * <pre>
   * Required. The time offset of the processed ad.
   * </pre>
   *
   * <code>.google.protobuf.Duration ad_time_offset = 3 [(.google.api.field_behavior) = REQUIRED];
   * </code>
   */
  @java.lang.Override
  public com.google.protobuf.DurationOrBuilder getAdTimeOffsetOrBuilder() {
    return adTimeOffset_ == null
        ? com.google.protobuf.Duration.getDefaultInstance()
        : adTimeOffset_;
  }

  public static final int SKIP_REASON_FIELD_NUMBER = 4;

  @SuppressWarnings("serial")
  private volatile java.lang.Object skipReason_ = "";
  /**
   *
   *
   * <pre>
   * Optional. Indicates the reason why the ad has been skipped.
   * </pre>
   *
   * <code>string skip_reason = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
   *
   * @return The skipReason.
   */
  @java.lang.Override
  public java.lang.String getSkipReason() {
    java.lang.Object ref = skipReason_;
    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();
      skipReason_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Optional. Indicates the reason why the ad has been skipped.
   * </pre>
   *
   * <code>string skip_reason = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
   *
   * @return The bytes for skipReason.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getSkipReasonBytes() {
    java.lang.Object ref = skipReason_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      skipReason_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int MEDIA_FIELD_NUMBER = 5;

  private static final class MediaDefaultEntryHolder {
    static final com.google.protobuf.MapEntry<java.lang.String, com.google.protobuf.Value>
        defaultEntry =
            com.google.protobuf.MapEntry
                .<java.lang.String, com.google.protobuf.Value>newDefaultInstance(
                    com.google.cloud.video.stitcher.v1.StitchDetailsProto
                        .internal_static_google_cloud_video_stitcher_v1_AdStitchDetail_MediaEntry_descriptor,
                    com.google.protobuf.WireFormat.FieldType.STRING,
                    "",
                    com.google.protobuf.WireFormat.FieldType.MESSAGE,
                    com.google.protobuf.Value.getDefaultInstance());
  }

  @SuppressWarnings("serial")
  private com.google.protobuf.MapField<java.lang.String, com.google.protobuf.Value> media_;

  private com.google.protobuf.MapField<java.lang.String, com.google.protobuf.Value>
      internalGetMedia() {
    if (media_ == null) {
      return com.google.protobuf.MapField.emptyMapField(MediaDefaultEntryHolder.defaultEntry);
    }
    return media_;
  }

  public int getMediaCount() {
    return internalGetMedia().getMap().size();
  }
  /**
   *
   *
   * <pre>
   * Optional. The metadata of the chosen media file for the ad.
   * </pre>
   *
   * <code>
   * map&lt;string, .google.protobuf.Value&gt; media = 5 [(.google.api.field_behavior) = OPTIONAL];
   * </code>
   */
  @java.lang.Override
  public boolean containsMedia(java.lang.String key) {
    if (key == null) {
      throw new NullPointerException("map key");
    }
    return internalGetMedia().getMap().containsKey(key);
  }
  /** Use {@link #getMediaMap()} instead. */
  @java.lang.Override
  @java.lang.Deprecated
  public java.util.Map<java.lang.String, com.google.protobuf.Value> getMedia() {
    return getMediaMap();
  }
  /**
   *
   *
   * <pre>
   * Optional. The metadata of the chosen media file for the ad.
   * </pre>
   *
   * <code>
   * map&lt;string, .google.protobuf.Value&gt; media = 5 [(.google.api.field_behavior) = OPTIONAL];
   * </code>
   */
  @java.lang.Override
  public java.util.Map<java.lang.String, com.google.protobuf.Value> getMediaMap() {
    return internalGetMedia().getMap();
  }
  /**
   *
   *
   * <pre>
   * Optional. The metadata of the chosen media file for the ad.
   * </pre>
   *
   * <code>
   * map&lt;string, .google.protobuf.Value&gt; media = 5 [(.google.api.field_behavior) = OPTIONAL];
   * </code>
   */
  @java.lang.Override
  public /* nullable */ com.google.protobuf.Value getMediaOrDefault(
      java.lang.String key,
      /* nullable */
      com.google.protobuf.Value defaultValue) {
    if (key == null) {
      throw new NullPointerException("map key");
    }
    java.util.Map<java.lang.String, com.google.protobuf.Value> map = internalGetMedia().getMap();
    return map.containsKey(key) ? map.get(key) : defaultValue;
  }
  /**
   *
   *
   * <pre>
   * Optional. The metadata of the chosen media file for the ad.
   * </pre>
   *
   * <code>
   * map&lt;string, .google.protobuf.Value&gt; media = 5 [(.google.api.field_behavior) = OPTIONAL];
   * </code>
   */
  @java.lang.Override
  public com.google.protobuf.Value getMediaOrThrow(java.lang.String key) {
    if (key == null) {
      throw new NullPointerException("map key");
    }
    java.util.Map<java.lang.String, com.google.protobuf.Value> map = internalGetMedia().getMap();
    if (!map.containsKey(key)) {
      throw new java.lang.IllegalArgumentException();
    }
    return map.get(key);
  }

  private byte memoizedIsInitialized = -1;

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

    memoizedIsInitialized = 1;
    return true;
  }

  @java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(adBreakId_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, adBreakId_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(adId_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, adId_);
    }
    if (adTimeOffset_ != null) {
      output.writeMessage(3, getAdTimeOffset());
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(skipReason_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 4, skipReason_);
    }
    com.google.protobuf.GeneratedMessageV3.serializeStringMapTo(
        output, internalGetMedia(), MediaDefaultEntryHolder.defaultEntry, 5);
    getUnknownFields().writeTo(output);
  }

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

    size = 0;
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(adBreakId_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, adBreakId_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(adId_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, adId_);
    }
    if (adTimeOffset_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getAdTimeOffset());
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(skipReason_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, skipReason_);
    }
    for (java.util.Map.Entry<java.lang.String, com.google.protobuf.Value> entry :
        internalGetMedia().getMap().entrySet()) {
      com.google.protobuf.MapEntry<java.lang.String, com.google.protobuf.Value> media__ =
          MediaDefaultEntryHolder.defaultEntry
              .newBuilderForType()
              .setKey(entry.getKey())
              .setValue(entry.getValue())
              .build();
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, media__);
    }
    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.AdStitchDetail)) {
      return super.equals(obj);
    }
    com.google.cloud.video.stitcher.v1.AdStitchDetail other =
        (com.google.cloud.video.stitcher.v1.AdStitchDetail) obj;

    if (!getAdBreakId().equals(other.getAdBreakId())) return false;
    if (!getAdId().equals(other.getAdId())) return false;
    if (hasAdTimeOffset() != other.hasAdTimeOffset()) return false;
    if (hasAdTimeOffset()) {
      if (!getAdTimeOffset().equals(other.getAdTimeOffset())) return false;
    }
    if (!getSkipReason().equals(other.getSkipReason())) return false;
    if (!internalGetMedia().equals(other.internalGetMedia())) 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) + AD_BREAK_ID_FIELD_NUMBER;
    hash = (53 * hash) + getAdBreakId().hashCode();
    hash = (37 * hash) + AD_ID_FIELD_NUMBER;
    hash = (53 * hash) + getAdId().hashCode();
    if (hasAdTimeOffset()) {
      hash = (37 * hash) + AD_TIME_OFFSET_FIELD_NUMBER;
      hash = (53 * hash) + getAdTimeOffset().hashCode();
    }
    hash = (37 * hash) + SKIP_REASON_FIELD_NUMBER;
    hash = (53 * hash) + getSkipReason().hashCode();
    if (!internalGetMedia().getMap().isEmpty()) {
      hash = (37 * hash) + MEDIA_FIELD_NUMBER;
      hash = (53 * hash) + internalGetMedia().hashCode();
    }
    hash = (29 * hash) + getUnknownFields().hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

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

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

  public static com.google.cloud.video.stitcher.v1.AdStitchDetail 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.AdStitchDetail 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.AdStitchDetail 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.AdStitchDetail 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.AdStitchDetail 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.AdStitchDetail 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.AdStitchDetail 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.AdStitchDetail prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }

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

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

    @SuppressWarnings({"rawtypes"})
    protected com.google.protobuf.MapField internalGetMapField(int number) {
      switch (number) {
        case 5:
          return internalGetMedia();
        default:
          throw new RuntimeException("Invalid map field number: " + number);
      }
    }

    @SuppressWarnings({"rawtypes"})
    protected com.google.protobuf.MapField internalGetMutableMapField(int number) {
      switch (number) {
        case 5:
          return internalGetMutableMedia();
        default:
          throw new RuntimeException("Invalid map field number: " + number);
      }
    }

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

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

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

    @java.lang.Override
    public Builder clear() {
      super.clear();
      bitField0_ = 0;
      adBreakId_ = "";
      adId_ = "";
      adTimeOffset_ = null;
      if (adTimeOffsetBuilder_ != null) {
        adTimeOffsetBuilder_.dispose();
        adTimeOffsetBuilder_ = null;
      }
      skipReason_ = "";
      internalGetMutableMedia().clear();
      return this;
    }

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

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

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

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

    private void buildPartial0(com.google.cloud.video.stitcher.v1.AdStitchDetail result) {
      int from_bitField0_ = bitField0_;
      if (((from_bitField0_ & 0x00000001) != 0)) {
        result.adBreakId_ = adBreakId_;
      }
      if (((from_bitField0_ & 0x00000002) != 0)) {
        result.adId_ = adId_;
      }
      if (((from_bitField0_ & 0x00000004) != 0)) {
        result.adTimeOffset_ =
            adTimeOffsetBuilder_ == null ? adTimeOffset_ : adTimeOffsetBuilder_.build();
      }
      if (((from_bitField0_ & 0x00000008) != 0)) {
        result.skipReason_ = skipReason_;
      }
      if (((from_bitField0_ & 0x00000010) != 0)) {
        result.media_ = internalGetMedia();
        result.media_.makeImmutable();
      }
    }

    @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.AdStitchDetail) {
        return mergeFrom((com.google.cloud.video.stitcher.v1.AdStitchDetail) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.video.stitcher.v1.AdStitchDetail other) {
      if (other == com.google.cloud.video.stitcher.v1.AdStitchDetail.getDefaultInstance())
        return this;
      if (!other.getAdBreakId().isEmpty()) {
        adBreakId_ = other.adBreakId_;
        bitField0_ |= 0x00000001;
        onChanged();
      }
      if (!other.getAdId().isEmpty()) {
        adId_ = other.adId_;
        bitField0_ |= 0x00000002;
        onChanged();
      }
      if (other.hasAdTimeOffset()) {
        mergeAdTimeOffset(other.getAdTimeOffset());
      }
      if (!other.getSkipReason().isEmpty()) {
        skipReason_ = other.skipReason_;
        bitField0_ |= 0x00000008;
        onChanged();
      }
      internalGetMutableMedia().mergeFrom(other.internalGetMedia());
      bitField0_ |= 0x00000010;
      this.mergeUnknownFields(other.getUnknownFields());
      onChanged();
      return this;
    }

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

    @java.lang.Override
    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      if (extensionRegistry == null) {
        throw new java.lang.NullPointerException();
      }
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            case 10:
              {
                adBreakId_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000001;
                break;
              } // case 10
            case 18:
              {
                adId_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000002;
                break;
              } // case 18
            case 26:
              {
                input.readMessage(getAdTimeOffsetFieldBuilder().getBuilder(), extensionRegistry);
                bitField0_ |= 0x00000004;
                break;
              } // case 26
            case 34:
              {
                skipReason_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000008;
                break;
              } // case 34
            case 42:
              {
                com.google.protobuf.MapEntry<java.lang.String, com.google.protobuf.Value> media__ =
                    input.readMessage(
                        MediaDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry);
                internalGetMutableMedia().getMutableMap().put(media__.getKey(), media__.getValue());
                bitField0_ |= 0x00000010;
                break;
              } // case 42
            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 java.lang.Object adBreakId_ = "";
    /**
     *
     *
     * <pre>
     * Required. The ad break ID of the processed ad.
     * </pre>
     *
     * <code>string ad_break_id = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @return The adBreakId.
     */
    public java.lang.String getAdBreakId() {
      java.lang.Object ref = adBreakId_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        adBreakId_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. The ad break ID of the processed ad.
     * </pre>
     *
     * <code>string ad_break_id = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @return The bytes for adBreakId.
     */
    public com.google.protobuf.ByteString getAdBreakIdBytes() {
      java.lang.Object ref = adBreakId_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        adBreakId_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. The ad break ID of the processed ad.
     * </pre>
     *
     * <code>string ad_break_id = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @param value The adBreakId to set.
     * @return This builder for chaining.
     */
    public Builder setAdBreakId(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      adBreakId_ = value;
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The ad break ID of the processed ad.
     * </pre>
     *
     * <code>string ad_break_id = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearAdBreakId() {
      adBreakId_ = getDefaultInstance().getAdBreakId();
      bitField0_ = (bitField0_ & ~0x00000001);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The ad break ID of the processed ad.
     * </pre>
     *
     * <code>string ad_break_id = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @param value The bytes for adBreakId to set.
     * @return This builder for chaining.
     */
    public Builder setAdBreakIdBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      adBreakId_ = value;
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }

    private java.lang.Object adId_ = "";
    /**
     *
     *
     * <pre>
     * Required. The ad ID of the processed ad.
     * </pre>
     *
     * <code>string ad_id = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @return The adId.
     */
    public java.lang.String getAdId() {
      java.lang.Object ref = adId_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        adId_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. The ad ID of the processed ad.
     * </pre>
     *
     * <code>string ad_id = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @return The bytes for adId.
     */
    public com.google.protobuf.ByteString getAdIdBytes() {
      java.lang.Object ref = adId_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        adId_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. The ad ID of the processed ad.
     * </pre>
     *
     * <code>string ad_id = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @param value The adId to set.
     * @return This builder for chaining.
     */
    public Builder setAdId(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      adId_ = value;
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The ad ID of the processed ad.
     * </pre>
     *
     * <code>string ad_id = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearAdId() {
      adId_ = getDefaultInstance().getAdId();
      bitField0_ = (bitField0_ & ~0x00000002);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The ad ID of the processed ad.
     * </pre>
     *
     * <code>string ad_id = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @param value The bytes for adId to set.
     * @return This builder for chaining.
     */
    public Builder setAdIdBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      adId_ = value;
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }

    private com.google.protobuf.Duration adTimeOffset_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Duration,
            com.google.protobuf.Duration.Builder,
            com.google.protobuf.DurationOrBuilder>
        adTimeOffsetBuilder_;
    /**
     *
     *
     * <pre>
     * Required. The time offset of the processed ad.
     * </pre>
     *
     * <code>.google.protobuf.Duration ad_time_offset = 3 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     *
     * @return Whether the adTimeOffset field is set.
     */
    public boolean hasAdTimeOffset() {
      return ((bitField0_ & 0x00000004) != 0);
    }
    /**
     *
     *
     * <pre>
     * Required. The time offset of the processed ad.
     * </pre>
     *
     * <code>.google.protobuf.Duration ad_time_offset = 3 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     *
     * @return The adTimeOffset.
     */
    public com.google.protobuf.Duration getAdTimeOffset() {
      if (adTimeOffsetBuilder_ == null) {
        return adTimeOffset_ == null
            ? com.google.protobuf.Duration.getDefaultInstance()
            : adTimeOffset_;
      } else {
        return adTimeOffsetBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Required. The time offset of the processed ad.
     * </pre>
     *
     * <code>.google.protobuf.Duration ad_time_offset = 3 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public Builder setAdTimeOffset(com.google.protobuf.Duration value) {
      if (adTimeOffsetBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        adTimeOffset_ = value;
      } else {
        adTimeOffsetBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The time offset of the processed ad.
     * </pre>
     *
     * <code>.google.protobuf.Duration ad_time_offset = 3 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public Builder setAdTimeOffset(com.google.protobuf.Duration.Builder builderForValue) {
      if (adTimeOffsetBuilder_ == null) {
        adTimeOffset_ = builderForValue.build();
      } else {
        adTimeOffsetBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The time offset of the processed ad.
     * </pre>
     *
     * <code>.google.protobuf.Duration ad_time_offset = 3 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public Builder mergeAdTimeOffset(com.google.protobuf.Duration value) {
      if (adTimeOffsetBuilder_ == null) {
        if (((bitField0_ & 0x00000004) != 0)
            && adTimeOffset_ != null
            && adTimeOffset_ != com.google.protobuf.Duration.getDefaultInstance()) {
          getAdTimeOffsetBuilder().mergeFrom(value);
        } else {
          adTimeOffset_ = value;
        }
      } else {
        adTimeOffsetBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The time offset of the processed ad.
     * </pre>
     *
     * <code>.google.protobuf.Duration ad_time_offset = 3 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public Builder clearAdTimeOffset() {
      bitField0_ = (bitField0_ & ~0x00000004);
      adTimeOffset_ = null;
      if (adTimeOffsetBuilder_ != null) {
        adTimeOffsetBuilder_.dispose();
        adTimeOffsetBuilder_ = null;
      }
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The time offset of the processed ad.
     * </pre>
     *
     * <code>.google.protobuf.Duration ad_time_offset = 3 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public com.google.protobuf.Duration.Builder getAdTimeOffsetBuilder() {
      bitField0_ |= 0x00000004;
      onChanged();
      return getAdTimeOffsetFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Required. The time offset of the processed ad.
     * </pre>
     *
     * <code>.google.protobuf.Duration ad_time_offset = 3 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public com.google.protobuf.DurationOrBuilder getAdTimeOffsetOrBuilder() {
      if (adTimeOffsetBuilder_ != null) {
        return adTimeOffsetBuilder_.getMessageOrBuilder();
      } else {
        return adTimeOffset_ == null
            ? com.google.protobuf.Duration.getDefaultInstance()
            : adTimeOffset_;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. The time offset of the processed ad.
     * </pre>
     *
     * <code>.google.protobuf.Duration ad_time_offset = 3 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Duration,
            com.google.protobuf.Duration.Builder,
            com.google.protobuf.DurationOrBuilder>
        getAdTimeOffsetFieldBuilder() {
      if (adTimeOffsetBuilder_ == null) {
        adTimeOffsetBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.protobuf.Duration,
                com.google.protobuf.Duration.Builder,
                com.google.protobuf.DurationOrBuilder>(
                getAdTimeOffset(), getParentForChildren(), isClean());
        adTimeOffset_ = null;
      }
      return adTimeOffsetBuilder_;
    }

    private java.lang.Object skipReason_ = "";
    /**
     *
     *
     * <pre>
     * Optional. Indicates the reason why the ad has been skipped.
     * </pre>
     *
     * <code>string skip_reason = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The skipReason.
     */
    public java.lang.String getSkipReason() {
      java.lang.Object ref = skipReason_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        skipReason_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Optional. Indicates the reason why the ad has been skipped.
     * </pre>
     *
     * <code>string skip_reason = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The bytes for skipReason.
     */
    public com.google.protobuf.ByteString getSkipReasonBytes() {
      java.lang.Object ref = skipReason_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        skipReason_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Optional. Indicates the reason why the ad has been skipped.
     * </pre>
     *
     * <code>string skip_reason = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @param value The skipReason to set.
     * @return This builder for chaining.
     */
    public Builder setSkipReason(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      skipReason_ = value;
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. Indicates the reason why the ad has been skipped.
     * </pre>
     *
     * <code>string skip_reason = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearSkipReason() {
      skipReason_ = getDefaultInstance().getSkipReason();
      bitField0_ = (bitField0_ & ~0x00000008);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. Indicates the reason why the ad has been skipped.
     * </pre>
     *
     * <code>string skip_reason = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @param value The bytes for skipReason to set.
     * @return This builder for chaining.
     */
    public Builder setSkipReasonBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      skipReason_ = value;
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }

    private com.google.protobuf.MapField<java.lang.String, com.google.protobuf.Value> media_;

    private com.google.protobuf.MapField<java.lang.String, com.google.protobuf.Value>
        internalGetMedia() {
      if (media_ == null) {
        return com.google.protobuf.MapField.emptyMapField(MediaDefaultEntryHolder.defaultEntry);
      }
      return media_;
    }

    private com.google.protobuf.MapField<java.lang.String, com.google.protobuf.Value>
        internalGetMutableMedia() {
      if (media_ == null) {
        media_ = com.google.protobuf.MapField.newMapField(MediaDefaultEntryHolder.defaultEntry);
      }
      if (!media_.isMutable()) {
        media_ = media_.copy();
      }
      bitField0_ |= 0x00000010;
      onChanged();
      return media_;
    }

    public int getMediaCount() {
      return internalGetMedia().getMap().size();
    }
    /**
     *
     *
     * <pre>
     * Optional. The metadata of the chosen media file for the ad.
     * </pre>
     *
     * <code>
     * map&lt;string, .google.protobuf.Value&gt; media = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    @java.lang.Override
    public boolean containsMedia(java.lang.String key) {
      if (key == null) {
        throw new NullPointerException("map key");
      }
      return internalGetMedia().getMap().containsKey(key);
    }
    /** Use {@link #getMediaMap()} instead. */
    @java.lang.Override
    @java.lang.Deprecated
    public java.util.Map<java.lang.String, com.google.protobuf.Value> getMedia() {
      return getMediaMap();
    }
    /**
     *
     *
     * <pre>
     * Optional. The metadata of the chosen media file for the ad.
     * </pre>
     *
     * <code>
     * map&lt;string, .google.protobuf.Value&gt; media = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    @java.lang.Override
    public java.util.Map<java.lang.String, com.google.protobuf.Value> getMediaMap() {
      return internalGetMedia().getMap();
    }
    /**
     *
     *
     * <pre>
     * Optional. The metadata of the chosen media file for the ad.
     * </pre>
     *
     * <code>
     * map&lt;string, .google.protobuf.Value&gt; media = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    @java.lang.Override
    public /* nullable */ com.google.protobuf.Value getMediaOrDefault(
        java.lang.String key,
        /* nullable */
        com.google.protobuf.Value defaultValue) {
      if (key == null) {
        throw new NullPointerException("map key");
      }
      java.util.Map<java.lang.String, com.google.protobuf.Value> map = internalGetMedia().getMap();
      return map.containsKey(key) ? map.get(key) : defaultValue;
    }
    /**
     *
     *
     * <pre>
     * Optional. The metadata of the chosen media file for the ad.
     * </pre>
     *
     * <code>
     * map&lt;string, .google.protobuf.Value&gt; media = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    @java.lang.Override
    public com.google.protobuf.Value getMediaOrThrow(java.lang.String key) {
      if (key == null) {
        throw new NullPointerException("map key");
      }
      java.util.Map<java.lang.String, com.google.protobuf.Value> map = internalGetMedia().getMap();
      if (!map.containsKey(key)) {
        throw new java.lang.IllegalArgumentException();
      }
      return map.get(key);
    }

    public Builder clearMedia() {
      bitField0_ = (bitField0_ & ~0x00000010);
      internalGetMutableMedia().getMutableMap().clear();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. The metadata of the chosen media file for the ad.
     * </pre>
     *
     * <code>
     * map&lt;string, .google.protobuf.Value&gt; media = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public Builder removeMedia(java.lang.String key) {
      if (key == null) {
        throw new NullPointerException("map key");
      }
      internalGetMutableMedia().getMutableMap().remove(key);
      return this;
    }
    /** Use alternate mutation accessors instead. */
    @java.lang.Deprecated
    public java.util.Map<java.lang.String, com.google.protobuf.Value> getMutableMedia() {
      bitField0_ |= 0x00000010;
      return internalGetMutableMedia().getMutableMap();
    }
    /**
     *
     *
     * <pre>
     * Optional. The metadata of the chosen media file for the ad.
     * </pre>
     *
     * <code>
     * map&lt;string, .google.protobuf.Value&gt; media = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public Builder putMedia(java.lang.String key, com.google.protobuf.Value value) {
      if (key == null) {
        throw new NullPointerException("map key");
      }
      if (value == null) {
        throw new NullPointerException("map value");
      }
      internalGetMutableMedia().getMutableMap().put(key, value);
      bitField0_ |= 0x00000010;
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. The metadata of the chosen media file for the ad.
     * </pre>
     *
     * <code>
     * map&lt;string, .google.protobuf.Value&gt; media = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public Builder putAllMedia(java.util.Map<java.lang.String, com.google.protobuf.Value> values) {
      internalGetMutableMedia().getMutableMap().putAll(values);
      bitField0_ |= 0x00000010;
      return this;
    }

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

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

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

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

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

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

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