chat

package
v0.93.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 16, 2022 License: BSD-3-Clause Imports: 16 Imported by: 31

Documentation

Overview

Package chat provides access to the Google Chat API.

For product documentation, see: https://developers.google.com/hangouts/chat

Creating a client

Usage example:

import "google.golang.org/api/chat/v1"
...
ctx := context.Background()
chatService, err := chat.NewService(ctx)

In this example, Google Application Default Credentials are used for authentication.

For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.

Other authentication options

To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:

chatService, err := chat.NewService(ctx, option.WithAPIKey("AIza..."))

To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:

config := &oauth2.Config{...}
// ...
token, err := config.Exchange(ctx, ...)
chatService, err := chat.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))

See https://godoc.org/google.golang.org/api/option/ for details on options.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionParameter

type ActionParameter struct {
	// Key: The name of the parameter for the action script.
	Key string `json:"key,omitempty"`

	// Value: The value of the parameter.
	Value string `json:"value,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Key") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Key") to include in API
	// requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

ActionParameter: List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.

func (*ActionParameter) MarshalJSON

func (s *ActionParameter) MarshalJSON() ([]byte, error)

type ActionResponse

type ActionResponse struct {
	// DialogAction: Input only. A response to an event related to a dialog
	// (https://developers.google.com/chat/how-tos/dialogs). Must be
	// accompanied by `ResponseType.Dialog`.
	DialogAction *DialogAction `json:"dialogAction,omitempty"`

	// Type: Input only. The type of Chat app response.
	//
	// Possible values:
	//   "TYPE_UNSPECIFIED" - Default type; will be handled as NEW_MESSAGE.
	//   "NEW_MESSAGE" - Post as a new message in the topic.
	//   "UPDATE_MESSAGE" - Update the Chat app's message. This is only
	// permitted on a CARD_CLICKED event where the message sender type is
	// BOT.
	//   "UPDATE_USER_MESSAGE_CARDS" - Update the cards on a user's message.
	// This is only permitted as a response to a MESSAGE event with a
	// matched url, or a CARD_CLICKED event where the message sender type is
	// HUMAN. Text will be ignored.
	//   "REQUEST_CONFIG" - Privately ask the user for additional auth or
	// config.
	//   "DIALOG" - Presents a
	// [dialog](https://developers.google.com/chat/how-tos/dialogs).
	Type string `json:"type,omitempty"`

	// Url: Input only. URL for users to auth or config. (Only for
	// REQUEST_CONFIG response types.)
	Url string `json:"url,omitempty"`

	// ForceSendFields is a list of field names (e.g. "DialogAction") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "DialogAction") to include
	// in API requests with the JSON null value. By default, fields with
	// empty values are omitted from API requests. However, any field with
	// an empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

ActionResponse: Parameters that a Chat app can use to configure how it's response is posted.

func (*ActionResponse) MarshalJSON

func (s *ActionResponse) MarshalJSON() ([]byte, error)

type ActionStatus added in v0.51.0

type ActionStatus struct {
	// StatusCode: The status code.
	//
	// Possible values:
	//   "OK" - Not an error; returned on success HTTP Mapping: 200 OK
	//   "CANCELLED" - The operation was cancelled, typically by the caller.
	// HTTP Mapping: 499 Client Closed Request
	//   "UNKNOWN" - Unknown error. For example, this error may be returned
	// when a `Status` value received from another address space belongs to
	// an error space that is not known in this address space. Also errors
	// raised by APIs that do not return enough error information may be
	// converted to this error. HTTP Mapping: 500 Internal Server Error
	//   "INVALID_ARGUMENT" - The client specified an invalid argument. Note
	// that this differs from `FAILED_PRECONDITION`. `INVALID_ARGUMENT`
	// indicates arguments that are problematic regardless of the state of
	// the system (e.g., a malformed file name). HTTP Mapping: 400 Bad
	// Request
	//   "DEADLINE_EXCEEDED" - The deadline expired before the operation
	// could complete. For operations that change the state of the system,
	// this error may be returned even if the operation has completed
	// successfully. For example, a successful response from a server could
	// have been delayed long enough for the deadline to expire. HTTP
	// Mapping: 504 Gateway Timeout
	//   "NOT_FOUND" - Some requested entity (e.g., file or directory) was
	// not found. Note to server developers: if a request is denied for an
	// entire class of users, such as gradual feature rollout or
	// undocumented allowlist, `NOT_FOUND` may be used. If a request is
	// denied for some users within a class of users, such as user-based
	// access control, `PERMISSION_DENIED` must be used. HTTP Mapping: 404
	// Not Found
	//   "ALREADY_EXISTS" - The entity that a client attempted to create
	// (e.g., file or directory) already exists. HTTP Mapping: 409 Conflict
	//   "PERMISSION_DENIED" - The caller does not have permission to
	// execute the specified operation. `PERMISSION_DENIED` must not be used
	// for rejections caused by exhausting some resource (use
	// `RESOURCE_EXHAUSTED` instead for those errors). `PERMISSION_DENIED`
	// must not be used if the caller can not be identified (use
	// `UNAUTHENTICATED` instead for those errors). This error code does not
	// imply the request is valid or the requested entity exists or
	// satisfies other pre-conditions. HTTP Mapping: 403 Forbidden
	//   "UNAUTHENTICATED" - The request does not have valid authentication
	// credentials for the operation. HTTP Mapping: 401 Unauthorized
	//   "RESOURCE_EXHAUSTED" - Some resource has been exhausted, perhaps a
	// per-user quota, or perhaps the entire file system is out of space.
	// HTTP Mapping: 429 Too Many Requests
	//   "FAILED_PRECONDITION" - The operation was rejected because the
	// system is not in a state required for the operation's execution. For
	// example, the directory to be deleted is non-empty, an rmdir operation
	// is applied to a non-directory, etc. Service implementors can use the
	// following guidelines to decide between `FAILED_PRECONDITION`,
	// `ABORTED`, and `UNAVAILABLE`: (a) Use `UNAVAILABLE` if the client can
	// retry just the failing call. (b) Use `ABORTED` if the client should
	// retry at a higher level. For example, when a client-specified
	// test-and-set fails, indicating the client should restart a
	// read-modify-write sequence. (c) Use `FAILED_PRECONDITION` if the
	// client should not retry until the system state has been explicitly
	// fixed. For example, if an "rmdir" fails because the directory is
	// non-empty, `FAILED_PRECONDITION` should be returned since the client
	// should not retry unless the files are deleted from the directory.
	// HTTP Mapping: 400 Bad Request
	//   "ABORTED" - The operation was aborted, typically due to a
	// concurrency issue such as a sequencer check failure or transaction
	// abort. See the guidelines above for deciding between
	// `FAILED_PRECONDITION`, `ABORTED`, and `UNAVAILABLE`. HTTP Mapping:
	// 409 Conflict
	//   "OUT_OF_RANGE" - The operation was attempted past the valid range.
	// E.g., seeking or reading past end-of-file. Unlike `INVALID_ARGUMENT`,
	// this error indicates a problem that may be fixed if the system state
	// changes. For example, a 32-bit file system will generate
	// `INVALID_ARGUMENT` if asked to read at an offset that is not in the
	// range [0,2^32-1], but it will generate `OUT_OF_RANGE` if asked to
	// read from an offset past the current file size. There is a fair bit
	// of overlap between `FAILED_PRECONDITION` and `OUT_OF_RANGE`. We
	// recommend using `OUT_OF_RANGE` (the more specific error) when it
	// applies so that callers who are iterating through a space can easily
	// look for an `OUT_OF_RANGE` error to detect when they are done. HTTP
	// Mapping: 400 Bad Request
	//   "UNIMPLEMENTED" - The operation is not implemented or is not
	// supported/enabled in this service. HTTP Mapping: 501 Not Implemented
	//   "INTERNAL" - Internal errors. This means that some invariants
	// expected by the underlying system have been broken. This error code
	// is reserved for serious errors. HTTP Mapping: 500 Internal Server
	// Error
	//   "UNAVAILABLE" - The service is currently unavailable. This is most
	// likely a transient condition, which can be corrected by retrying with
	// a backoff. Note that it is not always safe to retry non-idempotent
	// operations. See the guidelines above for deciding between
	// `FAILED_PRECONDITION`, `ABORTED`, and `UNAVAILABLE`. HTTP Mapping:
	// 503 Service Unavailable
	//   "DATA_LOSS" - Unrecoverable data loss or corruption. HTTP Mapping:
	// 500 Internal Server Error
	StatusCode string `json:"statusCode,omitempty"`

	// UserFacingMessage: The message to send users about the status of
	// their request. If unset, a generic message based on the `status_code`
	// is sent.
	UserFacingMessage string `json:"userFacingMessage,omitempty"`

	// ForceSendFields is a list of field names (e.g. "StatusCode") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "StatusCode") to include in
	// API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

ActionStatus: Represents the status for a request to either invoke or submit a dialog (https://developers.google.com/chat/how-tos/dialogs).

func (*ActionStatus) MarshalJSON added in v0.51.0

func (s *ActionStatus) MarshalJSON() ([]byte, error)

type Annotation

type Annotation struct {
	// Length: Length of the substring in the plain-text message body this
	// annotation corresponds to.
	Length int64 `json:"length,omitempty"`

	// SlashCommand: The metadata for a slash command.
	SlashCommand *SlashCommandMetadata `json:"slashCommand,omitempty"`

	// StartIndex: Start index (0-based, inclusive) in the plain-text
	// message body this annotation corresponds to.
	StartIndex int64 `json:"startIndex,omitempty"`

	// Type: The type of this annotation.
	//
	// Possible values:
	//   "ANNOTATION_TYPE_UNSPECIFIED" - Default value for the enum. DO NOT
	// USE.
	//   "USER_MENTION" - A user is mentioned.
	//   "SLASH_COMMAND" - A slash command is invoked.
	Type string `json:"type,omitempty"`

	// UserMention: The metadata of user mention.
	UserMention *UserMentionMetadata `json:"userMention,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Length") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Length") to include in API
	// requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

Annotation: Annotations associated with the plain-text body of the message. Example plain-text message body: ``` Hello @FooBot how are you!" ``` The corresponding annotations metadata: ``` "annotations":[{ "type":"USER_MENTION", "startIndex":6, "length":7, "userMention": { "user": { "name":"users/107946847022116401880", "displayName":"FooBot", "avatarUrl":"https://goo.gl/aeDtrS", "type":"BOT" }, "type":"MENTION" } }] ```

func (*Annotation) MarshalJSON

func (s *Annotation) MarshalJSON() ([]byte, error)

type Attachment added in v0.30.0

type Attachment struct {
	// AttachmentDataRef: A reference to the attachment data. This is used
	// with the media API to download the attachment data.
	AttachmentDataRef *AttachmentDataRef `json:"attachmentDataRef,omitempty"`

	// ContentName: The original file name for the content, not the full
	// path.
	ContentName string `json:"contentName,omitempty"`

	// ContentType: The content type (MIME type) of the file.
	ContentType string `json:"contentType,omitempty"`

	// DownloadUri: Output only. The download URL which should be used to
	// allow a human user to download the attachment. Chat apps should not
	// use this URL to download attachment content.
	DownloadUri string `json:"downloadUri,omitempty"`

	// DriveDataRef: A reference to the drive attachment. This is used with
	// the Drive API.
	DriveDataRef *DriveDataRef `json:"driveDataRef,omitempty"`

	// Name: Resource name of the attachment, in the form
	// "spaces/*/messages/*/attachments/*".
	Name string `json:"name,omitempty"`

	// Source: The source of the attachment.
	//
	// Possible values:
	//   "SOURCE_UNSPECIFIED"
	//   "DRIVE_FILE"
	//   "UPLOADED_CONTENT"
	Source string `json:"source,omitempty"`

	// ThumbnailUri: Output only. The thumbnail URL which should be used to
	// preview the attachment to a human user. Chat apps should not use this
	// URL to download attachment content.
	ThumbnailUri string `json:"thumbnailUri,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`

	// ForceSendFields is a list of field names (e.g. "AttachmentDataRef")
	// to unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "AttachmentDataRef") to
	// include in API requests with the JSON null value. By default, fields
	// with empty values are omitted from API requests. However, any field
	// with an empty value appearing in NullFields will be sent to the
	// server as null. It is an error if a field in this list has a
	// non-empty value. This may be used to include null fields in Patch
	// requests.
	NullFields []string `json:"-"`
}

Attachment: An attachment in Google Chat.

func (*Attachment) MarshalJSON added in v0.30.0

func (s *Attachment) MarshalJSON() ([]byte, error)

type AttachmentDataRef added in v0.30.0

