lib/google_api/chat/v1/model/google_apps_card_v1_decorated_text.ex

# 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.Chat.V1.Model.GoogleAppsCardV1DecoratedText do
  @moduledoc """
  A widget that displays text with optional decorations such as a label above or below the text, an icon in front of the text, a selection widget or a button after the text.

  ## Attributes

  *   `bottomLabel` (*type:* `String.t`, *default:* `nil`) - The formatted text label that shows below the main text.
  *   `button` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1Button.t`, *default:* `nil`) - A button that can be clicked to trigger an action.
  *   `endIcon` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1Icon.t`, *default:* `nil`) - An icon displayed after the text.
  *   `icon` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1Icon.t`, *default:* `nil`) - Deprecated in favor of start_icon.
  *   `onClick` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1OnClick.t`, *default:* `nil`) - Only the top and bottom label and content region are clickable.
  *   `startIcon` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1Icon.t`, *default:* `nil`) - The icon displayed in front of the text.
  *   `switchControl` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1SwitchControl.t`, *default:* `nil`) - A switch widget can be clicked to change its state or trigger an action.
  *   `text` (*type:* `String.t`, *default:* `nil`) - Required. The main widget formatted text. See Text formatting for details.
  *   `topLabel` (*type:* `String.t`, *default:* `nil`) - The formatted text label that shows above the main text.
  *   `wrapText` (*type:* `boolean()`, *default:* `nil`) - The wrap text setting. If `true`, the text is wrapped and displayed in multiline. Otherwise, the text is truncated.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :bottomLabel => String.t() | nil,
          :button => GoogleApi.Chat.V1.Model.GoogleAppsCardV1Button.t() | nil,
          :endIcon => GoogleApi.Chat.V1.Model.GoogleAppsCardV1Icon.t() | nil,
          :icon => GoogleApi.Chat.V1.Model.GoogleAppsCardV1Icon.t() | nil,
          :onClick => GoogleApi.Chat.V1.Model.GoogleAppsCardV1OnClick.t() | nil,
          :startIcon => GoogleApi.Chat.V1.Model.GoogleAppsCardV1Icon.t() | nil,
          :switchControl => GoogleApi.Chat.V1.Model.GoogleAppsCardV1SwitchControl.t() | nil,
          :text => String.t() | nil,
          :topLabel => String.t() | nil,
          :wrapText => boolean() | nil
        }

  field(:bottomLabel)
  field(:button, as: GoogleApi.Chat.V1.Model.GoogleAppsCardV1Button)
  field(:endIcon, as: GoogleApi.Chat.V1.Model.GoogleAppsCardV1Icon)
  field(:icon, as: GoogleApi.Chat.V1.Model.GoogleAppsCardV1Icon)
  field(:onClick, as: GoogleApi.Chat.V1.Model.GoogleAppsCardV1OnClick)
  field(:startIcon, as: GoogleApi.Chat.V1.Model.GoogleAppsCardV1Icon)
  field(:switchControl, as: GoogleApi.Chat.V1.Model.GoogleAppsCardV1SwitchControl)
  field(:text)
  field(:topLabel)
  field(:wrapText)
end

defimpl Poison.Decoder, for: GoogleApi.Chat.V1.Model.GoogleAppsCardV1DecoratedText do
  def decode(value, options) do
    GoogleApi.Chat.V1.Model.GoogleAppsCardV1DecoratedText.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Chat.V1.Model.GoogleAppsCardV1DecoratedText do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end