# 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.BasicChartSpec do
  @moduledoc """
  The specification for a basic chart. See BasicChartType for the list of charts this supports.

  ## Attributes

  *   `axis` (*type:* `list(GoogleApi.Sheets.V4.Model.BasicChartAxis.t)`, *default:* `nil`) - The axis on the chart.
  *   `chartType` (*type:* `String.t`, *default:* `nil`) - The type of the chart.
  *   `compareMode` (*type:* `String.t`, *default:* `nil`) - The behavior of tooltips and data highlighting when hovering on data and chart area.
  *   `domains` (*type:* `list(GoogleApi.Sheets.V4.Model.BasicChartDomain.t)`, *default:* `nil`) - The domain of data this is charting. Only a single domain is supported.
  *   `headerCount` (*type:* `integer()`, *default:* `nil`) - The number of rows or columns in the data that are "headers". If not set, Google Sheets will guess how many rows are headers based on the data. (Note that BasicChartAxis.title may override the axis title inferred from the header values.)
  *   `interpolateNulls` (*type:* `boolean()`, *default:* `nil`) - If some values in a series are missing, gaps may appear in the chart (e.g, segments of lines in a line chart will be missing). To eliminate these gaps set this to true. Applies to Line, Area, and Combo charts.
  *   `legendPosition` (*type:* `String.t`, *default:* `nil`) - The position of the chart legend.
  *   `lineSmoothing` (*type:* `boolean()`, *default:* `nil`) - Gets whether all lines should be rendered smooth or straight by default. Applies to Line charts.
  *   `series` (*type:* `list(GoogleApi.Sheets.V4.Model.BasicChartSeries.t)`, *default:* `nil`) - The data this chart is visualizing.
  *   `stackedType` (*type:* `String.t`, *default:* `nil`) - The stacked type for charts that support vertical stacking. Applies to Area, Bar, Column, Combo, and Stepped Area charts.
  *   `threeDimensional` (*type:* `boolean()`, *default:* `nil`) - True to make the chart 3D. Applies to Bar and Column charts.
  *   `totalDataLabel` (*type:* `GoogleApi.Sheets.V4.Model.DataLabel.t`, *default:* `nil`) - Controls whether to display additional data labels on stacked charts which sum the total value of all stacked values at each value along the domain axis. These data labels can only be set when chart_type is one of AREA, BAR, COLUMN, COMBO or STEPPED_AREA and stacked_type is either STACKED or PERCENT_STACKED. In addition, for COMBO, this will only be supported if there is only one type of stackable series type or one type has more series than the others and each of the other types have no more than one series. For example, if a chart has two stacked bar series and one area series, the total data labels will be supported. If it has three bar series and two area series, total data labels are not allowed. Neither CUSTOM nor placement can be set on the total_data_label.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :axis => list(GoogleApi.Sheets.V4.Model.BasicChartAxis.t()) | nil,
          :chartType => String.t() | nil,
          :compareMode => String.t() | nil,
          :domains => list(GoogleApi.Sheets.V4.Model.BasicChartDomain.t()) | nil,
          :headerCount => integer() | nil,
          :interpolateNulls => boolean() | nil,
          :legendPosition => String.t() | nil,
          :lineSmoothing => boolean() | nil,
          :series => list(GoogleApi.Sheets.V4.Model.BasicChartSeries.t()) | nil,
          :stackedType => String.t() | nil,
          :threeDimensional => boolean() | nil,
          :totalDataLabel => GoogleApi.Sheets.V4.Model.DataLabel.t() | nil
        }

  field(:axis, as: GoogleApi.Sheets.V4.Model.BasicChartAxis, type: :list)
  field(:chartType)
  field(:compareMode)
  field(:domains, as: GoogleApi.Sheets.V4.Model.BasicChartDomain, type: :list)
  field(:headerCount)
  field(:interpolateNulls)
  field(:legendPosition)
  field(:lineSmoothing)
  field(:series, as: GoogleApi.Sheets.V4.Model.BasicChartSeries, type: :list)
  field(:stackedType)
  field(:threeDimensional)
  field(:totalDataLabel, as: GoogleApi.Sheets.V4.Model.DataLabel)
end

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

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