# 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.DataFilterValueRange do
  @moduledoc """
  A range of values whose location is specified by a DataFilter.

  ## Attributes

  *   `dataFilter` (*type:* `GoogleApi.Sheets.V4.Model.DataFilter.t`, *default:* `nil`) - The data filter describing the location of the values in the spreadsheet.
  *   `majorDimension` (*type:* `String.t`, *default:* `nil`) - The major dimension of the values.
  *   `values` (*type:* `list(list(any()))`, *default:* `nil`) - The data to be written. If the provided values exceed any of the ranges matched by the data filter then the request fails. If the provided values are less than the matched ranges only the specified values are written, existing values in the matched ranges remain unaffected.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :dataFilter => GoogleApi.Sheets.V4.Model.DataFilter.t() | nil,
          :majorDimension => String.t() | nil,
          :values => list(list(any())) | nil
        }

  field(:dataFilter, as: GoogleApi.Sheets.V4.Model.DataFilter)
  field(:majorDimension)
  field(:values, type: :listlist)
end

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

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