# 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.PieChartSpec do
  @moduledoc """
  A pie chart.

  ## Attributes

  *   `domain` (*type:* `GoogleApi.Sheets.V4.Model.ChartData.t`, *default:* `nil`) - The data that covers the domain of the pie chart.
  *   `legendPosition` (*type:* `String.t`, *default:* `nil`) - Where the legend of the pie chart should be drawn.
  *   `pieHole` (*type:* `float()`, *default:* `nil`) - The size of the hole in the pie chart.
  *   `series` (*type:* `GoogleApi.Sheets.V4.Model.ChartData.t`, *default:* `nil`) - The data that covers the one and only series of the pie chart.
  *   `threeDimensional` (*type:* `boolean()`, *default:* `nil`) - True if the pie is three dimensional.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :domain => GoogleApi.Sheets.V4.Model.ChartData.t() | nil,
          :legendPosition => String.t() | nil,
          :pieHole => float() | nil,
          :series => GoogleApi.Sheets.V4.Model.ChartData.t() | nil,
          :threeDimensional => boolean() | nil
        }

  field(:domain, as: GoogleApi.Sheets.V4.Model.ChartData)
  field(:legendPosition)
  field(:pieHole)
  field(:series, as: GoogleApi.Sheets.V4.Model.ChartData)
  field(:threeDimensional)
end

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

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