# 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.GKEBackup.V1.Model.BackupConfig do
  @moduledoc """
  BackupConfig defines the configuration of Backups created via this BackupPlan.

  ## Attributes

  *   `allNamespaces` (*type:* `boolean()`, *default:* `nil`) - If True, include all namespaced resources
  *   `encryptionKey` (*type:* `GoogleApi.GKEBackup.V1.Model.EncryptionKey.t`, *default:* `nil`) - Optional. This defines a customer managed encryption key that will be used to encrypt the "config" portion (the Kubernetes resources) of Backups created via this plan. Default (empty): Config backup artifacts will not be encrypted.
  *   `includeSecrets` (*type:* `boolean()`, *default:* `nil`) - Optional. This flag specifies whether Kubernetes Secret resources should be included when they fall into the scope of Backups. Default: False
  *   `includeVolumeData` (*type:* `boolean()`, *default:* `nil`) - Optional. This flag specifies whether volume data should be backed up when PVCs are included in the scope of a Backup. Default: False
  *   `permissiveMode` (*type:* `boolean()`, *default:* `nil`) - Optional. If false, Backups will fail when Backup for GKE detects Kubernetes configuration that is non-standard or requires additional setup to restore. Default: False
  *   `selectedApplications` (*type:* `GoogleApi.GKEBackup.V1.Model.NamespacedNames.t`, *default:* `nil`) - If set, include just the resources referenced by the listed ProtectedApplications.
  *   `selectedNamespaces` (*type:* `GoogleApi.GKEBackup.V1.Model.Namespaces.t`, *default:* `nil`) - If set, include just the resources in the listed namespaces.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :allNamespaces => boolean() | nil,
          :encryptionKey => GoogleApi.GKEBackup.V1.Model.EncryptionKey.t() | nil,
          :includeSecrets => boolean() | nil,
          :includeVolumeData => boolean() | nil,
          :permissiveMode => boolean() | nil,
          :selectedApplications => GoogleApi.GKEBackup.V1.Model.NamespacedNames.t() | nil,
          :selectedNamespaces => GoogleApi.GKEBackup.V1.Model.Namespaces.t() | nil
        }

  field(:allNamespaces)
  field(:encryptionKey, as: GoogleApi.GKEBackup.V1.Model.EncryptionKey)
  field(:includeSecrets)
  field(:includeVolumeData)
  field(:permissiveMode)
  field(:selectedApplications, as: GoogleApi.GKEBackup.V1.Model.NamespacedNames)
  field(:selectedNamespaces, as: GoogleApi.GKEBackup.V1.Model.Namespaces)
end

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

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