/*
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/cloud/video/stitcher/v1/sessions.proto

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

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

  private ManifestOptions() {
    includeRenditions_ = java.util.Collections.emptyList();
    bitrateOrder_ = 0;
  }

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

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

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

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

  /**
   *
   *
   * <pre>
   * Defines the ordering policy during manifest generation.
   * </pre>
   *
   * Protobuf enum {@code google.cloud.video.stitcher.v1.ManifestOptions.OrderPolicy}
   */
  public enum OrderPolicy implements com.google.protobuf.ProtocolMessageEnum {
    /**
     *
     *
     * <pre>
     * Ordering policy is not specified.
     * </pre>
     *
     * <code>ORDER_POLICY_UNSPECIFIED = 0;</code>
     */
    ORDER_POLICY_UNSPECIFIED(0),
    /**
     *
     *
     * <pre>
     * Order by ascending.
     * </pre>
     *
     * <code>ASCENDING = 1;</code>
     */
    ASCENDING(1),
    /**
     *
     *
     * <pre>
     * Order by descending.
     * </pre>
     *
     * <code>DESCENDING = 2;</code>
     */
    DESCENDING(2),
    UNRECOGNIZED(-1),
    ;

    /**
     *
     *
     * <pre>
     * Ordering policy is not specified.
     * </pre>
     *
     * <code>ORDER_POLICY_UNSPECIFIED = 0;</code>
     */
    public static final int ORDER_POLICY_UNSPECIFIED_VALUE = 0;
    /**
     *
     *
     * <pre>
     * Order by ascending.
     * </pre>
     *
     * <code>ASCENDING = 1;</code>
     */
    public static final int ASCENDING_VALUE = 1;
    /**
     *
     *
     * <pre>
     * Order by descending.
     * </pre>
     *
     * <code>DESCENDING = 2;</code>
     */
    public static final int DESCENDING_VALUE = 2;

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

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

    /**
     * @param value The numeric wire value of the corresponding enum entry.
     * @return The enum associated with the given numeric wire value.
     */
    public static OrderPolicy forNumber(int value) {
      switch (value) {
        case 0:
          return ORDER_POLICY_UNSPECIFIED;
        case 1:
          return ASCENDING;
        case 2:
          return DESCENDING;
        default:
          return null;
      }
    }

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

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

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

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

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

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

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

    private final int value;

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

    // @@protoc_insertion_point(enum_scope:google.cloud.video.stitcher.v1.ManifestOptions.OrderPolicy)
  }

  public static final int INCLUDE_RENDITIONS_FIELD_NUMBER = 1;

  @SuppressWarnings("serial")
  private java.util.List<com.google.cloud.video.stitcher.v1.RenditionFilter> includeRenditions_;
  /**
   *
   *
   * <pre>
   * If specified, the output manifest will only return renditions matching the
   * specified filters.
   * </pre>
   *
   * <code>repeated .google.cloud.video.stitcher.v1.RenditionFilter include_renditions = 1;</code>
   */
  @java.lang.Override
  public java.util.List<com.google.cloud.video.stitcher.v1.RenditionFilter>
      getIncludeRenditionsList() {
    return includeRenditions_;
  }
  /**
   *
   *
   * <pre>
   * If specified, the output manifest will only return renditions matching the
   * specified filters.
   * </pre>
   *
   * <code>repeated .google.cloud.video.stitcher.v1.RenditionFilter include_renditions = 1;</code>
   */
  @java.lang.Override
  public java.util.List<? extends com.google.cloud.video.stitcher.v1.RenditionFilterOrBuilder>
      getIncludeRenditionsOrBuilderList() {
    return includeRenditions_;
  }
  /**
   *
   *
   * <pre>
   * If specified, the output manifest will only return renditions matching the
   * specified filters.
   * </pre>
   *
   * <code>repeated .google.cloud.video.stitcher.v1.RenditionFilter include_renditions = 1;</code>
   */
  @java.lang.Override
  public int getIncludeRenditionsCount() {
    return includeRenditions_.size();
  }
  /**
   *
   *
   * <pre>
   * If specified, the output manifest will only return renditions matching the
   * specified filters.
   * </pre>
   *
   * <code>repeated .google.cloud.video.stitcher.v1.RenditionFilter include_renditions = 1;</code>
   */
  @java.lang.Override
  public com.google.cloud.video.stitcher.v1.RenditionFilter getIncludeRenditions(int index) {
    return includeRenditions_.get(index);
  }
  /**
   *
   *
   * <pre>
   * If specified, the output manifest will only return renditions matching the
   * specified filters.
   * </pre>
   *
   * <code>repeated .google.cloud.video.stitcher.v1.RenditionFilter include_renditions = 1;</code>
   */
  @java.lang.Override
  public com.google.cloud.video.stitcher.v1.RenditionFilterOrBuilder getIncludeRenditionsOrBuilder(
      int index) {
    return includeRenditions_.get(index);
  }

  public static final int BITRATE_ORDER_FIELD_NUMBER = 2;
  private int bitrateOrder_ = 0;
  /**
   *
   *
   * <pre>
   * If specified, the output manifest will orders the video and muxed
   * renditions by bitrate according to the ordering policy.
   * </pre>
   *
   * <code>.google.cloud.video.stitcher.v1.ManifestOptions.OrderPolicy bitrate_order = 2;</code>
   *
   * @return The enum numeric value on the wire for bitrateOrder.
   */
  @java.lang.Override
  public int getBitrateOrderValue() {
    return bitrateOrder_;
  }
  /**
   *
   *
   * <pre>
   * If specified, the output manifest will orders the video and muxed
   * renditions by bitrate according to the ordering policy.
   * </pre>
   *
   * <code>.google.cloud.video.stitcher.v1.ManifestOptions.OrderPolicy bitrate_order = 2;</code>
   *
   * @return The bitrateOrder.
   */
  @java.lang.Override
  public com.google.cloud.video.stitcher.v1.ManifestOptions.OrderPolicy getBitrateOrder() {
    com.google.cloud.video.stitcher.v1.ManifestOptions.OrderPolicy result =
        com.google.cloud.video.stitcher.v1.ManifestOptions.OrderPolicy.forNumber(bitrateOrder_);
    return result == null
        ? com.google.cloud.video.stitcher.v1.ManifestOptions.OrderPolicy.UNRECOGNIZED
        : result;
  }

  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 < includeRenditions_.size(); i++) {
      output.writeMessage(1, includeRenditions_.get(i));
    }
    if (bitrateOrder_
        != com.google.cloud.video.stitcher.v1.ManifestOptions.OrderPolicy.ORDER_POLICY_UNSPECIFIED
            .getNumber()) {
      output.writeEnum(2, bitrateOrder_);
    }
    getUnknownFields().writeTo(output);
  }

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

    size = 0;
    for (int i = 0; i < includeRenditions_.size(); i++) {
      size +=
          com.google.protobuf.CodedOutputStream.computeMessageSize(1, includeRenditions_.get(i));
    }
    if (bitrateOrder_
        != com.google.cloud.video.stitcher.v1.ManifestOptions.OrderPolicy.ORDER_POLICY_UNSPECIFIED
            .getNumber()) {
      size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, bitrateOrder_);
    }
    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.ManifestOptions)) {
      return super.equals(obj);
    }
    com.google.cloud.video.stitcher.v1.ManifestOptions other =
        (com.google.cloud.video.stitcher.v1.ManifestOptions) obj;

    if (!getIncludeRenditionsList().equals(other.getIncludeRenditionsList())) return false;
    if (bitrateOrder_ != other.bitrateOrder_) return false;
    if (!getUnknownFields().equals(other.getUnknownFields())) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    if (getIncludeRenditionsCount() > 0) {
      hash = (37 * hash) + INCLUDE_RENDITIONS_FIELD_NUMBER;
      hash = (53 * hash) + getIncludeRenditionsList().hashCode();
    }
    hash = (37 * hash) + BITRATE_ORDER_FIELD_NUMBER;
    hash = (53 * hash) + bitrateOrder_;
    hash = (29 * hash) + getUnknownFields().hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

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

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

  public static com.google.cloud.video.stitcher.v1.ManifestOptions 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.ManifestOptions 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.ManifestOptions 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.ManifestOptions 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.ManifestOptions 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.ManifestOptions 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.ManifestOptions 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.ManifestOptions 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>
   * Options for manifest generation.
   * </pre>
   *
   * Protobuf type {@code google.cloud.video.stitcher.v1.ManifestOptions}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.video.stitcher.v1.ManifestOptions)
      com.google.cloud.video.stitcher.v1.ManifestOptionsOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.video.stitcher.v1.SessionsProto
          .internal_static_google_cloud_video_stitcher_v1_ManifestOptions_descriptor;
    }

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

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

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

    @java.lang.Override
    public Builder clear() {
      super.clear();
      bitField0_ = 0;
      if (includeRenditionsBuilder_ == null) {
        includeRenditions_ = java.util.Collections.emptyList();
      } else {
        includeRenditions_ = null;
        includeRenditionsBuilder_.clear();
      }
      bitField0_ = (bitField0_ & ~0x00000001);
      bitrateOrder_ = 0;
      return this;
    }

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

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

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

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

    private void buildPartialRepeatedFields(
        com.google.cloud.video.stitcher.v1.ManifestOptions result) {
      if (includeRenditionsBuilder_ == null) {
        if (((bitField0_ & 0x00000001) != 0)) {
          includeRenditions_ = java.util.Collections.unmodifiableList(includeRenditions_);
          bitField0_ = (bitField0_ & ~0x00000001);
        }
        result.includeRenditions_ = includeRenditions_;
      } else {
        result.includeRenditions_ = includeRenditionsBuilder_.build();
      }
    }

    private void buildPartial0(com.google.cloud.video.stitcher.v1.ManifestOptions result) {
      int from_bitField0_ = bitField0_;
      if (((from_bitField0_ & 0x00000002) != 0)) {
        result.bitrateOrder_ = bitrateOrder_;
      }
    }

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

    public Builder mergeFrom(com.google.cloud.video.stitcher.v1.ManifestOptions other) {
      if (other == com.google.cloud.video.stitcher.v1.ManifestOptions.getDefaultInstance())
        return this;
      if (includeRenditionsBuilder_ == null) {
        if (!other.includeRenditions_.isEmpty()) {
          if (includeRenditions_.isEmpty()) {
            includeRenditions_ = other.includeRenditions_;
            bitField0_ = (bitField0_ & ~0x00000001);
          } else {
            ensureIncludeRenditionsIsMutable();
            includeRenditions_.addAll(other.includeRenditions_);
          }
          onChanged();
        }
      } else {
        if (!other.includeRenditions_.isEmpty()) {
          if (includeRenditionsBuilder_.isEmpty()) {
            includeRenditionsBuilder_.dispose();
            includeRenditionsBuilder_ = null;
            includeRenditions_ = other.includeRenditions_;
            bitField0_ = (bitField0_ & ~0x00000001);
            includeRenditionsBuilder_ =
                com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
                    ? getIncludeRenditionsFieldBuilder()
                    : null;
          } else {
            includeRenditionsBuilder_.addAllMessages(other.includeRenditions_);
          }
        }
      }
      if (other.bitrateOrder_ != 0) {
        setBitrateOrderValue(other.getBitrateOrderValue());
      }
      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:
              {
                com.google.cloud.video.stitcher.v1.RenditionFilter m =
                    input.readMessage(
                        com.google.cloud.video.stitcher.v1.RenditionFilter.parser(),
                        extensionRegistry);
                if (includeRenditionsBuilder_ == null) {
                  ensureIncludeRenditionsIsMutable();
                  includeRenditions_.add(m);
                } else {
                  includeRenditionsBuilder_.addMessage(m);
                }
                break;
              } // case 10
            case 16:
              {
                bitrateOrder_ = input.readEnum();
                bitField0_ |= 0x00000002;
                break;
              } // case 16
            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.util.List<com.google.cloud.video.stitcher.v1.RenditionFilter> includeRenditions_ =
        java.util.Collections.emptyList();

    private void ensureIncludeRenditionsIsMutable() {
      if (!((bitField0_ & 0x00000001) != 0)) {
        includeRenditions_ =
            new java.util.ArrayList<com.google.cloud.video.stitcher.v1.RenditionFilter>(
                includeRenditions_);
        bitField0_ |= 0x00000001;
      }
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.cloud.video.stitcher.v1.RenditionFilter,
            com.google.cloud.video.stitcher.v1.RenditionFilter.Builder,
            com.google.cloud.video.stitcher.v1.RenditionFilterOrBuilder>
        includeRenditionsBuilder_;

    /**
     *
     *
     * <pre>
     * If specified, the output manifest will only return renditions matching the
     * specified filters.
     * </pre>
     *
     * <code>repeated .google.cloud.video.stitcher.v1.RenditionFilter include_renditions = 1;</code>
     */
    public java.util.List<com.google.cloud.video.stitcher.v1.RenditionFilter>
        getIncludeRenditionsList() {
      if (includeRenditionsBuilder_ == null) {
        return java.util.Collections.unmodifiableList(includeRenditions_);
      } else {
        return includeRenditionsBuilder_.getMessageList();
      }
    }
    /**
     *
     *
     * <pre>
     * If specified, the output manifest will only return renditions matching the
     * specified filters.
     * </pre>
     *
     * <code>repeated .google.cloud.video.stitcher.v1.RenditionFilter include_renditions = 1;</code>
     */
    public int getIncludeRenditionsCount() {
      if (includeRenditionsBuilder_ == null) {
        return includeRenditions_.size();
      } else {
        return includeRenditionsBuilder_.getCount();
      }
    }
    /**
     *
     *
     * <pre>
     * If specified, the output manifest will only return renditions matching the
     * specified filters.
     * </pre>
     *
     * <code>repeated .google.cloud.video.stitcher.v1.RenditionFilter include_renditions = 1;</code>
     */
    public com.google.cloud.video.stitcher.v1.RenditionFilter getIncludeRenditions(int index) {
      if (includeRenditionsBuilder_ == null) {
        return includeRenditions_.get(index);
      } else {
        return includeRenditionsBuilder_.getMessage(index);
      }
    }
    /**
     *
     *
     * <pre>
     * If specified, the output manifest will only return renditions matching the
     * specified filters.
     * </pre>
     *
     * <code>repeated .google.cloud.video.stitcher.v1.RenditionFilter include_renditions = 1;</code>
     */
    public Builder setIncludeRenditions(
        int index, com.google.cloud.video.stitcher.v1.RenditionFilter value) {
      if (includeRenditionsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureIncludeRenditionsIsMutable();
        includeRenditions_.set(index, value);
        onChanged();
      } else {
        includeRenditionsBuilder_.setMessage(index, value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * If specified, the output manifest will only return renditions matching the
     * specified filters.
     * </pre>
     *
     * <code>repeated .google.cloud.video.stitcher.v1.RenditionFilter include_renditions = 1;</code>
     */
    public Builder setIncludeRenditions(
        int index, com.google.cloud.video.stitcher.v1.RenditionFilter.Builder builderForValue) {
      if (includeRenditionsBuilder_ == null) {
        ensureIncludeRenditionsIsMutable();
        includeRenditions_.set(index, builderForValue.build());
        onChanged();
      } else {
        includeRenditionsBuilder_.setMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * If specified, the output manifest will only return renditions matching the
     * specified filters.
     * </pre>
     *
     * <code>repeated .google.cloud.video.stitcher.v1.RenditionFilter include_renditions = 1;</code>
     */
    public Builder addIncludeRenditions(com.google.cloud.video.stitcher.v1.RenditionFilter value) {
      if (includeRenditionsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureIncludeRenditionsIsMutable();
        includeRenditions_.add(value);
        onChanged();
      } else {
        includeRenditionsBuilder_.addMessage(value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * If specified, the output manifest will only return renditions matching the
     * specified filters.
     * </pre>
     *
     * <code>repeated .google.cloud.video.stitcher.v1.RenditionFilter include_renditions = 1;</code>
     */
    public Builder addIncludeRenditions(
        int index, com.google.cloud.video.stitcher.v1.RenditionFilter value) {
      if (includeRenditionsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureIncludeRenditionsIsMutable();
        includeRenditions_.add(index, value);
        onChanged();
      } else {
        includeRenditionsBuilder_.addMessage(index, value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * If specified, the output manifest will only return renditions matching the
     * specified filters.
     * </pre>
     *
     * <code>repeated .google.cloud.video.stitcher.v1.RenditionFilter include_renditions = 1;</code>
     */
    public Builder addIncludeRenditions(
        com.google.cloud.video.stitcher.v1.RenditionFilter.Builder builderForValue) {
      if (includeRenditionsBuilder_ == null) {
        ensureIncludeRenditionsIsMutable();
        includeRenditions_.add(builderForValue.build());
        onChanged();
      } else {
        includeRenditionsBuilder_.addMessage(builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * If specified, the output manifest will only return renditions matching the
     * specified filters.
     * </pre>
     *
     * <code>repeated .google.cloud.video.stitcher.v1.RenditionFilter include_renditions = 1;</code>
     */
    public Builder addIncludeRenditions(
        int index, com.google.cloud.video.stitcher.v1.RenditionFilter.Builder builderForValue) {
      if (includeRenditionsBuilder_ == null) {
        ensureIncludeRenditionsIsMutable();
        includeRenditions_.add(index, builderForValue.build());
        onChanged();
      } else {
        includeRenditionsBuilder_.addMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * If specified, the output manifest will only return renditions matching the
     * specified filters.
     * </pre>
     *
     * <code>repeated .google.cloud.video.stitcher.v1.RenditionFilter include_renditions = 1;</code>
     */
    public Builder addAllIncludeRenditions(
        java.lang.Iterable<? extends com.google.cloud.video.stitcher.v1.RenditionFilter> values) {
      if (includeRenditionsBuilder_ == null) {
        ensureIncludeRenditionsIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(values, includeRenditions_);
        onChanged();
      } else {
        includeRenditionsBuilder_.addAllMessages(values);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * If specified, the output manifest will only return renditions matching the
     * specified filters.
     * </pre>
     *
     * <code>repeated .google.cloud.video.stitcher.v1.RenditionFilter include_renditions = 1;</code>
     */
    public Builder clearIncludeRenditions() {
      if (includeRenditionsBuilder_ == null) {
        includeRenditions_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000001);
        onChanged();
      } else {
        includeRenditionsBuilder_.clear();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * If specified, the output manifest will only return renditions matching the
     * specified filters.
     * </pre>
     *
     * <code>repeated .google.cloud.video.stitcher.v1.RenditionFilter include_renditions = 1;</code>
     */
    public Builder removeIncludeRenditions(int index) {
      if (includeRenditionsBuilder_ == null) {
        ensureIncludeRenditionsIsMutable();
        includeRenditions_.remove(index);
        onChanged();
      } else {
        includeRenditionsBuilder_.remove(index);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * If specified, the output manifest will only return renditions matching the
     * specified filters.
     * </pre>
     *
     * <code>repeated .google.cloud.video.stitcher.v1.RenditionFilter include_renditions = 1;</code>
     */
    public com.google.cloud.video.stitcher.v1.RenditionFilter.Builder getIncludeRenditionsBuilder(
        int index) {
      return getIncludeRenditionsFieldBuilder().getBuilder(index);
    }
    /**
     *
     *
     * <pre>
     * If specified, the output manifest will only return renditions matching the
     * specified filters.
     * </pre>
     *
     * <code>repeated .google.cloud.video.stitcher.v1.RenditionFilter include_renditions = 1;</code>
     */
    public com.google.cloud.video.stitcher.v1.RenditionFilterOrBuilder
        getIncludeRenditionsOrBuilder(int index) {
      if (includeRenditionsBuilder_ == null) {
        return includeRenditions_.get(index);
      } else {
        return includeRenditionsBuilder_.getMessageOrBuilder(index);
      }
    }
    /**
     *
     *
     * <pre>
     * If specified, the output manifest will only return renditions matching the
     * specified filters.
     * </pre>
     *
     * <code>repeated .google.cloud.video.stitcher.v1.RenditionFilter include_renditions = 1;</code>
     */
    public java.util.List<? extends com.google.cloud.video.stitcher.v1.RenditionFilterOrBuilder>
        getIncludeRenditionsOrBuilderList() {
      if (includeRenditionsBuilder_ != null) {
        return includeRenditionsBuilder_.getMessageOrBuilderList();
      } else {
        return java.util.Collections.unmodifiableList(includeRenditions_);
      }
    }
    /**
     *
     *
     * <pre>
     * If specified, the output manifest will only return renditions matching the
     * specified filters.
     * </pre>
     *
     * <code>repeated .google.cloud.video.stitcher.v1.RenditionFilter include_renditions = 1;</code>
     */
    public com.google.cloud.video.stitcher.v1.RenditionFilter.Builder
        addIncludeRenditionsBuilder() {
      return getIncludeRenditionsFieldBuilder()
          .addBuilder(com.google.cloud.video.stitcher.v1.RenditionFilter.getDefaultInstance());
    }
    /**
     *
     *
     * <pre>
     * If specified, the output manifest will only return renditions matching the
     * specified filters.
     * </pre>
     *
     * <code>repeated .google.cloud.video.stitcher.v1.RenditionFilter include_renditions = 1;</code>
     */
    public com.google.cloud.video.stitcher.v1.RenditionFilter.Builder addIncludeRenditionsBuilder(
        int index) {
      return getIncludeRenditionsFieldBuilder()
          .addBuilder(
              index, com.google.cloud.video.stitcher.v1.RenditionFilter.getDefaultInstance());
    }
    /**
     *
     *
     * <pre>
     * If specified, the output manifest will only return renditions matching the
     * specified filters.
     * </pre>
     *
     * <code>repeated .google.cloud.video.stitcher.v1.RenditionFilter include_renditions = 1;</code>
     */
    public java.util.List<com.google.cloud.video.stitcher.v1.RenditionFilter.Builder>
        getIncludeRenditionsBuilderList() {
      return getIncludeRenditionsFieldBuilder().getBuilderList();
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.cloud.video.stitcher.v1.RenditionFilter,
            com.google.cloud.video.stitcher.v1.RenditionFilter.Builder,
            com.google.cloud.video.stitcher.v1.RenditionFilterOrBuilder>
        getIncludeRenditionsFieldBuilder() {
      if (includeRenditionsBuilder_ == null) {
        includeRenditionsBuilder_ =
            new com.google.protobuf.RepeatedFieldBuilderV3<
                com.google.cloud.video.stitcher.v1.RenditionFilter,
                com.google.cloud.video.stitcher.v1.RenditionFilter.Builder,
                com.google.cloud.video.stitcher.v1.RenditionFilterOrBuilder>(
                includeRenditions_,
                ((bitField0_ & 0x00000001) != 0),
                getParentForChildren(),
                isClean());
        includeRenditions_ = null;
      }
      return includeRenditionsBuilder_;
    }

    private int bitrateOrder_ = 0;
    /**
     *
     *
     * <pre>
     * If specified, the output manifest will orders the video and muxed
     * renditions by bitrate according to the ordering policy.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.ManifestOptions.OrderPolicy bitrate_order = 2;</code>
     *
     * @return The enum numeric value on the wire for bitrateOrder.
     */
    @java.lang.Override
    public int getBitrateOrderValue() {
      return bitrateOrder_;
    }
    /**
     *
     *
     * <pre>
     * If specified, the output manifest will orders the video and muxed
     * renditions by bitrate according to the ordering policy.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.ManifestOptions.OrderPolicy bitrate_order = 2;</code>
     *
     * @param value The enum numeric value on the wire for bitrateOrder to set.
     * @return This builder for chaining.
     */
    public Builder setBitrateOrderValue(int value) {
      bitrateOrder_ = value;
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * If specified, the output manifest will orders the video and muxed
     * renditions by bitrate according to the ordering policy.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.ManifestOptions.OrderPolicy bitrate_order = 2;</code>
     *
     * @return The bitrateOrder.
     */
    @java.lang.Override
    public com.google.cloud.video.stitcher.v1.ManifestOptions.OrderPolicy getBitrateOrder() {
      com.google.cloud.video.stitcher.v1.ManifestOptions.OrderPolicy result =
          com.google.cloud.video.stitcher.v1.ManifestOptions.OrderPolicy.forNumber(bitrateOrder_);
      return result == null
          ? com.google.cloud.video.stitcher.v1.ManifestOptions.OrderPolicy.UNRECOGNIZED
          : result;
    }
    /**
     *
     *
     * <pre>
     * If specified, the output manifest will orders the video and muxed
     * renditions by bitrate according to the ordering policy.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.ManifestOptions.OrderPolicy bitrate_order = 2;</code>
     *
     * @param value The bitrateOrder to set.
     * @return This builder for chaining.
     */
    public Builder setBitrateOrder(
        com.google.cloud.video.stitcher.v1.ManifestOptions.OrderPolicy value) {
      if (value == null) {
        throw new NullPointerException();
      }
      bitField0_ |= 0x00000002;
      bitrateOrder_ = value.getNumber();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * If specified, the output manifest will orders the video and muxed
     * renditions by bitrate according to the ordering policy.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.ManifestOptions.OrderPolicy bitrate_order = 2;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearBitrateOrder() {
      bitField0_ = (bitField0_ & ~0x00000002);
      bitrateOrder_ = 0;
      onChanged();
      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.ManifestOptions)
  }

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

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

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

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

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

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