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 ¶
- type ActionParameter
- type ActionResponse
- type Annotation
- type Attachment
- type AttachmentDataRef
- type Button
- type Card
- type CardAction
- type CardHeader
- type DeprecatedEvent
- type DmsConversationsMessagesCall
- func (c *DmsConversationsMessagesCall) Context(ctx context.Context) *DmsConversationsMessagesCall
- func (c *DmsConversationsMessagesCall) Do(opts ...googleapi.CallOption) (*Message, error)
- func (c *DmsConversationsMessagesCall) Fields(s ...googleapi.Field) *DmsConversationsMessagesCall
- func (c *DmsConversationsMessagesCall) Header() http.Header
- func (c *DmsConversationsMessagesCall) ThreadKey(threadKey string) *DmsConversationsMessagesCall
- type DmsConversationsService
- type DmsMessagesCall
- func (c *DmsMessagesCall) Context(ctx context.Context) *DmsMessagesCall
- func (c *DmsMessagesCall) Do(opts ...googleapi.CallOption) (*Message, error)
- func (c *DmsMessagesCall) Fields(s ...googleapi.Field) *DmsMessagesCall
- func (c *DmsMessagesCall) Header() http.Header
- func (c *DmsMessagesCall) ThreadKey(threadKey string) *DmsMessagesCall
- type DmsService
- type DmsWebhooksCall
- func (c *DmsWebhooksCall) Context(ctx context.Context) *DmsWebhooksCall
- func (c *DmsWebhooksCall) Do(opts ...googleapi.CallOption) (*Message, error)
- func (c *DmsWebhooksCall) Fields(s ...googleapi.Field) *DmsWebhooksCall
- func (c *DmsWebhooksCall) Header() http.Header
- func (c *DmsWebhooksCall) ThreadKey(threadKey string) *DmsWebhooksCall
- type DriveDataRef
- type Empty
- type FormAction
- type Image
- type ImageButton
- type KeyValue
- type ListMembershipsResponse
- type ListSpacesResponse
- type Media
- type MediaDownloadCall
- func (c *MediaDownloadCall) Context(ctx context.Context) *MediaDownloadCall
- func (c *MediaDownloadCall) Do(opts ...googleapi.CallOption) (*Media, error)
- func (c *MediaDownloadCall) Download(opts ...googleapi.CallOption) (*http.Response, error)
- func (c *MediaDownloadCall) Fields(s ...googleapi.Field) *MediaDownloadCall
- func (c *MediaDownloadCall) Header() http.Header
- func (c *MediaDownloadCall) IfNoneMatch(entityTag string) *MediaDownloadCall
- type MediaService
- type Membership
- type Message
- type OnClick
- type OpenLink
- type RoomsConversationsMessagesCall
- func (c *RoomsConversationsMessagesCall) Context(ctx context.Context) *RoomsConversationsMessagesCall
- func (c *RoomsConversationsMessagesCall) Do(opts ...googleapi.CallOption) (*Message, error)
- func (c *RoomsConversationsMessagesCall) Fields(s ...googleapi.Field) *RoomsConversationsMessagesCall
- func (c *RoomsConversationsMessagesCall) Header() http.Header
- func (c *RoomsConversationsMessagesCall) ThreadKey(threadKey string) *RoomsConversationsMessagesCall
- type RoomsConversationsService
- type RoomsMessagesCall
- func (c *RoomsMessagesCall) Context(ctx context.Context) *RoomsMessagesCall
- func (c *RoomsMessagesCall) Do(opts ...googleapi.CallOption) (*Message, error)
- func (c *RoomsMessagesCall) Fields(s ...googleapi.Field) *RoomsMessagesCall
- func (c *RoomsMessagesCall) Header() http.Header
- func (c *RoomsMessagesCall) ThreadKey(threadKey string) *RoomsMessagesCall
- type RoomsService
- type RoomsWebhooksCall
- func (c *RoomsWebhooksCall) Context(ctx context.Context) *RoomsWebhooksCall
- func (c *RoomsWebhooksCall) Do(opts ...googleapi.CallOption) (*Message, error)
- func (c *RoomsWebhooksCall) Fields(s ...googleapi.Field) *RoomsWebhooksCall
- func (c *RoomsWebhooksCall) Header() http.Header
- func (c *RoomsWebhooksCall) ThreadKey(threadKey string) *RoomsWebhooksCall
- type Section
- type Service
- type SlashCommand
- type SlashCommandMetadata
- type Space
- type SpacesGetCall
- func (c *SpacesGetCall) Context(ctx context.Context) *SpacesGetCall
- func (c *SpacesGetCall) Do(opts ...googleapi.CallOption) (*Space, error)
- func (c *SpacesGetCall) Fields(s ...googleapi.Field) *SpacesGetCall
- func (c *SpacesGetCall) Header() http.Header
- func (c *SpacesGetCall) IfNoneMatch(entityTag string) *SpacesGetCall
- type SpacesListCall
- func (c *SpacesListCall) Context(ctx context.Context) *SpacesListCall
- func (c *SpacesListCall) Do(opts ...googleapi.CallOption) (*ListSpacesResponse, error)
- func (c *SpacesListCall) Fields(s ...googleapi.Field) *SpacesListCall
- func (c *SpacesListCall) Header() http.Header
- func (c *SpacesListCall) IfNoneMatch(entityTag string) *SpacesListCall
- func (c *SpacesListCall) PageSize(pageSize int64) *SpacesListCall
- func (c *SpacesListCall) PageToken(pageToken string) *SpacesListCall
- func (c *SpacesListCall) Pages(ctx context.Context, f func(*ListSpacesResponse) error) error
- type SpacesMembersGetCall
- func (c *SpacesMembersGetCall) Context(ctx context.Context) *SpacesMembersGetCall
- func (c *SpacesMembersGetCall) Do(opts ...googleapi.CallOption) (*Membership, error)
- func (c *SpacesMembersGetCall) Fields(s ...googleapi.Field) *SpacesMembersGetCall
- func (c *SpacesMembersGetCall) Header() http.Header
- func (c *SpacesMembersGetCall) IfNoneMatch(entityTag string) *SpacesMembersGetCall
- type SpacesMembersListCall
- func (c *SpacesMembersListCall) Context(ctx context.Context) *SpacesMembersListCall
- func (c *SpacesMembersListCall) Do(opts ...googleapi.CallOption) (*ListMembershipsResponse, error)
- func (c *SpacesMembersListCall) Fields(s ...googleapi.Field) *SpacesMembersListCall
- func (c *SpacesMembersListCall) Header() http.Header
- func (c *SpacesMembersListCall) IfNoneMatch(entityTag string) *SpacesMembersListCall
- func (c *SpacesMembersListCall) PageSize(pageSize int64) *SpacesMembersListCall
- func (c *SpacesMembersListCall) PageToken(pageToken string) *SpacesMembersListCall
- func (c *SpacesMembersListCall) Pages(ctx context.Context, f func(*ListMembershipsResponse) error) error
- type SpacesMembersService
- type SpacesMessagesAttachmentsGetCall
- func (c *SpacesMessagesAttachmentsGetCall) Context(ctx context.Context) *SpacesMessagesAttachmentsGetCall
- func (c *SpacesMessagesAttachmentsGetCall) Do(opts ...googleapi.CallOption) (*Attachment, error)
- func (c *SpacesMessagesAttachmentsGetCall) Fields(s ...googleapi.Field) *SpacesMessagesAttachmentsGetCall
- func (c *SpacesMessagesAttachmentsGetCall) Header() http.Header
- func (c *SpacesMessagesAttachmentsGetCall) IfNoneMatch(entityTag string) *SpacesMessagesAttachmentsGetCall
- type SpacesMessagesAttachmentsService
- type SpacesMessagesCreateCall
- func (c *SpacesMessagesCreateCall) Context(ctx context.Context) *SpacesMessagesCreateCall
- func (c *SpacesMessagesCreateCall) Do(opts ...googleapi.CallOption) (*Message, error)
- func (c *SpacesMessagesCreateCall) Fields(s ...googleapi.Field) *SpacesMessagesCreateCall
- func (c *SpacesMessagesCreateCall) Header() http.Header
- func (c *SpacesMessagesCreateCall) ThreadKey(threadKey string) *SpacesMessagesCreateCall
- type SpacesMessagesDeleteCall
- func (c *SpacesMessagesDeleteCall) Context(ctx context.Context) *SpacesMessagesDeleteCall
- func (c *SpacesMessagesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error)
- func (c *SpacesMessagesDeleteCall) Fields(s ...googleapi.Field) *SpacesMessagesDeleteCall
- func (c *SpacesMessagesDeleteCall) Header() http.Header
- type SpacesMessagesGetCall
- func (c *SpacesMessagesGetCall) Context(ctx context.Context) *SpacesMessagesGetCall
- func (c *SpacesMessagesGetCall) Do(opts ...googleapi.CallOption) (*Message, error)
- func (c *SpacesMessagesGetCall) Fields(s ...googleapi.Field) *SpacesMessagesGetCall
- func (c *SpacesMessagesGetCall) Header() http.Header
- func (c *SpacesMessagesGetCall) IfNoneMatch(entityTag string) *SpacesMessagesGetCall
- type SpacesMessagesService
- func (r *SpacesMessagesService) Create(parent string, message *Message) *SpacesMessagesCreateCall
- func (r *SpacesMessagesService) Delete(name string) *SpacesMessagesDeleteCall
- func (r *SpacesMessagesService) Get(name string) *SpacesMessagesGetCall
- func (r *SpacesMessagesService) Update(name string, message *Message) *SpacesMessagesUpdateCall
- type SpacesMessagesUpdateCall
- func (c *SpacesMessagesUpdateCall) Context(ctx context.Context) *SpacesMessagesUpdateCall
- func (c *SpacesMessagesUpdateCall) Do(opts ...googleapi.CallOption) (*Message, error)
- func (c *SpacesMessagesUpdateCall) Fields(s ...googleapi.Field) *SpacesMessagesUpdateCall
- func (c *SpacesMessagesUpdateCall) Header() http.Header
- func (c *SpacesMessagesUpdateCall) UpdateMask(updateMask string) *SpacesMessagesUpdateCall
- type SpacesService
- type SpacesWebhooksCall
- func (c *SpacesWebhooksCall) Context(ctx context.Context) *SpacesWebhooksCall
- func (c *SpacesWebhooksCall) Do(opts ...googleapi.CallOption) (*Message, error)
- func (c *SpacesWebhooksCall) Fields(s ...googleapi.Field) *SpacesWebhooksCall
- func (c *SpacesWebhooksCall) Header() http.Header
- func (c *SpacesWebhooksCall) ThreadKey(threadKey string) *SpacesWebhooksCall
- type TextButton
- type TextParagraph
- type Thread
- type User
- type UserMentionMetadata
- type WidgetMarkup
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 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 { // Type: The type of bot 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 bot's own message. (Only after // CARD_CLICKED events.) // "REQUEST_CONFIG" - Privately ask the user for additional auth or // config. Type string `json:"type,omitempty"` // Url: 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. "Type") to // unconditionally include in API requests. By default, fields with // empty 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:"-"` }
ActionResponse: Parameters that a bot can use to configure how it's response is posted.
func (*ActionResponse) MarshalJSON ¶
func (s *ActionResponse) 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 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. Bots 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. Bots 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 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 Hangouts 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 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 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 ¶
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 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 ¶
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 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 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 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 (/hangouts/chat/how-tos/cards-onclick) for // more information. Action *FormAction `json:"action,omitempty"` // ConfigCompleteRedirectUrl: The URL the bot 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 (/hangouts/chat/how-tos/auth-3p) for more information. ConfigCompleteRedirectUrl string `json:"configCompleteRedirectUrl,omitempty"` // EventTime: The timestamp indicating when the event was dispatched. EventTime string `json:"eventTime,omitempty"` // Message: The message that triggered the event, if applicable. Message *Message `json:"message,omitempty"` // Space: The room or DM in which the event occurred. Space *Space `json:"space,omitempty"` // ThreadKey: The bot-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 bots can use to verify if a request is // from Google. The token is randomly generated by Google, remains // static, and can be obtained from the Google Chat API configuration // page in the Cloud Console. Developers can revoke/regenerate it if // needed from the same page. 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 room or direct message. // "ADDED_TO_SPACE" - The bot was added to a room or DM. // "REMOVED_FROM_SPACE" - The bot was removed from a room or DM. // "CARD_CLICKED" - The bot'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 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 DmsConversationsMessagesCall ¶ added in v0.36.0
type DmsConversationsMessagesCall struct {
// contains filtered or unexported fields
}
func (*DmsConversationsMessagesCall) Context ¶ added in v0.36.0
func (c *DmsConversationsMessagesCall) Context(ctx context.Context) *DmsConversationsMessagesCall
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
func (c *DmsConversationsMessagesCall) Do(opts ...googleapi.CallOption) (*Message, error)
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
func (c *DmsConversationsMessagesCall) Fields(s ...googleapi.Field) *DmsConversationsMessagesCall
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
func (c *DmsConversationsMessagesCall) Header() http.Header
Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.
func (*DmsConversationsMessagesCall) ThreadKey ¶ added in v0.36.0
func (c *DmsConversationsMessagesCall) ThreadKey(threadKey string) *DmsConversationsMessagesCall
ThreadKey sets the optional parameter "threadKey": Opaque thread identifier string that can be specified to group messages into a single thread. If this is the first message with a given thread identifier, a new thread is created. Subsequent messages with the same thread identifier will be posted into the same thread. This relieves bots and webhooks from having to store the Hangouts Chat thread ID of a thread (created earlier by them) to post further updates to it. Has no effect if thread field, corresponding to an existing thread, is set in message.
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/AAAAMpdlehY.
type DmsMessagesCall ¶ added in v0.36.0
type DmsMessagesCall struct {
// contains filtered or unexported fields
}
func (*DmsMessagesCall) Context ¶ added in v0.36.0
func (c *DmsMessagesCall) Context(ctx context.Context) *DmsMessagesCall
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
func (c *DmsMessagesCall) Fields(s ...googleapi.Field) *DmsMessagesCall
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) ThreadKey ¶ added in v0.36.0
func (c *DmsMessagesCall) ThreadKey(threadKey string) *DmsMessagesCall
ThreadKey sets the optional parameter "threadKey": Opaque thread identifier string that can be specified to group messages into a single thread. If this is the first message with a given thread identifier, a new thread is created. Subsequent messages with the same thread identifier will be posted into the same thread. This relieves bots and webhooks from having to store the Hangouts Chat thread ID of a thread (created earlier by them) to post further updates to it. Has no effect if thread field, corresponding to an existing thread, is set in message.
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/AAAAMpdlehY.
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/AAAAMpdlehY.
type DmsWebhooksCall ¶ added in v0.37.0
type DmsWebhooksCall struct {
// contains filtered or unexported fields
}
func (*DmsWebhooksCall) Context ¶ added in v0.37.0
func (c *DmsWebhooksCall) Context(ctx context.Context) *DmsWebhooksCall
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
func (c *DmsWebhooksCall) Fields(s ...googleapi.Field) *DmsWebhooksCall
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) ThreadKey ¶ added in v0.37.0
func (c *DmsWebhooksCall) ThreadKey(threadKey string) *DmsWebhooksCall
ThreadKey sets the optional parameter "threadKey": Opaque thread identifier string that can be specified to group messages into a single thread. If this is the first message with a given thread identifier, a new thread is created. Subsequent messages with the same thread identifier will be posted into the same thread. This relieves bots and webhooks from having to store the Hangouts Chat thread ID of a thread (created earlier by them) to post further updates to it. Has no effect if thread field, corresponding to an existing thread, is set in message.
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 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); } The JSON representation for `Empty` is empty JSON object `{}`.
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 bot 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 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 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 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 (*Image) UnmarshalJSON ¶
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 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 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 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 ¶
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 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 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 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 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
type MediaDownloadCall ¶ added in v0.30.0
type MediaDownloadCall struct {
// contains filtered or unexported fields
}
func (*MediaDownloadCall) Context ¶ added in v0.30.0
func (c *MediaDownloadCall) Context(ctx context.Context) *MediaDownloadCall
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
func (c *MediaDownloadCall) Fields(s ...googleapi.Field) *MediaDownloadCall
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: The creation time of the membership a.k.a the time at // which the member joined the space, if applicable. CreateTime string `json:"createTime,omitempty"` // Member: A User in Hangout Chat Member *User `json:"member,omitempty"` Name string `json:"name,omitempty"` // State: 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 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 Hangouts Chat.
func (*Membership) MarshalJSON ¶
func (s *Membership) MarshalJSON() ([]byte, error)
type Message ¶
type Message struct { // ActionResponse: Input only. Parameters that a bot 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 bot 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"` // CreateTime: Output only. The time at which the message was created in // Hangouts 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"` Name string `json:"name,omitempty"` // PreviewText: Text for generating preview chips. This text will not be // displayed to the user, but any links to images, web pages, videos, // etc. included here will generate preview chips. PreviewText string `json:"previewText,omitempty"` // Sender: The user who created the message. Sender *User `json:"sender,omitempty"` // SlashCommand: 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. 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 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 Hangouts Chat.
func (*Message) MarshalJSON ¶
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 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 ¶
type OpenLink ¶
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 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 ¶
type RoomsConversationsMessagesCall ¶ added in v0.36.0
type RoomsConversationsMessagesCall struct {
// contains filtered or unexported fields
}
func (*RoomsConversationsMessagesCall) Context ¶ added in v0.36.0
func (c *RoomsConversationsMessagesCall) Context(ctx context.Context) *RoomsConversationsMessagesCall
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
func (c *RoomsConversationsMessagesCall) Do(opts ...googleapi.CallOption) (*Message, error)
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
func (c *RoomsConversationsMessagesCall) Fields(s ...googleapi.Field) *RoomsConversationsMessagesCall
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
func (c *RoomsConversationsMessagesCall) Header() http.Header
Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.
func (*RoomsConversationsMessagesCall) ThreadKey ¶ added in v0.36.0
func (c *RoomsConversationsMessagesCall) ThreadKey(threadKey string) *RoomsConversationsMessagesCall
ThreadKey sets the optional parameter "threadKey": Opaque thread identifier string that can be specified to group messages into a single thread. If this is the first message with a given thread identifier, a new thread is created. Subsequent messages with the same thread identifier will be posted into the same thread. This relieves bots and webhooks from having to store the Hangouts Chat thread ID of a thread (created earlier by them) to post further updates to it. Has no effect if thread field, corresponding to an existing thread, is set in message.
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
func (r *RoomsConversationsService) Messages(parent string, message *Message) *RoomsConversationsMessagesCall
Messages: Legacy path for creating message. Calling these will result in a BadRequest response.
- parent: Space resource name, in the form "spaces/*". Example: spaces/AAAAMpdlehY.
type RoomsMessagesCall ¶ added in v0.36.0
type RoomsMessagesCall struct {
// contains filtered or unexported fields
}
func (*RoomsMessagesCall) Context ¶ added in v0.36.0
func (c *RoomsMessagesCall) Context(ctx context.Context) *RoomsMessagesCall
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
func (c *RoomsMessagesCall) Fields(s ...googleapi.Field) *RoomsMessagesCall
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) ThreadKey ¶ added in v0.36.0
func (c *RoomsMessagesCall) ThreadKey(threadKey string) *RoomsMessagesCall
ThreadKey sets the optional parameter "threadKey": Opaque thread identifier string that can be specified to group messages into a single thread. If this is the first message with a given thread identifier, a new thread is created. Subsequent messages with the same thread identifier will be posted into the same thread. This relieves bots and webhooks from having to store the Hangouts Chat thread ID of a thread (created earlier by them) to post further updates to it. Has no effect if thread field, corresponding to an existing thread, is set in message.
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/AAAAMpdlehY.
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/AAAAMpdlehY.
type RoomsWebhooksCall ¶ added in v0.37.0
type RoomsWebhooksCall struct {
// contains filtered or unexported fields
}
func (*RoomsWebhooksCall) Context ¶ added in v0.37.0
func (c *RoomsWebhooksCall) Context(ctx context.Context) *RoomsWebhooksCall
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
func (c *RoomsWebhooksCall) Fields(s ...googleapi.Field) *RoomsWebhooksCall
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) ThreadKey ¶ added in v0.37.0
func (c *RoomsWebhooksCall) ThreadKey(threadKey string) *RoomsWebhooksCall
ThreadKey sets the optional parameter "threadKey": Opaque thread identifier string that can be specified to group messages into a single thread. If this is the first message with a given thread identifier, a new thread is created. Subsequent messages with the same thread identifier will be posted into the same thread. This relieves bots and webhooks from having to store the Hangouts Chat thread ID of a thread (created earlier by them) to post further updates to it. Has no effect if thread field, corresponding to an existing thread, is set in message.
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 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 ¶
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
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
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 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 in 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 bot 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 bot 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 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: Output only. The display name (only if the space is a // room). Please note that this field might not be populated in direct // messages between humans. DisplayName string `json:"displayName,omitempty"` // Name: Resource name of the space, in the form "spaces/*". Example: // spaces/AAAAMpdlehYs Name string `json:"name,omitempty"` // SingleUserBotDm: Whether the space is a DM between a bot and a single // human. SingleUserBotDm bool `json:"singleUserBotDm,omitempty"` // Threaded: Whether the messages are threaded in this space. Threaded bool `json:"threaded,omitempty"` // Type: Output only. The type of a space. This is deprecated. Use // `single_user_bot_dm` instead. // // Possible values: // "TYPE_UNSPECIFIED" // "ROOM" - Multi-user spaces such as rooms and DMs between humans. // "DM" - 1:1 Direct Message between a human and a bot, where all // messages are flat. 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 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 room or DM in Hangouts Chat.
func (*Space) MarshalJSON ¶
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 ¶
func (c *SpacesListCall) Do(opts ...googleapi.CallOption) (*ListSpacesResponse, error)
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 ¶
func (c *SpacesMembersGetCall) Context(ctx context.Context) *SpacesMembersGetCall
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 ¶
func (c *SpacesMembersGetCall) Do(opts ...googleapi.CallOption) (*Membership, error)
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 ¶
func (c *SpacesMembersGetCall) Fields(s ...googleapi.Field) *SpacesMembersGetCall
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 ¶
func (c *SpacesMembersListCall) Context(ctx context.Context) *SpacesMembersListCall
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 ¶
func (c *SpacesMembersListCall) Do(opts ...googleapi.CallOption) (*ListMembershipsResponse, error)
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 ¶
func (c *SpacesMembersListCall) Fields(s ...googleapi.Field) *SpacesMembersListCall
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 ¶
func (c *SpacesMembersListCall) Pages(ctx context.Context, f func(*ListMembershipsResponse) 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 SpacesMembersService ¶
type SpacesMembersService struct {
// contains filtered or unexported fields
}
func NewSpacesMembersService ¶
func NewSpacesMembersService(s *Service) *SpacesMembersService
func (*SpacesMembersService) Get ¶
func (r *SpacesMembersService) Get(name string) *SpacesMembersGetCall
Get: Returns a membership.
- name: Resource name of the membership to be retrieved, in the form "spaces/*/members/*". Example: spaces/AAAAMpdlehY/members/105115627578887013105.
func (*SpacesMembersService) List ¶
func (r *SpacesMembersService) List(parent string) *SpacesMembersListCall
List: Lists human memberships in a space.
- parent: The resource name of the space for which membership list is to be fetched, in the form "spaces/*". Example: spaces/AAAAMpdlehY.
type SpacesMessagesAttachmentsGetCall ¶ added in v0.30.0
type SpacesMessagesAttachmentsGetCall struct {
// contains filtered or unexported fields
}
func (*SpacesMessagesAttachmentsGetCall) Context ¶ added in v0.30.0
func (c *SpacesMessagesAttachmentsGetCall) Context(ctx context.Context) *SpacesMessagesAttachmentsGetCall
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
func (c *SpacesMessagesAttachmentsGetCall) Do(opts ...googleapi.CallOption) (*Attachment, error)
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
func (c *SpacesMessagesAttachmentsGetCall) Fields(s ...googleapi.Field) *SpacesMessagesAttachmentsGetCall
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
func (c *SpacesMessagesAttachmentsGetCall) Header() http.Header
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
func (c *SpacesMessagesAttachmentsGetCall) IfNoneMatch(entityTag string) *SpacesMessagesAttachmentsGetCall
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
func (r *SpacesMessagesAttachmentsService) Get(name string) *SpacesMessagesAttachmentsGetCall
Get: Gets the metadata of a message attachment. The attachment data is fetched using the media API.
- 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 ¶
func (c *SpacesMessagesCreateCall) Context(ctx context.Context) *SpacesMessagesCreateCall
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 ¶
func (c *SpacesMessagesCreateCall) Do(opts ...googleapi.CallOption) (*Message, error)
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 ¶
func (c *SpacesMessagesCreateCall) Fields(s ...googleapi.Field) *SpacesMessagesCreateCall
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) ThreadKey ¶
func (c *SpacesMessagesCreateCall) ThreadKey(threadKey string) *SpacesMessagesCreateCall
ThreadKey sets the optional parameter "threadKey": Opaque thread identifier string that can be specified to group messages into a single thread. If this is the first message with a given thread identifier, a new thread is created. Subsequent messages with the same thread identifier will be posted into the same thread. This relieves bots and webhooks from having to store the Hangouts Chat thread ID of a thread (created earlier by them) to post further updates to it. Has no effect if thread field, corresponding to an existing thread, is set in message.
type SpacesMessagesDeleteCall ¶
type SpacesMessagesDeleteCall struct {
// contains filtered or unexported fields
}
func (*SpacesMessagesDeleteCall) Context ¶
func (c *SpacesMessagesDeleteCall) Context(ctx context.Context) *SpacesMessagesDeleteCall
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 ¶
func (c *SpacesMessagesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error)
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 ¶
func (c *SpacesMessagesDeleteCall) Fields(s ...googleapi.Field) *SpacesMessagesDeleteCall
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 ¶
func (c *SpacesMessagesGetCall) Context(ctx context.Context) *SpacesMessagesGetCall
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 ¶
func (c *SpacesMessagesGetCall) Do(opts ...googleapi.CallOption) (*Message, error)
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 ¶
func (c *SpacesMessagesGetCall) Fields(s ...googleapi.Field) *SpacesMessagesGetCall
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.
- parent: Space resource name, in the form "spaces/*". Example: spaces/AAAAMpdlehY.
func (*SpacesMessagesService) Delete ¶
func (r *SpacesMessagesService) Delete(name string) *SpacesMessagesDeleteCall
Delete: Deletes a message.
- name: Resource name of the message to be deleted, in the form "spaces/*/messages/*" Example: spaces/AAAAMpdlehY/messages/UMxbHmzDlr4.UMxbHmzDlr4.
func (*SpacesMessagesService) Get ¶
func (r *SpacesMessagesService) Get(name string) *SpacesMessagesGetCall
Get: Returns a message.
- name: Resource name of the message to be retrieved, in the form "spaces/*/messages/*". Example: spaces/AAAAMpdlehY/messages/UMxbHmzDlr4.UMxbHmzDlr4.
func (*SpacesMessagesService) Update ¶
func (r *SpacesMessagesService) Update(name string, message *Message) *SpacesMessagesUpdateCall
Update: Updates a message.
- name: .
type SpacesMessagesUpdateCall ¶
type SpacesMessagesUpdateCall struct {
// contains filtered or unexported fields
}
func (*SpacesMessagesUpdateCall) Context ¶
func (c *SpacesMessagesUpdateCall) Context(ctx context.Context) *SpacesMessagesUpdateCall
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 ¶
func (c *SpacesMessagesUpdateCall) Do(opts ...googleapi.CallOption) (*Message, error)
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 ¶
func (c *SpacesMessagesUpdateCall) Fields(s ...googleapi.Field) *SpacesMessagesUpdateCall
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 be updated, comma separated if there are multiple. Currently supported field paths: * text * cards
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.
- name: Resource name of the space, in the form "spaces/*". Example: spaces/AAAAMpdlehY.
func (*SpacesService) List ¶
func (r *SpacesService) List() *SpacesListCall
List: Lists spaces the caller is a member of.
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/AAAAMpdlehY.
type SpacesWebhooksCall ¶ added in v0.37.0
type SpacesWebhooksCall struct {
// contains filtered or unexported fields
}
func (*SpacesWebhooksCall) Context ¶ added in v0.37.0
func (c *SpacesWebhooksCall) Context(ctx context.Context) *SpacesWebhooksCall
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
func (c *SpacesWebhooksCall) Do(opts ...googleapi.CallOption) (*Message, error)
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
func (c *SpacesWebhooksCall) Fields(s ...googleapi.Field) *SpacesWebhooksCall
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) ThreadKey ¶ added in v0.37.0
func (c *SpacesWebhooksCall) ThreadKey(threadKey string) *SpacesWebhooksCall
ThreadKey sets the optional parameter "threadKey": Opaque thread identifier string that can be specified to group messages into a single thread. If this is the first message with a given thread identifier, a new thread is created. Subsequent messages with the same thread identifier will be posted into the same thread. This relieves bots and webhooks from having to store the Hangouts Chat thread ID of a thread (created earlier by them) to post further updates to it. Has no effect if thread field, corresponding to an existing thread, is set in message.
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 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 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/AAAAMpdlehY/threads/UMxbHmzDlr4 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 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 Hangouts Chat.
func (*Thread) MarshalJSON ¶
type User ¶
type User struct { // DisplayName: The user's display name. DisplayName string `json:"displayName,omitempty"` // DomainId: Obfuscated domain information. DomainId string `json:"domainId,omitempty"` // IsAnonymous: True when the user is deleted or the user's profile is // not visible. IsAnonymous bool `json:"isAnonymous,omitempty"` // Name: Resource name, in the format "users/*". Name string `json:"name,omitempty"` // Type: User type. // // Possible values: // "TYPE_UNSPECIFIED" - Default value for the enum. DO NOT USE. // "HUMAN" - Human user. // "BOT" - Bot 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 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 ¶
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 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 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)