# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AlloyDB.V1.Model.Backup do
  @moduledoc """
  Message describing Backup object

  ## Attributes

  *   `annotations` (*type:* `map()`, *default:* `nil`) - Annotations to allow client tools to store small amount of arbitrary data. This is distinct from labels. https://google.aip.dev/128
  *   `clusterName` (*type:* `String.t`, *default:* `nil`) - Required. The full resource name of the backup source cluster (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}).
  *   `clusterUid` (*type:* `String.t`, *default:* `nil`) - Output only. The system-generated UID of the cluster which was used to create this resource.
  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Create time stamp
  *   `databaseVersion` (*type:* `String.t`, *default:* `nil`) - Output only. The database engine major version of the cluster this backup was created from. Any restored cluster created from this backup will have the same database version.
  *   `deleteTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Delete time stamp
  *   `description` (*type:* `String.t`, *default:* `nil`) - User-provided description of the backup.
  *   `displayName` (*type:* `String.t`, *default:* `nil`) - User-settable and human-readable display name for the Backup.
  *   `encryptionConfig` (*type:* `GoogleApi.AlloyDB.V1.Model.EncryptionConfig.t`, *default:* `nil`) - Optional. The encryption config can be specified to encrypt the backup with a customer-managed encryption key (CMEK). When this field is not specified, the backup will then use default encryption scheme to protect the user data.
  *   `encryptionInfo` (*type:* `GoogleApi.AlloyDB.V1.Model.EncryptionInfo.t`, *default:* `nil`) - Output only. The encryption information for the backup.
  *   `etag` (*type:* `String.t`, *default:* `nil`) - For Resource freshness validation (https://google.aip.dev/154)
  *   `expiryQuantity` (*type:* `GoogleApi.AlloyDB.V1.Model.QuantityBasedExpiry.t`, *default:* `nil`) - Output only. The QuantityBasedExpiry of the backup, specified by the backup's retention policy. Once the expiry quantity is over retention, the backup is eligible to be garbage collected.
  *   `expiryTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The time at which after the backup is eligible to be garbage collected. It is the duration specified by the backup's retention policy, added to the backup's create_time.
  *   `labels` (*type:* `map()`, *default:* `nil`) - Labels as key value pairs
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. The name of the backup resource with the format: * projects/{project}/locations/{region}/backups/{backup_id} where the cluster and backup ID segments should satisfy the regex expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of lowercase letters, numbers, and dashes, starting with a letter, and ending with a letter or number. For more details see https://google.aip.dev/122. The prefix of the backup resource name is the name of the parent resource: * projects/{project}/locations/{region}
  *   `reconciling` (*type:* `boolean()`, *default:* `nil`) - Output only. Reconciling (https://google.aip.dev/128#reconciliation), if true, indicates that the service is actively updating the resource. This can happen due to user-triggered updates or system actions like failover or maintenance.
  *   `satisfiesPzs` (*type:* `boolean()`, *default:* `nil`) - Output only. Reserved for future use.
  *   `sizeBytes` (*type:* `String.t`, *default:* `nil`) - Output only. The size of the backup in bytes.
  *   `state` (*type:* `String.t`, *default:* `nil`) - Output only. The current state of the backup.
  *   `tags` (*type:* `map()`, *default:* `nil`) - Optional. Input only. Immutable. Tag keys/values directly bound to this resource. For example: ``` "123/environment": "production", "123/costCenter": "marketing" ```
  *   `type` (*type:* `String.t`, *default:* `nil`) - The backup type, which suggests the trigger for the backup.
  *   `uid` (*type:* `String.t`, *default:* `nil`) - Output only. The system-generated UID of the resource. The UID is assigned when the resource is created, and it is retained until it is deleted.
  *   `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Update time stamp Users should not infer any meaning from this field. Its value is generally unrelated to the timing of the backup creation operation.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :annotations => map() | nil,
          :clusterName => String.t() | nil,
          :clusterUid => String.t() | nil,
          :createTime => DateTime.t() | nil,
          :databaseVersion => String.t() | nil,
          :deleteTime => DateTime.t() | nil,
          :description => String.t() | nil,
          :displayName => String.t() | nil,
          :encryptionConfig => GoogleApi.AlloyDB.V1.Model.EncryptionConfig.t() | nil,
          :encryptionInfo => GoogleApi.AlloyDB.V1.Model.EncryptionInfo.t() | nil,
          :etag => String.t() | nil,
          :expiryQuantity => GoogleApi.AlloyDB.V1.Model.QuantityBasedExpiry.t() | nil,
          :expiryTime => DateTime.t() | nil,
          :labels => map() | nil,
          :name => String.t() | nil,
          :reconciling => boolean() | nil,
          :satisfiesPzs => boolean() | nil,
          :sizeBytes => String.t() | nil,
          :state => String.t() | nil,
          :tags => map() | nil,
          :type => String.t() | nil,
          :uid => String.t() | nil,
          :updateTime => DateTime.t() | nil
        }

  field(:annotations, type: :map)
  field(:clusterName)
  field(:clusterUid)
  field(:createTime, as: DateTime)
  field(:databaseVersion)
  field(:deleteTime, as: DateTime)
  field(:description)
  field(:displayName)
  field(:encryptionConfig, as: GoogleApi.AlloyDB.V1.Model.EncryptionConfig)
  field(:encryptionInfo, as: GoogleApi.AlloyDB.V1.Model.EncryptionInfo)
  field(:etag)
  field(:expiryQuantity, as: GoogleApi.AlloyDB.V1.Model.QuantityBasedExpiry)
  field(:expiryTime, as: DateTime)
  field(:labels, type: :map)
  field(:name)
  field(:reconciling)
  field(:satisfiesPzs)
  field(:sizeBytes)
  field(:state)
  field(:tags, type: :map)
  field(:type)
  field(:uid)
  field(:updateTime, as: DateTime)
end

defimpl Poison.Decoder, for: GoogleApi.AlloyDB.V1.Model.Backup do
  def decode(value, options) do
    GoogleApi.AlloyDB.V1.Model.Backup.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.AlloyDB.V1.Model.Backup do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
