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

    size = 0;
    if (automatedBackupMode_
        != com.google.cloud.memorystore.v1.AutomatedBackupConfig.AutomatedBackupMode
            .AUTOMATED_BACKUP_MODE_UNSPECIFIED
            .getNumber()) {
      size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, automatedBackupMode_);
    }
    if (scheduleCase_ == 2) {
      size +=
          com.google.protobuf.CodedOutputStream.computeMessageSize(
              2,
              (com.google.cloud.memorystore.v1.AutomatedBackupConfig.FixedFrequencySchedule)
                  schedule_);
    }
    if (((bitField0_ & 0x00000001) != 0)) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getRetention());
    }
    size += getUnknownFields().getSerializedSize();
    memoizedSize = size;
    return size;
  }
<pre>
Optional. How long to keep automated backups before the backups are
deleted. The value should be between 1 day and 365 days. If not specified,
the default value is 35 days.
</pre>

<code>.google.protobuf.Duration retention = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/AutomatedBackupConfig.java