lib/google_api/chat/v1/model/google_apps_card_v1_grid.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.GoogleAppsCardV1Grid do
  @moduledoc """
  Represents a Grid widget that displays items in a configurable grid layout.

  ## Attributes

  *   `borderStyle` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1BorderStyle.t`, *default:* `nil`) - The border style to apply to each grid item.
  *   `columnCount` (*type:* `integer()`, *default:* `nil`) - The number of columns to display in the grid. A default value is used if this field isn't specified, and that default value is different depending on where the grid is shown (dialog versus companion).
  *   `items` (*type:* `list(GoogleApi.Chat.V1.Model.GoogleAppsCardV1GridItem.t)`, *default:* `nil`) - The items to display in the grid.
  *   `onClick` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1OnClick.t`, *default:* `nil`) - This callback is reused by each individual grid item, but with the item's identifier and index in the items list added to the callback's parameters.
  *   `title` (*type:* `String.t`, *default:* `nil`) - The text that displays in the grid header.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :borderStyle => GoogleApi.Chat.V1.Model.GoogleAppsCardV1BorderStyle.t() | nil,
          :columnCount => integer() | nil,
          :items => list(GoogleApi.Chat.V1.Model.GoogleAppsCardV1GridItem.t()) | nil,
          :onClick => GoogleApi.Chat.V1.Model.GoogleAppsCardV1OnClick.t() | nil,
          :title => String.t() | nil
        }

  field(:borderStyle, as: GoogleApi.Chat.V1.Model.GoogleAppsCardV1BorderStyle)
  field(:columnCount)
  field(:items, as: GoogleApi.Chat.V1.Model.GoogleAppsCardV1GridItem, type: :list)
  field(:onClick, as: GoogleApi.Chat.V1.Model.GoogleAppsCardV1OnClick)
  field(:title)
end

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

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