# 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.Sheets.V4.Model.FilterCriteria do
  @moduledoc """
  Criteria for showing/hiding rows in a filter or filter view.

  ## Attributes

  *   `condition` (*type:* `GoogleApi.Sheets.V4.Model.BooleanCondition.t`, *default:* `nil`) - A condition that must be true for values to be shown. (This does not override hidden_values -- if a value is listed there, it will still be hidden.)
  *   `hiddenValues` (*type:* `list(String.t)`, *default:* `nil`) - Values that should be hidden.
  *   `visibleBackgroundColor` (*type:* `GoogleApi.Sheets.V4.Model.Color.t`, *default:* `nil`) - The background fill color to filter by; only cells with this fill color are shown. Mutually exclusive with visible_foreground_color. Deprecated: Use visible_background_color_style.
  *   `visibleBackgroundColorStyle` (*type:* `GoogleApi.Sheets.V4.Model.ColorStyle.t`, *default:* `nil`) - The background fill color to filter by; only cells with this fill color are shown. This field is mutually exclusive with visible_foreground_color, and must be set to an RGB-type color. If visible_background_color is also set, this field takes precedence.
  *   `visibleForegroundColor` (*type:* `GoogleApi.Sheets.V4.Model.Color.t`, *default:* `nil`) - The foreground color to filter by; only cells with this foreground color are shown. Mutually exclusive with visible_background_color. Deprecated: Use visible_foreground_color_style.
  *   `visibleForegroundColorStyle` (*type:* `GoogleApi.Sheets.V4.Model.ColorStyle.t`, *default:* `nil`) - The foreground color to filter by; only cells with this foreground color are shown. This field is mutually exclusive with visible_background_color, and must be set to an RGB-type color. If visible_foreground_color is also set, this field takes precedence.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :condition => GoogleApi.Sheets.V4.Model.BooleanCondition.t() | nil,
          :hiddenValues => list(String.t()) | nil,
          :visibleBackgroundColor => GoogleApi.Sheets.V4.Model.Color.t() | nil,
          :visibleBackgroundColorStyle => GoogleApi.Sheets.V4.Model.ColorStyle.t() | nil,
          :visibleForegroundColor => GoogleApi.Sheets.V4.Model.Color.t() | nil,
          :visibleForegroundColorStyle => GoogleApi.Sheets.V4.Model.ColorStyle.t() | nil
        }

  field(:condition, as: GoogleApi.Sheets.V4.Model.BooleanCondition)
  field(:hiddenValues, type: :list)
  field(:visibleBackgroundColor, as: GoogleApi.Sheets.V4.Model.Color)
  field(:visibleBackgroundColorStyle, as: GoogleApi.Sheets.V4.Model.ColorStyle)
  field(:visibleForegroundColor, as: GoogleApi.Sheets.V4.Model.Color)
  field(:visibleForegroundColorStyle, as: GoogleApi.Sheets.V4.Model.ColorStyle)
end

defimpl Poison.Decoder, for: GoogleApi.Sheets.V4.Model.FilterCriteria do
  def decode(value, options) do
    GoogleApi.Sheets.V4.Model.FilterCriteria.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Sheets.V4.Model.FilterCriteria do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
