# 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.CellFormat do
  @moduledoc """
  The format of a cell.

  ## Attributes

  *   `backgroundColor` (*type:* `GoogleApi.Sheets.V4.Model.Color.t`, *default:* `nil`) - The background color of the cell. Deprecated: Use background_color_style.
  *   `backgroundColorStyle` (*type:* `GoogleApi.Sheets.V4.Model.ColorStyle.t`, *default:* `nil`) - The background color of the cell. If background_color is also set, this field takes precedence.
  *   `borders` (*type:* `GoogleApi.Sheets.V4.Model.Borders.t`, *default:* `nil`) - The borders of the cell.
  *   `horizontalAlignment` (*type:* `String.t`, *default:* `nil`) - The horizontal alignment of the value in the cell.
  *   `hyperlinkDisplayType` (*type:* `String.t`, *default:* `nil`) - If one exists, how a hyperlink should be displayed in the cell.
  *   `numberFormat` (*type:* `GoogleApi.Sheets.V4.Model.NumberFormat.t`, *default:* `nil`) - A format describing how number values should be represented to the user.
  *   `padding` (*type:* `GoogleApi.Sheets.V4.Model.Padding.t`, *default:* `nil`) - The padding of the cell.
  *   `textDirection` (*type:* `String.t`, *default:* `nil`) - The direction of the text in the cell.
  *   `textFormat` (*type:* `GoogleApi.Sheets.V4.Model.TextFormat.t`, *default:* `nil`) - The format of the text in the cell (unless overridden by a format run). Setting a cell-level link here clears the cell's existing links. Setting the link field in a TextFormatRun takes precedence over the cell-level link.
  *   `textRotation` (*type:* `GoogleApi.Sheets.V4.Model.TextRotation.t`, *default:* `nil`) - The rotation applied to text in the cell.
  *   `verticalAlignment` (*type:* `String.t`, *default:* `nil`) - The vertical alignment of the value in the cell.
  *   `wrapStrategy` (*type:* `String.t`, *default:* `nil`) - The wrap strategy for the value in the cell.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :backgroundColor => GoogleApi.Sheets.V4.Model.Color.t() | nil,
          :backgroundColorStyle => GoogleApi.Sheets.V4.Model.ColorStyle.t() | nil,
          :borders => GoogleApi.Sheets.V4.Model.Borders.t() | nil,
          :horizontalAlignment => String.t() | nil,
          :hyperlinkDisplayType => String.t() | nil,
          :numberFormat => GoogleApi.Sheets.V4.Model.NumberFormat.t() | nil,
          :padding => GoogleApi.Sheets.V4.Model.Padding.t() | nil,
          :textDirection => String.t() | nil,
          :textFormat => GoogleApi.Sheets.V4.Model.TextFormat.t() | nil,
          :textRotation => GoogleApi.Sheets.V4.Model.TextRotation.t() | nil,
          :verticalAlignment => String.t() | nil,
          :wrapStrategy => String.t() | nil
        }

  field(:backgroundColor, as: GoogleApi.Sheets.V4.Model.Color)
  field(:backgroundColorStyle, as: GoogleApi.Sheets.V4.Model.ColorStyle)
  field(:borders, as: GoogleApi.Sheets.V4.Model.Borders)
  field(:horizontalAlignment)
  field(:hyperlinkDisplayType)
  field(:numberFormat, as: GoogleApi.Sheets.V4.Model.NumberFormat)
  field(:padding, as: GoogleApi.Sheets.V4.Model.Padding)
  field(:textDirection)
  field(:textFormat, as: GoogleApi.Sheets.V4.Model.TextFormat)
  field(:textRotation, as: GoogleApi.Sheets.V4.Model.TextRotation)
  field(:verticalAlignment)
  field(:wrapStrategy)
end

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

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