# 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.Filter do
  @moduledoc """
  Defines the filter for `Restore`. This filter can be used to further refine the resource selection of the `Restore` beyond the coarse-grained scope defined in the `RestorePlan`. `exclusion_filters` take precedence over `inclusion_filters`. If a resource matches both `inclusion_filters` and `exclusion_filters`, it will not be restored.

  ## Attributes

  *   `exclusionFilters` (*type:* `list(GoogleApi.GKEBackup.V1.Model.ResourceSelector.t)`, *default:* `nil`) - Optional. Excludes resources from restoration. If specified, a resource will not be restored if it matches any `ResourceSelector` of the `exclusion_filters`.
  *   `inclusionFilters` (*type:* `list(GoogleApi.GKEBackup.V1.Model.ResourceSelector.t)`, *default:* `nil`) - Optional. Selects resources for restoration. If specified, only resources which match `inclusion_filters` will be selected for restoration. A resource will be selected if it matches any `ResourceSelector` of the `inclusion_filters`.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :exclusionFilters => list(GoogleApi.GKEBackup.V1.Model.ResourceSelector.t()) | nil,
          :inclusionFilters => list(GoogleApi.GKEBackup.V1.Model.ResourceSelector.t()) | nil
        }

  field(:exclusionFilters, as: GoogleApi.GKEBackup.V1.Model.ResourceSelector, type: :list)
  field(:inclusionFilters, as: GoogleApi.GKEBackup.V1.Model.ResourceSelector, type: :list)
end

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

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