@maxim_mazurok/gapi.client.chat-v1 0.3.20260723 → 0.3.20260726
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +88 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
// This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
|
|
10
10
|
// In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
|
|
11
11
|
// Generated from: https://chat.googleapis.com/$discovery/rest?version=v1
|
|
12
|
-
// Revision:
|
|
12
|
+
// Revision: 20260726
|
|
13
13
|
|
|
14
14
|
/// <reference types="gapi.client" />
|
|
15
15
|
|
|
@@ -1442,6 +1442,35 @@ declare namespace gapi.client {
|
|
|
1442
1442
|
/** The URI of this link. */
|
|
1443
1443
|
uri?: string;
|
|
1444
1444
|
}
|
|
1445
|
+
interface SearchMessageResult {
|
|
1446
|
+
/** The matched message. */
|
|
1447
|
+
message?: Message;
|
|
1448
|
+
/** Indicates if the matched message is read by the calling user. Only returned if the request view is `SEARCH_MESSAGES_VIEW_FULL` and the calling credentials include one of the following [authorization scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - `https://www.googleapis.com/auth/chat.users.readstate.readonly` - `https://www.googleapis.com/auth/chat.users.readstate` */
|
|
1449
|
+
read?: boolean;
|
|
1450
|
+
/** The mute setting of the calling user for the space where the message is posted. The caller app can use this information to decide how to process the message depending on whether the space is muted for the user or not. Only returned if the request view is `SEARCH_MESSAGES_VIEW_FULL` and the calling credentials include the following [authorization scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - `https://www.googleapis.com/auth/chat.users.spacesettings` */
|
|
1451
|
+
spaceMuteSetting?: 'MUTE_SETTING_UNSPECIFIED' | 'UNMUTED' | 'MUTED';
|
|
1452
|
+
}
|
|
1453
|
+
interface SearchMessagesRequest {
|
|
1454
|
+
/** Required. A search query. The query can specify one or more search keywords, which are used to filter the results, You can also filter the results using the following message fields: - `create_time`: Accepts a timestamp in [RFC-3339](https://www.rfc-editor.org/rfc/rfc3339) format and the supported comparison operators are: `<` and `>=`. - `sender.name`: The resource name of the sender (`users/{user}`). Only supports `=`. You can use the e-mail as an alias for `{user}`. For example, `users/example@gmail.com`, where `example@gmail.com` is the e-mail of the Google Chat user. - `space.name`: The resource name of the space where the message is posted. (`spaces/{space}`). Only supports `=`. If this filter is not set, the search is performed across all direct messages and spaces the user has access to as a space member. - `space.display_name`: Supports the operator `:` (has) and filters spaces based on a partial match of their display name. Results are limited to the top five space matches. For example, `space.display_name:Project` searches for messages in the top five spaces that contain the word "Project" in their display names. - `attachment`: Supports the operator `:*` (has any) to check for the presence of attachments. If `attachment:*` is specified, only messages that have at least one attachment are returned. - `annotations.user_mentions.user.name`: The resource name of the mentioned user (`users/{user}`). Only supports `:` (has). For example: `annotations.user_mentions.user.name:"users/1234567890"` returns only messages that contain a mention to the specified user. Alternatively, the alias `me` can be used to filter for messages that mention the caller user, for example: `annotations.user_mentions.user.name:users/me`. You can also use the e-mail as an alias for `{user}`, for example, `users/example@gmail.com`. For advanced filtering, the following functions are also available: - `has_link()`: Returns only messages that have at least one hyperlink in the message text. - `is_unread()`: Filters out messages that have been read by the calling user. Using the `space.display_name` filter requires that the calling credentials include one of the following [authorization scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - `https://www.googleapis.com/auth/chat.spaces.readonly` - `https://www.googleapis.com/auth/chat.spaces` Using the `is_unread()` filter requires that the calling credentials include one of the following [authorization scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - `https://www.googleapis.com/auth/chat.users.readstate.readonly` - `https://www.googleapis.com/auth/chat.users.readstate` Across different fields, only `AND` operators are supported. A valid example is `sender.name = "users/1234567890" AND is_unread()`. The word `AND` is optional and is implied if omitted. For example, `sender.name = "users/1234567890" is_unread()` is valid and is equivalent to the previous example. An invalid example is `sender.name = "users/1234567890" OR is_unread()` because `OR` is not supported between different fields. Among the same field: - `create_time` supports only `AND`, and can only be used to represent an interval, such as `create_time >= "2022-01-01T00:00:00+00:00" AND create_time < "2023-01-01T00:00:00+00:00"`. - `sender.name` supports only the `OR` operator, for example: `sender.name = "users/1234567890" OR sender.name = "users/0987654321"`. - `space.name` supports only the `OR` operator, for example: `space.name = "spaces/ABCDEFGH" OR space.name = "spaces/QWERTYUI"`. - `space.display_name` supports the operators `AND` and `OR`, but not a mix of both. For example: `space.display_name:Project AND space.display_name:Tasks` returns messages that are in spaces with display names containing both `Project` and `Tasks`, whereas `space.display_name:Project OR space.display_name:Tasks` returns messages that are in spaces with display names containing either `Project` or `Tasks` or both. - `annotations.user_mentions.user.name` supports the operators `AND` and `OR`, but not a mix of both. For example: `annotations.user_mentions.user.name:"users/1234567890" AND annotations.user_mentions.user.name:"users/0987654321"` returns only messages that mentions both users, whereas `annotations.user_mentions.user.name:"users/1234567890" OR annotations.user_mentions.user.name:"users/0987654321"` returns messages that mention either user or both. Parentheses are required to disambiguate operator precedence when combining `AND` and `OR` operators in the same query. For example: `(sender.name="users/me" OR sender.name="users/123456") AND is_unread()`. Otherwise, parentheses are optional. The following example queries are valid: ``` "Pending reports" AND create_time >= "2023-01-01T00:00:00Z" sender.name = "users/example@gmail.com" annotations.user_mentions.user.name:"users/0987654321" attachment:* AND space.name = "spaces/ABCDEFGH" tasks AND is_unread() AND sender.name = "users/1234567890" "things to do" "urgent" (sender.name = "users/1234567890") AND (create_time < "2023-05-01T00:00:00Z") tasks AND space.name = "spaces/ABCDEFGH" AND has_link() "project one" is_unread() space.display_name:Project tasks ``` The maximum query length is 1,000 characters. Invalid queries are rejected by the server with an `INVALID_ARGUMENT` error. */
|
|
1455
|
+
filter?: string;
|
|
1456
|
+
/** Optional. How the results list is ordered. Supported attributes to order by are: - `create_time`: Sorts the results by the time of the message creation. Default value. - `relevance`: Sorts the results by relevance. [Developer Preview](https://developers.google.com/workspace/preview). The default ordering is `create_time desc`. Only a single order per query (`create_time` or `relevance`) is supported. Only descending order (`desc`) is supported, and it must be specified after the order attribute. */
|
|
1457
|
+
orderBy?: string;
|
|
1458
|
+
/** Optional. The maximum number of results to return. The service may return fewer than this value. If unspecified, at most 25 are returned. The maximum value is 100. If you use a value more than 100, it's automatically changed to 100. */
|
|
1459
|
+
pageSize?: number;
|
|
1460
|
+
/** Optional. A token, received from the previous search messages call. Provide this parameter to retrieve the subsequent page. When paginating, all other parameters provided should match the call that provided the page token. Passing different values to the other parameters might lead to unexpected results. */
|
|
1461
|
+
pageToken?: string;
|
|
1462
|
+
/** Optional. Specifies what kind of search results view to return. The default is `SEARCH_MESSAGES_VIEW_BASIC`. */
|
|
1463
|
+
view?:
|
|
1464
|
+
| 'SEARCH_MESSAGES_VIEW_UNSPECIFIED'
|
|
1465
|
+
| 'SEARCH_MESSAGES_VIEW_BASIC'
|
|
1466
|
+
| 'SEARCH_MESSAGES_VIEW_FULL';
|
|
1467
|
+
}
|
|
1468
|
+
interface SearchMessagesResponse {
|
|
1469
|
+
/** A token that can be used to retrieve the next page. If this field is empty, there are no subsequent pages. */
|
|
1470
|
+
nextPageToken?: string;
|
|
1471
|
+
/** The list of search results that matched the query. */
|
|
1472
|
+
results?: SearchMessageResult[];
|
|
1473
|
+
}
|
|
1445
1474
|
interface SearchSpacesResponse {
|
|
1446
1475
|
/** A token that can be used to retrieve the next page. If this field is empty, there are no subsequent pages. */
|
|
1447
1476
|
nextPageToken?: string;
|
|
@@ -2571,6 +2600,64 @@ declare namespace gapi.client {
|
|
|
2571
2600
|
},
|
|
2572
2601
|
body: Message,
|
|
2573
2602
|
): Request<Message>;
|
|
2603
|
+
/** Searches for messages in Google Chat that the calling user has access to. Returns a list of messages matching the search criteria. To search across all spaces the user has access to, set `parent` to `spaces/-`. Using any other value for `parent` results in an `INVALID_ARGUMENT` error. The returned messages have their `name` field populated with the full resource name, which includes the specific `space` in which the message resides. This API doesn't return all message types. The types of messages listed below aren't included in the response. Use ListMessages to list all messages. - Private Messages that are visible to the authenticated user. - Messages posted by Chat apps in spaces or group chats. - Messages in a Chat app DM. - Messages from blocked users. - Messages in spaces that the caller has muted. Requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) with one of the following [authorization scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - `https://www.googleapis.com/auth/chat.messages.readonly` - `https://www.googleapis.com/auth/chat.messages` */
|
|
2604
|
+
search(request: {
|
|
2605
|
+
/** V1 error format. */
|
|
2606
|
+
'$.xgafv'?: '1' | '2';
|
|
2607
|
+
/** OAuth access token. */
|
|
2608
|
+
access_token?: string;
|
|
2609
|
+
/** Data format for response. */
|
|
2610
|
+
alt?: 'json' | 'media' | 'proto';
|
|
2611
|
+
/** JSONP */
|
|
2612
|
+
callback?: string;
|
|
2613
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
2614
|
+
fields?: string;
|
|
2615
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
2616
|
+
key?: string;
|
|
2617
|
+
/** OAuth 2.0 token for the current user. */
|
|
2618
|
+
oauth_token?: string;
|
|
2619
|
+
/** Required. The resource name of the space to search within. To search across all spaces the user has access to, set this field to `spaces/-`. Using any other value for `parent` results in an `INVALID_ARGUMENT` error. To limit the search to one or more spaces, use `space.name` or `space.display_name` in the `filter`. */
|
|
2620
|
+
parent: string;
|
|
2621
|
+
/** Returns response with indentations and line breaks. */
|
|
2622
|
+
prettyPrint?: boolean;
|
|
2623
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
2624
|
+
quotaUser?: string;
|
|
2625
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
2626
|
+
upload_protocol?: string;
|
|
2627
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
2628
|
+
uploadType?: string;
|
|
2629
|
+
/** Request body */
|
|
2630
|
+
resource: SearchMessagesRequest;
|
|
2631
|
+
}): Request<SearchMessagesResponse>;
|
|
2632
|
+
search(
|
|
2633
|
+
request: {
|
|
2634
|
+
/** V1 error format. */
|
|
2635
|
+
'$.xgafv'?: '1' | '2';
|
|
2636
|
+
/** OAuth access token. */
|
|
2637
|
+
access_token?: string;
|
|
2638
|
+
/** Data format for response. */
|
|
2639
|
+
alt?: 'json' | 'media' | 'proto';
|
|
2640
|
+
/** JSONP */
|
|
2641
|
+
callback?: string;
|
|
2642
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
2643
|
+
fields?: string;
|
|
2644
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
2645
|
+
key?: string;
|
|
2646
|
+
/** OAuth 2.0 token for the current user. */
|
|
2647
|
+
oauth_token?: string;
|
|
2648
|
+
/** Required. The resource name of the space to search within. To search across all spaces the user has access to, set this field to `spaces/-`. Using any other value for `parent` results in an `INVALID_ARGUMENT` error. To limit the search to one or more spaces, use `space.name` or `space.display_name` in the `filter`. */
|
|
2649
|
+
parent: string;
|
|
2650
|
+
/** Returns response with indentations and line breaks. */
|
|
2651
|
+
prettyPrint?: boolean;
|
|
2652
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
2653
|
+
quotaUser?: string;
|
|
2654
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
2655
|
+
upload_protocol?: string;
|
|
2656
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
2657
|
+
uploadType?: string;
|
|
2658
|
+
},
|
|
2659
|
+
body: SearchMessagesRequest,
|
|
2660
|
+
): Request<SearchMessagesResponse>;
|
|
2574
2661
|
/** Updates a message. There's a difference between the `patch` and `update` methods. The `patch` method uses a `patch` request while the `update` method uses a `put` request. We recommend using the `patch` method. For an example, see [Update a message](https://developers.google.com/workspace/chat/update-messages). Supports the following types of [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with the authorization scope: - `https://www.googleapis.com/auth/chat.bot` - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) with one of the following authorization scopes: - `https://www.googleapis.com/auth/chat.messages` - `https://www.googleapis.com/auth/chat.import` (import mode spaces only) When using app authentication, requests can only update messages created by the calling Chat app. */
|
|
2575
2662
|
update(request: {
|
|
2576
2663
|
/** V1 error format. */
|