yandex.cloud.api.kms.v1.SymmetricKeyOuterClass Maven / Gradle / Ivy
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: yandex/cloud/kms/v1/symmetric_key.proto
package yandex.cloud.api.kms.v1;
public final class SymmetricKeyOuterClass {
  private SymmetricKeyOuterClass() {}
  public static void registerAllExtensions(
      com.google.protobuf.ExtensionRegistryLite registry) {
  }
  public static void registerAllExtensions(
      com.google.protobuf.ExtensionRegistry registry) {
    registerAllExtensions(
        (com.google.protobuf.ExtensionRegistryLite) registry);
  }
  /**
   * 
   * Supported symmetric encryption algorithms.
   * 
   *
   * Protobuf enum {@code yandex.cloud.kms.v1.SymmetricAlgorithm}
   */
  public enum SymmetricAlgorithm
      implements com.google.protobuf.ProtocolMessageEnum {
    /**
     * SYMMETRIC_ALGORITHM_UNSPECIFIED = 0;
     */
    SYMMETRIC_ALGORITHM_UNSPECIFIED(0),
    /**
     * 
     * AES algorithm with 128-bit keys.
     * 
     *
     * AES_128 = 1;
     */
    AES_128(1),
    /**
     * 
     * AES algorithm with 192-bit keys.
     * 
     *
     * AES_192 = 2;
     */
    AES_192(2),
    /**
     * 
     * AES algorithm with 256-bit keys.
     * 
     *
     * AES_256 = 3;
     */
    AES_256(3),
    /**
     * 
     * AES algorithm with 256-bit keys hosted by HSM
     * 
     *
     * AES_256_HSM = 4;
     */
    AES_256_HSM(4),
    UNRECOGNIZED(-1),
    ;
    /**
     * SYMMETRIC_ALGORITHM_UNSPECIFIED = 0;
     */
    public static final int SYMMETRIC_ALGORITHM_UNSPECIFIED_VALUE = 0;
    /**
     * 
     * AES algorithm with 128-bit keys.
     * 
     *
     * AES_128 = 1;
     */
    public static final int AES_128_VALUE = 1;
    /**
     * 
     * AES algorithm with 192-bit keys.
     * 
     *
     * AES_192 = 2;
     */
    public static final int AES_192_VALUE = 2;
    /**
     * 
     * AES algorithm with 256-bit keys.
     * 
     *
     * AES_256 = 3;
     */
    public static final int AES_256_VALUE = 3;
    /**
     * 
     * AES algorithm with 256-bit keys hosted by HSM
     * 
     *
     * AES_256_HSM = 4;
     */
    public static final int AES_256_HSM_VALUE = 4;
    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 SymmetricAlgorithm 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 SymmetricAlgorithm forNumber(int value) {
      switch (value) {
        case 0: return SYMMETRIC_ALGORITHM_UNSPECIFIED;
        case 1: return AES_128;
        case 2: return AES_192;
        case 3: return AES_256;
        case 4: return AES_256_HSM;
        default: return null;
      }
    }
    public static com.google.protobuf.Internal.EnumLiteMap
        internalGetValueMap() {
      return internalValueMap;
    }
    private static final com.google.protobuf.Internal.EnumLiteMap<
        SymmetricAlgorithm> internalValueMap =
          new com.google.protobuf.Internal.EnumLiteMap() {
            public SymmetricAlgorithm findValueByNumber(int number) {
              return SymmetricAlgorithm.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 yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.getDescriptor().getEnumTypes().get(0);
    }
    private static final SymmetricAlgorithm[] VALUES = values();
    public static SymmetricAlgorithm 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 SymmetricAlgorithm(int value) {
      this.value = value;
    }
    // @@protoc_insertion_point(enum_scope:yandex.cloud.kms.v1.SymmetricAlgorithm)
  }
  public interface SymmetricKeyOrBuilder extends
      // @@protoc_insertion_point(interface_extends:yandex.cloud.kms.v1.SymmetricKey)
      com.google.protobuf.MessageOrBuilder {
    /**
     * 
     * ID of the key.
     * 
     *
     * string id = 1;
     * @return The id.
     */
    java.lang.String getId();
    /**
     * 
     * ID of the key.
     * 
     *
     * string id = 1;
     * @return The bytes for id.
     */
    com.google.protobuf.ByteString
        getIdBytes();
    /**
     * 
     * ID of the folder that the key belongs to.
     * 
     *
     * string folder_id = 2;
     * @return The folderId.
     */
    java.lang.String getFolderId();
    /**
     * 
     * ID of the folder that the key belongs to.
     * 
     *
     * string folder_id = 2;
     * @return The bytes for folderId.
     */
    com.google.protobuf.ByteString
        getFolderIdBytes();
    /**
     * 
     * Time when the key was created.
     * 
     *
     * .google.protobuf.Timestamp created_at = 3;
     * @return Whether the createdAt field is set.
     */
    boolean hasCreatedAt();
    /**
     * 
     * Time when the key was created.
     * 
     *
     * .google.protobuf.Timestamp created_at = 3;
     * @return The createdAt.
     */
    com.google.protobuf.Timestamp getCreatedAt();
    /**
     * 
     * Time when the key was created.
     * 
     *
     * .google.protobuf.Timestamp created_at = 3;
     */
    com.google.protobuf.TimestampOrBuilder getCreatedAtOrBuilder();
    /**
     * 
     * Name of the key.
     * 
     *
     * string name = 4;
     * @return The name.
     */
    java.lang.String getName();
    /**
     * 
     * Name of the key.
     * 
     *
     * string name = 4;
     * @return The bytes for name.
     */
    com.google.protobuf.ByteString
        getNameBytes();
    /**
     * 
     * Description of the key.
     * 
     *
     * string description = 5;
     * @return The description.
     */
    java.lang.String getDescription();
    /**
     * 
     * Description of the key.
     * 
     *
     * string description = 5;
     * @return The bytes for description.
     */
    com.google.protobuf.ByteString
        getDescriptionBytes();
    /**
     * 
     * Custom labels for the key as `key:value` pairs. Maximum 64 per key.
     * 
     *
     * map<string, string> labels = 6;
     */
    int getLabelsCount();
    /**
     * 
     * Custom labels for the key as `key:value` pairs. Maximum 64 per key.
     * 
     *
     * map<string, string> labels = 6;
     */
    boolean containsLabels(
        java.lang.String key);
    /**
     * Use {@link #getLabelsMap()} instead.
     */
    @java.lang.Deprecated
    java.util.Map
    getLabels();
    /**
     * 
     * Custom labels for the key as `key:value` pairs. Maximum 64 per key.
     * 
     *
     * map<string, string> labels = 6;
     */
    java.util.Map
    getLabelsMap();
    /**
     * 
     * Custom labels for the key as `key:value` pairs. Maximum 64 per key.
     * 
     *
     * map<string, string> labels = 6;
     */
    java.lang.String getLabelsOrDefault(
        java.lang.String key,
        java.lang.String defaultValue);
    /**
     * 
     * Custom labels for the key as `key:value` pairs. Maximum 64 per key.
     * 
     *
     * map<string, string> labels = 6;
     */
    java.lang.String getLabelsOrThrow(
        java.lang.String key);
    /**
     * 
     * Current status of the key.
     * 
     *
     * .yandex.cloud.kms.v1.SymmetricKey.Status status = 7;
     * @return The enum numeric value on the wire for status.
     */
    int getStatusValue();
    /**
     * 
     * Current status of the key.
     * 
     *
     * .yandex.cloud.kms.v1.SymmetricKey.Status status = 7;
     * @return The status.
     */
    yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKey.Status getStatus();
    /**
     * 
     * Primary version of the key, used as the default for all encrypt/decrypt operations,
     * when no version ID is specified.
     * 
     *
     * .yandex.cloud.kms.v1.SymmetricKeyVersion primary_version = 8;
     * @return Whether the primaryVersion field is set.
     */
    boolean hasPrimaryVersion();
    /**
     * 
     * Primary version of the key, used as the default for all encrypt/decrypt operations,
     * when no version ID is specified.
     * 
     *
     * .yandex.cloud.kms.v1.SymmetricKeyVersion primary_version = 8;
     * @return The primaryVersion.
     */
    yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion getPrimaryVersion();
    /**
     * 
     * Primary version of the key, used as the default for all encrypt/decrypt operations,
     * when no version ID is specified.
     * 
     *
     * .yandex.cloud.kms.v1.SymmetricKeyVersion primary_version = 8;
     */
    yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersionOrBuilder getPrimaryVersionOrBuilder();
    /**
     * 
     * Default encryption algorithm to be used with new versions of the key.
     * 
     *
     * .yandex.cloud.kms.v1.SymmetricAlgorithm default_algorithm = 9;
     * @return The enum numeric value on the wire for defaultAlgorithm.
     */
    int getDefaultAlgorithmValue();
    /**
     * 
     * Default encryption algorithm to be used with new versions of the key.
     * 
     *
     * .yandex.cloud.kms.v1.SymmetricAlgorithm default_algorithm = 9;
     * @return The defaultAlgorithm.
     */
    yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricAlgorithm getDefaultAlgorithm();
    /**
     * 
     * Time of the last key rotation (time when the last version was created).
     * Empty if the key does not have versions yet.
     * 
     *
     * .google.protobuf.Timestamp rotated_at = 10;
     * @return Whether the rotatedAt field is set.
     */
    boolean hasRotatedAt();
    /**
     * 
     * Time of the last key rotation (time when the last version was created).
     * Empty if the key does not have versions yet.
     * 
     *
     * .google.protobuf.Timestamp rotated_at = 10;
     * @return The rotatedAt.
     */
    com.google.protobuf.Timestamp getRotatedAt();
    /**
     * 
     * Time of the last key rotation (time when the last version was created).
     * Empty if the key does not have versions yet.
     * 
     *
     * .google.protobuf.Timestamp rotated_at = 10;
     */
    com.google.protobuf.TimestampOrBuilder getRotatedAtOrBuilder();
    /**
     * 
     * Time period between automatic key rotations.
     * 
     *
     * .google.protobuf.Duration rotation_period = 11;
     * @return Whether the rotationPeriod field is set.
     */
    boolean hasRotationPeriod();
    /**
     * 
     * Time period between automatic key rotations.
     * 
     *
     * .google.protobuf.Duration rotation_period = 11;
     * @return The rotationPeriod.
     */
    com.google.protobuf.Duration getRotationPeriod();
    /**
     * 
     * Time period between automatic key rotations.
     * 
     *
     * .google.protobuf.Duration rotation_period = 11;
     */
    com.google.protobuf.DurationOrBuilder getRotationPeriodOrBuilder();
    /**
     * 
     * Flag that inhibits deletion of the key
     * 
     *
     * bool deletion_protection = 12;
     * @return The deletionProtection.
     */
    boolean getDeletionProtection();
  }
  /**
   * 
   * A symmetric KMS key that may contain several versions of the cryptographic material.
   * 
   *
   * Protobuf type {@code yandex.cloud.kms.v1.SymmetricKey}
   */
  public static final class SymmetricKey extends
      com.google.protobuf.GeneratedMessageV3 implements
      // @@protoc_insertion_point(message_implements:yandex.cloud.kms.v1.SymmetricKey)
      SymmetricKeyOrBuilder {
  private static final long serialVersionUID = 0L;
    // Use SymmetricKey.newBuilder() to construct.
    private SymmetricKey(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
      super(builder);
    }
    private SymmetricKey() {
      id_ = "";
      folderId_ = "";
      name_ = "";
      description_ = "";
      status_ = 0;
      defaultAlgorithm_ = 0;
    }
    @java.lang.Override
    @SuppressWarnings({"unused"})
    protected java.lang.Object newInstance(
        UnusedPrivateParameter unused) {
      return new SymmetricKey();
    }
    @java.lang.Override
    public final com.google.protobuf.UnknownFieldSet
    getUnknownFields() {
      return this.unknownFields;
    }
    private SymmetricKey(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      this();
      if (extensionRegistry == null) {
        throw new java.lang.NullPointerException();
      }
      int mutable_bitField0_ = 0;
      com.google.protobuf.UnknownFieldSet.Builder unknownFields =
          com.google.protobuf.UnknownFieldSet.newBuilder();
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            case 10: {
              java.lang.String s = input.readStringRequireUtf8();
              id_ = s;
              break;
            }
            case 18: {
              java.lang.String s = input.readStringRequireUtf8();
              folderId_ = s;
              break;
            }
            case 26: {
              com.google.protobuf.Timestamp.Builder subBuilder = null;
              if (createdAt_ != null) {
                subBuilder = createdAt_.toBuilder();
              }
              createdAt_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(createdAt_);
                createdAt_ = subBuilder.buildPartial();
              }
              break;
            }
            case 34: {
              java.lang.String s = input.readStringRequireUtf8();
              name_ = s;
              break;
            }
            case 42: {
              java.lang.String s = input.readStringRequireUtf8();
              description_ = s;
              break;
            }
            case 50: {
              if (!((mutable_bitField0_ & 0x00000001) != 0)) {
                labels_ = com.google.protobuf.MapField.newMapField(
                    LabelsDefaultEntryHolder.defaultEntry);
                mutable_bitField0_ |= 0x00000001;
              }
              com.google.protobuf.MapEntry
              labels__ = input.readMessage(
                  LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry);
              labels_.getMutableMap().put(
                  labels__.getKey(), labels__.getValue());
              break;
            }
            case 56: {
              int rawValue = input.readEnum();
              status_ = rawValue;
              break;
            }
            case 66: {
              yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion.Builder subBuilder = null;
              if (primaryVersion_ != null) {
                subBuilder = primaryVersion_.toBuilder();
              }
              primaryVersion_ = input.readMessage(yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(primaryVersion_);
                primaryVersion_ = subBuilder.buildPartial();
              }
              break;
            }
            case 72: {
              int rawValue = input.readEnum();
              defaultAlgorithm_ = rawValue;
              break;
            }
            case 82: {
              com.google.protobuf.Timestamp.Builder subBuilder = null;
              if (rotatedAt_ != null) {
                subBuilder = rotatedAt_.toBuilder();
              }
              rotatedAt_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(rotatedAt_);
                rotatedAt_ = subBuilder.buildPartial();
              }
              break;
            }
            case 90: {
              com.google.protobuf.Duration.Builder subBuilder = null;
              if (rotationPeriod_ != null) {
                subBuilder = rotationPeriod_.toBuilder();
              }
              rotationPeriod_ = input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(rotationPeriod_);
                rotationPeriod_ = subBuilder.buildPartial();
              }
              break;
            }
            case 96: {
              deletionProtection_ = input.readBool();
              break;
            }
            default: {
              if (!parseUnknownField(
                  input, unknownFields, extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
          }
        }
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.setUnfinishedMessage(this);
      } catch (java.io.IOException e) {
        throw new com.google.protobuf.InvalidProtocolBufferException(
            e).setUnfinishedMessage(this);
      } finally {
        this.unknownFields = unknownFields.build();
        makeExtensionsImmutable();
      }
    }
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.internal_static_yandex_cloud_kms_v1_SymmetricKey_descriptor;
    }
    @SuppressWarnings({"rawtypes"})
    @java.lang.Override
    protected com.google.protobuf.MapField internalGetMapField(
        int number) {
      switch (number) {
        case 6:
          return internalGetLabels();
        default:
          throw new RuntimeException(
              "Invalid map field number: " + number);
      }
    }
    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.internal_static_yandex_cloud_kms_v1_SymmetricKey_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKey.class, yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKey.Builder.class);
    }
    /**
     * Protobuf enum {@code yandex.cloud.kms.v1.SymmetricKey.Status}
     */
    public enum Status
        implements com.google.protobuf.ProtocolMessageEnum {
      /**
       * STATUS_UNSPECIFIED = 0;
       */
      STATUS_UNSPECIFIED(0),
      /**
       * 
       * The key is being created.
       * 
       *
       * CREATING = 1;
       */
      CREATING(1),
      /**
       * 
       * The key is active and can be used for encryption and decryption.
       * Can be set to INACTIVE using the [SymmetricKeyService.Update] method.
       * 
       *
       * ACTIVE = 2;
       */
      ACTIVE(2),
      /**
       * 
       * The key is inactive and unusable.
       * Can be set to ACTIVE using the [SymmetricKeyService.Update] method.
       * 
       *
       * INACTIVE = 3;
       */
      INACTIVE(3),
      UNRECOGNIZED(-1),
      ;
      /**
       * STATUS_UNSPECIFIED = 0;
       */
      public static final int STATUS_UNSPECIFIED_VALUE = 0;
      /**
       * 
       * The key is being created.
       * 
       *
       * CREATING = 1;
       */
      public static final int CREATING_VALUE = 1;
      /**
       * 
       * The key is active and can be used for encryption and decryption.
       * Can be set to INACTIVE using the [SymmetricKeyService.Update] method.
       * 
       *
       * ACTIVE = 2;
       */
      public static final int ACTIVE_VALUE = 2;
      /**
       * 
       * The key is inactive and unusable.
       * Can be set to ACTIVE using the [SymmetricKeyService.Update] method.
       * 
       *
       * INACTIVE = 3;
       */
      public static final int INACTIVE_VALUE = 3;
      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 Status 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 Status forNumber(int value) {
        switch (value) {
          case 0: return STATUS_UNSPECIFIED;
          case 1: return CREATING;
          case 2: return ACTIVE;
          case 3: return INACTIVE;
          default: return null;
        }
      }
      public static com.google.protobuf.Internal.EnumLiteMap
          internalGetValueMap() {
        return internalValueMap;
      }
      private static final com.google.protobuf.Internal.EnumLiteMap<
          Status> internalValueMap =
            new com.google.protobuf.Internal.EnumLiteMap() {
              public Status findValueByNumber(int number) {
                return Status.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 yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKey.getDescriptor().getEnumTypes().get(0);
      }
      private static final Status[] VALUES = values();
      public static Status 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 Status(int value) {
        this.value = value;
      }
      // @@protoc_insertion_point(enum_scope:yandex.cloud.kms.v1.SymmetricKey.Status)
    }
    public static final int ID_FIELD_NUMBER = 1;
    private volatile java.lang.Object id_;
    /**
     * 
     * ID of the key.
     * 
     *
     * string id = 1;
     * @return The id.
     */
    @java.lang.Override
    public java.lang.String getId() {
      java.lang.Object ref = id_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        id_ = s;
        return s;
      }
    }
    /**
     * 
     * ID of the key.
     * 
     *
     * string id = 1;
     * @return The bytes for id.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString
        getIdBytes() {
      java.lang.Object ref = id_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        id_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    public static final int FOLDER_ID_FIELD_NUMBER = 2;
    private volatile java.lang.Object folderId_;
    /**
     * 
     * ID of the folder that the key belongs to.
     * 
     *
     * string folder_id = 2;
     * @return The folderId.
     */
    @java.lang.Override
    public java.lang.String getFolderId() {
      java.lang.Object ref = folderId_;
      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();
        folderId_ = s;
        return s;
      }
    }
    /**
     * 
     * ID of the folder that the key belongs to.
     * 
     *
     * string folder_id = 2;
     * @return The bytes for folderId.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString
        getFolderIdBytes() {
      java.lang.Object ref = folderId_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        folderId_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    public static final int CREATED_AT_FIELD_NUMBER = 3;
    private com.google.protobuf.Timestamp createdAt_;
    /**
     * 
     * Time when the key was created.
     * 
     *
     * .google.protobuf.Timestamp created_at = 3;
     * @return Whether the createdAt field is set.
     */
    @java.lang.Override
    public boolean hasCreatedAt() {
      return createdAt_ != null;
    }
    /**
     * 
     * Time when the key was created.
     * 
     *
     * .google.protobuf.Timestamp created_at = 3;
     * @return The createdAt.
     */
    @java.lang.Override
    public com.google.protobuf.Timestamp getCreatedAt() {
      return createdAt_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createdAt_;
    }
    /**
     * 
     * Time when the key was created.
     * 
     *
     * .google.protobuf.Timestamp created_at = 3;
     */
    @java.lang.Override
    public com.google.protobuf.TimestampOrBuilder getCreatedAtOrBuilder() {
      return getCreatedAt();
    }
    public static final int NAME_FIELD_NUMBER = 4;
    private volatile java.lang.Object name_;
    /**
     * 
     * Name of the key.
     * 
     *
     * string name = 4;
     * @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;
      }
    }
    /**
     * 
     * Name of the key.
     * 
     *
     * string name = 4;
     * @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 DESCRIPTION_FIELD_NUMBER = 5;
    private volatile java.lang.Object description_;
    /**
     * 
     * Description of the key.
     * 
     *
     * string description = 5;
     * @return The description.
     */
    @java.lang.Override
    public java.lang.String getDescription() {
      java.lang.Object ref = description_;
      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();
        description_ = s;
        return s;
      }
    }
    /**
     * 
     * Description of the key.
     * 
     *
     * string description = 5;
     * @return The bytes for description.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString
        getDescriptionBytes() {
      java.lang.Object ref = description_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        description_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    public static final int LABELS_FIELD_NUMBER = 6;
    private static final class LabelsDefaultEntryHolder {
      static final com.google.protobuf.MapEntry<
          java.lang.String, java.lang.String> defaultEntry =
              com.google.protobuf.MapEntry
              .newDefaultInstance(
                  yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.internal_static_yandex_cloud_kms_v1_SymmetricKey_LabelsEntry_descriptor, 
                  com.google.protobuf.WireFormat.FieldType.STRING,
                  "",
                  com.google.protobuf.WireFormat.FieldType.STRING,
                  "");
    }
    private com.google.protobuf.MapField<
        java.lang.String, java.lang.String> labels_;
    private com.google.protobuf.MapField
    internalGetLabels() {
      if (labels_ == null) {
        return com.google.protobuf.MapField.emptyMapField(
            LabelsDefaultEntryHolder.defaultEntry);
      }
      return labels_;
    }
    public int getLabelsCount() {
      return internalGetLabels().getMap().size();
    }
    /**
     * 
     * Custom labels for the key as `key:value` pairs. Maximum 64 per key.
     * 
     *
     * map<string, string> labels = 6;
     */
    @java.lang.Override
    public boolean containsLabels(
        java.lang.String key) {
      if (key == null) { throw new NullPointerException("map key"); }
      return internalGetLabels().getMap().containsKey(key);
    }
    /**
     * Use {@link #getLabelsMap()} instead.
     */
    @java.lang.Override
    @java.lang.Deprecated
    public java.util.Map getLabels() {
      return getLabelsMap();
    }
    /**
     * 
     * Custom labels for the key as `key:value` pairs. Maximum 64 per key.
     * 
     *
     * map<string, string> labels = 6;
     */
    @java.lang.Override
    public java.util.Map getLabelsMap() {
      return internalGetLabels().getMap();
    }
    /**
     * 
     * Custom labels for the key as `key:value` pairs. Maximum 64 per key.
     * 
     *
     * map<string, string> labels = 6;
     */
    @java.lang.Override
    public java.lang.String getLabelsOrDefault(
        java.lang.String key,
        java.lang.String defaultValue) {
      if (key == null) { throw new NullPointerException("map key"); }
      java.util.Map map =
          internalGetLabels().getMap();
      return map.containsKey(key) ? map.get(key) : defaultValue;
    }
    /**
     * 
     * Custom labels for the key as `key:value` pairs. Maximum 64 per key.
     * 
     *
     * map<string, string> labels = 6;
     */
    @java.lang.Override
    public java.lang.String getLabelsOrThrow(
        java.lang.String key) {
      if (key == null) { throw new NullPointerException("map key"); }
      java.util.Map map =
          internalGetLabels().getMap();
      if (!map.containsKey(key)) {
        throw new java.lang.IllegalArgumentException();
      }
      return map.get(key);
    }
    public static final int STATUS_FIELD_NUMBER = 7;
    private int status_;
    /**
     * 
     * Current status of the key.
     * 
     *
     * .yandex.cloud.kms.v1.SymmetricKey.Status status = 7;
     * @return The enum numeric value on the wire for status.
     */
    @java.lang.Override public int getStatusValue() {
      return status_;
    }
    /**
     * 
     * Current status of the key.
     * 
     *
     * .yandex.cloud.kms.v1.SymmetricKey.Status status = 7;
     * @return The status.
     */
    @java.lang.Override public yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKey.Status getStatus() {
      @SuppressWarnings("deprecation")
      yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKey.Status result = yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKey.Status.valueOf(status_);
      return result == null ? yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKey.Status.UNRECOGNIZED : result;
    }
    public static final int PRIMARY_VERSION_FIELD_NUMBER = 8;
    private yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion primaryVersion_;
    /**
     * 
     * Primary version of the key, used as the default for all encrypt/decrypt operations,
     * when no version ID is specified.
     * 
     *
     * .yandex.cloud.kms.v1.SymmetricKeyVersion primary_version = 8;
     * @return Whether the primaryVersion field is set.
     */
    @java.lang.Override
    public boolean hasPrimaryVersion() {
      return primaryVersion_ != null;
    }
    /**
     * 
     * Primary version of the key, used as the default for all encrypt/decrypt operations,
     * when no version ID is specified.
     * 
     *
     * .yandex.cloud.kms.v1.SymmetricKeyVersion primary_version = 8;
     * @return The primaryVersion.
     */
    @java.lang.Override
    public yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion getPrimaryVersion() {
      return primaryVersion_ == null ? yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion.getDefaultInstance() : primaryVersion_;
    }
    /**
     * 
     * Primary version of the key, used as the default for all encrypt/decrypt operations,
     * when no version ID is specified.
     * 
     *
     * .yandex.cloud.kms.v1.SymmetricKeyVersion primary_version = 8;
     */
    @java.lang.Override
    public yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersionOrBuilder getPrimaryVersionOrBuilder() {
      return getPrimaryVersion();
    }
    public static final int DEFAULT_ALGORITHM_FIELD_NUMBER = 9;
    private int defaultAlgorithm_;
    /**
     * 
     * Default encryption algorithm to be used with new versions of the key.
     * 
     *
     * .yandex.cloud.kms.v1.SymmetricAlgorithm default_algorithm = 9;
     * @return The enum numeric value on the wire for defaultAlgorithm.
     */
    @java.lang.Override public int getDefaultAlgorithmValue() {
      return defaultAlgorithm_;
    }
    /**
     * 
     * Default encryption algorithm to be used with new versions of the key.
     * 
     *
     * .yandex.cloud.kms.v1.SymmetricAlgorithm default_algorithm = 9;
     * @return The defaultAlgorithm.
     */
    @java.lang.Override public yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricAlgorithm getDefaultAlgorithm() {
      @SuppressWarnings("deprecation")
      yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricAlgorithm result = yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricAlgorithm.valueOf(defaultAlgorithm_);
      return result == null ? yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricAlgorithm.UNRECOGNIZED : result;
    }
    public static final int ROTATED_AT_FIELD_NUMBER = 10;
    private com.google.protobuf.Timestamp rotatedAt_;
    /**
     * 
     * Time of the last key rotation (time when the last version was created).
     * Empty if the key does not have versions yet.
     * 
     *
     * .google.protobuf.Timestamp rotated_at = 10;
     * @return Whether the rotatedAt field is set.
     */
    @java.lang.Override
    public boolean hasRotatedAt() {
      return rotatedAt_ != null;
    }
    /**
     * 
     * Time of the last key rotation (time when the last version was created).
     * Empty if the key does not have versions yet.
     * 
     *
     * .google.protobuf.Timestamp rotated_at = 10;
     * @return The rotatedAt.
     */
    @java.lang.Override
    public com.google.protobuf.Timestamp getRotatedAt() {
      return rotatedAt_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : rotatedAt_;
    }
    /**
     * 
     * Time of the last key rotation (time when the last version was created).
     * Empty if the key does not have versions yet.
     * 
     *
     * .google.protobuf.Timestamp rotated_at = 10;
     */
    @java.lang.Override
    public com.google.protobuf.TimestampOrBuilder getRotatedAtOrBuilder() {
      return getRotatedAt();
    }
    public static final int ROTATION_PERIOD_FIELD_NUMBER = 11;
    private com.google.protobuf.Duration rotationPeriod_;
    /**
     * 
     * Time period between automatic key rotations.
     * 
     *
     * .google.protobuf.Duration rotation_period = 11;
     * @return Whether the rotationPeriod field is set.
     */
    @java.lang.Override
    public boolean hasRotationPeriod() {
      return rotationPeriod_ != null;
    }
    /**
     * 
     * Time period between automatic key rotations.
     * 
     *
     * .google.protobuf.Duration rotation_period = 11;
     * @return The rotationPeriod.
     */
    @java.lang.Override
    public com.google.protobuf.Duration getRotationPeriod() {
      return rotationPeriod_ == null ? com.google.protobuf.Duration.getDefaultInstance() : rotationPeriod_;
    }
    /**
     * 
     * Time period between automatic key rotations.
     * 
     *
     * .google.protobuf.Duration rotation_period = 11;
     */
    @java.lang.Override
    public com.google.protobuf.DurationOrBuilder getRotationPeriodOrBuilder() {
      return getRotationPeriod();
    }
    public static final int DELETION_PROTECTION_FIELD_NUMBER = 12;
    private boolean deletionProtection_;
    /**
     * 
     * Flag that inhibits deletion of the key
     * 
     *
     * bool deletion_protection = 12;
     * @return The deletionProtection.
     */
    @java.lang.Override
    public boolean getDeletionProtection() {
      return deletionProtection_;
    }
    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(id_)) {
        com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_);
      }
      if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(folderId_)) {
        com.google.protobuf.GeneratedMessageV3.writeString(output, 2, folderId_);
      }
      if (createdAt_ != null) {
        output.writeMessage(3, getCreatedAt());
      }
      if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
        com.google.protobuf.GeneratedMessageV3.writeString(output, 4, name_);
      }
      if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) {
        com.google.protobuf.GeneratedMessageV3.writeString(output, 5, description_);
      }
      com.google.protobuf.GeneratedMessageV3
        .serializeStringMapTo(
          output,
          internalGetLabels(),
          LabelsDefaultEntryHolder.defaultEntry,
          6);
      if (status_ != yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKey.Status.STATUS_UNSPECIFIED.getNumber()) {
        output.writeEnum(7, status_);
      }
      if (primaryVersion_ != null) {
        output.writeMessage(8, getPrimaryVersion());
      }
      if (defaultAlgorithm_ != yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricAlgorithm.SYMMETRIC_ALGORITHM_UNSPECIFIED.getNumber()) {
        output.writeEnum(9, defaultAlgorithm_);
      }
      if (rotatedAt_ != null) {
        output.writeMessage(10, getRotatedAt());
      }
      if (rotationPeriod_ != null) {
        output.writeMessage(11, getRotationPeriod());
      }
      if (deletionProtection_ != false) {
        output.writeBool(12, deletionProtection_);
      }
      unknownFields.writeTo(output);
    }
    @java.lang.Override
    public int getSerializedSize() {
      int size = memoizedSize;
      if (size != -1) return size;
      size = 0;
      if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) {
        size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_);
      }
      if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(folderId_)) {
        size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, folderId_);
      }
      if (createdAt_ != null) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(3, getCreatedAt());
      }
      if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
        size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, name_);
      }
      if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) {
        size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, description_);
      }
      for (java.util.Map.Entry entry
           : internalGetLabels().getMap().entrySet()) {
        com.google.protobuf.MapEntry
        labels__ = LabelsDefaultEntryHolder.defaultEntry.newBuilderForType()
            .setKey(entry.getKey())
            .setValue(entry.getValue())
            .build();
        size += com.google.protobuf.CodedOutputStream
            .computeMessageSize(6, labels__);
      }
      if (status_ != yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKey.Status.STATUS_UNSPECIFIED.getNumber()) {
        size += com.google.protobuf.CodedOutputStream
          .computeEnumSize(7, status_);
      }
      if (primaryVersion_ != null) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(8, getPrimaryVersion());
      }
      if (defaultAlgorithm_ != yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricAlgorithm.SYMMETRIC_ALGORITHM_UNSPECIFIED.getNumber()) {
        size += com.google.protobuf.CodedOutputStream
          .computeEnumSize(9, defaultAlgorithm_);
      }
      if (rotatedAt_ != null) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(10, getRotatedAt());
      }
      if (rotationPeriod_ != null) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(11, getRotationPeriod());
      }
      if (deletionProtection_ != false) {
        size += com.google.protobuf.CodedOutputStream
          .computeBoolSize(12, deletionProtection_);
      }
      size += unknownFields.getSerializedSize();
      memoizedSize = size;
      return size;
    }
    @java.lang.Override
    public boolean equals(final java.lang.Object obj) {
      if (obj == this) {
       return true;
      }
      if (!(obj instanceof yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKey)) {
        return super.equals(obj);
      }
      yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKey other = (yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKey) obj;
      if (!getId()
          .equals(other.getId())) return false;
      if (!getFolderId()
          .equals(other.getFolderId())) return false;
      if (hasCreatedAt() != other.hasCreatedAt()) return false;
      if (hasCreatedAt()) {
        if (!getCreatedAt()
            .equals(other.getCreatedAt())) return false;
      }
      if (!getName()
          .equals(other.getName())) return false;
      if (!getDescription()
          .equals(other.getDescription())) return false;
      if (!internalGetLabels().equals(
          other.internalGetLabels())) return false;
      if (status_ != other.status_) return false;
      if (hasPrimaryVersion() != other.hasPrimaryVersion()) return false;
      if (hasPrimaryVersion()) {
        if (!getPrimaryVersion()
            .equals(other.getPrimaryVersion())) return false;
      }
      if (defaultAlgorithm_ != other.defaultAlgorithm_) return false;
      if (hasRotatedAt() != other.hasRotatedAt()) return false;
      if (hasRotatedAt()) {
        if (!getRotatedAt()
            .equals(other.getRotatedAt())) return false;
      }
      if (hasRotationPeriod() != other.hasRotationPeriod()) return false;
      if (hasRotationPeriod()) {
        if (!getRotationPeriod()
            .equals(other.getRotationPeriod())) return false;
      }
      if (getDeletionProtection()
          != other.getDeletionProtection()) return false;
      if (!unknownFields.equals(other.unknownFields)) 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) + ID_FIELD_NUMBER;
      hash = (53 * hash) + getId().hashCode();
      hash = (37 * hash) + FOLDER_ID_FIELD_NUMBER;
      hash = (53 * hash) + getFolderId().hashCode();
      if (hasCreatedAt()) {
        hash = (37 * hash) + CREATED_AT_FIELD_NUMBER;
        hash = (53 * hash) + getCreatedAt().hashCode();
      }
      hash = (37 * hash) + NAME_FIELD_NUMBER;
      hash = (53 * hash) + getName().hashCode();
      hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER;
      hash = (53 * hash) + getDescription().hashCode();
      if (!internalGetLabels().getMap().isEmpty()) {
        hash = (37 * hash) + LABELS_FIELD_NUMBER;
        hash = (53 * hash) + internalGetLabels().hashCode();
      }
      hash = (37 * hash) + STATUS_FIELD_NUMBER;
      hash = (53 * hash) + status_;
      if (hasPrimaryVersion()) {
        hash = (37 * hash) + PRIMARY_VERSION_FIELD_NUMBER;
        hash = (53 * hash) + getPrimaryVersion().hashCode();
      }
      hash = (37 * hash) + DEFAULT_ALGORITHM_FIELD_NUMBER;
      hash = (53 * hash) + defaultAlgorithm_;
      if (hasRotatedAt()) {
        hash = (37 * hash) + ROTATED_AT_FIELD_NUMBER;
        hash = (53 * hash) + getRotatedAt().hashCode();
      }
      if (hasRotationPeriod()) {
        hash = (37 * hash) + ROTATION_PERIOD_FIELD_NUMBER;
        hash = (53 * hash) + getRotationPeriod().hashCode();
      }
      hash = (37 * hash) + DELETION_PROTECTION_FIELD_NUMBER;
      hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
          getDeletionProtection());
      hash = (29 * hash) + unknownFields.hashCode();
      memoizedHashCode = hash;
      return hash;
    }
    public static yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKey parseFrom(
        java.nio.ByteBuffer data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKey parseFrom(
        java.nio.ByteBuffer data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKey parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKey parseFrom(
        com.google.protobuf.ByteString data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKey parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKey parseFrom(
        byte[] data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKey parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input);
    }
    public static yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKey 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 yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKey parseDelimitedFrom(java.io.InputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseDelimitedWithIOException(PARSER, input);
    }
    public static yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKey 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 yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKey parseFrom(
        com.google.protobuf.CodedInputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input);
    }
    public static yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKey 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(yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKey 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;
    }
    /**
     * 
     * A symmetric KMS key that may contain several versions of the cryptographic material.
     * 
     *
     * Protobuf type {@code yandex.cloud.kms.v1.SymmetricKey}
     */
    public static final class Builder extends
        com.google.protobuf.GeneratedMessageV3.Builder implements
        // @@protoc_insertion_point(builder_implements:yandex.cloud.kms.v1.SymmetricKey)
        yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.internal_static_yandex_cloud_kms_v1_SymmetricKey_descriptor;
      }
      @SuppressWarnings({"rawtypes"})
      protected com.google.protobuf.MapField internalGetMapField(
          int number) {
        switch (number) {
          case 6:
            return internalGetLabels();
          default:
            throw new RuntimeException(
                "Invalid map field number: " + number);
        }
      }
      @SuppressWarnings({"rawtypes"})
      protected com.google.protobuf.MapField internalGetMutableMapField(
          int number) {
        switch (number) {
          case 6:
            return internalGetMutableLabels();
          default:
            throw new RuntimeException(
                "Invalid map field number: " + number);
        }
      }
      @java.lang.Override
      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.internal_static_yandex_cloud_kms_v1_SymmetricKey_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKey.class, yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKey.Builder.class);
      }
      // Construct using yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKey.newBuilder()
      private Builder() {
        maybeForceBuilderInitialization();
      }
      private Builder(
          com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        super(parent);
        maybeForceBuilderInitialization();
      }
      private void maybeForceBuilderInitialization() {
        if (com.google.protobuf.GeneratedMessageV3
                .alwaysUseFieldBuilders) {
        }
      }
      @java.lang.Override
      public Builder clear() {
        super.clear();
        id_ = "";
        folderId_ = "";
        if (createdAtBuilder_ == null) {
          createdAt_ = null;
        } else {
          createdAt_ = null;
          createdAtBuilder_ = null;
        }
        name_ = "";
        description_ = "";
        internalGetMutableLabels().clear();
        status_ = 0;
        if (primaryVersionBuilder_ == null) {
          primaryVersion_ = null;
        } else {
          primaryVersion_ = null;
          primaryVersionBuilder_ = null;
        }
        defaultAlgorithm_ = 0;
        if (rotatedAtBuilder_ == null) {
          rotatedAt_ = null;
        } else {
          rotatedAt_ = null;
          rotatedAtBuilder_ = null;
        }
        if (rotationPeriodBuilder_ == null) {
          rotationPeriod_ = null;
        } else {
          rotationPeriod_ = null;
          rotationPeriodBuilder_ = null;
        }
        deletionProtection_ = false;
        return this;
      }
      @java.lang.Override
      public com.google.protobuf.Descriptors.Descriptor
          getDescriptorForType() {
        return yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.internal_static_yandex_cloud_kms_v1_SymmetricKey_descriptor;
      }
      @java.lang.Override
      public yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKey getDefaultInstanceForType() {
        return yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKey.getDefaultInstance();
      }
      @java.lang.Override
      public yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKey build() {
        yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKey result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }
      @java.lang.Override
      public yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKey buildPartial() {
        yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKey result = new yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKey(this);
        int from_bitField0_ = bitField0_;
        result.id_ = id_;
        result.folderId_ = folderId_;
        if (createdAtBuilder_ == null) {
          result.createdAt_ = createdAt_;
        } else {
          result.createdAt_ = createdAtBuilder_.build();
        }
        result.name_ = name_;
        result.description_ = description_;
        result.labels_ = internalGetLabels();
        result.labels_.makeImmutable();
        result.status_ = status_;
        if (primaryVersionBuilder_ == null) {
          result.primaryVersion_ = primaryVersion_;
        } else {
          result.primaryVersion_ = primaryVersionBuilder_.build();
        }
        result.defaultAlgorithm_ = defaultAlgorithm_;
        if (rotatedAtBuilder_ == null) {
          result.rotatedAt_ = rotatedAt_;
        } else {
          result.rotatedAt_ = rotatedAtBuilder_.build();
        }
        if (rotationPeriodBuilder_ == null) {
          result.rotationPeriod_ = rotationPeriod_;
        } else {
          result.rotationPeriod_ = rotationPeriodBuilder_.build();
        }
        result.deletionProtection_ = deletionProtection_;
        onBuilt();
        return result;
      }
      @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 yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKey) {
          return mergeFrom((yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKey)other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }
      public Builder mergeFrom(yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKey other) {
        if (other == yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKey.getDefaultInstance()) return this;
        if (!other.getId().isEmpty()) {
          id_ = other.id_;
          onChanged();
        }
        if (!other.getFolderId().isEmpty()) {
          folderId_ = other.folderId_;
          onChanged();
        }
        if (other.hasCreatedAt()) {
          mergeCreatedAt(other.getCreatedAt());
        }
        if (!other.getName().isEmpty()) {
          name_ = other.name_;
          onChanged();
        }
        if (!other.getDescription().isEmpty()) {
          description_ = other.description_;
          onChanged();
        }
        internalGetMutableLabels().mergeFrom(
            other.internalGetLabels());
        if (other.status_ != 0) {
          setStatusValue(other.getStatusValue());
        }
        if (other.hasPrimaryVersion()) {
          mergePrimaryVersion(other.getPrimaryVersion());
        }
        if (other.defaultAlgorithm_ != 0) {
          setDefaultAlgorithmValue(other.getDefaultAlgorithmValue());
        }
        if (other.hasRotatedAt()) {
          mergeRotatedAt(other.getRotatedAt());
        }
        if (other.hasRotationPeriod()) {
          mergeRotationPeriod(other.getRotationPeriod());
        }
        if (other.getDeletionProtection() != false) {
          setDeletionProtection(other.getDeletionProtection());
        }
        this.mergeUnknownFields(other.unknownFields);
        onChanged();
        return this;
      }
      @java.lang.Override
      public final boolean isInitialized() {
        return true;
      }
      @java.lang.Override
      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKey parsedMessage = null;
        try {
          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          parsedMessage = (yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKey) e.getUnfinishedMessage();
          throw e.unwrapIOException();
        } finally {
          if (parsedMessage != null) {
            mergeFrom(parsedMessage);
          }
        }
        return this;
      }
      private int bitField0_;
      private java.lang.Object id_ = "";
      /**
       * 
       * ID of the key.
       * 
       *
       * string id = 1;
       * @return The id.
       */
      public java.lang.String getId() {
        java.lang.Object ref = id_;
        if (!(ref instanceof java.lang.String)) {
          com.google.protobuf.ByteString bs =
              (com.google.protobuf.ByteString) ref;
          java.lang.String s = bs.toStringUtf8();
          id_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * 
       * ID of the key.
       * 
       *
       * string id = 1;
       * @return The bytes for id.
       */
      public com.google.protobuf.ByteString
          getIdBytes() {
        java.lang.Object ref = id_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          id_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * 
       * ID of the key.
       * 
       *
       * string id = 1;
       * @param value The id to set.
       * @return This builder for chaining.
       */
      public Builder setId(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  
        id_ = value;
        onChanged();
        return this;
      }
      /**
       * 
       * ID of the key.
       * 
       *
       * string id = 1;
       * @return This builder for chaining.
       */
      public Builder clearId() {
        
        id_ = getDefaultInstance().getId();
        onChanged();
        return this;
      }
      /**
       * 
       * ID of the key.
       * 
       *
       * string id = 1;
       * @param value The bytes for id to set.
       * @return This builder for chaining.
       */
      public Builder setIdBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
        
        id_ = value;
        onChanged();
        return this;
      }
      private java.lang.Object folderId_ = "";
      /**
       * 
       * ID of the folder that the key belongs to.
       * 
       *
       * string folder_id = 2;
       * @return The folderId.
       */
      public java.lang.String getFolderId() {
        java.lang.Object ref = folderId_;
        if (!(ref instanceof java.lang.String)) {
          com.google.protobuf.ByteString bs =
              (com.google.protobuf.ByteString) ref;
          java.lang.String s = bs.toStringUtf8();
          folderId_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * 
       * ID of the folder that the key belongs to.
       * 
       *
       * string folder_id = 2;
       * @return The bytes for folderId.
       */
      public com.google.protobuf.ByteString
          getFolderIdBytes() {
        java.lang.Object ref = folderId_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          folderId_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * 
       * ID of the folder that the key belongs to.
       * 
       *
       * string folder_id = 2;
       * @param value The folderId to set.
       * @return This builder for chaining.
       */
      public Builder setFolderId(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  
        folderId_ = value;
        onChanged();
        return this;
      }
      /**
       * 
       * ID of the folder that the key belongs to.
       * 
       *
       * string folder_id = 2;
       * @return This builder for chaining.
       */
      public Builder clearFolderId() {
        
        folderId_ = getDefaultInstance().getFolderId();
        onChanged();
        return this;
      }
      /**
       * 
       * ID of the folder that the key belongs to.
       * 
       *
       * string folder_id = 2;
       * @param value The bytes for folderId to set.
       * @return This builder for chaining.
       */
      public Builder setFolderIdBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
        
        folderId_ = value;
        onChanged();
        return this;
      }
      private com.google.protobuf.Timestamp createdAt_;
      private com.google.protobuf.SingleFieldBuilderV3<
          com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> createdAtBuilder_;
      /**
       * 
       * Time when the key was created.
       * 
       *
       * .google.protobuf.Timestamp created_at = 3;
       * @return Whether the createdAt field is set.
       */
      public boolean hasCreatedAt() {
        return createdAtBuilder_ != null || createdAt_ != null;
      }
      /**
       * 
       * Time when the key was created.
       * 
       *
       * .google.protobuf.Timestamp created_at = 3;
       * @return The createdAt.
       */
      public com.google.protobuf.Timestamp getCreatedAt() {
        if (createdAtBuilder_ == null) {
          return createdAt_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createdAt_;
        } else {
          return createdAtBuilder_.getMessage();
        }
      }
      /**
       * 
       * Time when the key was created.
       * 
       *
       * .google.protobuf.Timestamp created_at = 3;
       */
      public Builder setCreatedAt(com.google.protobuf.Timestamp value) {
        if (createdAtBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          createdAt_ = value;
          onChanged();
        } else {
          createdAtBuilder_.setMessage(value);
        }
        return this;
      }
      /**
       * 
       * Time when the key was created.
       * 
       *
       * .google.protobuf.Timestamp created_at = 3;
       */
      public Builder setCreatedAt(
          com.google.protobuf.Timestamp.Builder builderForValue) {
        if (createdAtBuilder_ == null) {
          createdAt_ = builderForValue.build();
          onChanged();
        } else {
          createdAtBuilder_.setMessage(builderForValue.build());
        }
        return this;
      }
      /**
       * 
       * Time when the key was created.
       * 
       *
       * .google.protobuf.Timestamp created_at = 3;
       */
      public Builder mergeCreatedAt(com.google.protobuf.Timestamp value) {
        if (createdAtBuilder_ == null) {
          if (createdAt_ != null) {
            createdAt_ =
              com.google.protobuf.Timestamp.newBuilder(createdAt_).mergeFrom(value).buildPartial();
          } else {
            createdAt_ = value;
          }
          onChanged();
        } else {
          createdAtBuilder_.mergeFrom(value);
        }
        return this;
      }
      /**
       * 
       * Time when the key was created.
       * 
       *
       * .google.protobuf.Timestamp created_at = 3;
       */
      public Builder clearCreatedAt() {
        if (createdAtBuilder_ == null) {
          createdAt_ = null;
          onChanged();
        } else {
          createdAt_ = null;
          createdAtBuilder_ = null;
        }
        return this;
      }
      /**
       * 
       * Time when the key was created.
       * 
       *
       * .google.protobuf.Timestamp created_at = 3;
       */
      public com.google.protobuf.Timestamp.Builder getCreatedAtBuilder() {
        
        onChanged();
        return getCreatedAtFieldBuilder().getBuilder();
      }
      /**
       * 
       * Time when the key was created.
       * 
       *
       * .google.protobuf.Timestamp created_at = 3;
       */
      public com.google.protobuf.TimestampOrBuilder getCreatedAtOrBuilder() {
        if (createdAtBuilder_ != null) {
          return createdAtBuilder_.getMessageOrBuilder();
        } else {
          return createdAt_ == null ?
              com.google.protobuf.Timestamp.getDefaultInstance() : createdAt_;
        }
      }
      /**
       * 
       * Time when the key was created.
       * 
       *
       * .google.protobuf.Timestamp created_at = 3;
       */
      private com.google.protobuf.SingleFieldBuilderV3<
          com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> 
          getCreatedAtFieldBuilder() {
        if (createdAtBuilder_ == null) {
          createdAtBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
              com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>(
                  getCreatedAt(),
                  getParentForChildren(),
                  isClean());
          createdAt_ = null;
        }
        return createdAtBuilder_;
      }
      private java.lang.Object name_ = "";
      /**
       * 
       * Name of the key.
       * 
       *
       * string name = 4;
       * @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;
        }
      }
      /**
       * 
       * Name of the key.
       * 
       *
       * string name = 4;
       * @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;
        }
      }
      /**
       * 
       * Name of the key.
       * 
       *
       * string name = 4;
       * @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;
        onChanged();
        return this;
      }
      /**
       * 
       * Name of the key.
       * 
       *
       * string name = 4;
       * @return This builder for chaining.
       */
      public Builder clearName() {
        
        name_ = getDefaultInstance().getName();
        onChanged();
        return this;
      }
      /**
       * 
       * Name of the key.
       * 
       *
       * string name = 4;
       * @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;
        onChanged();
        return this;
      }
      private java.lang.Object description_ = "";
      /**
       * 
       * Description of the key.
       * 
       *
       * string description = 5;
       * @return The description.
       */
      public java.lang.String getDescription() {
        java.lang.Object ref = description_;
        if (!(ref instanceof java.lang.String)) {
          com.google.protobuf.ByteString bs =
              (com.google.protobuf.ByteString) ref;
          java.lang.String s = bs.toStringUtf8();
          description_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * 
       * Description of the key.
       * 
       *
       * string description = 5;
       * @return The bytes for description.
       */
      public com.google.protobuf.ByteString
          getDescriptionBytes() {
        java.lang.Object ref = description_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          description_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * 
       * Description of the key.
       * 
       *
       * string description = 5;
       * @param value The description to set.
       * @return This builder for chaining.
       */
      public Builder setDescription(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  
        description_ = value;
        onChanged();
        return this;
      }
      /**
       * 
       * Description of the key.
       * 
       *
       * string description = 5;
       * @return This builder for chaining.
       */
      public Builder clearDescription() {
        
        description_ = getDefaultInstance().getDescription();
        onChanged();
        return this;
      }
      /**
       * 
       * Description of the key.
       * 
       *
       * string description = 5;
       * @param value The bytes for description to set.
       * @return This builder for chaining.
       */
      public Builder setDescriptionBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
        
        description_ = value;
        onChanged();
        return this;
      }
      private com.google.protobuf.MapField<
          java.lang.String, java.lang.String> labels_;
      private com.google.protobuf.MapField
      internalGetLabels() {
        if (labels_ == null) {
          return com.google.protobuf.MapField.emptyMapField(
              LabelsDefaultEntryHolder.defaultEntry);
        }
        return labels_;
      }
      private com.google.protobuf.MapField
      internalGetMutableLabels() {
        onChanged();;
        if (labels_ == null) {
          labels_ = com.google.protobuf.MapField.newMapField(
              LabelsDefaultEntryHolder.defaultEntry);
        }
        if (!labels_.isMutable()) {
          labels_ = labels_.copy();
        }
        return labels_;
      }
      public int getLabelsCount() {
        return internalGetLabels().getMap().size();
      }
      /**
       * 
       * Custom labels for the key as `key:value` pairs. Maximum 64 per key.
       * 
       *
       * map<string, string> labels = 6;
       */
      @java.lang.Override
      public boolean containsLabels(
          java.lang.String key) {
        if (key == null) { throw new NullPointerException("map key"); }
        return internalGetLabels().getMap().containsKey(key);
      }
      /**
       * Use {@link #getLabelsMap()} instead.
       */
      @java.lang.Override
      @java.lang.Deprecated
      public java.util.Map getLabels() {
        return getLabelsMap();
      }
      /**
       * 
       * Custom labels for the key as `key:value` pairs. Maximum 64 per key.
       * 
       *
       * map<string, string> labels = 6;
       */
      @java.lang.Override
      public java.util.Map getLabelsMap() {
        return internalGetLabels().getMap();
      }
      /**
       * 
       * Custom labels for the key as `key:value` pairs. Maximum 64 per key.
       * 
       *
       * map<string, string> labels = 6;
       */
      @java.lang.Override
      public java.lang.String getLabelsOrDefault(
          java.lang.String key,
          java.lang.String defaultValue) {
        if (key == null) { throw new NullPointerException("map key"); }
        java.util.Map map =
            internalGetLabels().getMap();
        return map.containsKey(key) ? map.get(key) : defaultValue;
      }
      /**
       * 
       * Custom labels for the key as `key:value` pairs. Maximum 64 per key.
       * 
       *
       * map<string, string> labels = 6;
       */
      @java.lang.Override
      public java.lang.String getLabelsOrThrow(
          java.lang.String key) {
        if (key == null) { throw new NullPointerException("map key"); }
        java.util.Map map =
            internalGetLabels().getMap();
        if (!map.containsKey(key)) {
          throw new java.lang.IllegalArgumentException();
        }
        return map.get(key);
      }
      public Builder clearLabels() {
        internalGetMutableLabels().getMutableMap()
            .clear();
        return this;
      }
      /**
       * 
       * Custom labels for the key as `key:value` pairs. Maximum 64 per key.
       * 
       *
       * map<string, string> labels = 6;
       */
      public Builder removeLabels(
          java.lang.String key) {
        if (key == null) { throw new NullPointerException("map key"); }
        internalGetMutableLabels().getMutableMap()
            .remove(key);
        return this;
      }
      /**
       * Use alternate mutation accessors instead.
       */
      @java.lang.Deprecated
      public java.util.Map
      getMutableLabels() {
        return internalGetMutableLabels().getMutableMap();
      }
      /**
       * 
       * Custom labels for the key as `key:value` pairs. Maximum 64 per key.
       * 
       *
       * map<string, string> labels = 6;
       */
      public Builder putLabels(
          java.lang.String key,
          java.lang.String value) {
        if (key == null) { throw new NullPointerException("map key"); }
        if (value == null) {
  throw new NullPointerException("map value");
}
        internalGetMutableLabels().getMutableMap()
            .put(key, value);
        return this;
      }
      /**
       * 
       * Custom labels for the key as `key:value` pairs. Maximum 64 per key.
       * 
       *
       * map<string, string> labels = 6;
       */
      public Builder putAllLabels(
          java.util.Map values) {
        internalGetMutableLabels().getMutableMap()
            .putAll(values);
        return this;
      }
      private int status_ = 0;
      /**
       * 
       * Current status of the key.
       * 
       *
       * .yandex.cloud.kms.v1.SymmetricKey.Status status = 7;
       * @return The enum numeric value on the wire for status.
       */
      @java.lang.Override public int getStatusValue() {
        return status_;
      }
      /**
       * 
       * Current status of the key.
       * 
       *
       * .yandex.cloud.kms.v1.SymmetricKey.Status status = 7;
       * @param value The enum numeric value on the wire for status to set.
       * @return This builder for chaining.
       */
      public Builder setStatusValue(int value) {
        
        status_ = value;
        onChanged();
        return this;
      }
      /**
       * 
       * Current status of the key.
       * 
       *
       * .yandex.cloud.kms.v1.SymmetricKey.Status status = 7;
       * @return The status.
       */
      @java.lang.Override
      public yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKey.Status getStatus() {
        @SuppressWarnings("deprecation")
        yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKey.Status result = yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKey.Status.valueOf(status_);
        return result == null ? yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKey.Status.UNRECOGNIZED : result;
      }
      /**
       * 
       * Current status of the key.
       * 
       *
       * .yandex.cloud.kms.v1.SymmetricKey.Status status = 7;
       * @param value The status to set.
       * @return This builder for chaining.
       */
      public Builder setStatus(yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKey.Status value) {
        if (value == null) {
          throw new NullPointerException();
        }
        
        status_ = value.getNumber();
        onChanged();
        return this;
      }
      /**
       * 
       * Current status of the key.
       * 
       *
       * .yandex.cloud.kms.v1.SymmetricKey.Status status = 7;
       * @return This builder for chaining.
       */
      public Builder clearStatus() {
        
        status_ = 0;
        onChanged();
        return this;
      }
      private yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion primaryVersion_;
      private com.google.protobuf.SingleFieldBuilderV3<
          yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion, yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion.Builder, yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersionOrBuilder> primaryVersionBuilder_;
      /**
       * 
       * Primary version of the key, used as the default for all encrypt/decrypt operations,
       * when no version ID is specified.
       * 
       *
       * .yandex.cloud.kms.v1.SymmetricKeyVersion primary_version = 8;
       * @return Whether the primaryVersion field is set.
       */
      public boolean hasPrimaryVersion() {
        return primaryVersionBuilder_ != null || primaryVersion_ != null;
      }
      /**
       * 
       * Primary version of the key, used as the default for all encrypt/decrypt operations,
       * when no version ID is specified.
       * 
       *
       * .yandex.cloud.kms.v1.SymmetricKeyVersion primary_version = 8;
       * @return The primaryVersion.
       */
      public yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion getPrimaryVersion() {
        if (primaryVersionBuilder_ == null) {
          return primaryVersion_ == null ? yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion.getDefaultInstance() : primaryVersion_;
        } else {
          return primaryVersionBuilder_.getMessage();
        }
      }
      /**
       * 
       * Primary version of the key, used as the default for all encrypt/decrypt operations,
       * when no version ID is specified.
       * 
       *
       * .yandex.cloud.kms.v1.SymmetricKeyVersion primary_version = 8;
       */
      public Builder setPrimaryVersion(yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion value) {
        if (primaryVersionBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          primaryVersion_ = value;
          onChanged();
        } else {
          primaryVersionBuilder_.setMessage(value);
        }
        return this;
      }
      /**
       * 
       * Primary version of the key, used as the default for all encrypt/decrypt operations,
       * when no version ID is specified.
       * 
       *
       * .yandex.cloud.kms.v1.SymmetricKeyVersion primary_version = 8;
       */
      public Builder setPrimaryVersion(
          yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion.Builder builderForValue) {
        if (primaryVersionBuilder_ == null) {
          primaryVersion_ = builderForValue.build();
          onChanged();
        } else {
          primaryVersionBuilder_.setMessage(builderForValue.build());
        }
        return this;
      }
      /**
       * 
       * Primary version of the key, used as the default for all encrypt/decrypt operations,
       * when no version ID is specified.
       * 
       *
       * .yandex.cloud.kms.v1.SymmetricKeyVersion primary_version = 8;
       */
      public Builder mergePrimaryVersion(yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion value) {
        if (primaryVersionBuilder_ == null) {
          if (primaryVersion_ != null) {
            primaryVersion_ =
              yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion.newBuilder(primaryVersion_).mergeFrom(value).buildPartial();
          } else {
            primaryVersion_ = value;
          }
          onChanged();
        } else {
          primaryVersionBuilder_.mergeFrom(value);
        }
        return this;
      }
      /**
       * 
       * Primary version of the key, used as the default for all encrypt/decrypt operations,
       * when no version ID is specified.
       * 
       *
       * .yandex.cloud.kms.v1.SymmetricKeyVersion primary_version = 8;
       */
      public Builder clearPrimaryVersion() {
        if (primaryVersionBuilder_ == null) {
          primaryVersion_ = null;
          onChanged();
        } else {
          primaryVersion_ = null;
          primaryVersionBuilder_ = null;
        }
        return this;
      }
      /**
       * 
       * Primary version of the key, used as the default for all encrypt/decrypt operations,
       * when no version ID is specified.
       * 
       *
       * .yandex.cloud.kms.v1.SymmetricKeyVersion primary_version = 8;
       */
      public yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion.Builder getPrimaryVersionBuilder() {
        
        onChanged();
        return getPrimaryVersionFieldBuilder().getBuilder();
      }
      /**
       * 
       * Primary version of the key, used as the default for all encrypt/decrypt operations,
       * when no version ID is specified.
       * 
       *
       * .yandex.cloud.kms.v1.SymmetricKeyVersion primary_version = 8;
       */
      public yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersionOrBuilder getPrimaryVersionOrBuilder() {
        if (primaryVersionBuilder_ != null) {
          return primaryVersionBuilder_.getMessageOrBuilder();
        } else {
          return primaryVersion_ == null ?
              yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion.getDefaultInstance() : primaryVersion_;
        }
      }
      /**
       * 
       * Primary version of the key, used as the default for all encrypt/decrypt operations,
       * when no version ID is specified.
       * 
       *
       * .yandex.cloud.kms.v1.SymmetricKeyVersion primary_version = 8;
       */
      private com.google.protobuf.SingleFieldBuilderV3<
          yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion, yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion.Builder, yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersionOrBuilder> 
          getPrimaryVersionFieldBuilder() {
        if (primaryVersionBuilder_ == null) {
          primaryVersionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
              yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion, yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion.Builder, yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersionOrBuilder>(
                  getPrimaryVersion(),
                  getParentForChildren(),
                  isClean());
          primaryVersion_ = null;
        }
        return primaryVersionBuilder_;
      }
      private int defaultAlgorithm_ = 0;
      /**
       * 
       * Default encryption algorithm to be used with new versions of the key.
       * 
       *
       * .yandex.cloud.kms.v1.SymmetricAlgorithm default_algorithm = 9;
       * @return The enum numeric value on the wire for defaultAlgorithm.
       */
      @java.lang.Override public int getDefaultAlgorithmValue() {
        return defaultAlgorithm_;
      }
      /**
       * 
       * Default encryption algorithm to be used with new versions of the key.
       * 
       *
       * .yandex.cloud.kms.v1.SymmetricAlgorithm default_algorithm = 9;
       * @param value The enum numeric value on the wire for defaultAlgorithm to set.
       * @return This builder for chaining.
       */
      public Builder setDefaultAlgorithmValue(int value) {
        
        defaultAlgorithm_ = value;
        onChanged();
        return this;
      }
      /**
       * 
       * Default encryption algorithm to be used with new versions of the key.
       * 
       *
       * .yandex.cloud.kms.v1.SymmetricAlgorithm default_algorithm = 9;
       * @return The defaultAlgorithm.
       */
      @java.lang.Override
      public yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricAlgorithm getDefaultAlgorithm() {
        @SuppressWarnings("deprecation")
        yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricAlgorithm result = yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricAlgorithm.valueOf(defaultAlgorithm_);
        return result == null ? yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricAlgorithm.UNRECOGNIZED : result;
      }
      /**
       * 
       * Default encryption algorithm to be used with new versions of the key.
       * 
       *
       * .yandex.cloud.kms.v1.SymmetricAlgorithm default_algorithm = 9;
       * @param value The defaultAlgorithm to set.
       * @return This builder for chaining.
       */
      public Builder setDefaultAlgorithm(yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricAlgorithm value) {
        if (value == null) {
          throw new NullPointerException();
        }
        
        defaultAlgorithm_ = value.getNumber();
        onChanged();
        return this;
      }
      /**
       * 
       * Default encryption algorithm to be used with new versions of the key.
       * 
       *
       * .yandex.cloud.kms.v1.SymmetricAlgorithm default_algorithm = 9;
       * @return This builder for chaining.
       */
      public Builder clearDefaultAlgorithm() {
        
        defaultAlgorithm_ = 0;
        onChanged();
        return this;
      }
      private com.google.protobuf.Timestamp rotatedAt_;
      private com.google.protobuf.SingleFieldBuilderV3<
          com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> rotatedAtBuilder_;
      /**
       * 
       * Time of the last key rotation (time when the last version was created).
       * Empty if the key does not have versions yet.
       * 
       *
       * .google.protobuf.Timestamp rotated_at = 10;
       * @return Whether the rotatedAt field is set.
       */
      public boolean hasRotatedAt() {
        return rotatedAtBuilder_ != null || rotatedAt_ != null;
      }
      /**
       * 
       * Time of the last key rotation (time when the last version was created).
       * Empty if the key does not have versions yet.
       * 
       *
       * .google.protobuf.Timestamp rotated_at = 10;
       * @return The rotatedAt.
       */
      public com.google.protobuf.Timestamp getRotatedAt() {
        if (rotatedAtBuilder_ == null) {
          return rotatedAt_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : rotatedAt_;
        } else {
          return rotatedAtBuilder_.getMessage();
        }
      }
      /**
       * 
       * Time of the last key rotation (time when the last version was created).
       * Empty if the key does not have versions yet.
       * 
       *
       * .google.protobuf.Timestamp rotated_at = 10;
       */
      public Builder setRotatedAt(com.google.protobuf.Timestamp value) {
        if (rotatedAtBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          rotatedAt_ = value;
          onChanged();
        } else {
          rotatedAtBuilder_.setMessage(value);
        }
        return this;
      }
      /**
       * 
       * Time of the last key rotation (time when the last version was created).
       * Empty if the key does not have versions yet.
       * 
       *
       * .google.protobuf.Timestamp rotated_at = 10;
       */
      public Builder setRotatedAt(
          com.google.protobuf.Timestamp.Builder builderForValue) {
        if (rotatedAtBuilder_ == null) {
          rotatedAt_ = builderForValue.build();
          onChanged();
        } else {
          rotatedAtBuilder_.setMessage(builderForValue.build());
        }
        return this;
      }
      /**
       * 
       * Time of the last key rotation (time when the last version was created).
       * Empty if the key does not have versions yet.
       * 
       *
       * .google.protobuf.Timestamp rotated_at = 10;
       */
      public Builder mergeRotatedAt(com.google.protobuf.Timestamp value) {
        if (rotatedAtBuilder_ == null) {
          if (rotatedAt_ != null) {
            rotatedAt_ =
              com.google.protobuf.Timestamp.newBuilder(rotatedAt_).mergeFrom(value).buildPartial();
          } else {
            rotatedAt_ = value;
          }
          onChanged();
        } else {
          rotatedAtBuilder_.mergeFrom(value);
        }
        return this;
      }
      /**
       * 
       * Time of the last key rotation (time when the last version was created).
       * Empty if the key does not have versions yet.
       * 
       *
       * .google.protobuf.Timestamp rotated_at = 10;
       */
      public Builder clearRotatedAt() {
        if (rotatedAtBuilder_ == null) {
          rotatedAt_ = null;
          onChanged();
        } else {
          rotatedAt_ = null;
          rotatedAtBuilder_ = null;
        }
        return this;
      }
      /**
       * 
       * Time of the last key rotation (time when the last version was created).
       * Empty if the key does not have versions yet.
       * 
       *
       * .google.protobuf.Timestamp rotated_at = 10;
       */
      public com.google.protobuf.Timestamp.Builder getRotatedAtBuilder() {
        
        onChanged();
        return getRotatedAtFieldBuilder().getBuilder();
      }
      /**
       * 
       * Time of the last key rotation (time when the last version was created).
       * Empty if the key does not have versions yet.
       * 
       *
       * .google.protobuf.Timestamp rotated_at = 10;
       */
      public com.google.protobuf.TimestampOrBuilder getRotatedAtOrBuilder() {
        if (rotatedAtBuilder_ != null) {
          return rotatedAtBuilder_.getMessageOrBuilder();
        } else {
          return rotatedAt_ == null ?
              com.google.protobuf.Timestamp.getDefaultInstance() : rotatedAt_;
        }
      }
      /**
       * 
       * Time of the last key rotation (time when the last version was created).
       * Empty if the key does not have versions yet.
       * 
       *
       * .google.protobuf.Timestamp rotated_at = 10;
       */
      private com.google.protobuf.SingleFieldBuilderV3<
          com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> 
          getRotatedAtFieldBuilder() {
        if (rotatedAtBuilder_ == null) {
          rotatedAtBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
              com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>(
                  getRotatedAt(),
                  getParentForChildren(),
                  isClean());
          rotatedAt_ = null;
        }
        return rotatedAtBuilder_;
      }
      private com.google.protobuf.Duration rotationPeriod_;
      private com.google.protobuf.SingleFieldBuilderV3<
          com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> rotationPeriodBuilder_;
      /**
       * 
       * Time period between automatic key rotations.
       * 
       *
       * .google.protobuf.Duration rotation_period = 11;
       * @return Whether the rotationPeriod field is set.
       */
      public boolean hasRotationPeriod() {
        return rotationPeriodBuilder_ != null || rotationPeriod_ != null;
      }
      /**
       * 
       * Time period between automatic key rotations.
       * 
       *
       * .google.protobuf.Duration rotation_period = 11;
       * @return The rotationPeriod.
       */
      public com.google.protobuf.Duration getRotationPeriod() {
        if (rotationPeriodBuilder_ == null) {
          return rotationPeriod_ == null ? com.google.protobuf.Duration.getDefaultInstance() : rotationPeriod_;
        } else {
          return rotationPeriodBuilder_.getMessage();
        }
      }
      /**
       * 
       * Time period between automatic key rotations.
       * 
       *
       * .google.protobuf.Duration rotation_period = 11;
       */
      public Builder setRotationPeriod(com.google.protobuf.Duration value) {
        if (rotationPeriodBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          rotationPeriod_ = value;
          onChanged();
        } else {
          rotationPeriodBuilder_.setMessage(value);
        }
        return this;
      }
      /**
       * 
       * Time period between automatic key rotations.
       * 
       *
       * .google.protobuf.Duration rotation_period = 11;
       */
      public Builder setRotationPeriod(
          com.google.protobuf.Duration.Builder builderForValue) {
        if (rotationPeriodBuilder_ == null) {
          rotationPeriod_ = builderForValue.build();
          onChanged();
        } else {
          rotationPeriodBuilder_.setMessage(builderForValue.build());
        }
        return this;
      }
      /**
       * 
       * Time period between automatic key rotations.
       * 
       *
       * .google.protobuf.Duration rotation_period = 11;
       */
      public Builder mergeRotationPeriod(com.google.protobuf.Duration value) {
        if (rotationPeriodBuilder_ == null) {
          if (rotationPeriod_ != null) {
            rotationPeriod_ =
              com.google.protobuf.Duration.newBuilder(rotationPeriod_).mergeFrom(value).buildPartial();
          } else {
            rotationPeriod_ = value;
          }
          onChanged();
        } else {
          rotationPeriodBuilder_.mergeFrom(value);
        }
        return this;
      }
      /**
       * 
       * Time period between automatic key rotations.
       * 
       *
       * .google.protobuf.Duration rotation_period = 11;
       */
      public Builder clearRotationPeriod() {
        if (rotationPeriodBuilder_ == null) {
          rotationPeriod_ = null;
          onChanged();
        } else {
          rotationPeriod_ = null;
          rotationPeriodBuilder_ = null;
        }
        return this;
      }
      /**
       * 
       * Time period between automatic key rotations.
       * 
       *
       * .google.protobuf.Duration rotation_period = 11;
       */
      public com.google.protobuf.Duration.Builder getRotationPeriodBuilder() {
        
        onChanged();
        return getRotationPeriodFieldBuilder().getBuilder();
      }
      /**
       * 
       * Time period between automatic key rotations.
       * 
       *
       * .google.protobuf.Duration rotation_period = 11;
       */
      public com.google.protobuf.DurationOrBuilder getRotationPeriodOrBuilder() {
        if (rotationPeriodBuilder_ != null) {
          return rotationPeriodBuilder_.getMessageOrBuilder();
        } else {
          return rotationPeriod_ == null ?
              com.google.protobuf.Duration.getDefaultInstance() : rotationPeriod_;
        }
      }
      /**
       * 
       * Time period between automatic key rotations.
       * 
       *
       * .google.protobuf.Duration rotation_period = 11;
       */
      private com.google.protobuf.SingleFieldBuilderV3<
          com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> 
          getRotationPeriodFieldBuilder() {
        if (rotationPeriodBuilder_ == null) {
          rotationPeriodBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
              com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>(
                  getRotationPeriod(),
                  getParentForChildren(),
                  isClean());
          rotationPeriod_ = null;
        }
        return rotationPeriodBuilder_;
      }
      private boolean deletionProtection_ ;
      /**
       * 
       * Flag that inhibits deletion of the key
       * 
       *
       * bool deletion_protection = 12;
       * @return The deletionProtection.
       */
      @java.lang.Override
      public boolean getDeletionProtection() {
        return deletionProtection_;
      }
      /**
       * 
       * Flag that inhibits deletion of the key
       * 
       *
       * bool deletion_protection = 12;
       * @param value The deletionProtection to set.
       * @return This builder for chaining.
       */
      public Builder setDeletionProtection(boolean value) {
        
        deletionProtection_ = value;
        onChanged();
        return this;
      }
      /**
       * 
       * Flag that inhibits deletion of the key
       * 
       *
       * bool deletion_protection = 12;
       * @return This builder for chaining.
       */
      public Builder clearDeletionProtection() {
        
        deletionProtection_ = false;
        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:yandex.cloud.kms.v1.SymmetricKey)
    }
    // @@protoc_insertion_point(class_scope:yandex.cloud.kms.v1.SymmetricKey)
    private static final yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKey DEFAULT_INSTANCE;
    static {
      DEFAULT_INSTANCE = new yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKey();
    }
    public static yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKey getDefaultInstance() {
      return DEFAULT_INSTANCE;
    }
    private static final com.google.protobuf.Parser
        PARSER = new com.google.protobuf.AbstractParser() {
      @java.lang.Override
      public SymmetricKey parsePartialFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return new SymmetricKey(input, extensionRegistry);
      }
    };
    public static com.google.protobuf.Parser parser() {
      return PARSER;
    }
    @java.lang.Override
    public com.google.protobuf.Parser getParserForType() {
      return PARSER;
    }
    @java.lang.Override
    public yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKey getDefaultInstanceForType() {
      return DEFAULT_INSTANCE;
    }
  }
  public interface SymmetricKeyVersionOrBuilder extends
      // @@protoc_insertion_point(interface_extends:yandex.cloud.kms.v1.SymmetricKeyVersion)
      com.google.protobuf.MessageOrBuilder {
    /**
     * 
     * ID of the key version.
     * 
     *
     * string id = 1;
     * @return The id.
     */
    java.lang.String getId();
    /**
     * 
     * ID of the key version.
     * 
     *
     * string id = 1;
     * @return The bytes for id.
     */
    com.google.protobuf.ByteString
        getIdBytes();
    /**
     * 
     * ID of the symmetric KMS key that the version belongs to.
     * 
     *
     * string key_id = 2;
     * @return The keyId.
     */
    java.lang.String getKeyId();
    /**
     * 
     * ID of the symmetric KMS key that the version belongs to.
     * 
     *
     * string key_id = 2;
     * @return The bytes for keyId.
     */
    com.google.protobuf.ByteString
        getKeyIdBytes();
    /**
     * 
     * Status of the key version.
     * 
     *
     * .yandex.cloud.kms.v1.SymmetricKeyVersion.Status status = 3;
     * @return The enum numeric value on the wire for status.
     */
    int getStatusValue();
    /**
     * 
     * Status of the key version.
     * 
     *
     * .yandex.cloud.kms.v1.SymmetricKeyVersion.Status status = 3;
     * @return The status.
     */
    yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion.Status getStatus();
    /**
     * 
     * Encryption algorithm that should be used when using the key version to encrypt plaintext.
     * 
     *
     * .yandex.cloud.kms.v1.SymmetricAlgorithm algorithm = 4;
     * @return The enum numeric value on the wire for algorithm.
     */
    int getAlgorithmValue();
    /**
     * 
     * Encryption algorithm that should be used when using the key version to encrypt plaintext.
     * 
     *
     * .yandex.cloud.kms.v1.SymmetricAlgorithm algorithm = 4;
     * @return The algorithm.
     */
    yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricAlgorithm getAlgorithm();
    /**
     * 
     * Time when the key version was created.
     * 
     *
     * .google.protobuf.Timestamp created_at = 5;
     * @return Whether the createdAt field is set.
     */
    boolean hasCreatedAt();
    /**
     * 
     * Time when the key version was created.
     * 
     *
     * .google.protobuf.Timestamp created_at = 5;
     * @return The createdAt.
     */
    com.google.protobuf.Timestamp getCreatedAt();
    /**
     * 
     * Time when the key version was created.
     * 
     *
     * .google.protobuf.Timestamp created_at = 5;
     */
    com.google.protobuf.TimestampOrBuilder getCreatedAtOrBuilder();
    /**
     * 
     * Indication of a primary version, that is to be used by default for all cryptographic
     * operations that don't have a key version explicitly specified.
     * 
     *
     * bool primary = 6;
     * @return The primary.
     */
    boolean getPrimary();
    /**
     * 
     * Time when the key version is going to be destroyed. Empty unless the status
     * is `SCHEDULED_FOR_DESTRUCTION`.
     * 
     *
     * .google.protobuf.Timestamp destroy_at = 7;
     * @return Whether the destroyAt field is set.
     */
    boolean hasDestroyAt();
    /**
     * 
     * Time when the key version is going to be destroyed. Empty unless the status
     * is `SCHEDULED_FOR_DESTRUCTION`.
     * 
     *
     * .google.protobuf.Timestamp destroy_at = 7;
     * @return The destroyAt.
     */
    com.google.protobuf.Timestamp getDestroyAt();
    /**
     * 
     * Time when the key version is going to be destroyed. Empty unless the status
     * is `SCHEDULED_FOR_DESTRUCTION`.
     * 
     *
     * .google.protobuf.Timestamp destroy_at = 7;
     */
    com.google.protobuf.TimestampOrBuilder getDestroyAtOrBuilder();
    /**
     * 
     * Indication of the version that is hosted by HSM.
     * 
     *
     * bool hosted_by_hsm = 8;
     * @return The hostedByHsm.
     */
    boolean getHostedByHsm();
  }
  /**
   * 
   * Symmetric KMS key version: metadata about actual cryptographic data.
   * 
   *
   * Protobuf type {@code yandex.cloud.kms.v1.SymmetricKeyVersion}
   */
  public static final class SymmetricKeyVersion extends
      com.google.protobuf.GeneratedMessageV3 implements
      // @@protoc_insertion_point(message_implements:yandex.cloud.kms.v1.SymmetricKeyVersion)
      SymmetricKeyVersionOrBuilder {
  private static final long serialVersionUID = 0L;
    // Use SymmetricKeyVersion.newBuilder() to construct.
    private SymmetricKeyVersion(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
      super(builder);
    }
    private SymmetricKeyVersion() {
      id_ = "";
      keyId_ = "";
      status_ = 0;
      algorithm_ = 0;
    }
    @java.lang.Override
    @SuppressWarnings({"unused"})
    protected java.lang.Object newInstance(
        UnusedPrivateParameter unused) {
      return new SymmetricKeyVersion();
    }
    @java.lang.Override
    public final com.google.protobuf.UnknownFieldSet
    getUnknownFields() {
      return this.unknownFields;
    }
    private SymmetricKeyVersion(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      this();
      if (extensionRegistry == null) {
        throw new java.lang.NullPointerException();
      }
      com.google.protobuf.UnknownFieldSet.Builder unknownFields =
          com.google.protobuf.UnknownFieldSet.newBuilder();
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            case 10: {
              java.lang.String s = input.readStringRequireUtf8();
              id_ = s;
              break;
            }
            case 18: {
              java.lang.String s = input.readStringRequireUtf8();
              keyId_ = s;
              break;
            }
            case 24: {
              int rawValue = input.readEnum();
              status_ = rawValue;
              break;
            }
            case 32: {
              int rawValue = input.readEnum();
              algorithm_ = rawValue;
              break;
            }
            case 42: {
              com.google.protobuf.Timestamp.Builder subBuilder = null;
              if (createdAt_ != null) {
                subBuilder = createdAt_.toBuilder();
              }
              createdAt_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(createdAt_);
                createdAt_ = subBuilder.buildPartial();
              }
              break;
            }
            case 48: {
              primary_ = input.readBool();
              break;
            }
            case 58: {
              com.google.protobuf.Timestamp.Builder subBuilder = null;
              if (destroyAt_ != null) {
                subBuilder = destroyAt_.toBuilder();
              }
              destroyAt_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(destroyAt_);
                destroyAt_ = subBuilder.buildPartial();
              }
              break;
            }
            case 64: {
              hostedByHsm_ = input.readBool();
              break;
            }
            default: {
              if (!parseUnknownField(
                  input, unknownFields, extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
          }
        }
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.setUnfinishedMessage(this);
      } catch (java.io.IOException e) {
        throw new com.google.protobuf.InvalidProtocolBufferException(
            e).setUnfinishedMessage(this);
      } finally {
        this.unknownFields = unknownFields.build();
        makeExtensionsImmutable();
      }
    }
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.internal_static_yandex_cloud_kms_v1_SymmetricKeyVersion_descriptor;
    }
    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.internal_static_yandex_cloud_kms_v1_SymmetricKeyVersion_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion.class, yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion.Builder.class);
    }
    /**
     * 
     * Possible version status.
     * 
     *
     * Protobuf enum {@code yandex.cloud.kms.v1.SymmetricKeyVersion.Status}
     */
    public enum Status
        implements com.google.protobuf.ProtocolMessageEnum {
      /**
       * STATUS_UNSPECIFIED = 0;
       */
      STATUS_UNSPECIFIED(0),
      /**
       * 
       * The version is active and can be used for encryption and decryption.
       * 
       *
       * ACTIVE = 1;
       */
      ACTIVE(1),
      /**
       * 
       * The version is scheduled for destruction, the time when it will be destroyed
       * is specified in the [SymmetricKeyVersion.destroy_at] field.
       * 
       *
       * SCHEDULED_FOR_DESTRUCTION = 2;
       */
      SCHEDULED_FOR_DESTRUCTION(2),
      /**
       * 
       * The version is destroyed and cannot be recovered.
       * 
       *
       * DESTROYED = 3;
       */
      DESTROYED(3),
      UNRECOGNIZED(-1),
      ;
      /**
       * STATUS_UNSPECIFIED = 0;
       */
      public static final int STATUS_UNSPECIFIED_VALUE = 0;
      /**
       * 
       * The version is active and can be used for encryption and decryption.
       * 
       *
       * ACTIVE = 1;
       */
      public static final int ACTIVE_VALUE = 1;
      /**
       * 
       * The version is scheduled for destruction, the time when it will be destroyed
       * is specified in the [SymmetricKeyVersion.destroy_at] field.
       * 
       *
       * SCHEDULED_FOR_DESTRUCTION = 2;
       */
      public static final int SCHEDULED_FOR_DESTRUCTION_VALUE = 2;
      /**
       * 
       * The version is destroyed and cannot be recovered.
       * 
       *
       * DESTROYED = 3;
       */
      public static final int DESTROYED_VALUE = 3;
      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 Status 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 Status forNumber(int value) {
        switch (value) {
          case 0: return STATUS_UNSPECIFIED;
          case 1: return ACTIVE;
          case 2: return SCHEDULED_FOR_DESTRUCTION;
          case 3: return DESTROYED;
          default: return null;
        }
      }
      public static com.google.protobuf.Internal.EnumLiteMap
          internalGetValueMap() {
        return internalValueMap;
      }
      private static final com.google.protobuf.Internal.EnumLiteMap<
          Status> internalValueMap =
            new com.google.protobuf.Internal.EnumLiteMap() {
              public Status findValueByNumber(int number) {
                return Status.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 yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion.getDescriptor().getEnumTypes().get(0);
      }
      private static final Status[] VALUES = values();
      public static Status 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 Status(int value) {
        this.value = value;
      }
      // @@protoc_insertion_point(enum_scope:yandex.cloud.kms.v1.SymmetricKeyVersion.Status)
    }
    public static final int ID_FIELD_NUMBER = 1;
    private volatile java.lang.Object id_;
    /**
     * 
     * ID of the key version.
     * 
     *
     * string id = 1;
     * @return The id.
     */
    @java.lang.Override
    public java.lang.String getId() {
      java.lang.Object ref = id_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        id_ = s;
        return s;
      }
    }
    /**
     * 
     * ID of the key version.
     * 
     *
     * string id = 1;
     * @return The bytes for id.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString
        getIdBytes() {
      java.lang.Object ref = id_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        id_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    public static final int KEY_ID_FIELD_NUMBER = 2;
    private volatile java.lang.Object keyId_;
    /**
     * 
     * ID of the symmetric KMS key that the version belongs to.
     * 
     *
     * string key_id = 2;
     * @return The keyId.
     */
    @java.lang.Override
    public java.lang.String getKeyId() {
      java.lang.Object ref = keyId_;
      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();
        keyId_ = s;
        return s;
      }
    }
    /**
     * 
     * ID of the symmetric KMS key that the version belongs to.
     * 
     *
     * string key_id = 2;
     * @return The bytes for keyId.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString
        getKeyIdBytes() {
      java.lang.Object ref = keyId_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        keyId_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    public static final int STATUS_FIELD_NUMBER = 3;
    private int status_;
    /**
     * 
     * Status of the key version.
     * 
     *
     * .yandex.cloud.kms.v1.SymmetricKeyVersion.Status status = 3;
     * @return The enum numeric value on the wire for status.
     */
    @java.lang.Override public int getStatusValue() {
      return status_;
    }
    /**
     * 
     * Status of the key version.
     * 
     *
     * .yandex.cloud.kms.v1.SymmetricKeyVersion.Status status = 3;
     * @return The status.
     */
    @java.lang.Override public yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion.Status getStatus() {
      @SuppressWarnings("deprecation")
      yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion.Status result = yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion.Status.valueOf(status_);
      return result == null ? yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion.Status.UNRECOGNIZED : result;
    }
    public static final int ALGORITHM_FIELD_NUMBER = 4;
    private int algorithm_;
    /**
     * 
     * Encryption algorithm that should be used when using the key version to encrypt plaintext.
     * 
     *
     * .yandex.cloud.kms.v1.SymmetricAlgorithm algorithm = 4;
     * @return The enum numeric value on the wire for algorithm.
     */
    @java.lang.Override public int getAlgorithmValue() {
      return algorithm_;
    }
    /**
     * 
     * Encryption algorithm that should be used when using the key version to encrypt plaintext.
     * 
     *
     * .yandex.cloud.kms.v1.SymmetricAlgorithm algorithm = 4;
     * @return The algorithm.
     */
    @java.lang.Override public yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricAlgorithm getAlgorithm() {
      @SuppressWarnings("deprecation")
      yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricAlgorithm result = yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricAlgorithm.valueOf(algorithm_);
      return result == null ? yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricAlgorithm.UNRECOGNIZED : result;
    }
    public static final int CREATED_AT_FIELD_NUMBER = 5;
    private com.google.protobuf.Timestamp createdAt_;
    /**
     * 
     * Time when the key version was created.
     * 
     *
     * .google.protobuf.Timestamp created_at = 5;
     * @return Whether the createdAt field is set.
     */
    @java.lang.Override
    public boolean hasCreatedAt() {
      return createdAt_ != null;
    }
    /**
     * 
     * Time when the key version was created.
     * 
     *
     * .google.protobuf.Timestamp created_at = 5;
     * @return The createdAt.
     */
    @java.lang.Override
    public com.google.protobuf.Timestamp getCreatedAt() {
      return createdAt_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createdAt_;
    }
    /**
     * 
     * Time when the key version was created.
     * 
     *
     * .google.protobuf.Timestamp created_at = 5;
     */
    @java.lang.Override
    public com.google.protobuf.TimestampOrBuilder getCreatedAtOrBuilder() {
      return getCreatedAt();
    }
    public static final int PRIMARY_FIELD_NUMBER = 6;
    private boolean primary_;
    /**
     * 
     * Indication of a primary version, that is to be used by default for all cryptographic
     * operations that don't have a key version explicitly specified.
     * 
     *
     * bool primary = 6;
     * @return The primary.
     */
    @java.lang.Override
    public boolean getPrimary() {
      return primary_;
    }
    public static final int DESTROY_AT_FIELD_NUMBER = 7;
    private com.google.protobuf.Timestamp destroyAt_;
    /**
     * 
     * Time when the key version is going to be destroyed. Empty unless the status
     * is `SCHEDULED_FOR_DESTRUCTION`.
     * 
     *
     * .google.protobuf.Timestamp destroy_at = 7;
     * @return Whether the destroyAt field is set.
     */
    @java.lang.Override
    public boolean hasDestroyAt() {
      return destroyAt_ != null;
    }
    /**
     * 
     * Time when the key version is going to be destroyed. Empty unless the status
     * is `SCHEDULED_FOR_DESTRUCTION`.
     * 
     *
     * .google.protobuf.Timestamp destroy_at = 7;
     * @return The destroyAt.
     */
    @java.lang.Override
    public com.google.protobuf.Timestamp getDestroyAt() {
      return destroyAt_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : destroyAt_;
    }
    /**
     * 
     * Time when the key version is going to be destroyed. Empty unless the status
     * is `SCHEDULED_FOR_DESTRUCTION`.
     * 
     *
     * .google.protobuf.Timestamp destroy_at = 7;
     */
    @java.lang.Override
    public com.google.protobuf.TimestampOrBuilder getDestroyAtOrBuilder() {
      return getDestroyAt();
    }
    public static final int HOSTED_BY_HSM_FIELD_NUMBER = 8;
    private boolean hostedByHsm_;
    /**
     * 
     * Indication of the version that is hosted by HSM.
     * 
     *
     * bool hosted_by_hsm = 8;
     * @return The hostedByHsm.
     */
    @java.lang.Override
    public boolean getHostedByHsm() {
      return hostedByHsm_;
    }
    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(id_)) {
        com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_);
      }
      if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(keyId_)) {
        com.google.protobuf.GeneratedMessageV3.writeString(output, 2, keyId_);
      }
      if (status_ != yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion.Status.STATUS_UNSPECIFIED.getNumber()) {
        output.writeEnum(3, status_);
      }
      if (algorithm_ != yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricAlgorithm.SYMMETRIC_ALGORITHM_UNSPECIFIED.getNumber()) {
        output.writeEnum(4, algorithm_);
      }
      if (createdAt_ != null) {
        output.writeMessage(5, getCreatedAt());
      }
      if (primary_ != false) {
        output.writeBool(6, primary_);
      }
      if (destroyAt_ != null) {
        output.writeMessage(7, getDestroyAt());
      }
      if (hostedByHsm_ != false) {
        output.writeBool(8, hostedByHsm_);
      }
      unknownFields.writeTo(output);
    }
    @java.lang.Override
    public int getSerializedSize() {
      int size = memoizedSize;
      if (size != -1) return size;
      size = 0;
      if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) {
        size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_);
      }
      if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(keyId_)) {
        size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, keyId_);
      }
      if (status_ != yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion.Status.STATUS_UNSPECIFIED.getNumber()) {
        size += com.google.protobuf.CodedOutputStream
          .computeEnumSize(3, status_);
      }
      if (algorithm_ != yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricAlgorithm.SYMMETRIC_ALGORITHM_UNSPECIFIED.getNumber()) {
        size += com.google.protobuf.CodedOutputStream
          .computeEnumSize(4, algorithm_);
      }
      if (createdAt_ != null) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(5, getCreatedAt());
      }
      if (primary_ != false) {
        size += com.google.protobuf.CodedOutputStream
          .computeBoolSize(6, primary_);
      }
      if (destroyAt_ != null) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(7, getDestroyAt());
      }
      if (hostedByHsm_ != false) {
        size += com.google.protobuf.CodedOutputStream
          .computeBoolSize(8, hostedByHsm_);
      }
      size += unknownFields.getSerializedSize();
      memoizedSize = size;
      return size;
    }
    @java.lang.Override
    public boolean equals(final java.lang.Object obj) {
      if (obj == this) {
       return true;
      }
      if (!(obj instanceof yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion)) {
        return super.equals(obj);
      }
      yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion other = (yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion) obj;
      if (!getId()
          .equals(other.getId())) return false;
      if (!getKeyId()
          .equals(other.getKeyId())) return false;
      if (status_ != other.status_) return false;
      if (algorithm_ != other.algorithm_) return false;
      if (hasCreatedAt() != other.hasCreatedAt()) return false;
      if (hasCreatedAt()) {
        if (!getCreatedAt()
            .equals(other.getCreatedAt())) return false;
      }
      if (getPrimary()
          != other.getPrimary()) return false;
      if (hasDestroyAt() != other.hasDestroyAt()) return false;
      if (hasDestroyAt()) {
        if (!getDestroyAt()
            .equals(other.getDestroyAt())) return false;
      }
      if (getHostedByHsm()
          != other.getHostedByHsm()) return false;
      if (!unknownFields.equals(other.unknownFields)) 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) + ID_FIELD_NUMBER;
      hash = (53 * hash) + getId().hashCode();
      hash = (37 * hash) + KEY_ID_FIELD_NUMBER;
      hash = (53 * hash) + getKeyId().hashCode();
      hash = (37 * hash) + STATUS_FIELD_NUMBER;
      hash = (53 * hash) + status_;
      hash = (37 * hash) + ALGORITHM_FIELD_NUMBER;
      hash = (53 * hash) + algorithm_;
      if (hasCreatedAt()) {
        hash = (37 * hash) + CREATED_AT_FIELD_NUMBER;
        hash = (53 * hash) + getCreatedAt().hashCode();
      }
      hash = (37 * hash) + PRIMARY_FIELD_NUMBER;
      hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
          getPrimary());
      if (hasDestroyAt()) {
        hash = (37 * hash) + DESTROY_AT_FIELD_NUMBER;
        hash = (53 * hash) + getDestroyAt().hashCode();
      }
      hash = (37 * hash) + HOSTED_BY_HSM_FIELD_NUMBER;
      hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
          getHostedByHsm());
      hash = (29 * hash) + unknownFields.hashCode();
      memoizedHashCode = hash;
      return hash;
    }
    public static yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion parseFrom(
        java.nio.ByteBuffer data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion parseFrom(
        java.nio.ByteBuffer data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion parseFrom(
        com.google.protobuf.ByteString data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion parseFrom(
        byte[] data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input);
    }
    public static yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion 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 yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion parseDelimitedFrom(java.io.InputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseDelimitedWithIOException(PARSER, input);
    }
    public static yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion 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 yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion parseFrom(
        com.google.protobuf.CodedInputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input);
    }
    public static yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion 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(yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion 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;
    }
    /**
     * 
     * Symmetric KMS key version: metadata about actual cryptographic data.
     * 
     *
     * Protobuf type {@code yandex.cloud.kms.v1.SymmetricKeyVersion}
     */
    public static final class Builder extends
        com.google.protobuf.GeneratedMessageV3.Builder implements
        // @@protoc_insertion_point(builder_implements:yandex.cloud.kms.v1.SymmetricKeyVersion)
        yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersionOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.internal_static_yandex_cloud_kms_v1_SymmetricKeyVersion_descriptor;
      }
      @java.lang.Override
      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.internal_static_yandex_cloud_kms_v1_SymmetricKeyVersion_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion.class, yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion.Builder.class);
      }
      // Construct using yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion.newBuilder()
      private Builder() {
        maybeForceBuilderInitialization();
      }
      private Builder(
          com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        super(parent);
        maybeForceBuilderInitialization();
      }
      private void maybeForceBuilderInitialization() {
        if (com.google.protobuf.GeneratedMessageV3
                .alwaysUseFieldBuilders) {
        }
      }
      @java.lang.Override
      public Builder clear() {
        super.clear();
        id_ = "";
        keyId_ = "";
        status_ = 0;
        algorithm_ = 0;
        if (createdAtBuilder_ == null) {
          createdAt_ = null;
        } else {
          createdAt_ = null;
          createdAtBuilder_ = null;
        }
        primary_ = false;
        if (destroyAtBuilder_ == null) {
          destroyAt_ = null;
        } else {
          destroyAt_ = null;
          destroyAtBuilder_ = null;
        }
        hostedByHsm_ = false;
        return this;
      }
      @java.lang.Override
      public com.google.protobuf.Descriptors.Descriptor
          getDescriptorForType() {
        return yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.internal_static_yandex_cloud_kms_v1_SymmetricKeyVersion_descriptor;
      }
      @java.lang.Override
      public yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion getDefaultInstanceForType() {
        return yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion.getDefaultInstance();
      }
      @java.lang.Override
      public yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion build() {
        yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }
      @java.lang.Override
      public yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion buildPartial() {
        yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion result = new yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion(this);
        result.id_ = id_;
        result.keyId_ = keyId_;
        result.status_ = status_;
        result.algorithm_ = algorithm_;
        if (createdAtBuilder_ == null) {
          result.createdAt_ = createdAt_;
        } else {
          result.createdAt_ = createdAtBuilder_.build();
        }
        result.primary_ = primary_;
        if (destroyAtBuilder_ == null) {
          result.destroyAt_ = destroyAt_;
        } else {
          result.destroyAt_ = destroyAtBuilder_.build();
        }
        result.hostedByHsm_ = hostedByHsm_;
        onBuilt();
        return result;
      }
      @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 yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion) {
          return mergeFrom((yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion)other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }
      public Builder mergeFrom(yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion other) {
        if (other == yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion.getDefaultInstance()) return this;
        if (!other.getId().isEmpty()) {
          id_ = other.id_;
          onChanged();
        }
        if (!other.getKeyId().isEmpty()) {
          keyId_ = other.keyId_;
          onChanged();
        }
        if (other.status_ != 0) {
          setStatusValue(other.getStatusValue());
        }
        if (other.algorithm_ != 0) {
          setAlgorithmValue(other.getAlgorithmValue());
        }
        if (other.hasCreatedAt()) {
          mergeCreatedAt(other.getCreatedAt());
        }
        if (other.getPrimary() != false) {
          setPrimary(other.getPrimary());
        }
        if (other.hasDestroyAt()) {
          mergeDestroyAt(other.getDestroyAt());
        }
        if (other.getHostedByHsm() != false) {
          setHostedByHsm(other.getHostedByHsm());
        }
        this.mergeUnknownFields(other.unknownFields);
        onChanged();
        return this;
      }
      @java.lang.Override
      public final boolean isInitialized() {
        return true;
      }
      @java.lang.Override
      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion parsedMessage = null;
        try {
          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          parsedMessage = (yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion) e.getUnfinishedMessage();
          throw e.unwrapIOException();
        } finally {
          if (parsedMessage != null) {
            mergeFrom(parsedMessage);
          }
        }
        return this;
      }
      private java.lang.Object id_ = "";
      /**
       * 
       * ID of the key version.
       * 
       *
       * string id = 1;
       * @return The id.
       */
      public java.lang.String getId() {
        java.lang.Object ref = id_;
        if (!(ref instanceof java.lang.String)) {
          com.google.protobuf.ByteString bs =
              (com.google.protobuf.ByteString) ref;
          java.lang.String s = bs.toStringUtf8();
          id_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * 
       * ID of the key version.
       * 
       *
       * string id = 1;
       * @return The bytes for id.
       */
      public com.google.protobuf.ByteString
          getIdBytes() {
        java.lang.Object ref = id_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          id_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * 
       * ID of the key version.
       * 
       *
       * string id = 1;
       * @param value The id to set.
       * @return This builder for chaining.
       */
      public Builder setId(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  
        id_ = value;
        onChanged();
        return this;
      }
      /**
       * 
       * ID of the key version.
       * 
       *
       * string id = 1;
       * @return This builder for chaining.
       */
      public Builder clearId() {
        
        id_ = getDefaultInstance().getId();
        onChanged();
        return this;
      }
      /**
       * 
       * ID of the key version.
       * 
       *
       * string id = 1;
       * @param value The bytes for id to set.
       * @return This builder for chaining.
       */
      public Builder setIdBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
        
        id_ = value;
        onChanged();
        return this;
      }
      private java.lang.Object keyId_ = "";
      /**
       * 
       * ID of the symmetric KMS key that the version belongs to.
       * 
       *
       * string key_id = 2;
       * @return The keyId.
       */
      public java.lang.String getKeyId() {
        java.lang.Object ref = keyId_;
        if (!(ref instanceof java.lang.String)) {
          com.google.protobuf.ByteString bs =
              (com.google.protobuf.ByteString) ref;
          java.lang.String s = bs.toStringUtf8();
          keyId_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * 
       * ID of the symmetric KMS key that the version belongs to.
       * 
       *
       * string key_id = 2;
       * @return The bytes for keyId.
       */
      public com.google.protobuf.ByteString
          getKeyIdBytes() {
        java.lang.Object ref = keyId_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          keyId_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * 
       * ID of the symmetric KMS key that the version belongs to.
       * 
       *
       * string key_id = 2;
       * @param value The keyId to set.
       * @return This builder for chaining.
       */
      public Builder setKeyId(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  
        keyId_ = value;
        onChanged();
        return this;
      }
      /**
       * 
       * ID of the symmetric KMS key that the version belongs to.
       * 
       *
       * string key_id = 2;
       * @return This builder for chaining.
       */
      public Builder clearKeyId() {
        
        keyId_ = getDefaultInstance().getKeyId();
        onChanged();
        return this;
      }
      /**
       * 
       * ID of the symmetric KMS key that the version belongs to.
       * 
       *
       * string key_id = 2;
       * @param value The bytes for keyId to set.
       * @return This builder for chaining.
       */
      public Builder setKeyIdBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
        
        keyId_ = value;
        onChanged();
        return this;
      }
      private int status_ = 0;
      /**
       * 
       * Status of the key version.
       * 
       *
       * .yandex.cloud.kms.v1.SymmetricKeyVersion.Status status = 3;
       * @return The enum numeric value on the wire for status.
       */
      @java.lang.Override public int getStatusValue() {
        return status_;
      }
      /**
       * 
       * Status of the key version.
       * 
       *
       * .yandex.cloud.kms.v1.SymmetricKeyVersion.Status status = 3;
       * @param value The enum numeric value on the wire for status to set.
       * @return This builder for chaining.
       */
      public Builder setStatusValue(int value) {
        
        status_ = value;
        onChanged();
        return this;
      }
      /**
       * 
       * Status of the key version.
       * 
       *
       * .yandex.cloud.kms.v1.SymmetricKeyVersion.Status status = 3;
       * @return The status.
       */
      @java.lang.Override
      public yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion.Status getStatus() {
        @SuppressWarnings("deprecation")
        yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion.Status result = yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion.Status.valueOf(status_);
        return result == null ? yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion.Status.UNRECOGNIZED : result;
      }
      /**
       * 
       * Status of the key version.
       * 
       *
       * .yandex.cloud.kms.v1.SymmetricKeyVersion.Status status = 3;
       * @param value The status to set.
       * @return This builder for chaining.
       */
      public Builder setStatus(yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion.Status value) {
        if (value == null) {
          throw new NullPointerException();
        }
        
        status_ = value.getNumber();
        onChanged();
        return this;
      }
      /**
       * 
       * Status of the key version.
       * 
       *
       * .yandex.cloud.kms.v1.SymmetricKeyVersion.Status status = 3;
       * @return This builder for chaining.
       */
      public Builder clearStatus() {
        
        status_ = 0;
        onChanged();
        return this;
      }
      private int algorithm_ = 0;
      /**
       * 
       * Encryption algorithm that should be used when using the key version to encrypt plaintext.
       * 
       *
       * .yandex.cloud.kms.v1.SymmetricAlgorithm algorithm = 4;
       * @return The enum numeric value on the wire for algorithm.
       */
      @java.lang.Override public int getAlgorithmValue() {
        return algorithm_;
      }
      /**
       * 
       * Encryption algorithm that should be used when using the key version to encrypt plaintext.
       * 
       *
       * .yandex.cloud.kms.v1.SymmetricAlgorithm algorithm = 4;
       * @param value The enum numeric value on the wire for algorithm to set.
       * @return This builder for chaining.
       */
      public Builder setAlgorithmValue(int value) {
        
        algorithm_ = value;
        onChanged();
        return this;
      }
      /**
       * 
       * Encryption algorithm that should be used when using the key version to encrypt plaintext.
       * 
       *
       * .yandex.cloud.kms.v1.SymmetricAlgorithm algorithm = 4;
       * @return The algorithm.
       */
      @java.lang.Override
      public yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricAlgorithm getAlgorithm() {
        @SuppressWarnings("deprecation")
        yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricAlgorithm result = yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricAlgorithm.valueOf(algorithm_);
        return result == null ? yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricAlgorithm.UNRECOGNIZED : result;
      }
      /**
       * 
       * Encryption algorithm that should be used when using the key version to encrypt plaintext.
       * 
       *
       * .yandex.cloud.kms.v1.SymmetricAlgorithm algorithm = 4;
       * @param value The algorithm to set.
       * @return This builder for chaining.
       */
      public Builder setAlgorithm(yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricAlgorithm value) {
        if (value == null) {
          throw new NullPointerException();
        }
        
        algorithm_ = value.getNumber();
        onChanged();
        return this;
      }
      /**
       * 
       * Encryption algorithm that should be used when using the key version to encrypt plaintext.
       * 
       *
       * .yandex.cloud.kms.v1.SymmetricAlgorithm algorithm = 4;
       * @return This builder for chaining.
       */
      public Builder clearAlgorithm() {
        
        algorithm_ = 0;
        onChanged();
        return this;
      }
      private com.google.protobuf.Timestamp createdAt_;
      private com.google.protobuf.SingleFieldBuilderV3<
          com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> createdAtBuilder_;
      /**
       * 
       * Time when the key version was created.
       * 
       *
       * .google.protobuf.Timestamp created_at = 5;
       * @return Whether the createdAt field is set.
       */
      public boolean hasCreatedAt() {
        return createdAtBuilder_ != null || createdAt_ != null;
      }
      /**
       * 
       * Time when the key version was created.
       * 
       *
       * .google.protobuf.Timestamp created_at = 5;
       * @return The createdAt.
       */
      public com.google.protobuf.Timestamp getCreatedAt() {
        if (createdAtBuilder_ == null) {
          return createdAt_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createdAt_;
        } else {
          return createdAtBuilder_.getMessage();
        }
      }
      /**
       * 
       * Time when the key version was created.
       * 
       *
       * .google.protobuf.Timestamp created_at = 5;
       */
      public Builder setCreatedAt(com.google.protobuf.Timestamp value) {
        if (createdAtBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          createdAt_ = value;
          onChanged();
        } else {
          createdAtBuilder_.setMessage(value);
        }
        return this;
      }
      /**
       * 
       * Time when the key version was created.
       * 
       *
       * .google.protobuf.Timestamp created_at = 5;
       */
      public Builder setCreatedAt(
          com.google.protobuf.Timestamp.Builder builderForValue) {
        if (createdAtBuilder_ == null) {
          createdAt_ = builderForValue.build();
          onChanged();
        } else {
          createdAtBuilder_.setMessage(builderForValue.build());
        }
        return this;
      }
      /**
       * 
       * Time when the key version was created.
       * 
       *
       * .google.protobuf.Timestamp created_at = 5;
       */
      public Builder mergeCreatedAt(com.google.protobuf.Timestamp value) {
        if (createdAtBuilder_ == null) {
          if (createdAt_ != null) {
            createdAt_ =
              com.google.protobuf.Timestamp.newBuilder(createdAt_).mergeFrom(value).buildPartial();
          } else {
            createdAt_ = value;
          }
          onChanged();
        } else {
          createdAtBuilder_.mergeFrom(value);
        }
        return this;
      }
      /**
       * 
       * Time when the key version was created.
       * 
       *
       * .google.protobuf.Timestamp created_at = 5;
       */
      public Builder clearCreatedAt() {
        if (createdAtBuilder_ == null) {
          createdAt_ = null;
          onChanged();
        } else {
          createdAt_ = null;
          createdAtBuilder_ = null;
        }
        return this;
      }
      /**
       * 
       * Time when the key version was created.
       * 
       *
       * .google.protobuf.Timestamp created_at = 5;
       */
      public com.google.protobuf.Timestamp.Builder getCreatedAtBuilder() {
        
        onChanged();
        return getCreatedAtFieldBuilder().getBuilder();
      }
      /**
       * 
       * Time when the key version was created.
       * 
       *
       * .google.protobuf.Timestamp created_at = 5;
       */
      public com.google.protobuf.TimestampOrBuilder getCreatedAtOrBuilder() {
        if (createdAtBuilder_ != null) {
          return createdAtBuilder_.getMessageOrBuilder();
        } else {
          return createdAt_ == null ?
              com.google.protobuf.Timestamp.getDefaultInstance() : createdAt_;
        }
      }
      /**
       * 
       * Time when the key version was created.
       * 
       *
       * .google.protobuf.Timestamp created_at = 5;
       */
      private com.google.protobuf.SingleFieldBuilderV3<
          com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> 
          getCreatedAtFieldBuilder() {
        if (createdAtBuilder_ == null) {
          createdAtBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
              com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>(
                  getCreatedAt(),
                  getParentForChildren(),
                  isClean());
          createdAt_ = null;
        }
        return createdAtBuilder_;
      }
      private boolean primary_ ;
      /**
       * 
       * Indication of a primary version, that is to be used by default for all cryptographic
       * operations that don't have a key version explicitly specified.
       * 
       *
       * bool primary = 6;
       * @return The primary.
       */
      @java.lang.Override
      public boolean getPrimary() {
        return primary_;
      }
      /**
       * 
       * Indication of a primary version, that is to be used by default for all cryptographic
       * operations that don't have a key version explicitly specified.
       * 
       *
       * bool primary = 6;
       * @param value The primary to set.
       * @return This builder for chaining.
       */
      public Builder setPrimary(boolean value) {
        
        primary_ = value;
        onChanged();
        return this;
      }
      /**
       * 
       * Indication of a primary version, that is to be used by default for all cryptographic
       * operations that don't have a key version explicitly specified.
       * 
       *
       * bool primary = 6;
       * @return This builder for chaining.
       */
      public Builder clearPrimary() {
        
        primary_ = false;
        onChanged();
        return this;
      }
      private com.google.protobuf.Timestamp destroyAt_;
      private com.google.protobuf.SingleFieldBuilderV3<
          com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> destroyAtBuilder_;
      /**
       * 
       * Time when the key version is going to be destroyed. Empty unless the status
       * is `SCHEDULED_FOR_DESTRUCTION`.
       * 
       *
       * .google.protobuf.Timestamp destroy_at = 7;
       * @return Whether the destroyAt field is set.
       */
      public boolean hasDestroyAt() {
        return destroyAtBuilder_ != null || destroyAt_ != null;
      }
      /**
       * 
       * Time when the key version is going to be destroyed. Empty unless the status
       * is `SCHEDULED_FOR_DESTRUCTION`.
       * 
       *
       * .google.protobuf.Timestamp destroy_at = 7;
       * @return The destroyAt.
       */
      public com.google.protobuf.Timestamp getDestroyAt() {
        if (destroyAtBuilder_ == null) {
          return destroyAt_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : destroyAt_;
        } else {
          return destroyAtBuilder_.getMessage();
        }
      }
      /**
       * 
       * Time when the key version is going to be destroyed. Empty unless the status
       * is `SCHEDULED_FOR_DESTRUCTION`.
       * 
       *
       * .google.protobuf.Timestamp destroy_at = 7;
       */
      public Builder setDestroyAt(com.google.protobuf.Timestamp value) {
        if (destroyAtBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          destroyAt_ = value;
          onChanged();
        } else {
          destroyAtBuilder_.setMessage(value);
        }
        return this;
      }
      /**
       * 
       * Time when the key version is going to be destroyed. Empty unless the status
       * is `SCHEDULED_FOR_DESTRUCTION`.
       * 
       *
       * .google.protobuf.Timestamp destroy_at = 7;
       */
      public Builder setDestroyAt(
          com.google.protobuf.Timestamp.Builder builderForValue) {
        if (destroyAtBuilder_ == null) {
          destroyAt_ = builderForValue.build();
          onChanged();
        } else {
          destroyAtBuilder_.setMessage(builderForValue.build());
        }
        return this;
      }
      /**
       * 
       * Time when the key version is going to be destroyed. Empty unless the status
       * is `SCHEDULED_FOR_DESTRUCTION`.
       * 
       *
       * .google.protobuf.Timestamp destroy_at = 7;
       */
      public Builder mergeDestroyAt(com.google.protobuf.Timestamp value) {
        if (destroyAtBuilder_ == null) {
          if (destroyAt_ != null) {
            destroyAt_ =
              com.google.protobuf.Timestamp.newBuilder(destroyAt_).mergeFrom(value).buildPartial();
          } else {
            destroyAt_ = value;
          }
          onChanged();
        } else {
          destroyAtBuilder_.mergeFrom(value);
        }
        return this;
      }
      /**
       * 
       * Time when the key version is going to be destroyed. Empty unless the status
       * is `SCHEDULED_FOR_DESTRUCTION`.
       * 
       *
       * .google.protobuf.Timestamp destroy_at = 7;
       */
      public Builder clearDestroyAt() {
        if (destroyAtBuilder_ == null) {
          destroyAt_ = null;
          onChanged();
        } else {
          destroyAt_ = null;
          destroyAtBuilder_ = null;
        }
        return this;
      }
      /**
       * 
       * Time when the key version is going to be destroyed. Empty unless the status
       * is `SCHEDULED_FOR_DESTRUCTION`.
       * 
       *
       * .google.protobuf.Timestamp destroy_at = 7;
       */
      public com.google.protobuf.Timestamp.Builder getDestroyAtBuilder() {
        
        onChanged();
        return getDestroyAtFieldBuilder().getBuilder();
      }
      /**
       * 
       * Time when the key version is going to be destroyed. Empty unless the status
       * is `SCHEDULED_FOR_DESTRUCTION`.
       * 
       *
       * .google.protobuf.Timestamp destroy_at = 7;
       */
      public com.google.protobuf.TimestampOrBuilder getDestroyAtOrBuilder() {
        if (destroyAtBuilder_ != null) {
          return destroyAtBuilder_.getMessageOrBuilder();
        } else {
          return destroyAt_ == null ?
              com.google.protobuf.Timestamp.getDefaultInstance() : destroyAt_;
        }
      }
      /**
       * 
       * Time when the key version is going to be destroyed. Empty unless the status
       * is `SCHEDULED_FOR_DESTRUCTION`.
       * 
       *
       * .google.protobuf.Timestamp destroy_at = 7;
       */
      private com.google.protobuf.SingleFieldBuilderV3<
          com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> 
          getDestroyAtFieldBuilder() {
        if (destroyAtBuilder_ == null) {
          destroyAtBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
              com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>(
                  getDestroyAt(),
                  getParentForChildren(),
                  isClean());
          destroyAt_ = null;
        }
        return destroyAtBuilder_;
      }
      private boolean hostedByHsm_ ;
      /**
       * 
       * Indication of the version that is hosted by HSM.
       * 
       *
       * bool hosted_by_hsm = 8;
       * @return The hostedByHsm.
       */
      @java.lang.Override
      public boolean getHostedByHsm() {
        return hostedByHsm_;
      }
      /**
       * 
       * Indication of the version that is hosted by HSM.
       * 
       *
       * bool hosted_by_hsm = 8;
       * @param value The hostedByHsm to set.
       * @return This builder for chaining.
       */
      public Builder setHostedByHsm(boolean value) {
        
        hostedByHsm_ = value;
        onChanged();
        return this;
      }
      /**
       * 
       * Indication of the version that is hosted by HSM.
       * 
       *
       * bool hosted_by_hsm = 8;
       * @return This builder for chaining.
       */
      public Builder clearHostedByHsm() {
        
        hostedByHsm_ = false;
        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:yandex.cloud.kms.v1.SymmetricKeyVersion)
    }
    // @@protoc_insertion_point(class_scope:yandex.cloud.kms.v1.SymmetricKeyVersion)
    private static final yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion DEFAULT_INSTANCE;
    static {
      DEFAULT_INSTANCE = new yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion();
    }
    public static yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion getDefaultInstance() {
      return DEFAULT_INSTANCE;
    }
    private static final com.google.protobuf.Parser
        PARSER = new com.google.protobuf.AbstractParser() {
      @java.lang.Override
      public SymmetricKeyVersion parsePartialFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return new SymmetricKeyVersion(input, extensionRegistry);
      }
    };
    public static com.google.protobuf.Parser parser() {
      return PARSER;
    }
    @java.lang.Override
    public com.google.protobuf.Parser getParserForType() {
      return PARSER;
    }
    @java.lang.Override
    public yandex.cloud.api.kms.v1.SymmetricKeyOuterClass.SymmetricKeyVersion getDefaultInstanceForType() {
      return DEFAULT_INSTANCE;
    }
  }
  private static final com.google.protobuf.Descriptors.Descriptor
    internal_static_yandex_cloud_kms_v1_SymmetricKey_descriptor;
  private static final 
    com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_yandex_cloud_kms_v1_SymmetricKey_fieldAccessorTable;
  private static final com.google.protobuf.Descriptors.Descriptor
    internal_static_yandex_cloud_kms_v1_SymmetricKey_LabelsEntry_descriptor;
  private static final 
    com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_yandex_cloud_kms_v1_SymmetricKey_LabelsEntry_fieldAccessorTable;
  private static final com.google.protobuf.Descriptors.Descriptor
    internal_static_yandex_cloud_kms_v1_SymmetricKeyVersion_descriptor;
  private static final 
    com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_yandex_cloud_kms_v1_SymmetricKeyVersion_fieldAccessorTable;
  public static com.google.protobuf.Descriptors.FileDescriptor
      getDescriptor() {
    return descriptor;
  }
  private static  com.google.protobuf.Descriptors.FileDescriptor
      descriptor;
  static {
    java.lang.String[] descriptorData = {
      "\n\'yandex/cloud/kms/v1/symmetric_key.prot" +
      "o\022\023yandex.cloud.kms.v1\032\037google/protobuf/" +
      "timestamp.proto\032\036google/protobuf/duratio" +
      "n.proto\"\372\004\n\014SymmetricKey\022\n\n\002id\030\001 \001(\t\022\021\n\t" +
      "folder_id\030\002 \001(\t\022.\n\ncreated_at\030\003 \001(\0132\032.go" +
      "ogle.protobuf.Timestamp\022\014\n\004name\030\004 \001(\t\022\023\n" +
      "\013description\030\005 \001(\t\022=\n\006labels\030\006 \003(\0132-.yan" +
      "dex.cloud.kms.v1.SymmetricKey.LabelsEntr" +
      "y\0228\n\006status\030\007 \001(\0162(.yandex.cloud.kms.v1." +
      "SymmetricKey.Status\022A\n\017primary_version\030\010" +
      " \001(\0132(.yandex.cloud.kms.v1.SymmetricKeyV" +
      "ersion\022B\n\021default_algorithm\030\t \001(\0162\'.yand" +
      "ex.cloud.kms.v1.SymmetricAlgorithm\022.\n\nro" +
      "tated_at\030\n \001(\0132\032.google.protobuf.Timesta" +
      "mp\0222\n\017rotation_period\030\013 \001(\0132\031.google.pro" +
      "tobuf.Duration\022\033\n\023deletion_protection\030\014 " +
      "\001(\010\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value" +
      "\030\002 \001(\t:\0028\001\"H\n\006Status\022\026\n\022STATUS_UNSPECIFI" +
      "ED\020\000\022\014\n\010CREATING\020\001\022\n\n\006ACTIVE\020\002\022\014\n\010INACTI" +
      "VE\020\003\"\222\003\n\023SymmetricKeyVersion\022\n\n\002id\030\001 \001(\t" +
      "\022\016\n\006key_id\030\002 \001(\t\022?\n\006status\030\003 \001(\0162/.yande" +
      "x.cloud.kms.v1.SymmetricKeyVersion.Statu" +
      "s\022:\n\talgorithm\030\004 \001(\0162\'.yandex.cloud.kms." +
      "v1.SymmetricAlgorithm\022.\n\ncreated_at\030\005 \001(" +
      "\0132\032.google.protobuf.Timestamp\022\017\n\007primary" +
      "\030\006 \001(\010\022.\n\ndestroy_at\030\007 \001(\0132\032.google.prot" +
      "obuf.Timestamp\022\025\n\rhosted_by_hsm\030\010 \001(\010\"Z\n" +
      "\006Status\022\026\n\022STATUS_UNSPECIFIED\020\000\022\n\n\006ACTIV" +
      "E\020\001\022\035\n\031SCHEDULED_FOR_DESTRUCTION\020\002\022\r\n\tDE" +
      "STROYED\020\003*q\n\022SymmetricAlgorithm\022#\n\037SYMME" +
      "TRIC_ALGORITHM_UNSPECIFIED\020\000\022\013\n\007AES_128\020" +
      "\001\022\013\n\007AES_192\020\002\022\013\n\007AES_256\020\003\022\017\n\013AES_256_H" +
      "SM\020\004BV\n\027yandex.cloud.api.kms.v1Z;github." +
      "com/yandex-cloud/go-genproto/yandex/clou" +
      "d/kms/v1;kmsb\006proto3"
    };
    descriptor = com.google.protobuf.Descriptors.FileDescriptor
      .internalBuildGeneratedFileFrom(descriptorData,
        new com.google.protobuf.Descriptors.FileDescriptor[] {
          com.google.protobuf.TimestampProto.getDescriptor(),
          com.google.protobuf.DurationProto.getDescriptor(),
        });
    internal_static_yandex_cloud_kms_v1_SymmetricKey_descriptor =
      getDescriptor().getMessageTypes().get(0);
    internal_static_yandex_cloud_kms_v1_SymmetricKey_fieldAccessorTable = new
      com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
        internal_static_yandex_cloud_kms_v1_SymmetricKey_descriptor,
        new java.lang.String[] { "Id", "FolderId", "CreatedAt", "Name", "Description", "Labels", "Status", "PrimaryVersion", "DefaultAlgorithm", "RotatedAt", "RotationPeriod", "DeletionProtection", });
    internal_static_yandex_cloud_kms_v1_SymmetricKey_LabelsEntry_descriptor =
      internal_static_yandex_cloud_kms_v1_SymmetricKey_descriptor.getNestedTypes().get(0);
    internal_static_yandex_cloud_kms_v1_SymmetricKey_LabelsEntry_fieldAccessorTable = new
      com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
        internal_static_yandex_cloud_kms_v1_SymmetricKey_LabelsEntry_descriptor,
        new java.lang.String[] { "Key", "Value", });
    internal_static_yandex_cloud_kms_v1_SymmetricKeyVersion_descriptor =
      getDescriptor().getMessageTypes().get(1);
    internal_static_yandex_cloud_kms_v1_SymmetricKeyVersion_fieldAccessorTable = new
      com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
        internal_static_yandex_cloud_kms_v1_SymmetricKeyVersion_descriptor,
        new java.lang.String[] { "Id", "KeyId", "Status", "Algorithm", "CreatedAt", "Primary", "DestroyAt", "HostedByHsm", });
    com.google.protobuf.TimestampProto.getDescriptor();
    com.google.protobuf.DurationProto.getDescriptor();
  }
  // @@protoc_insertion_point(outer_class_scope)
}
                                       © 2015 - 2025 Weber Informatics LLC | Privacy Policy