# 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.WaterfallChartCustomSubtotal do
  @moduledoc """
  A custom subtotal column for a waterfall chart series.

  ## Attributes

  *   `dataIsSubtotal` (*type:* `boolean()`, *default:* `nil`) - True if the data point at subtotal_index is the subtotal. If false, the subtotal will be computed and appear after the data point.
  *   `label` (*type:* `String.t`, *default:* `nil`) - A label for the subtotal column.
  *   `subtotalIndex` (*type:* `integer()`, *default:* `nil`) - The zero-based index of a data point within the series. If data_is_subtotal is true, the data point at this index is the subtotal. Otherwise, the subtotal appears after the data point with this index. A series can have multiple subtotals at arbitrary indices, but subtotals do not affect the indices of the data points. For example, if a series has three data points, their indices will always be 0, 1, and 2, regardless of how many subtotals exist on the series or what data points they are associated with.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :dataIsSubtotal => boolean() | nil,
          :label => String.t() | nil,
          :subtotalIndex => integer() | nil
        }

  field(:dataIsSubtotal)
  field(:label)
  field(:subtotalIndex)
end

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

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