Class: Google::Apps::Card::V1::Grid

Inherits:
Object
  • Object
show all
Extended by:
Protobuf::MessageExts::ClassMethods
Includes:
Protobuf::MessageExts
Defined in:
proto_docs/google/apps/card/v1/card.rb

Overview

Displays a grid with a collection of items. Items can only include text or images. For responsive columns, or to include more than text or images, use Columns. For an example in Google Chat apps, see Display a Grid with a collection of items.

A grid supports any number of columns and items. The number of rows is determined by items divided by columns. A grid with 10 items and 2 columns has 5 rows. A grid with 11 items and 2 columns has 6 rows.

Google Workspace Add-ons and Chat apps:

For example, the following JSON creates a 2 column grid with a single item:

"grid": {
  "title": "A fine collection of items",
  "columnCount": 2,
  "borderStyle": {
    "type": "STROKE",
    "cornerRadius": 4
  },
  "items": [
    {
      "image": {
        "imageUri": "https://www.example.com/image.png",
        "cropStyle": {
          "type": "SQUARE"
        },
        "borderStyle": {
          "type": "STROKE"
        }
      },
      "title": "An item",
      "textAlignment": "CENTER"
    }
  ],
  "onClick": {
    "openLink": {
      "url": "https://www.example.com"
    }
  }
}

Defined Under Namespace

Classes: GridItem

Instance Attribute Summary collapse

Instance Attribute Details

#border_style::Google::Apps::Card::V1::BorderStyle

Returns The border style to apply to each grid item.

Returns:



1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
# File 'proto_docs/google/apps/card/v1/card.rb', line 1698

class Grid
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Represents an item in a grid layout. Items can contain text, an image, or
  # both text and an image.
  #
  # [Google Workspace Add-ons and Chat
  # apps](https://developers.google.com/workspace/extend):
  # @!attribute [rw] id
  #   @return [::String]
  #     A user-specified identifier for this grid item. This identifier is
  #     returned in the parent grid's `onClick` callback parameters.
  # @!attribute [rw] image
  #   @return [::Google::Apps::Card::V1::ImageComponent]
  #     The image that displays in the grid item.
  # @!attribute [rw] title
  #   @return [::String]
  #     The grid item's title.
  # @!attribute [rw] subtitle
  #   @return [::String]
  #     The grid item's subtitle.
  # @!attribute [rw] layout
  #   @return [::Google::Apps::Card::V1::Grid::GridItem::GridItemLayout]
  #     The layout to use for the grid item.
  class GridItem
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Represents the various layout options available for a grid item.
    #
    # [Google Workspace Add-ons and Chat
    # apps](https://developers.google.com/workspace/extend):
    module GridItemLayout
      # Don't use. Unspecified.
      GRID_ITEM_LAYOUT_UNSPECIFIED = 0

      # The title and subtitle are shown below the grid item's image.
      TEXT_BELOW = 1

      # The title and subtitle are shown above the grid item's image.
      TEXT_ABOVE = 2
    end
  end
end

#column_count::Integer

Returns 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).

Returns:

  • (::Integer)

    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).



1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
# File 'proto_docs/google/apps/card/v1/card.rb', line 1698

class Grid
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Represents an item in a grid layout. Items can contain text, an image, or
  # both text and an image.
  #
  # [Google Workspace Add-ons and Chat
  # apps](https://developers.google.com/workspace/extend):
  # @!attribute [rw] id
  #   @return [::String]
  #     A user-specified identifier for this grid item. This identifier is
  #     returned in the parent grid's `onClick` callback parameters.
  # @!attribute [rw] image
  #   @return [::Google::Apps::Card::V1::ImageComponent]
  #     The image that displays in the grid item.
  # @!attribute [rw] title
  #   @return [::String]
  #     The grid item's title.
  # @!attribute [rw] subtitle
  #   @return [::String]
  #     The grid item's subtitle.
  # @!attribute [rw] layout
  #   @return [::Google::Apps::Card::V1::Grid::GridItem::GridItemLayout]
  #     The layout to use for the grid item.
  class GridItem
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Represents the various layout options available for a grid item.
    #
    # [Google Workspace Add-ons and Chat
    # apps](https://developers.google.com/workspace/extend):
    module GridItemLayout
      # Don't use. Unspecified.
      GRID_ITEM_LAYOUT_UNSPECIFIED = 0

      # The title and subtitle are shown below the grid item's image.
      TEXT_BELOW = 1

      # The title and subtitle are shown above the grid item's image.
      TEXT_ABOVE = 2
    end
  end
end

#items::Array<::Google::Apps::Card::V1::Grid::GridItem>

Returns The items to display in the grid.

Returns:



