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:



1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
# File 'proto_docs/google/apps/card/v1/card.rb', line 1971

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



1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
# File 'proto_docs/google/apps/card/v1/card.rb', line 1971

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:



1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
# File 'proto_docs/google/apps/card/v1/card.rb', line 1971

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.



1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
# File 'proto_docs/google/apps/card/v1/card.rb', line 1971

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.



1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
# File 'proto_docs/google/apps/card/v1/card.rb', line 1971

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