lib/google_api/chat/v1/model/google_apps_card_v1_selection_item.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.GoogleAppsCardV1SelectionItem do
  @moduledoc """
  An item that users can select in a selection input, such as a checkbox or switch. [Google Workspace Add-ons and Chat apps](https://developers.google.com/workspace/extend):

  ## Attributes

  *   `bottomText` (*type:* `String.t`, *default:* `nil`) - For multiselect menus, a text description or label that's displayed below the item's `text` field.
  *   `selected` (*type:* `boolean()`, *default:* `nil`) - Whether the item is selected by default. If the selection input only accepts one value (such as for radio buttons or a dropdown menu), only set this field for one item.
  *   `startIconUri` (*type:* `String.t`, *default:* `nil`) - For multiselect menus, the URL for the icon displayed next to the item's `text` field. Supports PNG and JPEG files. Must be an `HTTPS` URL. For example, `https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png`.
  *   `text` (*type:* `String.t`, *default:* `nil`) - The text that identifies or describes the item to users.
  *   `value` (*type:* `String.t`, *default:* `nil`) - The value associated with this item. The client should use this as a form input value. For details about working with form inputs, see [Receive form data](https://developers.google.com/workspace/chat/read-form-data).
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :bottomText => String.t() | nil,
          :selected => boolean() | nil,
          :startIconUri => String.t() | nil,
          :text => String.t() | nil,
          :value => String.t() | nil
        }

  field(:bottomText)
  field(:selected)
  field(:startIconUri)
  field(:text)
  field(:value)
end

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

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