1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
# File 'proto_docs/google/apps/card/v1/card.rb', line 1698

class Grid
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Represents an item in a grid layout. Items can contain text, an image, or
  # both text and an image.
  #
  # [Google Workspace Add-ons and Chat
  # apps](https://developers.google.com/workspace/extend):
  # @!attribute [rw] id
  #   @return [::String]
  #     A user-specified identifier for this grid item. This identifier is
  #     returned in the parent grid's `onClick` callback parameters.
  # @!attribute [rw] image
  #   @return [::Google::Apps::Card::V1::ImageComponent]
  #     The image that displays in the grid item.
  # @!attribute [rw] title
  #   @return [::String]
  #     The grid item's title.
  # @!attribute [rw] subtitle
  #   @return [::String]
  #     The grid item's subtitle.
  # @!attribute [rw] layout
  #   @return [::Google::Apps::Card::V1::Grid::GridItem::GridItemLayout]
  #     The layout to use for the grid item.
  class GridItem
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Represents the various layout options available for a grid item.
    #
    # [Google Workspace Add-ons and Chat
    # apps](https://developers.google.com/workspace/extend):
    module GridItemLayout
      # Don't use. Unspecified.
      GRID_ITEM_LAYOUT_UNSPECIFIED = 0

      # The title and subtitle are shown below the grid item's image.
      TEXT_BELOW = 1

      # The title and subtitle are shown above the grid item's image.
      TEXT_ABOVE = 2
    end
  end
end

#on_click::Google::Apps::Card::V1::OnClick

Returns 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.

Returns:

  • (::Google::Apps::Card::V1::OnClick)

    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.



1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
# File 'proto_docs/google/apps/card/v1/card.rb', line 1698

class Grid
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Represents an item in a grid layout. Items can contain text, an image, or
  # both text and an image.
  #
  # [Google Workspace Add-ons and Chat
  # apps](https://developers.google.com/workspace/extend):
  # @!attribute [rw] id
  #   @return [::String]
  #     A user-specified identifier for this grid item. This identifier is
  #     returned in the parent grid's `onClick` callback parameters.
  # @!attribute [rw] image
  #   @return [::Google::Apps::Card::V1::ImageComponent]
  #     The image that displays in the grid item.
  # @!attribute [rw] title
  #   @return [::String]
  #     The grid item's title.
  # @!attribute [rw] subtitle
  #   @return [::String]
  #     The grid item's subtitle.
  # @!attribute [rw] layout
  #   @return [::Google::Apps::Card::V1::Grid::GridItem::GridItemLayout]
  #     The layout to use for the grid item.
  class GridItem
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Represents the various layout options available for a grid item.
    #
    # [Google Workspace Add-ons and Chat
    # apps](https://developers.google.com/workspace/extend):
    module GridItemLayout
      # Don't use. Unspecified.
      GRID_ITEM_LAYOUT_UNSPECIFIED = 0

      # The title and subtitle are shown below the grid item's image.
      TEXT_BELOW = 1

      # The title and subtitle are shown above the grid item's image.
      TEXT_ABOVE = 2
    end
  end
end

#title::String

Returns The text that displays in the grid header.

Returns:

  • (::String)

    The text that displays in the grid header.



1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
# File 'proto_docs/google/apps/card/v1/card.rb', line 1698

class Grid
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Represents an item in a grid layout. Items can contain text, an image, or
  # both text and an image.
  #
  # [Google Workspace Add-ons and Chat
  # apps](https://developers.google.com/workspace/extend):
  # @!attribute [rw] id
  #   @return [::String]
  #     A user-specified identifier for this grid item. This identifier is
  #     returned in the parent grid's `onClick` callback parameters.
  # @!attribute [rw] image
  #   @return [::Google::Apps::Card::V1::ImageComponent]
  #     The image that displays in the grid item.
  # @!attribute [rw] title
  #   @return [::String]
  #     The grid item's title.
  # @!attribute [rw] subtitle
  #   @return [::String]
  #     The grid item's subtitle.
  # @!attribute [rw] layout
  #   @return [::Google::Apps::Card::V1::Grid::GridItem::GridItemLayout]
  #     The layout to use for the grid item.
  class GridItem
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Represents the various layout options available for a grid item.
    #
    # [Google Workspace Add-ons and Chat
    # apps](https://developers.google.com/workspace/extend):
    module GridItemLayout
      # Don't use. Unspecified.
      GRID_ITEM_LAYOUT_UNSPECIFIED = 0

      # The title and subtitle are shown below the grid item's image.
      TEXT_BELOW = 1

      # The title and subtitle are shown above the grid item's image.
      TEXT_ABOVE = 2
    end
  end
end