# 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.TextFormat do
  @moduledoc """
  The format of a run of text in a cell. Absent values indicate that the field isn't specified.

  ## Attributes

  *   `bold` (*type:* `boolean()`, *default:* `nil`) - True if the text is bold.
  *   `fontFamily` (*type:* `String.t`, *default:* `nil`) - The font family.
  *   `fontSize` (*type:* `integer()`, *default:* `nil`) - The size of the font.
  *   `foregroundColor` (*type:* `GoogleApi.Sheets.V4.Model.Color.t`, *default:* `nil`) - The foreground color of the text. Deprecated: Use foreground_color_style.
  *   `foregroundColorStyle` (*type:* `GoogleApi.Sheets.V4.Model.ColorStyle.t`, *default:* `nil`) - The foreground color of the text. If foreground_color is also set, this field takes precedence.
  *   `italic` (*type:* `boolean()`, *default:* `nil`) - True if the text is italicized.
  *   `link` (*type:* `GoogleApi.Sheets.V4.Model.Link.t`, *default:* `nil`) - The link destination of the text, if any. Setting the link field in a TextFormatRun will clear the cell's existing links or a cell-level link set in the same request. When a link is set, the text foreground color will be set to the default link color and the text will be underlined. If these fields are modified in the same request, those values will be used instead of the link defaults.
  *   `strikethrough` (*type:* `boolean()`, *default:* `nil`) - True if the text has a strikethrough.
  *   `underline` (*type:* `boolean()`, *default:* `nil`) - True if the text is underlined.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :bold => boolean() | nil,
          :fontFamily => String.t() | nil,
          :fontSize => integer() | nil,
          :foregroundColor => GoogleApi.Sheets.V4.Model.Color.t() | nil,
          :foregroundColorStyle => GoogleApi.Sheets.V4.Model.ColorStyle.t() | nil,
          :italic => boolean() | nil,
          :link => GoogleApi.Sheets.V4.Model.Link.t() | nil,
          :strikethrough => boolean() | nil,
          :underline => boolean() | nil
        }

  field(:bold)
  field(:fontFamily)
  field(:fontSize)
  field(:foregroundColor, as: GoogleApi.Sheets.V4.Model.Color)
  field(:foregroundColorStyle, as: GoogleApi.Sheets.V4.Model.ColorStyle)
  field(:italic)
  field(:link, as: GoogleApi.Sheets.V4.Model.Link)
  field(:strikethrough)
  field(:underline)
end

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

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