# 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.BasicChartAxis do
  @moduledoc """
  An axis of the chart. A chart may not have more than one axis per axis position.

  ## Attributes

  *   `format` (*type:* `GoogleApi.Sheets.V4.Model.TextFormat.t`, *default:* `nil`) - The format of the title. Only valid if the axis is not associated with the domain. The link field is not supported.
  *   `position` (*type:* `String.t`, *default:* `nil`) - The position of this axis.
  *   `title` (*type:* `String.t`, *default:* `nil`) - The title of this axis. If set, this overrides any title inferred from headers of the data.
  *   `titleTextPosition` (*type:* `GoogleApi.Sheets.V4.Model.TextPosition.t`, *default:* `nil`) - The axis title text position.
  *   `viewWindowOptions` (*type:* `GoogleApi.Sheets.V4.Model.ChartAxisViewWindowOptions.t`, *default:* `nil`) - The view window options for this axis.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :format => GoogleApi.Sheets.V4.Model.TextFormat.t() | nil,
          :position => String.t() | nil,
          :title => String.t() | nil,
          :titleTextPosition => GoogleApi.Sheets.V4.Model.TextPosition.t() | nil,
          :viewWindowOptions => GoogleApi.Sheets.V4.Model.ChartAxisViewWindowOptions.t() | nil
        }

  field(:format, as: GoogleApi.Sheets.V4.Model.TextFormat)
  field(:position)
  field(:title)
  field(:titleTextPosition, as: GoogleApi.Sheets.V4.Model.TextPosition)
  field(:viewWindowOptions, as: GoogleApi.Sheets.V4.Model.ChartAxisViewWindowOptions)
end

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

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