# 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.ContinuousBackupConfig do
  @moduledoc """
  ContinuousBackupConfig describes the continuous backups recovery configurations of a cluster.

  ## Attributes

  *   `enabled` (*type:* `boolean()`, *default:* `nil`) - Whether ContinuousBackup is enabled.
  *   `encryptionConfig` (*type:* `GoogleApi.AlloyDB.V1.Model.EncryptionConfig.t`, *default:* `nil`) - The encryption config can be specified to encrypt the backups with a customer-managed encryption key (CMEK). When this field is not specified, the backup will use the cluster's encryption config.
  *   `recoveryWindowDays` (*type:* `integer()`, *default:* `nil`) - The number of days that are eligible to restore from using PITR. To support the entire recovery window, backups and logs are retained for one day more than the recovery window. If not set, defaults to 14 days.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :enabled => boolean() | nil,
          :encryptionConfig => GoogleApi.AlloyDB.V1.Model.EncryptionConfig.t() | nil,
          :recoveryWindowDays => integer() | nil
        }

  field(:enabled)
  field(:encryptionConfig, as: GoogleApi.AlloyDB.V1.Model.EncryptionConfig)
  field(:recoveryWindowDays)
end

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

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