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

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

/**
 *
 *
 * <pre>
 * Configuration for a CDN key. Used by the Video Stitcher
 * to sign URIs for fetching video manifests and signing
 * media segments for playback.
 * </pre>
 *
 * Protobuf type {@code google.cloud.video.stitcher.v1.CdnKey}
 */
public final class CdnKey extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.video.stitcher.v1.CdnKey)
    CdnKeyOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use CdnKey.newBuilder() to construct.
  private CdnKey(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private CdnKey() {
    name_ = "";
    hostname_ = "";
  }

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

  @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.CdnKeysProto
        .internal_static_google_cloud_video_stitcher_v1_CdnKey_descriptor;
  }

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

  private int cdnKeyConfigCase_ = 0;
  private java.lang.Object cdnKeyConfig_;

  public enum CdnKeyConfigCase
      implements
          com.google.protobuf.Internal.EnumLite,
          com.google.protobuf.AbstractMessage.InternalOneOfEnum {
    GOOGLE_CDN_KEY(5),
    AKAMAI_CDN_KEY(6),
    MEDIA_CDN_KEY(8),
    CDNKEYCONFIG_NOT_SET(0);
    private final int value;

    private CdnKeyConfigCase(int value) {
      this.value = value;
    }
    /**
     * @param value The number of the enum to look for.
     * @return The enum associated with the given number.
     * @deprecated Use {@link #forNumber(int)} instead.
     */
    @java.lang.Deprecated
    public static CdnKeyConfigCase valueOf(int value) {
      return forNumber(value);
    }

    public static CdnKeyConfigCase forNumber(int value) {
      switch (value) {
        case 5:
          return GOOGLE_CDN_KEY;
        case 6:
          return AKAMAI_CDN_KEY;
        case 8:
          return MEDIA_CDN_KEY;
        case 0:
          return CDNKEYCONFIG_NOT_SET;
        default:
          return null;
      }
    }

    public int getNumber() {
      return this.value;
    }
  };

  public CdnKeyConfigCase getCdnKeyConfigCase() {
    return CdnKeyConfigCase.forNumber(cdnKeyConfigCase_);
  }

  public static final int GOOGLE_CDN_KEY_FIELD_NUMBER = 5;
  /**
   *
   *
   * <pre>
   * The configuration for a Google Cloud CDN key.
   * </pre>
   *
   * <code>.google.cloud.video.stitcher.v1.GoogleCdnKey google_cdn_key = 5;</code>
   *
   * @return Whether the googleCdnKey field is set.
   */
  @java.lang.Override
  public boolean hasGoogleCdnKey() {
    return cdnKeyConfigCase_ == 5;
  }
  /**
   *
   *
   * <pre>
   * The configuration for a Google Cloud CDN key.
   * </pre>
   *
   * <code>.google.cloud.video.stitcher.v1.GoogleCdnKey google_cdn_key = 5;</code>
   *
   * @return The googleCdnKey.
   */
  @java.lang.Override
  public com.google.cloud.video.stitcher.v1.GoogleCdnKey getGoogleCdnKey() {
    if (cdnKeyConfigCase_ == 5) {
      return (com.google.cloud.video.stitcher.v1.GoogleCdnKey) cdnKeyConfig_;
    }
    return com.google.cloud.video.stitcher.v1.GoogleCdnKey.getDefaultInstance();
  }
  /**
   *
   *
   * <pre>
   * The configuration for a Google Cloud CDN key.
   * </pre>
   *
   * <code>.google.cloud.video.stitcher.v1.GoogleCdnKey google_cdn_key = 5;</code>
   */
  @java.lang.Override
  public com.google.cloud.video.stitcher.v1.GoogleCdnKeyOrBuilder getGoogleCdnKeyOrBuilder() {
    if (cdnKeyConfigCase_ == 5) {
      return (com.google.cloud.video.stitcher.v1.GoogleCdnKey) cdnKeyConfig_;
    }
    return com.google.cloud.video.stitcher.v1.GoogleCdnKey.getDefaultInstance();
  }

  public static final int AKAMAI_CDN_KEY_FIELD_NUMBER = 6;
  /**
   *
   *
   * <pre>
   * The configuration for an Akamai CDN key.
   * </pre>
   *
   * <code>.google.cloud.video.stitcher.v1.AkamaiCdnKey akamai_cdn_key = 6;</code>
   *
   * @return Whether the akamaiCdnKey field is set.
   */
  @java.lang.Override
  public boolean hasAkamaiCdnKey() {
    return cdnKeyConfigCase_ == 6;
  }
  /**
   *
   *
   * <pre>
   * The configuration for an Akamai CDN key.
   * </pre>
   *
   * <code>.google.cloud.video.stitcher.v1.AkamaiCdnKey akamai_cdn_key = 6;</code>
   *
   * @return The akamaiCdnKey.
   */
  @java.lang.Override
  public com.google.cloud.video.stitcher.v1.AkamaiCdnKey getAkamaiCdnKey() {
    if (cdnKeyConfigCase_ == 6) {
      return (com.google.cloud.video.stitcher.v1.AkamaiCdnKey) cdnKeyConfig_;
    }
    return com.google.cloud.video.stitcher.v1.AkamaiCdnKey.getDefaultInstance();
  }
  /**
   *
   *
   * <pre>
   * The configuration for an Akamai CDN key.
   * </pre>
   *
   * <code>.google.cloud.video.stitcher.v1.AkamaiCdnKey akamai_cdn_key = 6;</code>
   */
  @java.lang.Override
  public com.google.cloud.video.stitcher.v1.AkamaiCdnKeyOrBuilder getAkamaiCdnKeyOrBuilder() {
    if (cdnKeyConfigCase_ == 6) {
      return (com.google.cloud.video.stitcher.v1.AkamaiCdnKey) cdnKeyConfig_;
    }
    return com.google.cloud.video.stitcher.v1.AkamaiCdnKey.getDefaultInstance();
  }

  public static final int MEDIA_CDN_KEY_FIELD_NUMBER = 8;
  /**
   *
   *
   * <pre>
   * The configuration for a Media CDN key.
   * </pre>
   *
   * <code>.google.cloud.video.stitcher.v1.MediaCdnKey media_cdn_key = 8;</code>
   *
   * @return Whether the mediaCdnKey field is set.
   */
  @java.lang.Override
  public boolean hasMediaCdnKey() {
    return cdnKeyConfigCase_ == 8;
  }
  /**
   *
   *
   * <pre>
   * The configuration for a Media CDN key.
   * </pre>
   *
   * <code>.google.cloud.video.stitcher.v1.MediaCdnKey media_cdn_key = 8;</code>
   *
   * @return The mediaCdnKey.
   */
  @java.lang.Override
  public com.google.cloud.video.stitcher.v1.MediaCdnKey getMediaCdnKey() {
    if (cdnKeyConfigCase_ == 8) {
      return (com.google.cloud.video.stitcher.v1.MediaCdnKey) cdnKeyConfig_;
    }
    return com.google.cloud.video.stitcher.v1.MediaCdnKey.getDefaultInstance();
  }
  /**
   *
   *
   * <pre>
   * The configuration for a Media CDN key.
   * </pre>
   *
   * <code>.google.cloud.video.stitcher.v1.MediaCdnKey media_cdn_key = 8;</code>
   */
  @java.lang.Override
  public com.google.cloud.video.stitcher.v1.MediaCdnKeyOrBuilder getMediaCdnKeyOrBuilder() {
    if (cdnKeyConfigCase_ == 8) {
      return (com.google.cloud.video.stitcher.v1.MediaCdnKey) cdnKeyConfig_;
    }
    return com.google.cloud.video.stitcher.v1.MediaCdnKey.getDefaultInstance();
  }

  public static final int NAME_FIELD_NUMBER = 1;

  @SuppressWarnings("serial")
  private volatile java.lang.Object name_ = "";
  /**
   *
   *
   * <pre>
   * The resource name of the CDN key, in the form of
   * `projects/{project}/locations/{location}/cdnKeys/{id}`.
   * The name is ignored when creating a CDN key.
   * </pre>
   *
   * <code>string name = 1;</code>
   *
   * @return The name.
   */
  @java.lang.Override
  public java.lang.String getName() {
    java.lang.Object ref = name_;
    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();
      name_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * The resource name of the CDN key, in the form of
   * `projects/{project}/locations/{location}/cdnKeys/{id}`.
   * The name is ignored when creating a CDN key.
   * </pre>
   *
   * <code>string name = 1;</code>
   *
   * @return The bytes for name.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getNameBytes() {
    java.lang.Object ref = name_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      name_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int HOSTNAME_FIELD_NUMBER = 4;

  @SuppressWarnings("serial")
  private volatile java.lang.Object hostname_ = "";
  /**
   *
   *
   * <pre>
   * The hostname this key applies to.
   * </pre>
   *
   * <code>string hostname = 4;</code>
   *
   * @return The hostname.
   */
  @java.lang.Override
  public java.lang.String getHostname() {
    java.lang.Object ref = hostname_;
    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();
      hostname_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * The hostname this key applies to.
   * </pre>
   *
   * <code>string hostname = 4;</code>
   *
   * @return The bytes for hostname.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getHostnameBytes() {
    java.lang.Object ref = hostname_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      hostname_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  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(name_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(hostname_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 4, hostname_);
    }
    if (cdnKeyConfigCase_ == 5) {
      output.writeMessage(5, (com.google.cloud.video.stitcher.v1.GoogleCdnKey) cdnKeyConfig_);
    }
    if (cdnKeyConfigCase_ == 6) {
      output.writeMessage(6, (com.google.cloud.video.stitcher.v1.AkamaiCdnKey) cdnKeyConfig_);
    }
    if (cdnKeyConfigCase_ == 8) {
      output.writeMessage(8, (com.google.cloud.video.stitcher.v1.MediaCdnKey) cdnKeyConfig_);
    }
    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(name_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(hostname_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, hostname_);
    }
    if (cdnKeyConfigCase_ == 5) {
      size +=
          com.google.protobuf.CodedOutputStream.computeMessageSize(
              5, (com.google.cloud.video.stitcher.v1.GoogleCdnKey) cdnKeyConfig_);
    }
    if (cdnKeyConfigCase_ == 6) {
      size +=
          com.google.protobuf.CodedOutputStream.computeMessageSize(
              6, (com.google.cloud.video.stitcher.v1.AkamaiCdnKey) cdnKeyConfig_);
    }
    if (cdnKeyConfigCase_ == 8) {
      size +=
          com.google.protobuf.CodedOutputStream.computeMessageSize(
              8, (com.google.cloud.video.stitcher.v1.MediaCdnKey) cdnKeyConfig_);
    }
    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.CdnKey)) {
      return super.equals(obj);
    }
    com.google.cloud.video.stitcher.v1.CdnKey other =
        (com.google.cloud.video.stitcher.v1.CdnKey) obj;

    if (!getName().equals(other.getName())) return false;
    if (!getHostname().equals(other.getHostname())) return false;
    if (!getCdnKeyConfigCase().equals(other.getCdnKeyConfigCase())) return false;
    switch (cdnKeyConfigCase_) {
      case 5:
        if (!getGoogleCdnKey().equals(other.getGoogleCdnKey())) return false;
        break;
      case 6:
        if (!getAkamaiCdnKey().equals(other.getAkamaiCdnKey())) return false;
        break;
      case 8:
        if (!getMediaCdnKey().equals(other.getMediaCdnKey())) return false;
        break;
      case 0:
      default:
    }
    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) + NAME_FIELD_NUMBER;
    hash = (53 * hash) + getName().hashCode();
    hash = (37 * hash) + HOSTNAME_FIELD_NUMBER;
    hash = (53 * hash) + getHostname().hashCode();
    switch (cdnKeyConfigCase_) {
      case 5:
        hash = (37 * hash) + GOOGLE_CDN_KEY_FIELD_NUMBER;
        hash = (53 * hash) + getGoogleCdnKey().hashCode();
        break;
      case 6:
        hash = (37 * hash) + AKAMAI_CDN_KEY_FIELD_NUMBER;
        hash = (53 * hash) + getAkamaiCdnKey().hashCode();
        break;
      case 8:
        hash = (37 * hash) + MEDIA_CDN_KEY_FIELD_NUMBER;
        hash = (53 * hash) + getMediaCdnKey().hashCode();
        break;
      case 0:
      default:
    }
    hash = (29 * hash) + getUnknownFields().hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

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

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

  public static com.google.cloud.video.stitcher.v1.CdnKey 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.CdnKey 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.CdnKey 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.CdnKey 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.CdnKey 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.CdnKey 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.CdnKey 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.CdnKey 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>
   * Configuration for a CDN key. Used by the Video Stitcher
   * to sign URIs for fetching video manifests and signing
   * media segments for playback.
   * </pre>
   *
   * Protobuf type {@code google.cloud.video.stitcher.v1.CdnKey}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.video.stitcher.v1.CdnKey)
      com.google.cloud.video.stitcher.v1.CdnKeyOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.video.stitcher.v1.CdnKeysProto
          .internal_static_google_cloud_video_stitcher_v1_CdnKey_descriptor;
    }

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

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

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

    @java.lang.Override
    public Builder clear() {
      super.clear();
      bitField0_ = 0;
      if (googleCdnKeyBuilder_ != null) {
        googleCdnKeyBuilder_.clear();
      }
      if (akamaiCdnKeyBuilder_ != null) {
        akamaiCdnKeyBuilder_.clear();
      }
      if (mediaCdnKeyBuilder_ != null) {
        mediaCdnKeyBuilder_.clear();
      }
      name_ = "";
      hostname_ = "";
      cdnKeyConfigCase_ = 0;
      cdnKeyConfig_ = null;
      return this;
    }

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

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

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

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

    private void buildPartial0(com.google.cloud.video.stitcher.v1.CdnKey result) {
      int from_bitField0_ = bitField0_;
      if (((from_bitField0_ & 0x00000008) != 0)) {
        result.name_ = name_;
      }
      if (((from_bitField0_ & 0x00000010) != 0)) {
        result.hostname_ = hostname_;
      }
    }

    private void buildPartialOneofs(com.google.cloud.video.stitcher.v1.CdnKey result) {
      result.cdnKeyConfigCase_ = cdnKeyConfigCase_;
      result.cdnKeyConfig_ = this.cdnKeyConfig_;
      if (cdnKeyConfigCase_ == 5 && googleCdnKeyBuilder_ != null) {
        result.cdnKeyConfig_ = googleCdnKeyBuilder_.build();
      }
      if (cdnKeyConfigCase_ == 6 && akamaiCdnKeyBuilder_ != null) {
        result.cdnKeyConfig_ = akamaiCdnKeyBuilder_.build();
      }
      if (cdnKeyConfigCase_ == 8 && mediaCdnKeyBuilder_ != null) {
        result.cdnKeyConfig_ = mediaCdnKeyBuilder_.build();
      }
    }

    @java.lang.Override
    public Builder clone() {
      return super.clone();
    }

    @java.lang.Override
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.setField(field, value);
    }

    @java.lang.Override
    public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
      return super.clearField(field);
    }

    @java.lang.Override
    public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return super.clearOneof(oneof);
    }

    @java.lang.Override
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
      return super.setRepeatedField(field, index, value);
    }

    @java.lang.Override
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.addRepeatedField(field, value);
    }

    @java.lang.Override
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof com.google.cloud.video.stitcher.v1.CdnKey) {
        return mergeFrom((com.google.cloud.video.stitcher.v1.CdnKey) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.video.stitcher.v1.CdnKey other) {
      if (other == com.google.cloud.video.stitcher.v1.CdnKey.getDefaultInstance()) return this;
      if (!other.getName().isEmpty()) {
        name_ = other.name_;
        bitField0_ |= 0x00000008;
        onChanged();
      }
      if (!other.getHostname().isEmpty()) {
        hostname_ = other.hostname_;
        bitField0_ |= 0x00000010;
        onChanged();
      }
      switch (other.getCdnKeyConfigCase()) {
        case GOOGLE_CDN_KEY:
          {
            mergeGoogleCdnKey(other.getGoogleCdnKey());
            break;
          }
        case AKAMAI_CDN_KEY:
          {
            mergeAkamaiCdnKey(other.getAkamaiCdnKey());
            break;
          }
        case MEDIA_CDN_KEY:
          {
            mergeMediaCdnKey(other.getMediaCdnKey());
            break;
          }
        case CDNKEYCONFIG_NOT_SET:
          {
            break;
          }
      }
      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:
              {
                name_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000008;
                break;
              } // case 10
            case 34:
              {
                hostname_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000010;
                break;
              } // case 34
            case 42:
              {
                input.readMessage(getGoogleCdnKeyFieldBuilder().getBuilder(), extensionRegistry);
                cdnKeyConfigCase_ = 5;
                break;
              } // case 42
            case 50:
              {
                input.readMessage(getAkamaiCdnKeyFieldBuilder().getBuilder(), extensionRegistry);
                cdnKeyConfigCase_ = 6;
                break;
              } // case 50
            case 66:
              {
                input.readMessage(getMediaCdnKeyFieldBuilder().getBuilder(), extensionRegistry);
                cdnKeyConfigCase_ = 8;
                break;
              } // case 66
            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 cdnKeyConfigCase_ = 0;
    private java.lang.Object cdnKeyConfig_;

    public CdnKeyConfigCase getCdnKeyConfigCase() {
      return CdnKeyConfigCase.forNumber(cdnKeyConfigCase_);
    }

    public Builder clearCdnKeyConfig() {
      cdnKeyConfigCase_ = 0;
      cdnKeyConfig_ = null;
      onChanged();
      return this;
    }

    private int bitField0_;

    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.video.stitcher.v1.GoogleCdnKey,
            com.google.cloud.video.stitcher.v1.GoogleCdnKey.Builder,
            com.google.cloud.video.stitcher.v1.GoogleCdnKeyOrBuilder>
        googleCdnKeyBuilder_;
    /**
     *
     *
     * <pre>
     * The configuration for a Google Cloud CDN key.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.GoogleCdnKey google_cdn_key = 5;</code>
     *
     * @return Whether the googleCdnKey field is set.
     */
    @java.lang.Override
    public boolean hasGoogleCdnKey() {
      return cdnKeyConfigCase_ == 5;
    }
    /**
     *
     *
     * <pre>
     * The configuration for a Google Cloud CDN key.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.GoogleCdnKey google_cdn_key = 5;</code>
     *
     * @return The googleCdnKey.
     */
    @java.lang.Override
    public com.google.cloud.video.stitcher.v1.GoogleCdnKey getGoogleCdnKey() {
      if (googleCdnKeyBuilder_ == null) {
        if (cdnKeyConfigCase_ == 5) {
          return (com.google.cloud.video.stitcher.v1.GoogleCdnKey) cdnKeyConfig_;
        }
        return com.google.cloud.video.stitcher.v1.GoogleCdnKey.getDefaultInstance();
      } else {
        if (cdnKeyConfigCase_ == 5) {
          return googleCdnKeyBuilder_.getMessage();
        }
        return com.google.cloud.video.stitcher.v1.GoogleCdnKey.getDefaultInstance();
      }
    }
    /**
     *
     *
     * <pre>
     * The configuration for a Google Cloud CDN key.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.GoogleCdnKey google_cdn_key = 5;</code>
     */
    public Builder setGoogleCdnKey(com.google.cloud.video.stitcher.v1.GoogleCdnKey value) {
      if (googleCdnKeyBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        cdnKeyConfig_ = value;
        onChanged();
      } else {
        googleCdnKeyBuilder_.setMessage(value);
      }
      cdnKeyConfigCase_ = 5;
      return this;
    }
    /**
     *
     *
     * <pre>
     * The configuration for a Google Cloud CDN key.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.GoogleCdnKey google_cdn_key = 5;</code>
     */
    public Builder setGoogleCdnKey(
        com.google.cloud.video.stitcher.v1.GoogleCdnKey.Builder builderForValue) {
      if (googleCdnKeyBuilder_ == null) {
        cdnKeyConfig_ = builderForValue.build();
        onChanged();
      } else {
        googleCdnKeyBuilder_.setMessage(builderForValue.build());
      }
      cdnKeyConfigCase_ = 5;
      return this;
    }
    /**
     *
     *
     * <pre>
     * The configuration for a Google Cloud CDN key.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.GoogleCdnKey google_cdn_key = 5;</code>
     */
    public Builder mergeGoogleCdnKey(com.google.cloud.video.stitcher.v1.GoogleCdnKey value) {
      if (googleCdnKeyBuilder_ == null) {
        if (cdnKeyConfigCase_ == 5
            && cdnKeyConfig_
                != com.google.cloud.video.stitcher.v1.GoogleCdnKey.getDefaultInstance()) {
          cdnKeyConfig_ =
              com.google.cloud.video.stitcher.v1.GoogleCdnKey.newBuilder(
                      (com.google.cloud.video.stitcher.v1.GoogleCdnKey) cdnKeyConfig_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          cdnKeyConfig_ = value;
        }
        onChanged();
      } else {
        if (cdnKeyConfigCase_ == 5) {
          googleCdnKeyBuilder_.mergeFrom(value);
        } else {
          googleCdnKeyBuilder_.setMessage(value);
        }
      }
      cdnKeyConfigCase_ = 5;
      return this;
    }
    /**
     *
     *
     * <pre>
     * The configuration for a Google Cloud CDN key.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.GoogleCdnKey google_cdn_key = 5;</code>
     */
    public Builder clearGoogleCdnKey() {
      if (googleCdnKeyBuilder_ == null) {
        if (cdnKeyConfigCase_ == 5) {
          cdnKeyConfigCase_ = 0;
          cdnKeyConfig_ = null;
          onChanged();
        }
      } else {
        if (cdnKeyConfigCase_ == 5) {
          cdnKeyConfigCase_ = 0;
          cdnKeyConfig_ = null;
        }
        googleCdnKeyBuilder_.clear();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The configuration for a Google Cloud CDN key.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.GoogleCdnKey google_cdn_key = 5;</code>
     */
    public com.google.cloud.video.stitcher.v1.GoogleCdnKey.Builder getGoogleCdnKeyBuilder() {
      return getGoogleCdnKeyFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * The configuration for a Google Cloud CDN key.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.GoogleCdnKey google_cdn_key = 5;</code>
     */
    @java.lang.Override
    public com.google.cloud.video.stitcher.v1.GoogleCdnKeyOrBuilder getGoogleCdnKeyOrBuilder() {
      if ((cdnKeyConfigCase_ == 5) && (googleCdnKeyBuilder_ != null)) {
        return googleCdnKeyBuilder_.getMessageOrBuilder();
      } else {
        if (cdnKeyConfigCase_ == 5) {
          return (com.google.cloud.video.stitcher.v1.GoogleCdnKey) cdnKeyConfig_;
        }
        return com.google.cloud.video.stitcher.v1.GoogleCdnKey.getDefaultInstance();
      }
    }
    /**
     *
     *
     * <pre>
     * The configuration for a Google Cloud CDN key.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.GoogleCdnKey google_cdn_key = 5;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.video.stitcher.v1.GoogleCdnKey,
            com.google.cloud.video.stitcher.v1.GoogleCdnKey.Builder,
            com.google.cloud.video.stitcher.v1.GoogleCdnKeyOrBuilder>
        getGoogleCdnKeyFieldBuilder() {
      if (googleCdnKeyBuilder_ == null) {
        if (!(cdnKeyConfigCase_ == 5)) {
          cdnKeyConfig_ = com.google.cloud.video.stitcher.v1.GoogleCdnKey.getDefaultInstance();
        }
        googleCdnKeyBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.cloud.video.stitcher.v1.GoogleCdnKey,
                com.google.cloud.video.stitcher.v1.GoogleCdnKey.Builder,
                com.google.cloud.video.stitcher.v1.GoogleCdnKeyOrBuilder>(
                (com.google.cloud.video.stitcher.v1.GoogleCdnKey) cdnKeyConfig_,
                getParentForChildren(),
                isClean());
        cdnKeyConfig_ = null;
      }
      cdnKeyConfigCase_ = 5;
      onChanged();
      return googleCdnKeyBuilder_;
    }

    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.video.stitcher.v1.AkamaiCdnKey,
            com.google.cloud.video.stitcher.v1.AkamaiCdnKey.Builder,
            com.google.cloud.video.stitcher.v1.AkamaiCdnKeyOrBuilder>
        akamaiCdnKeyBuilder_;
    /**
     *
     *
     * <pre>
     * The configuration for an Akamai CDN key.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.AkamaiCdnKey akamai_cdn_key = 6;</code>
     *
     * @return Whether the akamaiCdnKey field is set.
     */
    @java.lang.Override
    public boolean hasAkamaiCdnKey() {
      return cdnKeyConfigCase_ == 6;
    }
    /**
     *
     *
     * <pre>
     * The configuration for an Akamai CDN key.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.AkamaiCdnKey akamai_cdn_key = 6;</code>
     *
     * @return The akamaiCdnKey.
     */
    @java.lang.Override
    public com.google.cloud.video.stitcher.v1.AkamaiCdnKey getAkamaiCdnKey() {
      if (akamaiCdnKeyBuilder_ == null) {
        if (cdnKeyConfigCase_ == 6) {
          return (com.google.cloud.video.stitcher.v1.AkamaiCdnKey) cdnKeyConfig_;
        }
        return com.google.cloud.video.stitcher.v1.AkamaiCdnKey.getDefaultInstance();
      } else {
        if (cdnKeyConfigCase_ == 6) {
          return akamaiCdnKeyBuilder_.getMessage();
        }
        return com.google.cloud.video.stitcher.v1.AkamaiCdnKey.getDefaultInstance();
      }
    }
    /**
     *
     *
     * <pre>
     * The configuration for an Akamai CDN key.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.AkamaiCdnKey akamai_cdn_key = 6;</code>
     */
    public Builder setAkamaiCdnKey(com.google.cloud.video.stitcher.v1.AkamaiCdnKey value) {
      if (akamaiCdnKeyBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        cdnKeyConfig_ = value;
        onChanged();
      } else {
        akamaiCdnKeyBuilder_.setMessage(value);
      }
      cdnKeyConfigCase_ = 6;
      return this;
    }
    /**
     *
     *
     * <pre>
     * The configuration for an Akamai CDN key.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.AkamaiCdnKey akamai_cdn_key = 6;</code>
     */
    public Builder setAkamaiCdnKey(
        com.google.cloud.video.stitcher.v1.AkamaiCdnKey.Builder builderForValue) {
      if (akamaiCdnKeyBuilder_ == null) {
        cdnKeyConfig_ = builderForValue.build();
        onChanged();
      } else {
        akamaiCdnKeyBuilder_.setMessage(builderForValue.build());
      }
      cdnKeyConfigCase_ = 6;
      return this;
    }
    /**
     *
     *
     * <pre>
     * The configuration for an Akamai CDN key.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.AkamaiCdnKey akamai_cdn_key = 6;</code>
     */
    public Builder mergeAkamaiCdnKey(com.google.cloud.video.stitcher.v1.AkamaiCdnKey value) {
      if (akamaiCdnKeyBuilder_ == null) {
        if (cdnKeyConfigCase_ == 6
            && cdnKeyConfig_
                != com.google.cloud.video.stitcher.v1.AkamaiCdnKey.getDefaultInstance()) {
          cdnKeyConfig_ =
              com.google.cloud.video.stitcher.v1.AkamaiCdnKey.newBuilder(
                      (com.google.cloud.video.stitcher.v1.AkamaiCdnKey) cdnKeyConfig_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          cdnKeyConfig_ = value;
        }
        onChanged();
      } else {
        if (cdnKeyConfigCase_ == 6) {
          akamaiCdnKeyBuilder_.mergeFrom(value);
        } else {
          akamaiCdnKeyBuilder_.setMessage(value);
        }
      }
      cdnKeyConfigCase_ = 6;
      return this;
    }
    /**
     *
     *
     * <pre>
     * The configuration for an Akamai CDN key.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.AkamaiCdnKey akamai_cdn_key = 6;</code>
     */
    public Builder clearAkamaiCdnKey() {
      if (akamaiCdnKeyBuilder_ == null) {
        if (cdnKeyConfigCase_ == 6) {
          cdnKeyConfigCase_ = 0;
          cdnKeyConfig_ = null;
          onChanged();
        }
      } else {
        if (cdnKeyConfigCase_ == 6) {
          cdnKeyConfigCase_ = 0;
          cdnKeyConfig_ = null;
        }
        akamaiCdnKeyBuilder_.clear();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The configuration for an Akamai CDN key.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.AkamaiCdnKey akamai_cdn_key = 6;</code>
     */
    public com.google.cloud.video.stitcher.v1.AkamaiCdnKey.Builder getAkamaiCdnKeyBuilder() {
      return getAkamaiCdnKeyFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * The configuration for an Akamai CDN key.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.AkamaiCdnKey akamai_cdn_key = 6;</code>
     */
    @java.lang.Override
    public com.google.cloud.video.stitcher.v1.AkamaiCdnKeyOrBuilder getAkamaiCdnKeyOrBuilder() {
      if ((cdnKeyConfigCase_ == 6) && (akamaiCdnKeyBuilder_ != null)) {
        return akamaiCdnKeyBuilder_.getMessageOrBuilder();
      } else {
        if (cdnKeyConfigCase_ == 6) {
          return (com.google.cloud.video.stitcher.v1.AkamaiCdnKey) cdnKeyConfig_;
        }
        return com.google.cloud.video.stitcher.v1.AkamaiCdnKey.getDefaultInstance();
      }
    }
    /**
     *
     *
     * <pre>
     * The configuration for an Akamai CDN key.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.AkamaiCdnKey akamai_cdn_key = 6;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.video.stitcher.v1.AkamaiCdnKey,
            com.google.cloud.video.stitcher.v1.AkamaiCdnKey.Builder,
            com.google.cloud.video.stitcher.v1.AkamaiCdnKeyOrBuilder>
        getAkamaiCdnKeyFieldBuilder() {
      if (akamaiCdnKeyBuilder_ == null) {
        if (!(cdnKeyConfigCase_ == 6)) {
          cdnKeyConfig_ = com.google.cloud.video.stitcher.v1.AkamaiCdnKey.getDefaultInstance();
        }
        akamaiCdnKeyBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.cloud.video.stitcher.v1.AkamaiCdnKey,
                com.google.cloud.video.stitcher.v1.AkamaiCdnKey.Builder,
                com.google.cloud.video.stitcher.v1.AkamaiCdnKeyOrBuilder>(
                (com.google.cloud.video.stitcher.v1.AkamaiCdnKey) cdnKeyConfig_,
                getParentForChildren(),
                isClean());
        cdnKeyConfig_ = null;
      }
      cdnKeyConfigCase_ = 6;
      onChanged();
      return akamaiCdnKeyBuilder_;
    }

    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.video.stitcher.v1.MediaCdnKey,
            com.google.cloud.video.stitcher.v1.MediaCdnKey.Builder,
            com.google.cloud.video.stitcher.v1.MediaCdnKeyOrBuilder>
        mediaCdnKeyBuilder_;
    /**
     *
     *
     * <pre>
     * The configuration for a Media CDN key.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.MediaCdnKey media_cdn_key = 8;</code>
     *
     * @return Whether the mediaCdnKey field is set.
     */
    @java.lang.Override
    public boolean hasMediaCdnKey() {
      return cdnKeyConfigCase_ == 8;
    }
    /**
     *
     *
     * <pre>
     * The configuration for a Media CDN key.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.MediaCdnKey media_cdn_key = 8;</code>
     *
     * @return The mediaCdnKey.
     */
    @java.lang.Override
    public com.google.cloud.video.stitcher.v1.MediaCdnKey getMediaCdnKey() {
      if (mediaCdnKeyBuilder_ == null) {
        if (cdnKeyConfigCase_ == 8) {
          return (com.google.cloud.video.stitcher.v1.MediaCdnKey) cdnKeyConfig_;
        }
        return com.google.cloud.video.stitcher.v1.MediaCdnKey.getDefaultInstance();
      } else {
        if (cdnKeyConfigCase_ == 8) {
          return mediaCdnKeyBuilder_.getMessage();
        }
        return com.google.cloud.video.stitcher.v1.MediaCdnKey.getDefaultInstance();
      }
    }
    /**
     *
     *
     * <pre>
     * The configuration for a Media CDN key.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.MediaCdnKey media_cdn_key = 8;</code>
     */
    public Builder setMediaCdnKey(com.google.cloud.video.stitcher.v1.MediaCdnKey value) {
      if (mediaCdnKeyBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        cdnKeyConfig_ = value;
        onChanged();
      } else {
        mediaCdnKeyBuilder_.setMessage(value);
      }
      cdnKeyConfigCase_ = 8;
      return this;
    }
    /**
     *
     *
     * <pre>
     * The configuration for a Media CDN key.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.MediaCdnKey media_cdn_key = 8;</code>
     */
    public Builder setMediaCdnKey(
        com.google.cloud.video.stitcher.v1.MediaCdnKey.Builder builderForValue) {
      if (mediaCdnKeyBuilder_ == null) {
        cdnKeyConfig_ = builderForValue.build();
        onChanged();
      } else {
        mediaCdnKeyBuilder_.setMessage(builderForValue.build());
      }
      cdnKeyConfigCase_ = 8;
      return this;
    }
    /**
     *
     *
     * <pre>
     * The configuration for a Media CDN key.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.MediaCdnKey media_cdn_key = 8;</code>
     */
    public Builder mergeMediaCdnKey(com.google.cloud.video.stitcher.v1.MediaCdnKey value) {
      if (mediaCdnKeyBuilder_ == null) {
        if (cdnKeyConfigCase_ == 8
            && cdnKeyConfig_
                != com.google.cloud.video.stitcher.v1.MediaCdnKey.getDefaultInstance()) {
          cdnKeyConfig_ =
              com.google.cloud.video.stitcher.v1.MediaCdnKey.newBuilder(
                      (com.google.cloud.video.stitcher.v1.MediaCdnKey) cdnKeyConfig_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          cdnKeyConfig_ = value;
        }
        onChanged();
      } else {
        if (cdnKeyConfigCase_ == 8) {
          mediaCdnKeyBuilder_.mergeFrom(value);
        } else {
          mediaCdnKeyBuilder_.setMessage(value);
        }
      }
      cdnKeyConfigCase_ = 8;
      return this;
    }
    /**
     *
     *
     * <pre>
     * The configuration for a Media CDN key.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.MediaCdnKey media_cdn_key = 8;</code>
     */
    public Builder clearMediaCdnKey() {
      if (mediaCdnKeyBuilder_ == null) {
        if (cdnKeyConfigCase_ == 8) {
          cdnKeyConfigCase_ = 0;
          cdnKeyConfig_ = null;
          onChanged();
        }
      } else {
        if (cdnKeyConfigCase_ == 8) {
          cdnKeyConfigCase_ = 0;
          cdnKeyConfig_ = null;
        }
        mediaCdnKeyBuilder_.clear();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The configuration for a Media CDN key.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.MediaCdnKey media_cdn_key = 8;</code>
     */
    public com.google.cloud.video.stitcher.v1.MediaCdnKey.Builder getMediaCdnKeyBuilder() {
      return getMediaCdnKeyFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * The configuration for a Media CDN key.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.MediaCdnKey media_cdn_key = 8;</code>
     */
    @java.lang.Override
    public com.google.cloud.video.stitcher.v1.MediaCdnKeyOrBuilder getMediaCdnKeyOrBuilder() {
      if ((cdnKeyConfigCase_ == 8) && (mediaCdnKeyBuilder_ != null)) {
        return mediaCdnKeyBuilder_.getMessageOrBuilder();
      } else {
        if (cdnKeyConfigCase_ == 8) {
          return (com.google.cloud.video.stitcher.v1.MediaCdnKey) cdnKeyConfig_;
        }
        return com.google.cloud.video.stitcher.v1.MediaCdnKey.getDefaultInstance();
      }
    }
    /**
     *
     *
     * <pre>
     * The configuration for a Media CDN key.
     * </pre>
     *
     * <code>.google.cloud.video.stitcher.v1.MediaCdnKey media_cdn_key = 8;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.video.stitcher.v1.MediaCdnKey,
            com.google.cloud.video.stitcher.v1.MediaCdnKey.Builder,
            com.google.cloud.video.stitcher.v1.MediaCdnKeyOrBuilder>
        getMediaCdnKeyFieldBuilder() {
      if (mediaCdnKeyBuilder_ == null) {
        if (!(cdnKeyConfigCase_ == 8)) {
          cdnKeyConfig_ = com.google.cloud.video.stitcher.v1.MediaCdnKey.getDefaultInstance();
        }
        mediaCdnKeyBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.cloud.video.stitcher.v1.MediaCdnKey,
                com.google.cloud.video.stitcher.v1.MediaCdnKey.Builder,
                com.google.cloud.video.stitcher.v1.MediaCdnKeyOrBuilder>(
                (com.google.cloud.video.stitcher.v1.MediaCdnKey) cdnKeyConfig_,
                getParentForChildren(),
                isClean());
        cdnKeyConfig_ = null;
      }
      cdnKeyConfigCase_ = 8;
      onChanged();
      return mediaCdnKeyBuilder_;
    }

    private java.lang.Object name_ = "";
    /**
     *
     *
     * <pre>
     * The resource name of the CDN key, in the form of
     * `projects/{project}/locations/{location}/cdnKeys/{id}`.
     * The name is ignored when creating a CDN key.
     * </pre>
     *
     * <code>string name = 1;</code>
     *
     * @return The name.
     */
    public java.lang.String getName() {
      java.lang.Object ref = name_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        name_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The resource name of the CDN key, in the form of
     * `projects/{project}/locations/{location}/cdnKeys/{id}`.
     * The name is ignored when creating a CDN key.
     * </pre>
     *
     * <code>string name = 1;</code>
     *
     * @return The bytes for name.
     */
    public com.google.protobuf.ByteString getNameBytes() {
      java.lang.Object ref = name_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        name_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The resource name of the CDN key, in the form of
     * `projects/{project}/locations/{location}/cdnKeys/{id}`.
     * The name is ignored when creating a CDN key.
     * </pre>
     *
     * <code>string name = 1;</code>
     *
     * @param value The name to set.
     * @return This builder for chaining.
     */
    public Builder setName(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      name_ = value;
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The resource name of the CDN key, in the form of
     * `projects/{project}/locations/{location}/cdnKeys/{id}`.
     * The name is ignored when creating a CDN key.
     * </pre>
     *
     * <code>string name = 1;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearName() {
      name_ = getDefaultInstance().getName();
      bitField0_ = (bitField0_ & ~0x00000008);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The resource name of the CDN key, in the form of
     * `projects/{project}/locations/{location}/cdnKeys/{id}`.
     * The name is ignored when creating a CDN key.
     * </pre>
     *
     * <code>string name = 1;</code>
     *
     * @param value The bytes for name to set.
     * @return This builder for chaining.
     */
    public Builder setNameBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      name_ = value;
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }

    private java.lang.Object hostname_ = "";
    /**
     *
     *
     * <pre>
     * The hostname this key applies to.
     * </pre>
     *
     * <code>string hostname = 4;</code>
     *
     * @return The hostname.
     */
    public java.lang.String getHostname() {
      java.lang.Object ref = hostname_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        hostname_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The hostname this key applies to.
     * </pre>
     *
     * <code>string hostname = 4;</code>
     *
     * @return The bytes for hostname.
     */
    public com.google.protobuf.ByteString getHostnameBytes() {
      java.lang.Object ref = hostname_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        hostname_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The hostname this key applies to.
     * </pre>
     *
     * <code>string hostname = 4;</code>
     *
     * @param value The hostname to set.
     * @return This builder for chaining.
     */
    public Builder setHostname(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      hostname_ = value;
      bitField0_ |= 0x00000010;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The hostname this key applies to.
     * </pre>
     *
     * <code>string hostname = 4;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearHostname() {
      hostname_ = getDefaultInstance().getHostname();
      bitField0_ = (bitField0_ & ~0x00000010);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The hostname this key applies to.
     * </pre>
     *
     * <code>string hostname = 4;</code>
     *
     * @param value The bytes for hostname to set.
     * @return This builder for chaining.
     */
    public Builder setHostnameBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      hostname_ = value;
      bitField0_ |= 0x00000010;
      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.CdnKey)
  }

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

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

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

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

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

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