# 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.ClusterResourceRestoreScope do
  @moduledoc """
  Defines the scope of cluster-scoped resources to restore. Some group kinds are not reasonable choices for a restore, and will cause an error if selected here. Any scope selection that would restore "all valid" resources automatically excludes these group kinds. - gkebackup.gke.io/BackupJob - gkebackup.gke.io/RestoreJob - metrics.k8s.io/NodeMetrics - migration.k8s.io/StorageState - migration.k8s.io/StorageVersionMigration - Node - snapshot.storage.k8s.io/VolumeSnapshotContent - storage.k8s.io/CSINode Some group kinds are driven by restore configuration elsewhere, and will cause an error if selected here. - Namespace - PersistentVolume

  ## Attributes

  *   `allGroupKinds` (*type:* `boolean()`, *default:* `nil`) - Optional. If True, all valid cluster-scoped resources will be restored. Mutually exclusive to any other field in the message.
  *   `excludedGroupKinds` (*type:* `list(GoogleApi.GKEBackup.V1.Model.GroupKind.t)`, *default:* `nil`) - Optional. A list of cluster-scoped resource group kinds to NOT restore from the backup. If specified, all valid cluster-scoped resources will be restored except for those specified in the list. Mutually exclusive to any other field in the message.
  *   `noGroupKinds` (*type:* `boolean()`, *default:* `nil`) - Optional. If True, no cluster-scoped resources will be restored. This has the same restore scope as if the message is not defined. Mutually exclusive to any other field in the message.
  *   `selectedGroupKinds` (*type:* `list(GoogleApi.GKEBackup.V1.Model.GroupKind.t)`, *default:* `nil`) - Optional. A list of cluster-scoped resource group kinds to restore from the backup. If specified, only the selected resources will be restored. Mutually exclusive to any other field in the message.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :allGroupKinds => boolean() | nil,
          :excludedGroupKinds => list(GoogleApi.GKEBackup.V1.Model.GroupKind.t()) | nil,
          :noGroupKinds => boolean() | nil,
          :selectedGroupKinds => list(GoogleApi.GKEBackup.V1.Model.GroupKind.t()) | nil
        }

  field(:allGroupKinds)
  field(:excludedGroupKinds, as: GoogleApi.GKEBackup.V1.Model.GroupKind, type: :list)
  field(:noGroupKinds)
  field(:selectedGroupKinds, as: GoogleApi.GKEBackup.V1.Model.GroupKind, type: :list)
end

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

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