Class Icon.Builder

  • All Implemented Interfaces:
    IconOrBuilder, com.google.protobuf.GeneratedMessage.ExtendableMessageOrBuilder<com.google.protobuf.GeneratedMessageV3>, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, java.lang.Cloneable
    Enclosing class:
    Icon

    public static final class Icon.Builder
    extends com.google.protobuf.GeneratedMessageV3.Builder<Icon.Builder>
    implements IconOrBuilder
     An icon displayed in a widget on a card. For an example in Google Chat apps,
     see [Add an
     icon](https://developers.google.com/workspace/chat/add-text-image-card-dialog#add_an_icon).
    
     Supports
     [built-in](https://developers.google.com/workspace/chat/format-messages#builtinicons)
     and
     [custom](https://developers.google.com/workspace/chat/format-messages#customicons)
     icons.
    
     [Google Workspace Add-ons and Chat
     apps](https://developers.google.com/workspace/extend):
     
    Protobuf type google.apps.card.v1.Icon
    • Method Detail

      • getDescriptor

        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
      • internalGetFieldAccessorTable

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Overrides:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.Builder<Icon.Builder>
      • clear

        public Icon.Builder clear()
        Specified by:
        clear in interface com.google.protobuf.Message.Builder
        Specified by:
        clear in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clear in class com.google.protobuf.GeneratedMessageV3.Builder<Icon.Builder>
      • getDescriptorForType

        public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
        Specified by:
        getDescriptorForType in interface com.google.protobuf.Message.Builder
        Specified by:
        getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
        Overrides:
        getDescriptorForType in class com.google.protobuf.GeneratedMessage.Builder<Icon.Builder>
      • getDefaultInstanceForType

        public Icon getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.GeneratedMessage.ExtendableMessageOrBuilder<com.google.protobuf.GeneratedMessageV3>
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
      • build

        public Icon build()
        Specified by:
        build in interface com.google.protobuf.Message.Builder
        Specified by:
        build in interface com.google.protobuf.MessageLite.Builder
      • buildPartial

        public Icon buildPartial()
        Specified by:
        buildPartial in interface com.google.protobuf.Message.Builder
        Specified by:
        buildPartial in interface com.google.protobuf.MessageLite.Builder
      • clone

        public Icon.Builder clone()
        Specified by:
        clone in interface com.google.protobuf.Message.Builder
        Specified by:
        clone in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clone in class com.google.protobuf.GeneratedMessageV3.Builder<Icon.Builder>
      • setField

        public Icon.Builder setField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                     java.lang.Object value)
        Specified by:
        setField in interface com.google.protobuf.Message.Builder
        Overrides:
        setField in class com.google.protobuf.GeneratedMessageV3.Builder<Icon.Builder>
      • clearField

        public Icon.Builder clearField​(com.google.protobuf.Descriptors.FieldDescriptor field)
        Specified by:
        clearField in interface com.google.protobuf.Message.Builder
        Overrides:
        clearField in class com.google.protobuf.GeneratedMessageV3.Builder<Icon.Builder>
      • clearOneof

        public Icon.Builder clearOneof​(com.google.protobuf.Descriptors.OneofDescriptor oneof)
        Specified by:
        clearOneof in interface com.google.protobuf.Message.Builder
        Overrides:
        clearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<Icon.Builder>
      • setRepeatedField

        public Icon.Builder setRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                             int index,
                                             java.lang.Object value)
        Specified by:
        setRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        setRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<Icon.Builder>
      • addRepeatedField

        public Icon.Builder addRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                             java.lang.Object value)
        Specified by:
        addRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        addRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<Icon.Builder>
      • mergeFrom

        public Icon.Builder mergeFrom​(com.google.protobuf.Message other)
        Specified by:
        mergeFrom in interface com.google.protobuf.Message.Builder
        Overrides:
        mergeFrom in class com.google.protobuf.AbstractMessage.Builder<Icon.Builder>
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessage.ExtendableBuilder<com.google.protobuf.GeneratedMessageV3,​Icon.Builder>
      • mergeFrom

        public Icon.Builder mergeFrom​(com.google.protobuf.CodedInputStream input,
                                      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                               throws java.io.IOException
        Specified by:
        mergeFrom in interface com.google.protobuf.Message.Builder
        Specified by:
        mergeFrom in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        mergeFrom in class com.google.protobuf.AbstractMessage.Builder<Icon.Builder>
        Throws:
        java.io.IOException
      • hasKnownIcon

        public boolean hasKnownIcon()
         Display one of the built-in icons provided by Google Workspace.
        
         For example, to display an airplane icon, specify `AIRPLANE`.
         For a bus, specify `BUS`.
        
         For a full list of supported icons, see [built-in
         icons](https://developers.google.com/workspace/chat/format-messages#builtinicons).
         
        string known_icon = 1;
        Specified by:
        hasKnownIcon in interface IconOrBuilder
        Returns:
        Whether the knownIcon field is set.
      • getKnownIcon

        public java.lang.String getKnownIcon()
         Display one of the built-in icons provided by Google Workspace.
        
         For example, to display an airplane icon, specify `AIRPLANE`.
         For a bus, specify `BUS`.
        
         For a full list of supported icons, see [built-in
         icons](https://developers.google.com/workspace/chat/format-messages#builtinicons).
         
        string known_icon = 1;
        Specified by:
        getKnownIcon in interface IconOrBuilder
        Returns:
        The knownIcon.
      • getKnownIconBytes

        public com.google.protobuf.ByteString getKnownIconBytes()
         Display one of the built-in icons provided by Google Workspace.
        
         For example, to display an airplane icon, specify `AIRPLANE`.
         For a bus, specify `BUS`.
        
         For a full list of supported icons, see [built-in
         icons](https://developers.google.com/workspace/chat/format-messages#builtinicons).
         
        string known_icon = 1;
        Specified by:
        getKnownIconBytes in interface IconOrBuilder
        Returns:
        The bytes for knownIcon.
      • setKnownIcon

        public Icon.Builder setKnownIcon​(java.lang.String value)
         Display one of the built-in icons provided by Google Workspace.
        
         For example, to display an airplane icon, specify `AIRPLANE`.
         For a bus, specify `BUS`.
        
         For a full list of supported icons, see [built-in
         icons](https://developers.google.com/workspace/chat/format-messages#builtinicons).
         
        string known_icon = 1;
        Parameters:
        value - The knownIcon to set.
        Returns:
        This builder for chaining.
      • clearKnownIcon

        public Icon.Builder clearKnownIcon()
         Display one of the built-in icons provided by Google Workspace.
        
         For example, to display an airplane icon, specify `AIRPLANE`.
         For a bus, specify `BUS`.
        
         For a full list of supported icons, see [built-in
         icons](https://developers.google.com/workspace/chat/format-messages#builtinicons).
         
        string known_icon = 1;
        Returns:
        This builder for chaining.
      • setKnownIconBytes

        public Icon.Builder setKnownIconBytes​(com.google.protobuf.ByteString value)
         Display one of the built-in icons provided by Google Workspace.
        
         For example, to display an airplane icon, specify `AIRPLANE`.
         For a bus, specify `BUS`.
        
         For a full list of supported icons, see [built-in
         icons](https://developers.google.com/workspace/chat/format-messages#builtinicons).
         
        string known_icon = 1;
        Parameters:
        value - The bytes for knownIcon to set.
        Returns:
        This builder for chaining.
      • hasIconUrl

        public boolean hasIconUrl()
         Display a custom icon hosted at an HTTPS URL.
        
         For example:
        
         ```
         "iconUrl":
         "https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png"
         ```
        
         Supported file types include `.png` and `.jpg`.
         
        string icon_url = 2;
        Specified by:
        hasIconUrl in interface IconOrBuilder
        Returns:
        Whether the iconUrl field is set.
      • getIconUrl

        public java.lang.String getIconUrl()
         Display a custom icon hosted at an HTTPS URL.
        
         For example:
        
         ```
         "iconUrl":
         "https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png"
         ```
        
         Supported file types include `.png` and `.jpg`.
         
        string icon_url = 2;
        Specified by:
        getIconUrl in interface IconOrBuilder
        Returns:
        The iconUrl.
      • getIconUrlBytes

        public com.google.protobuf.ByteString getIconUrlBytes()
         Display a custom icon hosted at an HTTPS URL.
        
         For example:
        
         ```
         "iconUrl":
         "https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png"
         ```
        
         Supported file types include `.png` and `.jpg`.
         
        string icon_url = 2;
        Specified by:
        getIconUrlBytes in interface IconOrBuilder
        Returns:
        The bytes for iconUrl.
      • setIconUrl

        public Icon.Builder setIconUrl​(java.lang.String value)
         Display a custom icon hosted at an HTTPS URL.
        
         For example:
        
         ```
         "iconUrl":
         "https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png"
         ```
        
         Supported file types include `.png` and `.jpg`.
         
        string icon_url = 2;
        Parameters:
        value - The iconUrl to set.
        Returns:
        This builder for chaining.
      • clearIconUrl

        public Icon.Builder clearIconUrl()
         Display a custom icon hosted at an HTTPS URL.
        
         For example:
        
         ```
         "iconUrl":
         "https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png"
         ```
        
         Supported file types include `.png` and `.jpg`.
         
        string icon_url = 2;
        Returns:
        This builder for chaining.
      • setIconUrlBytes

        public Icon.Builder setIconUrlBytes​(com.google.protobuf.ByteString value)
         Display a custom icon hosted at an HTTPS URL.
        
         For example:
        
         ```
         "iconUrl":
         "https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png"
         ```
        
         Supported file types include `.png` and `.jpg`.
         
        string icon_url = 2;
        Parameters:
        value - The bytes for iconUrl to set.
        Returns:
        This builder for chaining.
      • hasMaterialIcon

        public boolean hasMaterialIcon()
         Display one of the [Google Material
         Icons](https://fonts.google.com/icons).
        
         For example, to display a [checkbox
         icon](https://fonts.google.com/icons?selected=Material%20Symbols%20Outlined%3Acheck_box%3AFILL%400%3Bwght%40400%3BGRAD%400%3Bopsz%4048),
         use
         ```
         "material_icon": {
           "name": "check_box"
         }
         ```
        
         [Google Chat apps](https://developers.google.com/workspace/chat):
         
        .google.apps.card.v1.MaterialIcon material_icon = 5;
        Specified by:
        hasMaterialIcon in interface IconOrBuilder
        Returns:
        Whether the materialIcon field is set.
      • getMaterialIcon

        public MaterialIcon getMaterialIcon()
         Display one of the [Google Material
         Icons](https://fonts.google.com/icons).
        
         For example, to display a [checkbox
         icon](https://fonts.google.com/icons?selected=Material%20Symbols%20Outlined%3Acheck_box%3AFILL%400%3Bwght%40400%3BGRAD%400%3Bopsz%4048),
         use
         ```
         "material_icon": {
           "name": "check_box"
         }
         ```
        
         [Google Chat apps](https://developers.google.com/workspace/chat):
         
        .google.apps.card.v1.MaterialIcon material_icon = 5;
        Specified by:
        getMaterialIcon in interface IconOrBuilder
        Returns:
        The materialIcon.
      • setMaterialIcon

        public Icon.Builder setMaterialIcon​(MaterialIcon value)
         Display one of the [Google Material
         Icons](https://fonts.google.com/icons).
        
         For example, to display a [checkbox
         icon](https://fonts.google.com/icons?selected=Material%20Symbols%20Outlined%3Acheck_box%3AFILL%400%3Bwght%40400%3BGRAD%400%3Bopsz%4048),
         use
         ```
         "material_icon": {
           "name": "check_box"
         }
         ```
        
         [Google Chat apps](https://developers.google.com/workspace/chat):
         
        .google.apps.card.v1.MaterialIcon material_icon = 5;
      • setMaterialIcon

        public Icon.Builder setMaterialIcon​(MaterialIcon.Builder builderForValue)
         Display one of the [Google Material
         Icons](https://fonts.google.com/icons).
        
         For example, to display a [checkbox
         icon](https://fonts.google.com/icons?selected=Material%20Symbols%20Outlined%3Acheck_box%3AFILL%400%3Bwght%40400%3BGRAD%400%3Bopsz%4048),
         use
         ```
         "material_icon": {
           "name": "check_box"
         }
         ```
        
         [Google Chat apps](https://developers.google.com/workspace/chat):
         
        .google.apps.card.v1.MaterialIcon material_icon = 5;
      • mergeMaterialIcon

        public Icon.Builder mergeMaterialIcon​(MaterialIcon value)
         Display one of the [Google Material
         Icons](https://fonts.google.com/icons).
        
         For example, to display a [checkbox
         icon](https://fonts.google.com/icons?selected=Material%20Symbols%20Outlined%3Acheck_box%3AFILL%400%3Bwght%40400%3BGRAD%400%3Bopsz%4048),
         use
         ```
         "material_icon": {
           "name": "check_box"
         }
         ```
        
         [Google Chat apps](https://developers.google.com/workspace/chat):
         
        .google.apps.card.v1.MaterialIcon material_icon = 5;
      • clearMaterialIcon

        public Icon.Builder clearMaterialIcon()
         Display one of the [Google Material
         Icons](https://fonts.google.com/icons).
        
         For example, to display a [checkbox
         icon](https://fonts.google.com/icons?selected=Material%20Symbols%20Outlined%3Acheck_box%3AFILL%400%3Bwght%40400%3BGRAD%400%3Bopsz%4048),
         use
         ```
         "material_icon": {
           "name": "check_box"
         }
         ```
        
         [Google Chat apps](https://developers.google.com/workspace/chat):
         
        .google.apps.card.v1.MaterialIcon material_icon = 5;
      • getMaterialIconBuilder

        public MaterialIcon.Builder getMaterialIconBuilder()
         Display one of the [Google Material
         Icons](https://fonts.google.com/icons).
        
         For example, to display a [checkbox
         icon](https://fonts.google.com/icons?selected=Material%20Symbols%20Outlined%3Acheck_box%3AFILL%400%3Bwght%40400%3BGRAD%400%3Bopsz%4048),
         use
         ```
         "material_icon": {
           "name": "check_box"
         }
         ```
        
         [Google Chat apps](https://developers.google.com/workspace/chat):
         
        .google.apps.card.v1.MaterialIcon material_icon = 5;
      • getMaterialIconOrBuilder

        public MaterialIconOrBuilder getMaterialIconOrBuilder()
         Display one of the [Google Material
         Icons](https://fonts.google.com/icons).
        
         For example, to display a [checkbox
         icon](https://fonts.google.com/icons?selected=Material%20Symbols%20Outlined%3Acheck_box%3AFILL%400%3Bwght%40400%3BGRAD%400%3Bopsz%4048),
         use
         ```
         "material_icon": {
           "name": "check_box"
         }
         ```
        
         [Google Chat apps](https://developers.google.com/workspace/chat):
         
        .google.apps.card.v1.MaterialIcon material_icon = 5;
        Specified by:
        getMaterialIconOrBuilder in interface IconOrBuilder
      • getAltText

        public java.lang.String getAltText()
         Optional. A description of the icon used for accessibility.
         If unspecified, the default value `Button` is provided. As a best practice,
         you should set a helpful description for what the icon displays, and if
         applicable, what it does. For example, `A user's account portrait`, or
         `Opens a new browser tab and navigates to the Google Chat developer
         documentation at https://developers.google.com/workspace/chat`.
        
         If the icon is set in a [`Button`][google.apps.card.v1.Button], the
         `altText` appears as helper text when the user hovers over the button.
         However, if the button also sets `text`, the icon's `altText` is ignored.
         
        string alt_text = 3;
        Specified by:
        getAltText in interface IconOrBuilder
        Returns:
        The altText.
      • getAltTextBytes

        public com.google.protobuf.ByteString getAltTextBytes()
         Optional. A description of the icon used for accessibility.
         If unspecified, the default value `Button` is provided. As a best practice,
         you should set a helpful description for what the icon displays, and if
         applicable, what it does. For example, `A user's account portrait`, or
         `Opens a new browser tab and navigates to the Google Chat developer
         documentation at https://developers.google.com/workspace/chat`.
        
         If the icon is set in a [`Button`][google.apps.card.v1.Button], the
         `altText` appears as helper text when the user hovers over the button.
         However, if the button also sets `text`, the icon's `altText` is ignored.
         
        string alt_text = 3;
        Specified by:
        getAltTextBytes in interface IconOrBuilder
        Returns:
        The bytes for altText.
      • setAltText

        public Icon.Builder setAltText​(java.lang.String value)
         Optional. A description of the icon used for accessibility.
         If unspecified, the default value `Button` is provided. As a best practice,
         you should set a helpful description for what the icon displays, and if
         applicable, what it does. For example, `A user's account portrait`, or
         `Opens a new browser tab and navigates to the Google Chat developer
         documentation at https://developers.google.com/workspace/chat`.
        
         If the icon is set in a [`Button`][google.apps.card.v1.Button], the
         `altText` appears as helper text when the user hovers over the button.
         However, if the button also sets `text`, the icon's `altText` is ignored.
         
        string alt_text = 3;
        Parameters:
        value - The altText to set.
        Returns:
        This builder for chaining.
      • clearAltText

        public Icon.Builder clearAltText()
         Optional. A description of the icon used for accessibility.
         If unspecified, the default value `Button` is provided. As a best practice,
         you should set a helpful description for what the icon displays, and if
         applicable, what it does. For example, `A user's account portrait`, or
         `Opens a new browser tab and navigates to the Google Chat developer
         documentation at https://developers.google.com/workspace/chat`.
        
         If the icon is set in a [`Button`][google.apps.card.v1.Button], the
         `altText` appears as helper text when the user hovers over the button.
         However, if the button also sets `text`, the icon's `altText` is ignored.
         
        string alt_text = 3;
        Returns:
        This builder for chaining.
      • setAltTextBytes

        public Icon.Builder setAltTextBytes​(com.google.protobuf.ByteString value)
         Optional. A description of the icon used for accessibility.
         If unspecified, the default value `Button` is provided. As a best practice,
         you should set a helpful description for what the icon displays, and if
         applicable, what it does. For example, `A user's account portrait`, or
         `Opens a new browser tab and navigates to the Google Chat developer
         documentation at https://developers.google.com/workspace/chat`.
        
         If the icon is set in a [`Button`][google.apps.card.v1.Button], the
         `altText` appears as helper text when the user hovers over the button.
         However, if the button also sets `text`, the icon's `altText` is ignored.
         
        string alt_text = 3;
        Parameters:
        value - The bytes for altText to set.
        Returns:
        This builder for chaining.
      • getImageTypeValue

        public int getImageTypeValue()
         The crop style applied to the image. In some cases, applying a
         `CIRCLE` crop causes the image to be drawn larger than a built-in
         icon.
         
        .google.apps.card.v1.Widget.ImageType image_type = 4;
        Specified by:
        getImageTypeValue in interface IconOrBuilder
        Returns:
        The enum numeric value on the wire for imageType.
      • setImageTypeValue

        public Icon.Builder setImageTypeValue​(int value)
         The crop style applied to the image. In some cases, applying a
         `CIRCLE` crop causes the image to be drawn larger than a built-in
         icon.
         
        .google.apps.card.v1.Widget.ImageType image_type = 4;
        Parameters:
        value - The enum numeric value on the wire for imageType to set.
        Returns:
        This builder for chaining.
      • getImageType

        public Widget.ImageType getImageType()
         The crop style applied to the image. In some cases, applying a
         `CIRCLE` crop causes the image to be drawn larger than a built-in
         icon.
         
        .google.apps.card.v1.Widget.ImageType image_type = 4;
        Specified by:
        getImageType in interface IconOrBuilder
        Returns:
        The imageType.
      • setImageType

        public Icon.Builder setImageType​(Widget.ImageType value)
         The crop style applied to the image. In some cases, applying a
         `CIRCLE` crop causes the image to be drawn larger than a built-in
         icon.
         
        .google.apps.card.v1.Widget.ImageType image_type = 4;
        Parameters:
        value - The imageType to set.
        Returns:
        This builder for chaining.
      • clearImageType

        public Icon.Builder clearImageType()
         The crop style applied to the image. In some cases, applying a
         `CIRCLE` crop causes the image to be drawn larger than a built-in
         icon.
         
        .google.apps.card.v1.Widget.ImageType image_type = 4;
        Returns:
        This builder for chaining.
      • setUnknownFields

        public final Icon.Builder setUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        setUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        setUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<Icon.Builder>
      • mergeUnknownFields

        public final Icon.Builder mergeUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        mergeUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        mergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<Icon.Builder>