type AttachmentDataRef struct {
	// ResourceName: The resource name of the attachment data. This is used
	// with the media API to download the attachment data.
	ResourceName string `json:"resourceName,omitempty"`

	// ForceSendFields is a list of field names (e.g. "ResourceName") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "ResourceName") to include
	// in API requests with the JSON null value. By default, fields with
	// empty values are omitted from API requests. However, any field with
	// an empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

AttachmentDataRef: A reference to the data of an attachment.

func (*AttachmentDataRef) MarshalJSON added in v0.30.0

func (s *AttachmentDataRef) MarshalJSON() ([]byte, error)

type Button

type Button struct {
	// ImageButton: A button with image and onclick action.
	ImageButton *ImageButton `json:"imageButton,omitempty"`

	// TextButton: A button with text and onclick action.
	TextButton *TextButton `json:"textButton,omitempty"`

	// ForceSendFields is a list of field names (e.g. "ImageButton") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "ImageButton") to include
	// in API requests with the JSON null value. By default, fields with
	// empty values are omitted from API requests. However, any field with
	// an empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

Button: A button. Can be a text button or an image button.

func (*Button) MarshalJSON

func (s *Button) MarshalJSON() ([]byte, error)

type Card

type Card struct {
	// CardActions: The actions of this card.
	CardActions []*CardAction `json:"cardActions,omitempty"`

	// Header: The header of the card. A header usually contains a title and
	// an image.
	Header *CardHeader `json:"header,omitempty"`

	// Name: Name of the card.
	Name string `json:"name,omitempty"`

	// Sections: Sections are separated by a line divider.
	Sections []*Section `json:"sections,omitempty"`

	// ForceSendFields is a list of field names (e.g. "CardActions") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "CardActions") to include
	// in API requests with the JSON null value. By default, fields with
	// empty values are omitted from API requests. However, any field with
	// an empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

Card: A card is a UI element that can contain UI widgets such as texts, images.

func (*Card) MarshalJSON

func (s *Card) MarshalJSON() ([]byte, error)

type CardAction

type CardAction struct {
	// ActionLabel: The label used to be displayed in the action menu item.
	ActionLabel string `json:"actionLabel,omitempty"`

	// OnClick: The onclick action for this action item.
	OnClick *OnClick `json:"onClick,omitempty"`

	// ForceSendFields is a list of field names (e.g. "ActionLabel") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "ActionLabel") to include
	// in API requests with the JSON null value. By default, fields with
	// empty values are omitted from API requests. However, any field with
	// an empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

CardAction: A card action is the action associated with the card. For an invoice card, a typical action would be: delete invoice, email invoice or open the invoice in browser.

func (*CardAction) MarshalJSON

func (s *CardAction) MarshalJSON() ([]byte, error)

type CardHeader

type CardHeader struct {
	// ImageStyle: The image's type (e.g. square border or circular border).
	//
	// Possible values:
	//   "IMAGE_STYLE_UNSPECIFIED"
	//   "IMAGE" - Square border.
	//   "AVATAR" - Circular border.
	ImageStyle string `json:"imageStyle,omitempty"`

	// ImageUrl: The URL of the image in the card header.
	ImageUrl string `json:"imageUrl,omitempty"`

	// Subtitle: The subtitle of the card header.
	Subtitle string `json:"subtitle,omitempty"`

	// Title: The title must be specified. The header has a fixed height: if
	// both a title and subtitle is specified, each will take up 1 line. If
	// only the title is specified, it will take up both lines.
	Title string `json:"title,omitempty"`

	// ForceSendFields is a list of field names (e.g. "ImageStyle") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "ImageStyle") to include in
	// API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

func (*CardHeader) MarshalJSON

func (s *CardHeader) MarshalJSON() ([]byte, error)

type CardWithId added in v0.49.0

type CardWithId struct {
	// Card: Card proto that allows Chat apps to specify UI elements and
	// editable widgets.
	Card *GoogleAppsCardV1Card `json:"card,omitempty"`

	// CardId: Required for `cardsV2` messages. Chat app-specified
	// identifier for this widget. Scoped within a message.
	CardId string `json:"cardId,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Card") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Card") to include in API
	// requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

CardWithId: Widgets for Chat apps to specify.

func (*CardWithId) MarshalJSON added in v0.49.0

func (s *CardWithId) MarshalJSON() ([]byte, error)

type ChatAppLogEntry added in v0.76.0

type ChatAppLogEntry struct {
	// Deployment: The deployment that caused the error. For Chat apps built
	// in Apps Script, this is the deployment ID defined by Apps Script.
	Deployment string `json:"deployment,omitempty"`

	// DeploymentFunction: The unencrypted `callback_method` name that was
	// running when the error was encountered.
	DeploymentFunction string `json:"deploymentFunction,omitempty"`

	// Error: The error code and message.
	Error *Status `json:"error,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Deployment") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Deployment") to include in
	// API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

ChatAppLogEntry: JSON payload of error messages. If the Cloud Logging API is enabled, these error messages are logged to Google Cloud Logging (https://cloud.google.com/logging/docs).

func (*ChatAppLogEntry) MarshalJSON added in v0.76.0

func (s *ChatAppLogEntry) MarshalJSON() ([]byte, error)

type Color added in v0.49.0

type Color struct {
	// Alpha: The fraction of this color that should be applied to the
	// pixel. That is, the final pixel color is defined by the equation:
	// `pixel color = alpha * (this color) + (1.0 - alpha) * (background
	// color)` This means that a value of 1.0 corresponds to a solid color,
	// whereas a value of 0.0 corresponds to a completely transparent color.
	// This uses a wrapper message rather than a simple float scalar so that
	// it is possible to distinguish between a default value and the value
	// being unset. If omitted, this color object is rendered as a solid
	// color (as if the alpha value had been explicitly given a value of
	// 1.0).
	Alpha float64 `json:"alpha,omitempty"`

	// Blue: The amount of blue in the color as a value in the interval [0,
	// 1].
	Blue float64 `json:"blue,omitempty"`

	// Green: The amount of green in the color as a value in the interval
	// [0, 1].
	Green float64 `json:"green,omitempty"`

	// Red: The amount of red in the color as a value in the interval [0,
	// 1].
	Red float64 `json:"red,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Alpha") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Alpha") to include in API
	// requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

Color: Represents a color in the RGBA color space. This representation is designed for simplicity of conversion to/from color representations in various languages over compactness. For example, the fields of this representation can be trivially provided to the constructor of `java.awt.Color` in Java; it can also be trivially provided to UIColor's `+colorWithRed:green:blue:alpha` method in iOS; and, with just a little work, it can be easily formatted into a CSS `rgba()` string in JavaScript. This reference page doesn't carry information about the absolute color space that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB, DCI-P3, BT.2020, etc.). By default, applications should assume the sRGB color space. When color equality needs to be decided, implementations, unless documented otherwise, treat two colors as equal if all their red, green, blue, and alpha values each differ by at most 1e-5. Example (Java): import com.google.type.Color; // ... public static java.awt.Color fromProto(Color protocolor) { float alpha = protocolor.hasAlpha() ? protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); } public static Color toProto(java.awt.Color color) { float red = (float) color.getRed(); float green = (float) color.getGreen(); float blue = (float) color.getBlue(); float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue / denominator); int alpha = color.getAlpha(); if (alpha != 255) { result.setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .build()); } return resultBuilder.build(); } // ... Example (iOS / Obj-C): // ... static UIColor* fromProto(Color* protocolor) { float red = [protocolor red]; float green = [protocolor green]; float blue = [protocolor blue]; FloatValue* alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper != nil) { alpha = [alpha_wrapper value]; } return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; } static Color* toProto(UIColor* color) { CGFloat red, green, blue, alpha; if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) { return nil; } Color* result = [[Color alloc] init]; [result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha <= 0.9999) { [result setAlpha:floatWrapperWithValue(alpha)]; } [result autorelease]; return result; } // ... Example (JavaScript): // ... var protoToCssColor = function(rgb_color) { var redFrac = rgb_color.red || 0.0; var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0; var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255); var blue = Math.floor(blueFrac * 255); if (!('alpha' in rgb_color)) { return rgbToCssColor(red, green, blue); } var alphaFrac = rgb_color.alpha.value || 0.0; var rgbParams = [red, green, blue].join(','); return ['rgba(', rgbParams, ',', alphaFrac, ')'].join(”); }; var rgbToCssColor = function(red, green, blue) { var rgbNumber = new Number((red << 16) | (green << 8) | blue); var hexString = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var resultBuilder = ['#']; for (var i = 0; i < missingZeros; i++) { resultBuilder.push('0'); } resultBuilder.push(hexString); return resultBuilder.join(”); }; // ...

func (*Color) MarshalJSON added in v0.49.0

func (s *Color) MarshalJSON() ([]byte, error)

func (*Color) UnmarshalJSON added in v0.49.0

func (s *Color) UnmarshalJSON(data []byte) error

type CommonEventObject added in v0.55.0

type CommonEventObject struct {
	// FormInputs: A map containing the current values of the widgets in a
	// card. The map keys are the string IDs assigned to each widget, and
	// the values represent inputs to the widget. Depending on the input
	// data type, a different object represents each input: For single-value
	// widgets, `StringInput`. For multi-value widgets, an array of
	// `StringInput` objects. For a date-time picker, a `DateTimeInput`. For
	// a date-only picker, a `DateInput`. For a time-only picker, a
	// `TimeInput`. Corresponds with the data entered by a user on a card in
	// a dialog (https://developers.google.com/chat/how-tos/dialogs).
	FormInputs map[string]Inputs `json:"formInputs,omitempty"`

	// HostApp: The hostApp enum which indicates the app the add-on is
	// invoked from. Always `CHAT` for Chat apps.
	//
	// Possible values:
	//   "UNSPECIFIED_HOST_APP" - Google can't identify a host app.
	//   "GMAIL" - The add-on launches from Gmail.
	//   "CALENDAR" - The add-on launches from Google Calendar.
	//   "DRIVE" - The add-on launches from Google Drive.
	//   "DEMO" - Not used.
	//   "DOCS" - The add-on launches from Google Docs.
	//   "SHEETS" - The add-on launches from Google Sheets.
	//   "SLIDES" - The add-on launches from Google Slides.
	//   "DRAWINGS" - The add-on launches from Google Drawings.
	//   "CHAT" - A Google Chat app. Not used for Google Workspace Add-ons.
	HostApp string `json:"hostApp,omitempty"`

	// InvokedFunction: Name of the invoked function associated with the
	// widget. Only set for Chat apps.
	InvokedFunction string `json:"invokedFunction,omitempty"`

	// Parameters: Custom parameters
	// (/chat/api/reference/rest/v1/cards#ActionParameter) passed to the
	// invoked function. Both keys and values must be strings.
	Parameters map[string]string `json:"parameters,omitempty"`

	// Platform: The platform enum which indicates the platform where the
	// event originates (`WEB`, `IOS`, or `ANDROID`). Not supported by Chat
	// apps.
	//
	// Possible values:
	//   "UNKNOWN_PLATFORM"
	//   "WEB"
	//   "IOS"
	//   "ANDROID"
	Platform string `json:"platform,omitempty"`

	// TimeZone: The timezone ID and offset from Coordinated Universal Time
	// (UTC).
	TimeZone *TimeZone `json:"timeZone,omitempty"`

	// UserLocale: The full `locale.displayName` in the format of [ISO 639
	// language code]-[ISO 3166 country/region code] such as "en-US". Not
	// supported by Chat apps.
	UserLocale string `json:"userLocale,omitempty"`

	// ForceSendFields is a list of field names (e.g. "FormInputs") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "FormInputs") to include in
	// API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

CommonEventObject: Represents information about the user's client, such as locale, host app, and platform. For Chat apps, `CommonEventObject` includes data submitted by users interacting with cards, like data entered in dialogs (https://developers.google.com/chat/how-tos/dialogs).

func (*CommonEventObject) MarshalJSON added in v0.55.0

func (s *CommonEventObject) MarshalJSON() ([]byte, error)

type DateInput added in v0.55.0

type DateInput struct {
	// MsSinceEpoch: Time since epoch time, in milliseconds.
	MsSinceEpoch int64 `json:"msSinceEpoch,omitempty,string"`

	// ForceSendFields is a list of field names (e.g. "MsSinceEpoch") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "MsSinceEpoch") to include
	// in API requests with the JSON null value. By default, fields with
	// empty values are omitted from API requests. However, any field with
	// an empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

DateInput: Date input values. Not supported by Chat apps.

func (*DateInput) MarshalJSON added in v0.55.0

func (s *DateInput) MarshalJSON() ([]byte, error)

type DateTimeInput added in v0.55.0

type DateTimeInput struct {
	// HasDate: Whether the `datetime` input includes a calendar date.
	HasDate bool `json:"hasDate,omitempty"`

	// HasTime: Whether the `datetime` input includes a timestamp.
	HasTime bool `json:"hasTime,omitempty"`

	// MsSinceEpoch: Time since epoch time, in milliseconds.
	MsSinceEpoch int64 `json:"msSinceEpoch,omitempty,string"`

	// ForceSendFields is a list of field names (e.g. "HasDate") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "HasDate") to include in
	// API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

DateTimeInput: Date and time input values. Not supported by Chat apps.

func (*DateTimeInput) MarshalJSON added in v0.55.0

func (s *DateTimeInput) MarshalJSON() ([]byte, error)

type DeprecatedEvent

type DeprecatedEvent struct {
	// Action: The form action data associated with an interactive card that
	// was clicked. Only populated for CARD_CLICKED events. See the
	// Interactive Cards guide (/chat/how-tos/cards-onclick) for more
	// information.
	Action *FormAction `json:"action,omitempty"`

	// Common: Represents information about the user's client, such as
	// locale, host app, and platform. For Chat apps, `CommonEventObject`
	// includes information submitted by users interacting with dialogs
	// (https://developers.google.com/chat/how-tos/dialogs), like data
	// entered on a card.
	Common *CommonEventObject `json:"common,omitempty"`

	// ConfigCompleteRedirectUrl: The URL the Chat app should redirect the
	// user to after they have completed an authorization or configuration
	// flow outside of Google Chat. See the Authorizing access to 3p
	// services guide (/chat/how-tos/auth-3p) for more information.
	ConfigCompleteRedirectUrl string `json:"configCompleteRedirectUrl,omitempty"`

	// DialogEventType: The type of dialog
	// (https://developers.google.com/chat/how-tos/dialogs) event received.
	//
	// Possible values:
	//   "TYPE_UNSPECIFIED" - This could be used when the corresponding
	// event is not dialog related. For example an @mention.
	//   "REQUEST_DIALOG" - Any user action that opens a
	// [dialog](https://developers.google.com/chat/how-tos/dialogs).
	//   "SUBMIT_DIALOG" - A card click event from a
	// [dialog](https://developers.google.com/chat/how-tos/dialogs).
	//   "CANCEL_DIALOG" - The
	// [dialog](https://developers.google.com/chat/how-tos/dialogs) was
	// cancelled.
	DialogEventType string `json:"dialogEventType,omitempty"`

	// EventTime: The timestamp indicating when the event occurred.
	EventTime string `json:"eventTime,omitempty"`

	// IsDialogEvent: True when the event is related to dialogs
	// (https://developers.google.com/chat/how-tos/dialogs).
	IsDialogEvent bool `json:"isDialogEvent,omitempty"`

	// Message: The message that triggered the event, if applicable.
	Message *Message `json:"message,omitempty"`

	// Space: The space in which the event occurred.
	Space *Space `json:"space,omitempty"`

	// ThreadKey: The Chat app-defined key for the thread related to the
	// event. See the thread_key field of the `spaces.message.create`
	// request for more information.
	ThreadKey string `json:"threadKey,omitempty"`

	// Token: A secret value that legacy Chat apps can use to verify if a
	// request is from Google. Google randomly generates the token, and its
	// value remains static. You can obtain, revoke, or regenerate the token
	// from the Chat API configuration page
	// (https://console.cloud.google.com/apis/api/chat.googleapis.com/hangouts-chat)
	// in the Google Cloud Console. Modern Chat apps don't use this field.
	// It is absent from API responses and the Chat API configuration page
	// (https://console.cloud.google.com/apis/api/chat.googleapis.com/hangouts-chat).
	Token string `json:"token,omitempty"`

	// Type: The type of the event.
	//
	// Possible values:
	//   "UNSPECIFIED" - Default value for the enum. DO NOT USE.
	//   "MESSAGE" - A message was sent in a space.
	//   "ADDED_TO_SPACE" - The Chat app was added to a space.
	//   "REMOVED_FROM_SPACE" - The Chat app was removed from a space.
	//   "CARD_CLICKED" - The Chat app's interactive card was clicked.
	Type string `json:"type,omitempty"`

	// User: The user that triggered the event.
	User *User `json:"user,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Action") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Action") to include in API
	// requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

DeprecatedEvent: Google Chat events.

func (*DeprecatedEvent) MarshalJSON

func (s *DeprecatedEvent) MarshalJSON() ([]byte, error)

type Dialog added in v0.51.0

type Dialog struct {
	// Body: Input only. Body of the dialog, which is rendered in a modal.
	// Google Chat apps do not support the following card entities:
	// `DateTimePicker`, `OnChangeAction`.
	Body *GoogleAppsCardV1Card `json:"body,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Body") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Body") to include in API
	// requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

Dialog: Wrapper around the card body of the dialog.

func (*Dialog) MarshalJSON added in v0.51.0

func (s *Dialog) MarshalJSON() ([]byte, error)

type DialogAction added in v0.51.0

type DialogAction struct {
	// ActionStatus: Input only. Status for a request to either invoke or
	// submit a dialog (https://developers.google.com/chat/how-tos/dialogs).
	// Displays a status and message to users, if necessary. For example, in
	// case of an error or success.
	ActionStatus *ActionStatus `json:"actionStatus,omitempty"`

	// Dialog: Input only. Dialog
	// (https://developers.google.com/chat/how-tos/dialogs) for the request.
	Dialog *Dialog `json:"dialog,omitempty"`

	// ForceSendFields is a list of field names (e.g. "ActionStatus") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "ActionStatus") to include
	// in API requests with the JSON null value. By default, fields with
	// empty values are omitted from API requests. However, any field with
	// an empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

DialogAction: Contains a dialog (https://developers.google.com/chat/how-tos/dialogs) and request status code.

func (*DialogAction) MarshalJSON added in v0.51.0

func (s *DialogAction) MarshalJSON() ([]byte, error)

type DmsConversationsMessagesCall added in v0.36.0

type DmsConversationsMessagesCall struct {
	// contains filtered or unexported fields
}

func (*DmsConversationsMessagesCall) Context added in v0.36.0

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*DmsConversationsMessagesCall) Do added in v0.36.0

Do executes the "chat.dms.conversations.messages" call. Exactly one of *Message or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Message.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*DmsConversationsMessagesCall) Fields added in v0.36.0

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*DmsConversationsMessagesCall) Header added in v0.36.0

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*DmsConversationsMessagesCall) RequestId added in v0.60.0

RequestId sets the optional parameter "requestId": A unique request ID for this message. Specifying an existing request ID returns the message created with that ID instead of creating a new message.

func (*DmsConversationsMessagesCall) ThreadKey added in v0.36.0

ThreadKey sets the optional parameter "threadKey": Opaque thread identifier. To start or add to a thread, create a message and specify a `threadKey` instead of thread.name. (Setting thread.name has no effect.) The first message with a given `threadKey` starts a new thread. Subsequent messages with the same `threadKey` post into the same thread.

type DmsConversationsService added in v0.36.0

type DmsConversationsService struct {
	// contains filtered or unexported fields
}

func NewDmsConversationsService added in v0.36.0

func NewDmsConversationsService(s *Service) *DmsConversationsService

func (*DmsConversationsService) Messages added in v0.36.0

func (r *DmsConversationsService) Messages(parent string, message *Message) *DmsConversationsMessagesCall

Messages: Legacy path for creating message. Calling these will result in a BadRequest response.

  • parent: Space resource name, in the form "spaces/*". Example: spaces/AAAAAAAAAAA.

type DmsMessagesCall added in v0.36.0

type DmsMessagesCall struct {
	// contains filtered or unexported fields
}

func (*DmsMessagesCall) Context added in v0.36.0

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*DmsMessagesCall) Do added in v0.36.0

func (c *DmsMessagesCall) Do(opts ...googleapi.CallOption) (*Message, error)

Do executes the "chat.dms.messages" call. Exactly one of *Message or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Message.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*DmsMessagesCall) Fields added in v0.36.0

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*DmsMessagesCall) Header added in v0.36.0

func (c *DmsMessagesCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*DmsMessagesCall) RequestId added in v0.60.0

func (c *DmsMessagesCall) RequestId(requestId string) *DmsMessagesCall

RequestId sets the optional parameter "requestId": A unique request ID for this message. Specifying an existing request ID returns the message created with that ID instead of creating a new message.

func (*DmsMessagesCall) ThreadKey added in v0.36.0

func (c *DmsMessagesCall) ThreadKey(threadKey string) *DmsMessagesCall

ThreadKey sets the optional parameter "threadKey": Opaque thread identifier. To start or add to a thread, create a message and specify a `threadKey` instead of thread.name. (Setting thread.name has no effect.) The first message with a given `threadKey` starts a new thread. Subsequent messages with the same `threadKey` post into the same thread.

type DmsService added in v0.36.0

type DmsService struct {
	Conversations *DmsConversationsService
	// contains filtered or unexported fields
}

func NewDmsService added in v0.36.0

func NewDmsService(s *Service) *DmsService

func (*DmsService) Messages added in v0.36.0

func (r *DmsService) Messages(parent string, message *Message) *DmsMessagesCall

Messages: Legacy path for creating message. Calling these will result in a BadRequest response.

  • parent: Space resource name, in the form "spaces/*". Example: spaces/AAAAAAAAAAA.

func (*DmsService) Webhooks added in v0.37.0

func (r *DmsService) Webhooks(parent string, message *Message) *DmsWebhooksCall

Webhooks: Legacy path for creating message. Calling these will result in a BadRequest response.

  • parent: Space resource name, in the form "spaces/*". Example: spaces/AAAAAAAAAAA.

type DmsWebhooksCall added in v0.37.0

type DmsWebhooksCall struct {
	// contains filtered or unexported fields
}

func (*DmsWebhooksCall) Context added in v0.37.0

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*DmsWebhooksCall) Do added in v0.37.0

func (c *DmsWebhooksCall) Do(opts ...googleapi.CallOption) (*Message, error)

Do executes the "chat.dms.webhooks" call. Exactly one of *Message or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Message.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*DmsWebhooksCall) Fields added in v0.37.0

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*DmsWebhooksCall) Header added in v0.37.0

func (c *DmsWebhooksCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*DmsWebhooksCall) RequestId added in v0.60.0

func (c *DmsWebhooksCall) RequestId(requestId string) *DmsWebhooksCall

RequestId sets the optional parameter "requestId": A unique request ID for this message. Specifying an existing request ID returns the message created with that ID instead of creating a new message.

func (*DmsWebhooksCall) ThreadKey added in v0.37.0

func (c *DmsWebhooksCall) ThreadKey(threadKey string) *DmsWebhooksCall

ThreadKey sets the optional parameter "threadKey": Opaque thread identifier. To start or add to a thread, create a message and specify a `threadKey` instead of thread.name. (Setting thread.name has no effect.) The first message with a given `threadKey` starts a new thread. Subsequent messages with the same `threadKey` post into the same thread.

type DriveDataRef added in v0.30.0

type DriveDataRef struct {
	// DriveFileId: The id for the drive file, for use with the Drive API.
	DriveFileId string `json:"driveFileId,omitempty"`

	// ForceSendFields is a list of field names (e.g. "DriveFileId") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "DriveFileId") to include
	// in API requests with the JSON null value. By default, fields with
	// empty values are omitted from API requests. However, any field with
	// an empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

DriveDataRef: A reference to the data of a drive attachment.

func (*DriveDataRef) MarshalJSON added in v0.30.0

func (s *DriveDataRef) MarshalJSON() ([]byte, error)

type Empty

type Empty struct {
	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`
}

Empty: A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }

type FormAction

type FormAction struct {
	// ActionMethodName: The method name is used to identify which part of
	// the form triggered the form submission. This information is echoed
	// back to the Chat app as part of the card click event. The same method
	// name can be used for several elements that trigger a common behavior
	// if desired.
	ActionMethodName string `json:"actionMethodName,omitempty"`

	// Parameters: List of action parameters.
	Parameters []*ActionParameter `json:"parameters,omitempty"`

	// ForceSendFields is a list of field names (e.g. "ActionMethodName") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "ActionMethodName") to
	// include in API requests with the JSON null value. By default, fields
	// with empty values are omitted from API requests. However, any field
	// with an empty value appearing in NullFields will be sent to the
	// server as null. It is an error if a field in this list has a
	// non-empty value. This may be used to include null fields in Patch
	// requests.
	NullFields []string `json:"-"`
}

FormAction: A form action describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form.

func (*FormAction) MarshalJSON

func (s *FormAction) MarshalJSON() ([]byte, error)

type GoogleAppsCardV1Action added in v0.49.0

type GoogleAppsCardV1Action struct {
	// Function: Apps Script function to invoke when the containing element
	// is clicked/activated.
	Function string `json:"function,omitempty"`

	// LoadIndicator: Specifies the loading indicator that the action
	// displays while making the call to the action.
	//
	// Possible values:
	//   "SPINNER" - Displays a spinner to indicate that content is loading.
	//   "NONE" - Nothing is displayed.
	LoadIndicator string `json:"loadIndicator,omitempty"`

	// Parameters: List of action parameters.
	Parameters []*GoogleAppsCardV1ActionParameter `json:"parameters,omitempty"`

	// PersistValues: Indicates whether form values persist after the
	// action. The default value is `false`. If `true`, form values remain
	// after the action is triggered. When using LoadIndicator.NONE
	// (workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator)
	// for actions, `persist_values` = `true`is recommended, as it ensures
	// that any changes made by the user after form or on change actions are
	// sent to the server are not overwritten by the response. If `false`,
	// the form values are cleared when the action is triggered. When
	// `persist_values` is set to `false`, it is strongly recommended that
	// the card use LoadIndicator.SPINNER
	// (workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator)
	// for all actions, as this locks the UI to ensure no changes are made
	// by the user while the action is being processed. Not supported by
	// Google Chat apps.
	PersistValues bool `json:"persistValues,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Function") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Function") to include in
	// API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

GoogleAppsCardV1Action: An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form.

func (*GoogleAppsCardV1Action) MarshalJSON added in v0.49.0

func (s *GoogleAppsCardV1Action) MarshalJSON() ([]byte, error)

type GoogleAppsCardV1ActionParameter added in v0.49.0

type GoogleAppsCardV1ActionParameter struct {
	// Key: The name of the parameter for the action script.
	Key string `json:"key,omitempty"`

	// Value: The value of the parameter.
	Value string `json:"value,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Key") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Key") to include in API
	// requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

GoogleAppsCardV1ActionParameter: List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters.

func (*GoogleAppsCardV1ActionParameter) MarshalJSON added in v0.49.0

func (s *GoogleAppsCardV1ActionParameter) MarshalJSON() ([]byte, error)

type GoogleAppsCardV1BorderStyle added in v0.49.0

type GoogleAppsCardV1BorderStyle struct {
	// CornerRadius: The corner radius for the border.
	CornerRadius int64 `json:"cornerRadius,omitempty"`

	// StrokeColor: The colors to use when the type is `BORDER_TYPE_STROKE`.
	StrokeColor *Color `json:"strokeColor,omitempty"`

	// Type: The border type.
	//
	// Possible values:
	//   "BORDER_TYPE_UNSPECIFIED" - No value specified.
	//   "NO_BORDER" - No border.
	//   "STROKE" - Outline.
	Type string `json:"type,omitempty"`

	// ForceSendFields is a list of field names (e.g. "CornerRadius") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "CornerRadius") to include
	// in API requests with the JSON null value. By default, fields with
	// empty values are omitted from API requests. However, any field with
	// an empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

GoogleAppsCardV1BorderStyle: Represents the complete border style applied to widgets.

func (*GoogleAppsCardV1BorderStyle) MarshalJSON added in v0.49.0

func (s *GoogleAppsCardV1BorderStyle) MarshalJSON() ([]byte, error)

type GoogleAppsCardV1Button added in v0.49.0

type GoogleAppsCardV1Button struct {
	// AltText: The alternative text used for accessibility. Has no effect
	// when an icon is set; use `icon.alt_text` instead.
	AltText string `json:"altText,omitempty"`

	// Color: If set, the button is filled with a solid background.
	Color *Color `json:"color,omitempty"`

	// Disabled: If `true`, the button is displayed in a disabled state and
	// doesn't respond to user actions.
	Disabled bool `json:"disabled,omitempty"`

	// Icon: The icon image.
	Icon *GoogleAppsCardV1Icon `json:"icon,omitempty"`

	// OnClick: The action to perform when the button is clicked.
	OnClick *GoogleAppsCardV1OnClick `json:"onClick,omitempty"`

	// Text: The text of the button.
	Text string `json:"text,omitempty"`

	// ForceSendFields is a list of field names (e.g. "AltText") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "AltText") to include in
	// API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

GoogleAppsCardV1Button: A button. Can be a text button or an image button.

func (*GoogleAppsCardV1Button) MarshalJSON added in v0.49.0

func (s *GoogleAppsCardV1Button) MarshalJSON() ([]byte, error)

type GoogleAppsCardV1ButtonList added in v0.49.0

type GoogleAppsCardV1ButtonList struct {
	// Buttons: An array of buttons.
	Buttons []*GoogleAppsCardV1Button `json:"buttons,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Buttons") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Buttons") to include in
	// API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

GoogleAppsCardV1ButtonList: A list of buttons layed out horizontally.

func (*GoogleAppsCardV1ButtonList) MarshalJSON added in v0.49.0

func (s *GoogleAppsCardV1ButtonList) MarshalJSON() ([]byte, error)

type GoogleAppsCardV1Card added in v0.49.0

type GoogleAppsCardV1Card struct {
	// CardActions: The card's actions. Actions are added to the card's
	// generated toolbar menu. For example, the following JSON constructs a
	// card action menu with Settings and Send Feedback options: “`
	// "card_actions": [ { "actionLabel": "Settings", "onClick": { "action":
	// { "functionName": "goToView", "parameters": [ { "key": "viewType",
	// "value": "SETTING" } ], "loadIndicator": "LoadIndicator.SPINNER" } }
	// }, { "actionLabel": "Send Feedback", "onClick": { "openLink": {
	// "url": "https://example.com/feedback" } } } ] “`
	CardActions []*GoogleAppsCardV1CardAction `json:"cardActions,omitempty"`

	// DisplayStyle: The `peekCardHeader` display style for. Not supported
	// by Google Chat apps.
	//
	// Possible values:
	//   "DISPLAY_STYLE_UNSPECIFIED" - Do not use.
	//   "PEEK" - The header of the card appears at the bottom of the
	// sidebar, partially covering the current top card of the stack.
	// Clicking the header pops the card into the card stack. If the card
	// has no header, a generated header is used instead.
	//   "REPLACE" - Default value. The card is shown by replacing the view
	// of the top card in the card stack.
	DisplayStyle string `json:"displayStyle,omitempty"`

	// FixedFooter: The fixed footer shown at the bottom of this card.
	FixedFooter *GoogleAppsCardV1CardFixedFooter `json:"fixedFooter,omitempty"`

	// Header: The header of the card. A header usually contains a title and
	// an image.
	Header *GoogleAppsCardV1CardHeader `json:"header,omitempty"`

	// Name: Name of the card. Used as a card identifier in card navigation.
	Name string `json:"name,omitempty"`

	// PeekCardHeader: When displaying contextual content, the peek card
	// header acts as a placeholder so that the user can navigate forward
	// between the homepage cards and the contextual cards. Not supported by
	// Google Chat apps.
	PeekCardHeader *GoogleAppsCardV1CardHeader `json:"peekCardHeader,omitempty"`

	// Sections: Sections are separated by a line divider.
	Sections []*GoogleAppsCardV1Section `json:"sections,omitempty"`

	// ForceSendFields is a list of field names (e.g. "CardActions") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "CardActions") to include
	// in API requests with the JSON null value. By default, fields with
	// empty values are omitted from API requests. However, any field with
	// an empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

GoogleAppsCardV1Card: A card is a UI element that can contain UI widgets such as text and images. For more information, see Cards . For example, the following JSON creates a card that has a header with the name, position, icons, and link for a contact, followed by a section with contact information like email and phone number. ``` { "header": { "title": "Sasha", "subtitle": "Software Engineer", "imageStyle": "ImageStyle.AVATAR", "imageUrl": "https://example.com/sasha.png", "imageAltText": "Avatar for Sasha" }, "sections" : [ { "header": "Contact Info", "widgets": [ { "decorated_text": { "icon": { "knownIcon": "EMAIL" }, "content": "sasha@example.com" } }, { "decoratedText": { "icon": { "knownIcon": "PERSON" }, "content": "Online" } }, { "decoratedText": { "icon": { "knownIcon": "PHONE" }, "content": "+1 (555) 555-1234" } }, { "buttons": [ { "textButton": { "text": "Share", }, "onClick": { "openLink": { "url": "https://example.com/share" } } }, { "textButton": { "text": "Edit", }, "onClick": { "action": { "function": "goToView", "parameters": [ { "key": "viewType", "value": "EDIT" } ], "loadIndicator": "LoadIndicator.SPINNER" } } } ] } ], "collapsible": true, "uncollapsibleWidgetsCount": 3 } ], "cardActions": [ { "actionLabel": "Send Feedback", "onClick": { "openLink": { "url": "https://example.com/feedback" } } } ], "name": "contact-card-K3wB6arF2H9L" } ```

func (*GoogleAppsCardV1Card) MarshalJSON added in v0.49.0

func (s *GoogleAppsCardV1Card) MarshalJSON() ([]byte, error)

type GoogleAppsCardV1CardAction added in v0.49.0

type GoogleAppsCardV1CardAction struct {
	// ActionLabel: The label that displays as the action menu item.
	ActionLabel string `json:"actionLabel,omitempty"`

	// OnClick: The `onClick` action for this action item.
	OnClick *GoogleAppsCardV1OnClick `json:"onClick,omitempty"`

	// ForceSendFields is a list of field names (e.g. "ActionLabel") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "ActionLabel") to include
	// in API requests with the JSON null value. By default, fields with
	// empty values are omitted from API requests. However, any field with
	// an empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

GoogleAppsCardV1CardAction: A card action is the action associated with the card. For example, an invoice card might include actions such as delete invoice, email invoice, or open the invoice in a browser.

func (*GoogleAppsCardV1CardAction) MarshalJSON added in v0.49.0

func (s *GoogleAppsCardV1CardAction) MarshalJSON() ([]byte, error)

type GoogleAppsCardV1CardFixedFooter added in v0.49.0

type GoogleAppsCardV1CardFixedFooter struct {
	// PrimaryButton: The primary button of the fixed footer. The button
	// must be a text button with text and color set.
	PrimaryButton *GoogleAppsCardV1Button `json:"primaryButton,omitempty"`

	// SecondaryButton: The secondary button of the fixed footer. The button
	// must be a text button with text and color set. `primaryButton` must
	// be set if `secondaryButton` is set.
	SecondaryButton *GoogleAppsCardV1Button `json:"secondaryButton,omitempty"`

	// ForceSendFields is a list of field names (e.g. "PrimaryButton") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "PrimaryButton") to include
	// in API requests with the JSON null value. By default, fields with
	// empty values are omitted from API requests. However, any field with
	// an empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

GoogleAppsCardV1CardFixedFooter: A persistent (sticky) footer that is added to the bottom of the card.

func (*GoogleAppsCardV1CardFixedFooter) MarshalJSON added in v0.49.0

func (s *GoogleAppsCardV1CardFixedFooter) MarshalJSON() ([]byte, error)

type GoogleAppsCardV1CardHeader added in v0.49.0

type GoogleAppsCardV1CardHeader struct {
	// ImageAltText: The alternative text of this image which is used for
	// accessibility.
	ImageAltText string `json:"imageAltText,omitempty"`

	// ImageType: The image's type.
	//
	// Possible values:
	//   "SQUARE" - Applies no cropping to the image.
	//   "CIRCLE" - Applies a circular mask to the image.
	ImageType string `json:"imageType,omitempty"`

	// ImageUrl: The URL of the image in the card header.
	ImageUrl string `json:"imageUrl,omitempty"`

	// Subtitle: The subtitle of the card header.
	Subtitle string `json:"subtitle,omitempty"`

	// Title: Required. The title of the card header. The header has a fixed
	// height: if both a title and subtitle are specified, each takes up one
	// line. If only the title is specified, it takes up both lines.
	Title string `json:"title,omitempty"`

	// ForceSendFields is a list of field names (e.g. "ImageAltText") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "ImageAltText") to include
	// in API requests with the JSON null value. By default, fields with
	// empty values are omitted from API requests. However, any field with
	// an empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

GoogleAppsCardV1CardHeader: Represents a card header.

func (*GoogleAppsCardV1CardHeader) MarshalJSON added in v0.49.0

func (s *GoogleAppsCardV1CardHeader) MarshalJSON() ([]byte, error)

type GoogleAppsCardV1DateTimePicker added in v0.49.0

type GoogleAppsCardV1DateTimePicker struct {
	// Label: The label for the field that displays to the user.
	Label string `json:"label,omitempty"`

	// Name: The name of the text input that's used in `formInput`, and
	// uniquely identifies this input.
	Name string `json:"name,omitempty"`

	// OnChangeAction: Triggered when the user clicks Save or Clear from the
	// date/time picker dialog. This is only triggered if the value changed
	// as a result of the Save/Clear operation.
	OnChangeAction *GoogleAppsCardV1Action `json:"onChangeAction,omitempty"`

	// TimezoneOffsetDate: The number representing the time zone offset from
	// UTC, in minutes. If set, the `value_ms_epoch` is displayed in the
	// specified time zone. If not set, it uses the user's time zone setting
	// on the client side.
	TimezoneOffsetDate int64 `json:"timezoneOffsetDate,omitempty"`

	// Type: The type of the date/time picker.
	//
	// Possible values:
	//   "DATE_AND_TIME" - The user can select a date and time.
	//   "DATE_ONLY" - The user can only select a date.
	//   "TIME_ONLY" - The user can only select a time.
	Type string `json:"type,omitempty"`

	// ValueMsEpoch: The value to display as the default value before user
	// input or previous user input. It is represented in milliseconds
	// (Epoch time). For `DATE_AND_TIME` type, the full epoch value is used.
	// For `DATE_ONLY` type, only date of the epoch time is used. For
	// `TIME_ONLY` type, only time of the epoch time is used. For example,
	// you can set epoch time to `3 * 60 * 60 * 1000` to represent 3am.
	ValueMsEpoch int64 `json:"valueMsEpoch,omitempty,string"`

	// ForceSendFields is a list of field names (e.g. "Label") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Label") to include in API
	// requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

GoogleAppsCardV1DateTimePicker: The widget that lets users to specify a date and time. Not supported by Google Chat apps.

func (*GoogleAppsCardV1DateTimePicker) MarshalJSON added in v0.49.0

func (s *GoogleAppsCardV1DateTimePicker) MarshalJSON() ([]byte, error)

type GoogleAppsCardV1DecoratedText added in v0.49.0

type GoogleAppsCardV1DecoratedText struct {
	// BottomLabel: The formatted text label that shows below the main text.
	BottomLabel string `json:"bottomLabel,omitempty"`

	// Button: A button that can be clicked to trigger an action.
	Button *GoogleAppsCardV1Button `json:"button,omitempty"`

	// EndIcon: An icon displayed after the text.
	EndIcon *GoogleAppsCardV1Icon `json:"endIcon,omitempty"`

	// Icon: Deprecated in favor of start_icon.
	Icon *GoogleAppsCardV1Icon `json:"icon,omitempty"`

	// OnClick: Only the top and bottom label and content region are
	// clickable.
	OnClick *GoogleAppsCardV1OnClick `json:"onClick,omitempty"`

	// StartIcon: The icon displayed in front of the text.
	StartIcon *GoogleAppsCardV1Icon `json:"startIcon,omitempty"`

	// SwitchControl: A switch widget can be clicked to change its state or
	// trigger an action.
	SwitchControl *GoogleAppsCardV1SwitchControl `json:"switchControl,omitempty"`

	// Text: Required. The main widget formatted text. See Text formatting
	// for details.
	Text string `json:"text,omitempty"`

	// TopLabel: The formatted text label that shows above the main text.
	TopLabel string `json:"topLabel,omitempty"`

	// WrapText: The wrap text setting. If `true`, the text is wrapped and
	// displayed in multiline. Otherwise, the text is truncated.
	WrapText bool `json:"wrapText,omitempty"`

	// ForceSendFields is a list of field names (e.g. "BottomLabel") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "BottomLabel") to include
	// in API requests with the JSON null value. By default, fields with
	// empty values are omitted from API requests. However, any field with
	// an empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

GoogleAppsCardV1DecoratedText: A widget that displays text with optional decorations such as a label above or below the text, an icon in front of the text, a selection widget or a button after the text.

func (*GoogleAppsCardV1DecoratedText) MarshalJSON added in v0.49.0

func (s *GoogleAppsCardV1DecoratedText) MarshalJSON() ([]byte, error)

type GoogleAppsCardV1Divider added in v0.49.0

type GoogleAppsCardV1Divider struct {
}

GoogleAppsCardV1Divider: A divider that appears in between widgets.

type GoogleAppsCardV1Grid added in v0.49.0

type GoogleAppsCardV1Grid struct {
	// BorderStyle: The border style to apply to each grid item.
	BorderStyle *GoogleAppsCardV1BorderStyle `json:"borderStyle,omitempty"`

	// ColumnCount: 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).
	ColumnCount int64 `json:"columnCount,omitempty"`

	// Items: The items to display in the grid.
	Items []*GoogleAppsCardV1GridItem `json:"items,omitempty"`

	// 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.
	OnClick *GoogleAppsCardV1OnClick `json:"onClick,omitempty"`

	// Title: The text that displays in the grid header.
	Title string `json:"title,omitempty"`

	// ForceSendFields is a list of field names (e.g. "BorderStyle") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "BorderStyle") to include
	// in API requests with the JSON null value. By default, fields with
	// empty values are omitted from API requests. However, any field with
	// an empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

GoogleAppsCardV1Grid: Represents a Grid widget that displays items in a configurable grid layout.

func (*GoogleAppsCardV1Grid) MarshalJSON added in v0.49.0

func (s *GoogleAppsCardV1Grid) MarshalJSON() ([]byte, error)

type GoogleAppsCardV1GridItem added in v0.49.0

type GoogleAppsCardV1GridItem struct {
	// Id: A user-specified identifier for this grid item. This identifier
	// is returned in the parent Grid's onClick callback parameters.
	Id string `json:"id,omitempty"`

	// Image: The image that displays in the grid item.
	Image *GoogleAppsCardV1ImageComponent `json:"image,omitempty"`

	// Layout: The layout to use for the grid item.
	//
	// Possible values:
	//   "GRID_ITEM_LAYOUT_UNSPECIFIED" - No layout specified.
	//   "TEXT_BELOW" - The title and subtitle are shown below the grid
	// item's image.
	//   "TEXT_ABOVE" - The title and subtitle are shown above the grid
	// item's image.
	Layout string `json:"layout,omitempty"`

	// Subtitle: The grid item's subtitle.
	Subtitle string `json:"subtitle,omitempty"`

	// TextAlignment: The horizontal alignment of the grid item's text.
	//
	// Possible values:
	//   "HORIZONTAL_ALIGNMENT_UNSPECIFIED" - Unspecified alignment.
	//   "START" - Alignment to the start position.
	//   "CENTER" - Alignment to the center position.
	//   "END" - Alignment to the end position.
	TextAlignment string `json:"textAlignment,omitempty"`

	// Title: The grid item's title.
	Title string `json:"title,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Id") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Id") to include in API
	// requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

GoogleAppsCardV1GridItem: Represents a single item in the grid layout.

func (*GoogleAppsCardV1GridItem) MarshalJSON added in v0.49.0

func (s *GoogleAppsCardV1GridItem) MarshalJSON() ([]byte, error)

type GoogleAppsCardV1Icon added in v0.49.0

type GoogleAppsCardV1Icon struct {
	// AltText: The description of the icon, used for accessibility. The
	// default value is provided if you don't specify one.
	AltText string `json:"altText,omitempty"`

	// IconUrl: The icon specified by a URL.
	IconUrl string `json:"iconUrl,omitempty"`

	// ImageType: The crop style applied to the image. In some cases,
	// applying a `CIRCLE` crop causes the image to be drawn larger than a
	// standard icon.
	//
	// Possible values:
	//   "SQUARE" - Applies no cropping to the image.
	//   "CIRCLE" - Applies a circular mask to the image.
	ImageType string `json:"imageType,omitempty"`

	// KnownIcon: The icon specified by the string name of a list of known
	// icons.
	KnownIcon string `json:"knownIcon,omitempty"`

	// ForceSendFields is a list of field names (e.g. "AltText") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "AltText") to include in
	// API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

func (*GoogleAppsCardV1Icon) MarshalJSON added in v0.49.0

func (s *GoogleAppsCardV1Icon) MarshalJSON() ([]byte, error)

type GoogleAppsCardV1Image added in v0.49.0

type GoogleAppsCardV1Image struct {
	// AltText: The alternative text of this image, used for accessibility.
	AltText string `json:"altText,omitempty"`

	// ImageUrl: An image URL.
	ImageUrl string `json:"imageUrl,omitempty"`

	// OnClick: The action triggered by an `onClick` event.
	OnClick *GoogleAppsCardV1OnClick `json:"onClick,omitempty"`

	// ForceSendFields is a list of field names (e.g. "AltText") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "AltText") to include in
	// API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

GoogleAppsCardV1Image: An image that is specified by a URL and can have an `onClick` action.

func (*GoogleAppsCardV1Image) MarshalJSON added in v0.49.0

func (s *GoogleAppsCardV1Image) MarshalJSON() ([]byte, error)

type GoogleAppsCardV1ImageComponent added in v0.49.0

type GoogleAppsCardV1ImageComponent struct {
	// AltText: The accessibility label for the image.
	AltText string `json:"altText,omitempty"`

	// BorderStyle: The border style to apply to the image.
	BorderStyle *GoogleAppsCardV1BorderStyle `json:"borderStyle,omitempty"`

	// CropStyle: The crop style to apply to the image.
	CropStyle *GoogleAppsCardV1ImageCropStyle `json:"cropStyle,omitempty"`

	// ImageUri: The image URL.
	ImageUri string `json:"imageUri,omitempty"`

	// ForceSendFields is a list of field names (e.g. "AltText") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "AltText") to include in
	// API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

GoogleAppsCardV1ImageComponent: Represents an image.

func (*GoogleAppsCardV1ImageComponent) MarshalJSON added in v0.49.0

func (s *GoogleAppsCardV1ImageComponent) MarshalJSON() ([]byte, error)

type GoogleAppsCardV1ImageCropStyle added in v0.49.0

type GoogleAppsCardV1ImageCropStyle struct {
	// AspectRatio: The aspect ratio to use if the crop type is
	// `RECTANGLE_CUSTOM`.
	AspectRatio float64 `json:"aspectRatio,omitempty"`

	// Type: The crop type.
	//
	// Possible values:
	//   "IMAGE_CROP_TYPE_UNSPECIFIED" - No value specified.
	//   "SQUARE" - Applies a square crop.
	//   "CIRCLE" - Applies a circular crop.
	//   "RECTANGLE_CUSTOM" - Applies a rectangular crop with a custom
	// aspect ratio.
	//   "RECTANGLE_4_3" - Applies a rectangular crop with a 4:3 aspect
	// ratio.
	Type string `json:"type,omitempty"`

	// ForceSendFields is a list of field names (e.g. "AspectRatio") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "AspectRatio") to include
	// in API requests with the JSON null value. By default, fields with
	// empty values are omitted from API requests. However, any field with
	// an empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

GoogleAppsCardV1ImageCropStyle: Represents the crop style applied to an image.

func (*GoogleAppsCardV1ImageCropStyle) MarshalJSON added in v0.49.0

func (s *GoogleAppsCardV1ImageCropStyle) MarshalJSON() ([]byte, error)

func (*GoogleAppsCardV1ImageCropStyle) UnmarshalJSON added in v0.49.0

func (s *GoogleAppsCardV1ImageCropStyle) UnmarshalJSON(data []byte) error

type GoogleAppsCardV1OnClick added in v0.49.0

type GoogleAppsCardV1OnClick struct {
	// Action: If specified, an action is triggered by this `onClick`.
	Action *GoogleAppsCardV1Action `json:"action,omitempty"`

	// Card: A new card is pushed to the card stack after clicking if
	// specified.
	Card *GoogleAppsCardV1Card `json:"card,omitempty"`

	// OpenDynamicLinkAction: An add-on triggers this action when the action
	// needs to open a link. This differs from the `open_link` above in that
	// this needs to talk to server to get the link. Thus some preparation
	// work is required for web client to do before the open link action
	// response comes back.
	OpenDynamicLinkAction *GoogleAppsCardV1Action `json:"openDynamicLinkAction,omitempty"`

	// OpenLink: If specified, this `onClick` triggers an open link action.
	OpenLink *GoogleAppsCardV1OpenLink `json:"openLink,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Action") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Action") to include in API
	// requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

GoogleAppsCardV1OnClick: Represents the response to an `onClick` event.

func (*GoogleAppsCardV1OnClick) MarshalJSON added in v0.49.0

func (s *GoogleAppsCardV1OnClick) MarshalJSON() ([]byte, error)
type GoogleAppsCardV1OpenLink struct {
	// OnClose: Whether the client forgets about a link after opening it, or
	// observes it until the window closes. Not supported by Chat apps.
	//
	// Possible values:
	//   "NOTHING" - Default value. The card does not reload; nothing
	// happens.
	//   "RELOAD" - Reloads the card after the child window closes. If used
	// in conjunction with
	// [OpenAs.OVERLAY](https://developers.google.com/workspace/add-ons/refer
	// ence/rpc/google.apps.card.v1#openas), the child window acts as a
	// modal dialog and the parent card is blocked until the child window
	// closes.
	OnClose string `json:"onClose,omitempty"`

	// OpenAs: How to open a link. Not supported by Chat apps.
	//
	// Possible values:
	//   "FULL_SIZE" - The link opens as a full size window (if that's the
	// frame used by the client.
	//   "OVERLAY" - The link opens as an overlay, such as a pop-up.
	OpenAs string `json:"openAs,omitempty"`

	// Url: The URL to open.
	Url string `json:"url,omitempty"`

	// ForceSendFields is a list of field names (e.g. "OnClose") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "OnClose") to include in
	// API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

GoogleAppsCardV1OpenLink: Represents an `onClick` event that opens a hyperlink.

func (*GoogleAppsCardV1OpenLink) MarshalJSON added in v0.49.0

func (s *GoogleAppsCardV1OpenLink) MarshalJSON() ([]byte, error)

type GoogleAppsCardV1Section added in v0.49.0

type GoogleAppsCardV1Section struct {
	// Collapsible: Indicates whether this section is collapsible. If a
	// section is collapsible, the description must be given.
	Collapsible bool `json:"collapsible,omitempty"`

	// Header: The header of the section. Formatted text is supported.
	Header string `json:"header,omitempty"`

	// UncollapsibleWidgetsCount: The number of uncollapsible widgets. For
	// example, when a section contains five widgets and the
	// `uncollapsibleWidgetsCount` is set to `2`, the first two widgets are
	// always shown and the last three are collapsed as default. The
	// `uncollapsibleWidgetsCount` is taken into account only when
	// `collapsible` is `true`.
	UncollapsibleWidgetsCount int64 `json:"uncollapsibleWidgetsCount,omitempty"`

	// Widgets: A section must contain at least 1 widget.
	Widgets []*GoogleAppsCardV1Widget `json:"widgets,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Collapsible") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Collapsible") to include
	// in API requests with the JSON null value. By default, fields with
	// empty values are omitted from API requests. However, any field with
	// an empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

GoogleAppsCardV1Section: A section contains a collection of widgets that are rendered vertically in the order that they are specified. Across all platforms, cards have a narrow fixed width, so there is currently no need for layout properties, for example, float.

func (*GoogleAppsCardV1Section) MarshalJSON added in v0.49.0

func (s *GoogleAppsCardV1Section) MarshalJSON() ([]byte, error)

type GoogleAppsCardV1SelectionInput added in v0.49.0

type GoogleAppsCardV1SelectionInput struct {
	// Items: An array of the selected items.
	Items []*GoogleAppsCardV1SelectionItem `json:"items,omitempty"`

	// Label: The label displayed ahead of the switch control.
	Label string `json:"label,omitempty"`

	// Name: The name of the text input which is used in `formInput`.
	Name string `json:"name,omitempty"`

	// OnChangeAction: If specified, the form is submitted when the
	// selection changes. If not specified, you must specify a separate
	// button.
	OnChangeAction *GoogleAppsCardV1Action `json:"onChangeAction,omitempty"`

	// Type: The type of the selection.
	//
	// Possible values:
	//   "CHECK_BOX" - A checkbox.
	//   "RADIO_BUTTON" - A radio button.
	//   "SWITCH" - A switch.
	//   "DROPDOWN" - A dropdown menu.
	Type string `json:"type,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Items") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Items") to include in API
	// requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

GoogleAppsCardV1SelectionInput: A widget that creates a UI item with options for users to select. For example, a dropdown menu.

func (*GoogleAppsCardV1SelectionInput) MarshalJSON added in v0.49.0

func (s *GoogleAppsCardV1SelectionInput) MarshalJSON() ([]byte, error)

type GoogleAppsCardV1SelectionItem added in v0.49.0

type GoogleAppsCardV1SelectionItem struct {
	// Selected: If more than one item is selected for `RADIO_BUTTON` and
	// `DROPDOWN`, the first selected item is treated as selected and the
	// ones after are ignored.
	Selected bool `json:"selected,omitempty"`

	// Text: The text to be displayed.
	Text string `json:"text,omitempty"`

	// Value: The value associated with this item. The client should use
	// this as a form input value.
	Value string `json:"value,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Selected") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Selected") to include in
	// API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

GoogleAppsCardV1SelectionItem: A selectable item in the switch control.

func (*GoogleAppsCardV1SelectionItem) MarshalJSON added in v0.49.0

func (s *GoogleAppsCardV1SelectionItem) MarshalJSON() ([]byte, error)

type GoogleAppsCardV1SuggestionItem added in v0.49.0

type GoogleAppsCardV1SuggestionItem struct {
	// Text: The suggested autocomplete result.
	Text string `json:"text,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Text") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Text") to include in API
	// requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

GoogleAppsCardV1SuggestionItem: A suggestion item.

func (*GoogleAppsCardV1SuggestionItem) MarshalJSON added in v0.49.0

func (s *GoogleAppsCardV1SuggestionItem) MarshalJSON() ([]byte, error)

type GoogleAppsCardV1Suggestions added in v0.49.0

type GoogleAppsCardV1Suggestions struct {
	// Items: A list of suggestions used for autocomplete recommendations.
	Items []*GoogleAppsCardV1SuggestionItem `json:"items,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Items") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Items") to include in API
	// requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

GoogleAppsCardV1Suggestions: A container wrapping elements necessary for showing suggestion items used in text input autocomplete.

func (*GoogleAppsCardV1Suggestions) MarshalJSON added in v0.49.0

func (s *GoogleAppsCardV1Suggestions) MarshalJSON() ([]byte, error)

type GoogleAppsCardV1SwitchControl added in v0.49.0

type GoogleAppsCardV1SwitchControl struct {
	// ControlType: The control type, either switch or checkbox.
	//
	// Possible values:
	//   "SWITCH" - A toggle-style switch.
	//   "CHECKBOX" - Deprecated in favor of `CHECK_BOX`.
	//   "CHECK_BOX" - A checkbox.
	ControlType string `json:"controlType,omitempty"`

	// Name: The name of the switch widget that's used in `formInput`.
	Name string `json:"name,omitempty"`

	// OnChangeAction: The action when the switch state is changed.
	OnChangeAction *GoogleAppsCardV1Action `json:"onChangeAction,omitempty"`

	// Selected: If the switch is selected.
	Selected bool `json:"selected,omitempty"`

	// Value: The value is what is passed back in the callback.
	Value string `json:"value,omitempty"`

	// ForceSendFields is a list of field names (e.g. "ControlType") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "ControlType") to include
	// in API requests with the JSON null value. By default, fields with
	// empty values are omitted from API requests. However, any field with
	// an empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

GoogleAppsCardV1SwitchControl: Either a toggle-style switch or a checkbox.

func (*GoogleAppsCardV1SwitchControl) MarshalJSON added in v0.49.0

func (s *GoogleAppsCardV1SwitchControl) MarshalJSON() ([]byte, error)

type GoogleAppsCardV1TextInput added in v0.49.0

type GoogleAppsCardV1TextInput struct {
	// AutoCompleteAction: The refresh function that returns suggestions
	// based on the user's input text. If the callback is not specified,
	// autocomplete is done in client side based on the initial suggestion
	// items.
	AutoCompleteAction *GoogleAppsCardV1Action `json:"autoCompleteAction,omitempty"`

	// HintText: The hint text.
	HintText string `json:"hintText,omitempty"`

	// InitialSuggestions: The initial suggestions made before any user
	// input.
	InitialSuggestions *GoogleAppsCardV1Suggestions `json:"initialSuggestions,omitempty"`

	// Label: At least one of label and hintText must be specified.
	Label string `json:"label,omitempty"`

	// Name: The name of the text input which is used in `formInput`.
	Name string `json:"name,omitempty"`

	// OnChangeAction: The onChange action, for example, invoke a function.
	OnChangeAction *GoogleAppsCardV1Action `json:"onChangeAction,omitempty"`

	// Type: The style of the text, for example, a single line or multiple
	// lines.
	//
	// Possible values:
	//   "SINGLE_LINE" - The text is put into a single line.
	//   "MULTIPLE_LINE" - The text is put into multiple lines.
	Type string `json:"type,omitempty"`

	// Value: The default value when there is no input from the user.
	Value string `json:"value,omitempty"`

	// ForceSendFields is a list of field names (e.g. "AutoCompleteAction")
	// to unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "AutoCompleteAction") to
	// include in API requests with the JSON null value. By default, fields
	// with empty values are omitted from API requests. However, any field
	// with an empty value appearing in NullFields will be sent to the
	// server as null. It is an error if a field in this list has a
	// non-empty value. This may be used to include null fields in Patch
	// requests.
	NullFields []string `json:"-"`
}

GoogleAppsCardV1TextInput: A text input is a UI item where users can input text. A text input can also have an onChange action and suggestions.

func (*GoogleAppsCardV1TextInput) MarshalJSON added in v0.49.0

func (s *GoogleAppsCardV1TextInput) MarshalJSON() ([]byte, error)

type GoogleAppsCardV1TextParagraph added in v0.49.0

type GoogleAppsCardV1TextParagraph struct {
	// Text: The text that's shown in the widget.
	Text string `json:"text,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Text") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Text") to include in API
	// requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

GoogleAppsCardV1TextParagraph: A paragraph of text that supports formatting. See Text formatting (workspace/add-ons/concepts/widgets#text_formatting) for details.

func (*GoogleAppsCardV1TextParagraph) MarshalJSON added in v0.49.0

func (s *GoogleAppsCardV1TextParagraph) MarshalJSON() ([]byte, error)

type GoogleAppsCardV1Widget added in v0.49.0

type GoogleAppsCardV1Widget struct {
	// ButtonList: A list of buttons. For example, the following JSON
	// creates two buttons. The first is a filled text button and the second
	// is an image button that opens a link: “` "buttonList": { "buttons":
	// [ "button": { "text": "Edit", "Color": { "Red": 255 "Green": 255
	// "Blue": 255 } "disabled": true }, "button": { "icon": { "knownIcon":
	// "INVITE" "altText": "check calendar" }, "onClick": { "openLink": {
	// "url": "https://example.com/calendar" } } }, ] } “`
	ButtonList *GoogleAppsCardV1ButtonList `json:"buttonList,omitempty"`

	// DateTimePicker: Displays a selection/input widget for date/time. For
	// example, the following JSON creates a date/time picker for an
	// appointment time: “` "date_time_picker": { "name":
	// "appointment_time", "label": "Book your appointment at:", "type":
	// "DateTimePickerType.DATE_AND_TIME", "valueMsEpoch": "796435200000" }
	// “`
	DateTimePicker *GoogleAppsCardV1DateTimePicker `json:"dateTimePicker,omitempty"`

	// DecoratedText: Displays a decorated text item in this widget. For
	// example, the following JSON creates a decorated text widget showing
	// email address: “` "decoratedText": { "icon": { "knownIcon": "EMAIL"
	// }, "topLabel": "Email Address", "content": "sasha@example.com",
	// "bottomLabel": "This is a new Email address!", "switchWidget": {
	// "name": "has_send_welcome_email_to_sasha", "selected": false,
	// "controlType": "ControlType.CHECKBOX" } } “`
	DecoratedText *GoogleAppsCardV1DecoratedText `json:"decoratedText,omitempty"`

	// Divider: Displays a divider. For example, the following JSON creates
	// a divider: “` "divider": { } “`
	Divider *GoogleAppsCardV1Divider `json:"divider,omitempty"`

	// Grid: Displays a grid with a collection of items. For example, the
	// following JSON creates a 2 column grid with a single item: “`
	// "grid": { "title": "A fine collection of items", "numColumns": 2,
	// "borderStyle": { "type": "STROKE", "cornerRadius": 4.0 }, "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" } } } “`
	Grid *GoogleAppsCardV1Grid `json:"grid,omitempty"`

	// HorizontalAlignment: The horizontal alignment of this widget.
	//
	// Possible values:
	//   "HORIZONTAL_ALIGNMENT_UNSPECIFIED" - Unspecified alignment.
	//   "START" - Alignment to the start position.
	//   "CENTER" - Alignment to the center position.
	//   "END" - Alignment to the end position.
	HorizontalAlignment string `json:"horizontalAlignment,omitempty"`

	// Image: Displays an image in this widget. For example, the following
	// JSON creates an image with alternative text: “` "image": {
	// "imageUrl": "https://example.com/sasha.png" "altText": "Avatar for
	// Sasha" } “`
	Image *GoogleAppsCardV1Image `json:"image,omitempty"`

	// SelectionInput: Displays a switch control in this widget. For
	// example, the following JSON creates a dropdown selection for size:
	// “` "switchControl": { "name": "size", "label": "Size" "type":
	// "SelectionType.DROPDOWN", "items": [ { "text": "S", "value": "small",
	// "selected": false }, { "text": "M", "value": "medium", "selected":
	// true }, { "text": "L", "value": "large", "selected": false }, {
	// "text": "XL", "value": "extra_large", "selected": false } ] } “`
	SelectionInput *GoogleAppsCardV1SelectionInput `json:"selectionInput,omitempty"`

	// TextInput: Displays a text input in this widget. For example, the
	// following JSON creates a text input for mail address: “`
	// "textInput": { "name": "mailing_address", "label": "Mailing Address"
	// } “` As another example, the following JSON creates a text input for
	// programming language with static suggestions: “` "textInput": {
	// "name": "preferred_programing_language", "label": "Preferred
	// Language", "initialSuggestions": { "items": [ { "text": "C++" }, {
	// "text": "Java" }, { "text": "JavaScript" }, { "text": "Python" } ] }
	// } “`
	TextInput *GoogleAppsCardV1TextInput `json:"textInput,omitempty"`

	// TextParagraph: Displays a text paragraph in this widget. For example,
	// the following JSON creates a bolded text: “` "textParagraph": {
	// "text": " *bold text*" } “`
	TextParagraph *GoogleAppsCardV1TextParagraph `json:"textParagraph,omitempty"`

	// ForceSendFields is a list of field names (e.g. "ButtonList") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "ButtonList") to include in
	// API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

GoogleAppsCardV1Widget: A widget is a UI element that presents texts, images, etc.

func (*GoogleAppsCardV1Widget) MarshalJSON added in v0.49.0

func (s *GoogleAppsCardV1Widget) MarshalJSON() ([]byte, error)

type Image

type Image struct {
	// AspectRatio: The aspect ratio of this image (width/height). This
	// field allows clients to reserve the right height for the image while
	// waiting for it to load. It's not meant to override the native aspect
	// ratio of the image. If unset, the server fills it by prefetching the
	// image.
	AspectRatio float64 `json:"aspectRatio,omitempty"`

	// ImageUrl: The URL of the image.
	ImageUrl string `json:"imageUrl,omitempty"`

	// OnClick: The onclick action.
	OnClick *OnClick `json:"onClick,omitempty"`

	// ForceSendFields is a list of field names (e.g. "AspectRatio") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "AspectRatio") to include
	// in API requests with the JSON null value. By default, fields with
	// empty values are omitted from API requests. However, any field with
	// an empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

Image: An image that is specified by a URL and can have an onclick action.

func (*Image) MarshalJSON

func (s *Image) MarshalJSON() ([]byte, error)

func (*Image) UnmarshalJSON

func (s *Image) UnmarshalJSON(data []byte) error

type ImageButton

type ImageButton struct {
	// Icon: The icon specified by an enum that indices to an icon provided
	// by Chat API.
	//
	// Possible values:
	//   "ICON_UNSPECIFIED"
	//   "AIRPLANE"
	//   "BOOKMARK"
	//   "BUS"
	//   "CAR"
	//   "CLOCK"
	//   "CONFIRMATION_NUMBER_ICON"
	//   "DOLLAR"
	//   "DESCRIPTION"
	//   "EMAIL"
	//   "EVENT_PERFORMER"
	//   "EVENT_SEAT"
	//   "FLIGHT_ARRIVAL"
	//   "FLIGHT_DEPARTURE"
	//   "HOTEL"
	//   "HOTEL_ROOM_TYPE"
	//   "INVITE"
	//   "MAP_PIN"
	//   "MEMBERSHIP"
	//   "MULTIPLE_PEOPLE"
	//   "OFFER"
	//   "PERSON"
	//   "PHONE"
	//   "RESTAURANT_ICON"
	//   "SHOPPING_CART"
	//   "STAR"
	//   "STORE"
	//   "TICKET"
	//   "TRAIN"
	//   "VIDEO_CAMERA"
	//   "VIDEO_PLAY"
	Icon string `json:"icon,omitempty"`

	// IconUrl: The icon specified by a URL.
	IconUrl string `json:"iconUrl,omitempty"`

	// Name: The name of this image_button which will be used for
	// accessibility. Default value will be provided if developers don't
	// specify.
	Name string `json:"name,omitempty"`

	// OnClick: The onclick action.
	OnClick *OnClick `json:"onClick,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Icon") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Icon") to include in API
	// requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

ImageButton: An image button with an onclick action.

func (*ImageButton) MarshalJSON

func (s *ImageButton) MarshalJSON() ([]byte, error)

type Inputs added in v0.55.0

type Inputs struct {
	// DateInput: Date input values. Not supported by Chat apps.
	DateInput *DateInput `json:"dateInput,omitempty"`

	// DateTimeInput: Date and time input values. Not supported by Chat
	// apps.
	DateTimeInput *DateTimeInput `json:"dateTimeInput,omitempty"`

	// StringInputs: Input parameter for regular widgets. For single-valued
	// widgets, it is a single value list. For multi-valued widgets, such as
	// checkbox, all the values are presented.
	StringInputs *StringInputs `json:"stringInputs,omitempty"`

	// TimeInput: Time input values. Not supported by Chat apps.
	TimeInput *TimeInput `json:"timeInput,omitempty"`

	// ForceSendFields is a list of field names (e.g. "DateInput") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "DateInput") to include in
	// API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

Inputs: Types of data inputs for widgets. Users enter data with these inputs.

func (*Inputs) MarshalJSON added in v0.55.0

func (s *Inputs) MarshalJSON() ([]byte, error)

type KeyValue

type KeyValue struct {
	// BottomLabel: The text of the bottom label. Formatted text supported.
	BottomLabel string `json:"bottomLabel,omitempty"`

	// Button: A button that can be clicked to trigger an action.
	Button *Button `json:"button,omitempty"`

	// Content: The text of the content. Formatted text supported and always
	// required.
	Content string `json:"content,omitempty"`

	// ContentMultiline: If the content should be multiline.
	ContentMultiline bool `json:"contentMultiline,omitempty"`

	// Icon: An enum value that will be replaced by the Chat API with the
	// corresponding icon image.
	//
	// Possible values:
	//   "ICON_UNSPECIFIED"
	//   "AIRPLANE"
	//   "BOOKMARK"
	//   "BUS"
	//   "CAR"
	//   "CLOCK"
	//   "CONFIRMATION_NUMBER_ICON"
	//   "DOLLAR"
	//   "DESCRIPTION"
	//   "EMAIL"
	//   "EVENT_PERFORMER"
	//   "EVENT_SEAT"
	//   "FLIGHT_ARRIVAL"
	//   "FLIGHT_DEPARTURE"
	//   "HOTEL"
	//   "HOTEL_ROOM_TYPE"
	//   "INVITE"
	//   "MAP_PIN"
	//   "MEMBERSHIP"
	//   "MULTIPLE_PEOPLE"
	//   "OFFER"
	//   "PERSON"
	//   "PHONE"
	//   "RESTAURANT_ICON"
	//   "SHOPPING_CART"
	//   "STAR"
	//   "STORE"
	//   "TICKET"
	//   "TRAIN"
	//   "VIDEO_CAMERA"
	//   "VIDEO_PLAY"
	Icon string `json:"icon,omitempty"`

	// IconUrl: The icon specified by a URL.
	IconUrl string `json:"iconUrl,omitempty"`

	// OnClick: The onclick action. Only the top label, bottom label and
	// content region are clickable.
	OnClick *OnClick `json:"onClick,omitempty"`

	// TopLabel: The text of the top label. Formatted text supported.
	TopLabel string `json:"topLabel,omitempty"`

	// ForceSendFields is a list of field names (e.g. "BottomLabel") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "BottomLabel") to include
	// in API requests with the JSON null value. By default, fields with
	// empty values are omitted from API requests. However, any field with
	// an empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

KeyValue: A UI element contains a key (label) and a value (content). And this element may also contain some actions such as onclick button.

func (*KeyValue) MarshalJSON

func (s *KeyValue) MarshalJSON() ([]byte, error)

type ListMembershipsResponse

type ListMembershipsResponse struct {
	// Memberships: List of memberships in the requested (or first) page.
	Memberships []*Membership `json:"memberships,omitempty"`

	// NextPageToken: Continuation token to retrieve the next page of
	// results. It will be empty for the last page of results.
	NextPageToken string `json:"nextPageToken,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`

	// ForceSendFields is a list of field names (e.g. "Memberships") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Memberships") to include
	// in API requests with the JSON null value. By default, fields with
	// empty values are omitted from API requests. However, any field with
	// an empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

func (*ListMembershipsResponse) MarshalJSON

func (s *ListMembershipsResponse) MarshalJSON() ([]byte, error)

type ListSpacesResponse

type ListSpacesResponse struct {
	// NextPageToken: Continuation token to retrieve the next page of
	// results. It will be empty for the last page of results. Tokens expire
	// in an hour. An error is thrown if an expired token is passed.
	NextPageToken string `json:"nextPageToken,omitempty"`

	// Spaces: List of spaces in the requested (or first) page.
	Spaces []*Space `json:"spaces,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`

	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "NextPageToken") to include
	// in API requests with the JSON null value. By default, fields with
	// empty values are omitted from API requests. However, any field with
	// an empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

func (*ListSpacesResponse) MarshalJSON

func (s *ListSpacesResponse) MarshalJSON() ([]byte, error)

type MatchedUrl added in v0.63.0

type MatchedUrl struct {
	// Url: Output only. The url that was matched.
	Url string `json:"url,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Url") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Url") to include in API
	// requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

MatchedUrl: A matched url in a Chat message. Chat apps can preview matched URLs. For more information, refer to Preview links (https://developers.google.com/chat/how-tos/preview-links).

func (*MatchedUrl) MarshalJSON added in v0.63.0

func (s *MatchedUrl) MarshalJSON() ([]byte, error)

type Media added in v0.30.0

type Media struct {
	// ResourceName: Name of the media resource.
	ResourceName string `json:"resourceName,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`

	// ForceSendFields is a list of field names (e.g. "ResourceName") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "ResourceName") to include
	// in API requests with the JSON null value. By default, fields with
	// empty values are omitted from API requests. However, any field with
	// an empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

Media: Media resource.

func (*Media) MarshalJSON added in v0.30.0

func (s *Media) MarshalJSON() ([]byte, error)

type MediaDownloadCall added in v0.30.0

type MediaDownloadCall struct {
	// contains filtered or unexported fields
}

func (*MediaDownloadCall) Context added in v0.30.0

Context sets the context to be used in this call's Do and Download methods. Any pending HTTP request will be aborted if the provided context is canceled.

func (*MediaDownloadCall) Do added in v0.30.0

func (c *MediaDownloadCall) Do(opts ...googleapi.CallOption) (*Media, error)

Do executes the "chat.media.download" call. Exactly one of *Media or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Media.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*MediaDownloadCall) Download added in v0.30.0

func (c *MediaDownloadCall) Download(opts ...googleapi.CallOption) (*http.Response, error)

Download fetches the API endpoint's "media" value, instead of the normal API response value. If the returned error is nil, the Response is guaranteed to have a 2xx status code. Callers must close the Response.Body as usual.

func (*MediaDownloadCall) Fields added in v0.30.0

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*MediaDownloadCall) Header added in v0.30.0

func (c *MediaDownloadCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*MediaDownloadCall) IfNoneMatch added in v0.30.0

func (c *MediaDownloadCall) IfNoneMatch(entityTag string) *MediaDownloadCall

IfNoneMatch sets the optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.

type MediaService added in v0.30.0

type MediaService struct {
	// contains filtered or unexported fields
}

func NewMediaService added in v0.30.0

func NewMediaService(s *Service) *MediaService

func (*MediaService) Download added in v0.30.0

func (r *MediaService) Download(resourceName string) *MediaDownloadCall

Download: Downloads media. Download is supported on the URI `/v1/media/{+name}?alt=media`.

  • resourceName: Name of the media that is being downloaded. See ReadRequest.resource_name.

type Membership

type Membership struct {
	// CreateTime: Output only. The creation time of the membership, such as
	// when a member joined or was invited to join a space.
	CreateTime string `json:"createTime,omitempty"`

	// Member: A Google Chat user or app. Format: `users/{user}` or
	// `users/app` When `users/{user}`, represents a person
	// (https://developers.google.com/people/api/rest/v1/people) in the
	// People API or a user
	// (https://developers.google.com/admin-sdk/directory/reference/rest/v1/users)
	// in the Admin SDK Directory API. When `users/app`, represents a Chat
	// app creating membership for itself.
	Member *User `json:"member,omitempty"`

	// Name: Resource name of the membership. Format:
	// spaces/{space}/members/{member}
	Name string `json:"name,omitempty"`

	// Role: Output only. User's role within a Chat space, which determines
	// their permitted actions in the space.
	//
	// Possible values:
	//   "MEMBERSHIP_ROLE_UNSPECIFIED" - Default value. The user isn't a
	// member of the space, but might be invited.
	//   "ROLE_MEMBER" - A member of the space. The user has basic
	// permissions, like sending messages to the space. In 1:1 and unnamed
	// group conversations, everyone has this role.
	//   "ROLE_MANAGER" - A space manager. The user has all basic
	// permissions plus administrative permissions that allow them to manage
	// the space, like adding or removing members. Only supports
	// SpaceType.SPACE.
	Role string `json:"role,omitempty"`

	// State: Output only. State of the membership.
	//
	// Possible values:
	//   "MEMBERSHIP_STATE_UNSPECIFIED" - Default, do not use.
	//   "JOINED" - The user has joined the space.
	//   "INVITED" - The user has been invited, is able to join the space,
	// but currently has not joined.
	//   "NOT_A_MEMBER" - The user is not a member of the space, has not
	// been invited and is not able to join the space.
	State string `json:"state,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`

	// ForceSendFields is a list of field names (e.g. "CreateTime") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "CreateTime") to include in
	// API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

Membership: Represents a membership relation in Google Chat, such as whether a user or Chat app is invited to, part of, or absent from a space.

func (*Membership) MarshalJSON

func (s *Membership) MarshalJSON() ([]byte, error)

type Message

type Message struct {
	// ActionResponse: Input only. Parameters that a Chat app can use to
	// configure how its response is posted.
	ActionResponse *ActionResponse `json:"actionResponse,omitempty"`

	// Annotations: Output only. Annotations associated with the text in
	// this message.
	Annotations []*Annotation `json:"annotations,omitempty"`

	// ArgumentText: Plain-text body of the message with all Chat app
	// mentions stripped out.
	ArgumentText string `json:"argumentText,omitempty"`

	// Attachment: User uploaded attachment.
	Attachment []*Attachment `json:"attachment,omitempty"`

	// Cards: Rich, formatted and interactive cards that can be used to
	// display UI elements such as: formatted texts, buttons, clickable
	// images. Cards are normally displayed below the plain-text body of the
	// message.
	Cards []*Card `json:"cards,omitempty"`

	// CardsV2: Richly formatted and interactive cards that display UI
	// elements and editable widgets, such as: - Formatted text - Buttons -
	// Clickable images - Checkboxes - Radio buttons - Input widgets. Cards
	// are usually displayed below the text-body of a Chat message, but can
	// situationally appear other places, such as dialogs
	// (https://developers.google.com/chat/how-tos/dialogs). The `cardId` is
	// a unique identifier among cards in the same message and for
	// identifying user input values. Currently supported widgets include: -
	// `TextParagraph` - `DecoratedText` - `Image` - `ButtonList`
	CardsV2 []*CardWithId `json:"cardsV2,omitempty"`

	// CreateTime: Output only. The time at which the message was created in
	// Google Chat server.
	CreateTime string `json:"createTime,omitempty"`

	// FallbackText: A plain-text description of the message's cards, used
	// when the actual cards cannot be displayed (e.g. mobile
	// notifications).
	FallbackText string `json:"fallbackText,omitempty"`

	// LastUpdateTime: Output only. The time at which the message was last
	// edited by a user. If the message has never been edited, this field is
	// empty.
	LastUpdateTime string `json:"lastUpdateTime,omitempty"`

	// MatchedUrl: Output only. A URL in `spaces.messages.text` that matches
	// a link preview pattern. For more information, refer to Preview links
	// (https://developers.google.com/chat/how-tos/preview-links).
	MatchedUrl *MatchedUrl `json:"matchedUrl,omitempty"`

	// Name: Resource name in the form `spaces/*/messages/*`. Example:
	// `spaces/AAAAAAAAAAA/messages/BBBBBBBBBBB.BBBBBBBBBBB`
	Name string `json:"name,omitempty"`

	// Sender: Output only. The user who created the message.
	Sender *User `json:"sender,omitempty"`

	// SlashCommand: Output only. Slash command information, if applicable.
	SlashCommand *SlashCommand `json:"slashCommand,omitempty"`

	// Space: The space the message belongs to.
	Space *Space `json:"space,omitempty"`

	// Text: Plain-text body of the message. The first link to an image,
	// video, web page, or other preview-able item generates a preview chip.
	Text string `json:"text,omitempty"`

	// Thread: The thread the message belongs to.
	Thread *Thread `json:"thread,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`

	// ForceSendFields is a list of field names (e.g. "ActionResponse") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "ActionResponse") to
	// include in API requests with the JSON null value. By default, fields
	// with empty values are omitted from API requests. However, any field
	// with an empty value appearing in NullFields will be sent to the
	// server as null. It is an error if a field in this list has a
	// non-empty value. This may be used to include null fields in Patch
	// requests.
	NullFields []string `json:"-"`
}

Message: A message in Google Chat.

func (*Message) MarshalJSON

func (s *Message) MarshalJSON() ([]byte, error)

type OnClick

type OnClick struct {
	// Action: A form action will be triggered by this onclick if specified.
	Action *FormAction `json:"action,omitempty"`

	// OpenLink: This onclick triggers an open link action if specified.
	OpenLink *OpenLink `json:"openLink,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Action") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Action") to include in API
	// requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

OnClick: An onclick action (e.g. open a link).

func (*OnClick) MarshalJSON

func (s *OnClick) MarshalJSON() ([]byte, error)
type OpenLink struct {
	// Url: The URL to open.
	Url string `json:"url,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Url") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Url") to include in API
	// requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

OpenLink: A link that opens a new window.

func (*OpenLink) MarshalJSON

func (s *OpenLink) MarshalJSON() ([]byte, error)

type RoomsConversationsMessagesCall added in v0.36.0

type RoomsConversationsMessagesCall struct {
	// contains filtered or unexported fields
}

func (*RoomsConversationsMessagesCall) Context added in v0.36.0

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*RoomsConversationsMessagesCall) Do added in v0.36.0

Do executes the "chat.rooms.conversations.messages" call. Exactly one of *Message or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Message.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*RoomsConversationsMessagesCall) Fields added in v0.36.0

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*RoomsConversationsMessagesCall) Header added in v0.36.0

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*RoomsConversationsMessagesCall) RequestId added in v0.60.0

RequestId sets the optional parameter "requestId": A unique request ID for this message. Specifying an existing request ID returns the message created with that ID instead of creating a new message.

func (*RoomsConversationsMessagesCall) ThreadKey added in v0.36.0

ThreadKey sets the optional parameter "threadKey": Opaque thread identifier. To start or add to a thread, create a message and specify a `threadKey` instead of thread.name. (Setting thread.name has no effect.) The first message with a given `threadKey` starts a new thread. Subsequent messages with the same `threadKey` post into the same thread.

type RoomsConversationsService added in v0.36.0

type RoomsConversationsService struct {
	// contains filtered or unexported fields
}

func NewRoomsConversationsService added in v0.36.0

func NewRoomsConversationsService(s *Service) *RoomsConversationsService

func (*RoomsConversationsService) Messages added in v0.36.0

Messages: Legacy path for creating message. Calling these will result in a BadRequest response.

  • parent: Space resource name, in the form "spaces/*". Example: spaces/AAAAAAAAAAA.

type RoomsMessagesCall added in v0.36.0

type RoomsMessagesCall struct {
	// contains filtered or unexported fields
}

func (*RoomsMessagesCall) Context added in v0.36.0

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*RoomsMessagesCall) Do added in v0.36.0

func (c *RoomsMessagesCall) Do(opts ...googleapi.CallOption) (*Message, error)

Do executes the "chat.rooms.messages" call. Exactly one of *Message or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Message.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*RoomsMessagesCall) Fields added in v0.36.0

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*RoomsMessagesCall) Header added in v0.36.0

func (c *RoomsMessagesCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*RoomsMessagesCall) RequestId added in v0.60.0

func (c *RoomsMessagesCall) RequestId(requestId string) *RoomsMessagesCall

RequestId sets the optional parameter "requestId": A unique request ID for this message. Specifying an existing request ID returns the message created with that ID instead of creating a new message.

func (*RoomsMessagesCall) ThreadKey added in v0.36.0

func (c *RoomsMessagesCall) ThreadKey(threadKey string) *RoomsMessagesCall

ThreadKey sets the optional parameter "threadKey": Opaque thread identifier. To start or add to a thread, create a message and specify a `threadKey` instead of thread.name. (Setting thread.name has no effect.) The first message with a given `threadKey` starts a new thread. Subsequent messages with the same `threadKey` post into the same thread.

type RoomsService added in v0.36.0

type RoomsService struct {
	Conversations *RoomsConversationsService
	// contains filtered or unexported fields
}

func NewRoomsService added in v0.36.0

func NewRoomsService(s *Service) *RoomsService

func (*RoomsService) Messages added in v0.36.0

func (r *RoomsService) Messages(parent string, message *Message) *RoomsMessagesCall

Messages: Legacy path for creating message. Calling these will result in a BadRequest response.

  • parent: Space resource name, in the form "spaces/*". Example: spaces/AAAAAAAAAAA.

func (*RoomsService) Webhooks added in v0.37.0

func (r *RoomsService) Webhooks(parent string, message *Message) *RoomsWebhooksCall

Webhooks: Legacy path for creating message. Calling these will result in a BadRequest response.

  • parent: Space resource name, in the form "spaces/*". Example: spaces/AAAAAAAAAAA.

type RoomsWebhooksCall added in v0.37.0

type RoomsWebhooksCall struct {
	// contains filtered or unexported fields
}

func (*RoomsWebhooksCall) Context added in v0.37.0

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*RoomsWebhooksCall) Do added in v0.37.0

func (c *RoomsWebhooksCall) Do(opts ...googleapi.CallOption) (*Message, error)

Do executes the "chat.rooms.webhooks" call. Exactly one of *Message or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Message.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*RoomsWebhooksCall) Fields added in v0.37.0

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*RoomsWebhooksCall) Header added in v0.37.0

func (c *RoomsWebhooksCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*RoomsWebhooksCall) RequestId added in v0.60.0

func (c *RoomsWebhooksCall) RequestId(requestId string) *RoomsWebhooksCall

RequestId sets the optional parameter "requestId": A unique request ID for this message. Specifying an existing request ID returns the message created with that ID instead of creating a new message.

func (*RoomsWebhooksCall) ThreadKey added in v0.37.0

func (c *RoomsWebhooksCall) ThreadKey(threadKey string) *RoomsWebhooksCall

ThreadKey sets the optional parameter "threadKey": Opaque thread identifier. To start or add to a thread, create a message and specify a `threadKey` instead of thread.name. (Setting thread.name has no effect.) The first message with a given `threadKey` starts a new thread. Subsequent messages with the same `threadKey` post into the same thread.

type Section

type Section struct {
	// Header: The header of the section, text formatted supported.
	Header string `json:"header,omitempty"`

	// Widgets: A section must contain at least 1 widget.
	Widgets []*WidgetMarkup `json:"widgets,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Header") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Header") to include in API
	// requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

Section: A section contains a collection of widgets that are rendered (vertically) in the order that they are specified. Across all platforms, cards have a narrow fixed width, so there is currently no need for layout properties (e.g. float).

func (*Section) MarshalJSON

func (s *Section) MarshalJSON() ([]byte, error)

type Service

type Service struct {
	BasePath  string // API endpoint base URL
	UserAgent string // optional additional User-Agent fragment

	Dms *DmsService

	Media *MediaService

	Rooms *RoomsService

	Spaces *SpacesService
	// contains filtered or unexported fields
}

func New deprecated

func New(client *http.Client) (*Service, error)

New creates a new Service. It uses the provided http.Client for requests.

Deprecated: please use NewService instead. To provide a custom HTTP client, use option.WithHTTPClient. If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.

func NewService added in v0.3.0

func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error)

NewService creates a new Service.

type SlashCommand added in v0.33.0

type SlashCommand struct {
	// CommandId: The id of the slash command invoked.
	CommandId int64 `json:"commandId,omitempty,string"`

	// ForceSendFields is a list of field names (e.g. "CommandId") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "CommandId") to include in
	// API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

SlashCommand: A slash command (https://developers.google.com/chat/how-tos/slash-commands) in Google Chat.

func (*SlashCommand) MarshalJSON added in v0.33.0

func (s *SlashCommand) MarshalJSON() ([]byte, error)

type SlashCommandMetadata added in v0.33.0

type SlashCommandMetadata struct {
	// Bot: The Chat app whose command was invoked.
	Bot *User `json:"bot,omitempty"`

	// CommandId: The command id of the invoked slash command.
	CommandId int64 `json:"commandId,omitempty,string"`

	// CommandName: The name of the invoked slash command.
	CommandName string `json:"commandName,omitempty"`

	// TriggersDialog: Indicating whether the slash command is for a dialog.
	TriggersDialog bool `json:"triggersDialog,omitempty"`

	// Type: The type of slash command.
	//
	// Possible values:
	//   "TYPE_UNSPECIFIED" - Default value for the enum. DO NOT USE.
	//   "ADD" - Add Chat app to space.
	//   "INVOKE" - Invoke slash command in space.
	Type string `json:"type,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Bot") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Bot") to include in API
	// requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

SlashCommandMetadata: Annotation metadata for slash commands (/).

func (*SlashCommandMetadata) MarshalJSON added in v0.33.0

func (s *SlashCommandMetadata) MarshalJSON() ([]byte, error)

type Space

type Space struct {
	// DisplayName: The space's display name. For direct messages between
	// humans, this field might be empty.
	DisplayName string `json:"displayName,omitempty"`

	// Name: Resource name of the space. Format: spaces/{space}
	Name string `json:"name,omitempty"`

	// SingleUserBotDm: Output only. Whether the space is a DM between a
	// Chat app and a single human.
	SingleUserBotDm bool `json:"singleUserBotDm,omitempty"`

	// SpaceDetails: Details about the space including description and
	// rules.
	SpaceDetails *SpaceDetails `json:"spaceDetails,omitempty"`

	// Threaded: Output only. Whether messages are threaded in this space.
	Threaded bool `json:"threaded,omitempty"`

	// Type: Output only. Deprecated: Use `singleUserBotDm` or `spaceType`
	// (developer preview) instead. The type of a space.
	//
	// Possible values:
	//   "TYPE_UNSPECIFIED"
	//   "ROOM" - Conversations between two or more humans.
	//   "DM" - 1:1 Direct Message between a human and a Chat app, where all
	// messages are flat. Note that this does not include direct messages
	// between two humans.
	Type string `json:"type,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`

	// ForceSendFields is a list of field names (e.g. "DisplayName") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "DisplayName") to include
	// in API requests with the JSON null value. By default, fields with
	// empty values are omitted from API requests. However, any field with
	// an empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

Space: A space in Google Chat. Spaces are conversations between two or more users or 1:1 messages between a user and a Chat app.

func (*Space) MarshalJSON

func (s *Space) MarshalJSON() ([]byte, error)

type SpaceDetails added in v0.90.0

type SpaceDetails struct {
	// Description: Optional. A description of the space. It could describe
	// the space's discussion topic, functional purpose, or participants.
	Description string `json:"description,omitempty"`

	// Guidelines: Optional. The space's rules, expectations, and etiquette.
	Guidelines string `json:"guidelines,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Description") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Description") to include
	// in API requests with the JSON null value. By default, fields with
	// empty values are omitted from API requests. However, any field with
	// an empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

SpaceDetails: Details about the space including description and rules.

func (*SpaceDetails) MarshalJSON added in v0.90.0

func (s *SpaceDetails) MarshalJSON() ([]byte, error)

type SpacesGetCall

type SpacesGetCall struct {
	// contains filtered or unexported fields
}

func (*SpacesGetCall) Context

func (c *SpacesGetCall) Context(ctx context.Context) *SpacesGetCall

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*SpacesGetCall) Do

func (c *SpacesGetCall) Do(opts ...googleapi.CallOption) (*Space, error)

Do executes the "chat.spaces.get" call. Exactly one of *Space or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Space.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*SpacesGetCall) Fields

func (c *SpacesGetCall) Fields(s ...googleapi.Field) *SpacesGetCall

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*SpacesGetCall) Header

func (c *SpacesGetCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*SpacesGetCall) IfNoneMatch

func (c *SpacesGetCall) IfNoneMatch(entityTag string) *SpacesGetCall

IfNoneMatch sets the optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.

type SpacesListCall

type SpacesListCall struct {
	// contains filtered or unexported fields
}

func (*SpacesListCall) Context

func (c *SpacesListCall) Context(ctx context.Context) *SpacesListCall

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*SpacesListCall) Do

Do executes the "chat.spaces.list" call. Exactly one of *ListSpacesResponse or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *ListSpacesResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*SpacesListCall) Fields

func (c *SpacesListCall) Fields(s ...googleapi.Field) *SpacesListCall

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*SpacesListCall) Header

func (c *SpacesListCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*SpacesListCall) IfNoneMatch

func (c *SpacesListCall) IfNoneMatch(entityTag string) *SpacesListCall

IfNoneMatch sets the optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.

func (*SpacesListCall) PageSize

func (c *SpacesListCall) PageSize(pageSize int64) *SpacesListCall

PageSize sets the optional parameter "pageSize": Requested page size. The value is capped at 1000. Server may return fewer results than requested. If unspecified, server will default to 100.

func (*SpacesListCall) PageToken

func (c *SpacesListCall) PageToken(pageToken string) *SpacesListCall

PageToken sets the optional parameter "pageToken": A token identifying a page of results the server should return.

func (*SpacesListCall) Pages

func (c *SpacesListCall) Pages(ctx context.Context, f func(*ListSpacesResponse) error) error

Pages invokes f for each page of results. A non-nil error returned from f will halt the iteration. The provided context supersedes any context provided to the Context method.

type SpacesMembersGetCall

type SpacesMembersGetCall struct {
	// contains filtered or unexported fields
}

func (*SpacesMembersGetCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*SpacesMembersGetCall) Do

Do executes the "chat.spaces.members.get" call. Exactly one of *Membership or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Membership.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*SpacesMembersGetCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*SpacesMembersGetCall) Header

func (c *SpacesMembersGetCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*SpacesMembersGetCall) IfNoneMatch

func (c *SpacesMembersGetCall) IfNoneMatch(entityTag string) *SpacesMembersGetCall

IfNoneMatch sets the optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.

type SpacesMembersListCall

type SpacesMembersListCall struct {
	// contains filtered or unexported fields
}

func (*SpacesMembersListCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*SpacesMembersListCall) Do

Do executes the "chat.spaces.members.list" call. Exactly one of *ListMembershipsResponse or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *ListMembershipsResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*SpacesMembersListCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*SpacesMembersListCall) Header

func (c *SpacesMembersListCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*SpacesMembersListCall) IfNoneMatch

func (c *SpacesMembersListCall) IfNoneMatch(entityTag string) *SpacesMembersListCall

IfNoneMatch sets the optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.

func (*SpacesMembersListCall) PageSize

func (c *SpacesMembersListCall) PageSize(pageSize int64) *SpacesMembersListCall

PageSize sets the optional parameter "pageSize": Requested page size. The value is capped at 1000. Server may return fewer results than requested. If unspecified, server will default to 100.

func (*SpacesMembersListCall) PageToken

func (c *SpacesMembersListCall) PageToken(pageToken string) *SpacesMembersListCall

PageToken sets the optional parameter "pageToken": A token identifying a page of results the server should return.

func (*SpacesMembersListCall) Pages

Pages invokes f for each page of results. A non-nil error returned from f will halt the iteration. The provided context supersedes any context provided to the Context method.

type SpacesMembersService

type SpacesMembersService struct {
	// contains filtered or unexported fields
}

func NewSpacesMembersService

func NewSpacesMembersService(s *Service) *SpacesMembersService

func (*SpacesMembersService) Get

Get: Returns a membership. Requires service account authentication (https://developers.google.com/chat/api/guides/auth/service-accounts).

  • name: Resource name of the membership to retrieve. Format: spaces/{space}/members/{member}.

func (*SpacesMembersService) List

List: Lists human memberships in a space. Requires service account authentication (https://developers.google.com/chat/api/guides/auth/service-accounts).

  • parent: The resource name of the space for which to fetch a membership list. Format: spaces/{space}.

type SpacesMessagesAttachmentsGetCall added in v0.30.0

type SpacesMessagesAttachmentsGetCall struct {
	// contains filtered or unexported fields
}

func (*SpacesMessagesAttachmentsGetCall) Context added in v0.30.0

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*SpacesMessagesAttachmentsGetCall) Do added in v0.30.0

Do executes the "chat.spaces.messages.attachments.get" call. Exactly one of *Attachment or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Attachment.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*SpacesMessagesAttachmentsGetCall) Fields added in v0.30.0

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*SpacesMessagesAttachmentsGetCall) Header added in v0.30.0

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*SpacesMessagesAttachmentsGetCall) IfNoneMatch added in v0.30.0

IfNoneMatch sets the optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.

type SpacesMessagesAttachmentsService added in v0.30.0

type SpacesMessagesAttachmentsService struct {
	// contains filtered or unexported fields
}

func NewSpacesMessagesAttachmentsService added in v0.30.0

func NewSpacesMessagesAttachmentsService(s *Service) *SpacesMessagesAttachmentsService

func (*SpacesMessagesAttachmentsService) Get added in v0.30.0

Get: Gets the metadata of a message attachment. The attachment data is fetched using the media API. Requires service account authentication (https://developers.google.com/chat/api/guides/auth/service-accounts).

  • name: Resource name of the attachment, in the form "spaces/*/messages/*/attachments/*".

type SpacesMessagesCreateCall

type SpacesMessagesCreateCall struct {
	// contains filtered or unexported fields
}

func (*SpacesMessagesCreateCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*SpacesMessagesCreateCall) Do

Do executes the "chat.spaces.messages.create" call. Exactly one of *Message or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Message.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*SpacesMessagesCreateCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*SpacesMessagesCreateCall) Header

func (c *SpacesMessagesCreateCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*SpacesMessagesCreateCall) RequestId added in v0.60.0

func (c *SpacesMessagesCreateCall) RequestId(requestId string) *SpacesMessagesCreateCall

RequestId sets the optional parameter "requestId": A unique request ID for this message. Specifying an existing request ID returns the message created with that ID instead of creating a new message.

func (*SpacesMessagesCreateCall) ThreadKey

func (c *SpacesMessagesCreateCall) ThreadKey(threadKey string) *SpacesMessagesCreateCall

ThreadKey sets the optional parameter "threadKey": Opaque thread identifier. To start or add to a thread, create a message and specify a `threadKey` instead of thread.name. (Setting thread.name has no effect.) The first message with a given `threadKey` starts a new thread. Subsequent messages with the same `threadKey` post into the same thread.

type SpacesMessagesDeleteCall

type SpacesMessagesDeleteCall struct {
	// contains filtered or unexported fields
}

func (*SpacesMessagesDeleteCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*SpacesMessagesDeleteCall) Do

Do executes the "chat.spaces.messages.delete" call. Exactly one of *Empty or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Empty.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*SpacesMessagesDeleteCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*SpacesMessagesDeleteCall) Header

func (c *SpacesMessagesDeleteCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

type SpacesMessagesGetCall

type SpacesMessagesGetCall struct {
	// contains filtered or unexported fields
}

func (*SpacesMessagesGetCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*SpacesMessagesGetCall) Do

Do executes the "chat.spaces.messages.get" call. Exactly one of *Message or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Message.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*SpacesMessagesGetCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*SpacesMessagesGetCall) Header

func (c *SpacesMessagesGetCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*SpacesMessagesGetCall) IfNoneMatch

func (c *SpacesMessagesGetCall) IfNoneMatch(entityTag string) *SpacesMessagesGetCall

IfNoneMatch sets the optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.

type SpacesMessagesService

type SpacesMessagesService struct {
	Attachments *SpacesMessagesAttachmentsService
	// contains filtered or unexported fields
}

func NewSpacesMessagesService

func NewSpacesMessagesService(s *Service) *SpacesMessagesService

func (*SpacesMessagesService) Create

func (r *SpacesMessagesService) Create(parent string, message *Message) *SpacesMessagesCreateCall

Create: Creates a message. Requires service account authentication (https://developers.google.com/chat/api/guides/auth/service-accounts).

  • parent: Space resource name, in the form "spaces/*". Example: spaces/AAAAAAAAAAA.

func (*SpacesMessagesService) Delete

Delete: Deletes a message. Requires service account authentication (https://developers.google.com/chat/api/guides/auth/service-accounts).

  • name: Resource name of the message to be deleted, in the form "spaces/*/messages/*" Example: spaces/AAAAAAAAAAA/messages/BBBBBBBBBBB.BBBBBBBBBBB.

func (*SpacesMessagesService) Get

Get: Returns a message. Requires service account authentication (https://developers.google.com/chat/api/guides/auth/service-accounts).

  • name: Resource name of the message to be retrieved, in the form "spaces/*/messages/*". Example: spaces/AAAAAAAAAAA/messages/BBBBBBBBBBB.BBBBBBBBBBB.

func (*SpacesMessagesService) Update

func (r *SpacesMessagesService) Update(name string, message *Message) *SpacesMessagesUpdateCall

Update: Updates a message. Requires service account authentication (https://developers.google.com/chat/api/guides/auth/service-accounts).

  • name: Resource name in the form `spaces/*/messages/*`. Example: `spaces/AAAAAAAAAAA/messages/BBBBBBBBBBB.BBBBBBBBBBB`.

type SpacesMessagesUpdateCall

type SpacesMessagesUpdateCall struct {
	// contains filtered or unexported fields
}

func (*SpacesMessagesUpdateCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*SpacesMessagesUpdateCall) Do

Do executes the "chat.spaces.messages.update" call. Exactly one of *Message or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Message.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*SpacesMessagesUpdateCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*SpacesMessagesUpdateCall) Header

func (c *SpacesMessagesUpdateCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*SpacesMessagesUpdateCall) UpdateMask

func (c *SpacesMessagesUpdateCall) UpdateMask(updateMask string) *SpacesMessagesUpdateCall

UpdateMask sets the optional parameter "updateMask": Required. The field paths to update. Separate multiple values with commas. Currently supported field paths: - text - cards (Requires service account authentication (/chat/api/guides/auth/service-accounts).)

type SpacesService

type SpacesService struct {
	Members *SpacesMembersService

	Messages *SpacesMessagesService
	// contains filtered or unexported fields
}

func NewSpacesService

func NewSpacesService(s *Service) *SpacesService

func (*SpacesService) Get

func (r *SpacesService) Get(name string) *SpacesGetCall

Get: Returns a space. Requires service account authentication (https://developers.google.com/chat/api/guides/auth/service-accounts).

  • name: Resource name of the space, in the form "spaces/*". Format: spaces/{space}.

func (*SpacesService) List

func (r *SpacesService) List() *SpacesListCall

List: Lists spaces the caller is a member of. Requires service account authentication (https://developers.google.com/chat/api/guides/auth/service-accounts).

func (*SpacesService) Webhooks added in v0.37.0

func (r *SpacesService) Webhooks(parent string, message *Message) *SpacesWebhooksCall

Webhooks: Legacy path for creating message. Calling these will result in a BadRequest response.

  • parent: Space resource name, in the form "spaces/*". Example: spaces/AAAAAAAAAAA.

type SpacesWebhooksCall added in v0.37.0

type SpacesWebhooksCall struct {
	// contains filtered or unexported fields
}

func (*SpacesWebhooksCall) Context added in v0.37.0

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*SpacesWebhooksCall) Do added in v0.37.0

Do executes the "chat.spaces.webhooks" call. Exactly one of *Message or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Message.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*SpacesWebhooksCall) Fields added in v0.37.0

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*SpacesWebhooksCall) Header added in v0.37.0

func (c *SpacesWebhooksCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*SpacesWebhooksCall) RequestId added in v0.60.0

func (c *SpacesWebhooksCall) RequestId(requestId string) *SpacesWebhooksCall

RequestId sets the optional parameter "requestId": A unique request ID for this message. Specifying an existing request ID returns the message created with that ID instead of creating a new message.

func (*SpacesWebhooksCall) ThreadKey added in v0.37.0

func (c *SpacesWebhooksCall) ThreadKey(threadKey string) *SpacesWebhooksCall

ThreadKey sets the optional parameter "threadKey": Opaque thread identifier. To start or add to a thread, create a message and specify a `threadKey` instead of thread.name. (Setting thread.name has no effect.) The first message with a given `threadKey` starts a new thread. Subsequent messages with the same `threadKey` post into the same thread.

type Status added in v0.61.0

type Status struct {
	// Code: The status code, which should be an enum value of
	// google.rpc.Code.
	Code int64 `json:"code,omitempty"`

	// Details: A list of messages that carry the error details. There is a
	// common set of message types for APIs to use.
	Details []googleapi.RawMessage `json:"details,omitempty"`

	// Message: A developer-facing error message, which should be in
	// English. Any user-facing error message should be localized and sent
	// in the google.rpc.Status.details field, or localized by the client.
	Message string `json:"message,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Code") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Code") to include in API
	// requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

Status: The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by gRPC (https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the API Design Guide (https://cloud.google.com/apis/design/errors).

func (*Status) MarshalJSON added in v0.61.0

func (s *Status) MarshalJSON() ([]byte, error)

type StringInputs added in v0.55.0

type StringInputs struct {
	// Value: An array of strings entered by the user.
	Value []string `json:"value,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Value") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Value") to include in API
	// requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

StringInputs: Input parameter for regular widgets. For single-valued widgets, it is a single value list. For multi-valued widgets, such as checkbox, all the values are presented.

func (*StringInputs) MarshalJSON added in v0.55.0

func (s *StringInputs) MarshalJSON() ([]byte, error)

type TextButton

type TextButton struct {
	// OnClick: The onclick action of the button.
	OnClick *OnClick `json:"onClick,omitempty"`

	// Text: The text of the button.
	Text string `json:"text,omitempty"`

	// ForceSendFields is a list of field names (e.g. "OnClick") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "OnClick") to include in
	// API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

TextButton: A button with text and onclick action.

func (*TextButton) MarshalJSON

func (s *TextButton) MarshalJSON() ([]byte, error)

type TextParagraph

type TextParagraph struct {
	Text string `json:"text,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Text") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Text") to include in API
	// requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

TextParagraph: A paragraph of text. Formatted text supported.

func (*TextParagraph) MarshalJSON

func (s *TextParagraph) MarshalJSON() ([]byte, error)

type Thread

type Thread struct {
	// Name: Resource name, in the form "spaces/*/threads/*". Example:
	// spaces/AAAAAAAAAAA/threads/TTTTTTTTTTT
	Name string `json:"name,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Name") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Name") to include in API
	// requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

Thread: A thread in Google Chat.

func (*Thread) MarshalJSON

func (s *Thread) MarshalJSON() ([]byte, error)

type TimeInput added in v0.55.0

type TimeInput struct {
	// Hours: The hour on a 24-hour clock.
	Hours int64 `json:"hours,omitempty"`

	// Minutes: The number of minutes past the hour. Valid values are 0 to
	// 59.
	Minutes int64 `json:"minutes,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Hours") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Hours") to include in API
	// requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

TimeInput: Time input values. Not supported by Chat apps.

func (*TimeInput) MarshalJSON added in v0.55.0

func (s *TimeInput) MarshalJSON() ([]byte, error)

type TimeZone added in v0.55.0

type TimeZone struct {
	// Id: The IANA TZ (https://www.iana.org/time-zones) time zone database
	// code, such as "America/Toronto".
	Id string `json:"id,omitempty"`

	// Offset: The user timezone offset, in milliseconds, from Coordinated
	// Universal Time (UTC).
	Offset int64 `json:"offset,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Id") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Id") to include in API
	// requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

TimeZone: The timezone ID and offset from Coordinated Universal Time (UTC). Not supported by Chat apps.

func (*TimeZone) MarshalJSON added in v0.55.0

func (s *TimeZone) MarshalJSON() ([]byte, error)

type User

type User struct {
	// DisplayName: Output only. The user's display name.
	DisplayName string `json:"displayName,omitempty"`

	// DomainId: Unique identifier of the user's Google Workspace domain.
	DomainId string `json:"domainId,omitempty"`

	// IsAnonymous: Output only. When `true`, the user is deleted or their
	// profile is not visible.
	IsAnonymous bool `json:"isAnonymous,omitempty"`

	// Name: Resource name for a Google Chat user. Represents a person
	// (https://developers.google.com/people/api/rest/v1/people#Person) in
	// the People API or a user
	// (https://developers.google.com/admin-sdk/directory/reference/rest/v1/users)
	// in the Admin SDK Directory API. Formatted as: `users/{user}`
	Name string `json:"name,omitempty"`

	// Type: User type.
	//
	// Possible values:
	//   "TYPE_UNSPECIFIED" - Default value for the enum. DO NOT USE.
	//   "HUMAN" - Human user.
	//   "BOT" - Chat app user.
	Type string `json:"type,omitempty"`

	// ForceSendFields is a list of field names (e.g. "DisplayName") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "DisplayName") to include
	// in API requests with the JSON null value. By default, fields with
	// empty values are omitted from API requests. However, any field with
	// an empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

User: A user in Google Chat.

func (*User) MarshalJSON

func (s *User) MarshalJSON() ([]byte, error)

type UserMentionMetadata

type UserMentionMetadata struct {
	// Type: The type of user mention.
	//
	// Possible values:
	//   "TYPE_UNSPECIFIED" - Default value for the enum. DO NOT USE.
	//   "ADD" - Add user to space.
	//   "MENTION" - Mention user in space.
	Type string `json:"type,omitempty"`

	// User: The user mentioned.
	User *User `json:"user,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Type") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Type") to include in API
	// requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

UserMentionMetadata: Annotation metadata for user mentions (@).

func (*UserMentionMetadata) MarshalJSON

func (s *UserMentionMetadata) MarshalJSON() ([]byte, error)

type WidgetMarkup

type WidgetMarkup struct {
	// Buttons: A list of buttons. Buttons is also oneof data and only one
	// of these fields should be set.
	Buttons []*Button `json:"buttons,omitempty"`

	// Image: Display an image in this widget.
	Image *Image `json:"image,omitempty"`

	// KeyValue: Display a key value item in this widget.
	KeyValue *KeyValue `json:"keyValue,omitempty"`

	// TextParagraph: Display a text paragraph in this widget.
	TextParagraph *TextParagraph `json:"textParagraph,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Buttons") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Buttons") to include in
	// API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

WidgetMarkup: A widget is a UI element that presents texts, images, etc.

func (*WidgetMarkup) MarshalJSON

func (s *WidgetMarkup) MarshalJSON() ([]byte, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL