Skip to content

Commit b74ec0e

Browse files
feat: [google-apps-chat] Exposing 1p integration message content (drive, calendar, huddle, meet chips) (#14126)
- [ ] Regenerate this pull request now. BEGIN_COMMIT_OVERRIDE feat: Exposing 1p integration message content (drive, calendar, huddle, meet chips) docs: Update reference documentation for annotations. Introduce new richlink metadata types END_COMMIT_OVERRIDE PiperOrigin-RevId: 785870918 Source-Link: googleapis/googleapis@31c2593 Source-Link: googleapis/googleapis-gen@0daa0c8 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWFwcHMtY2hhdC8uT3dsQm90LnlhbWwiLCJoIjoiMGRhYTBjODY3NDRiNDlhMWVlNmExNDllMTAxYmNlY2UxOWRhNmE5NCJ9 --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent ad84308 commit b74ec0e

File tree

9 files changed

+168
-9
lines changed

9 files changed

+168
-9
lines changed

packages/google-apps-chat/google/apps/chat/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,11 @@
2626
from google.apps.chat_v1.types.annotation import (
2727
Annotation,
2828
AnnotationType,
29+
CalendarEventLinkData,
2930
ChatSpaceLinkData,
3031
CustomEmojiMetadata,
3132
DriveLinkData,
33+
MeetSpaceLinkData,
3234
RichLinkMetadata,
3335
SlashCommandMetadata,
3436
UserMentionMetadata,
@@ -151,9 +153,11 @@
151153
"ChatServiceAsyncClient",
152154
"ActionStatus",
153155
"Annotation",
156+
"CalendarEventLinkData",
154157
"ChatSpaceLinkData",
155158
"CustomEmojiMetadata",
156159
"DriveLinkData",
160+
"MeetSpaceLinkData",
157161
"RichLinkMetadata",
158162
"SlashCommandMetadata",
159163
"UserMentionMetadata",

packages/google-apps-chat/google/apps/chat/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "0.2.6" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-apps-chat/google/apps/chat_v1/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@
2323
from .types.annotation import (
2424
Annotation,
2525
AnnotationType,
26+
CalendarEventLinkData,
2627
ChatSpaceLinkData,
2728
CustomEmojiMetadata,
2829
DriveLinkData,
30+
MeetSpaceLinkData,
2931
RichLinkMetadata,
3032
SlashCommandMetadata,
3133
UserMentionMetadata,
@@ -150,6 +152,7 @@
150152
"AttachedGif",
151153
"Attachment",
152154
"AttachmentDataRef",
155+
"CalendarEventLinkData",
153156
"CardWithId",
154157
"ChatServiceClient",
155158
"ChatSpaceLinkData",
@@ -200,6 +203,7 @@
200203
"ListSpacesRequest",
201204
"ListSpacesResponse",
202205
"MatchedUrl",
206+
"MeetSpaceLinkData",
203207
"Membership",
204208
"MembershipBatchCreatedEventData",
205209
"MembershipBatchDeletedEventData",

packages/google-apps-chat/google/apps/chat_v1/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "0.2.6" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-apps-chat/google/apps/chat_v1/types/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@
1717
from .annotation import (
1818
Annotation,
1919
AnnotationType,
20+
CalendarEventLinkData,
2021
ChatSpaceLinkData,
2122
CustomEmojiMetadata,
2223
DriveLinkData,
24+
MeetSpaceLinkData,
2325
RichLinkMetadata,
2426
SlashCommandMetadata,
2527
UserMentionMetadata,
@@ -137,9 +139,11 @@
137139
__all__ = (
138140
"ActionStatus",
139141
"Annotation",
142+
"CalendarEventLinkData",
140143
"ChatSpaceLinkData",
141144
"CustomEmojiMetadata",
142145
"DriveLinkData",
146+
"MeetSpaceLinkData",
143147
"RichLinkMetadata",
144148
"SlashCommandMetadata",
145149
"UserMentionMetadata",

packages/google-apps-chat/google/apps/chat_v1/types/annotation.py

Lines changed: 131 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
"CustomEmojiMetadata",
3434
"DriveLinkData",
3535
"ChatSpaceLinkData",
36+
"MeetSpaceLinkData",
37+
"CalendarEventLinkData",
3638
},
3739
)
3840

@@ -60,8 +62,10 @@ class AnnotationType(proto.Enum):
6062

6163

6264
class Annotation(proto.Message):
63-
r"""Output only. Annotations associated with the plain-text body of the
64-
message. To add basic formatting to a text message, see `Format text
65+
r"""Output only. Annotations can be associated with the plain-text body
66+
of the message or with chips that link to Google Workspace resources
67+
like Google Docs or Sheets with ``start_index`` and ``length`` of 0.
68+
To add basic formatting to a text message, see `Format text
6569
messages <https://developers.google.com/workspace/chat/format-messages>`__.
6670
6771
Example plain-text message body:
@@ -107,7 +111,8 @@ class Annotation(proto.Message):
107111
This field is a member of `oneof`_ ``_start_index``.
108112
length (int):
109113
Length of the substring in the plain-text
110-
message body this annotation corresponds to.
114+
message body this annotation corresponds to. If
115+
not present, indicates a length of 0.
111116
user_mention (google.apps.chat_v1.types.UserMentionMetadata):
112117
The metadata of user mention.
113118
@@ -260,7 +265,10 @@ class Type(proto.Enum):
260265

261266

262267
class RichLinkMetadata(proto.Message):
263-
r"""A rich link to a resource.
268+
r"""A rich link to a resource. Rich links can be associated with the
269+
plain-text body of the message or represent chips that link to
270+
Google Workspace resources like Google Docs or Sheets with
271+
``start_index`` and ``length`` of 0.
264272
265273
This message has `oneof`_ fields (mutually exclusive fields).
266274
For each oneof, at most one member field can be set at the same time.
@@ -281,6 +289,14 @@ class RichLinkMetadata(proto.Message):
281289
chat_space_link_data (google.apps.chat_v1.types.ChatSpaceLinkData):
282290
Data for a chat space link.
283291
292+
This field is a member of `oneof`_ ``data``.
293+
meet_space_link_data (google.apps.chat_v1.types.MeetSpaceLinkData):
294+
Data for a Meet space link.
295+
296+
This field is a member of `oneof`_ ``data``.
297+
calendar_event_link_data (google.apps.chat_v1.types.CalendarEventLinkData):
298+
Data for a Calendar event link.
299+
284300
This field is a member of `oneof`_ ``data``.
285301
"""
286302

@@ -295,10 +311,18 @@ class RichLinkType(proto.Enum):
295311
CHAT_SPACE (2):
296312
A Chat space rich link type. For example, a
297313
space smart chip.
314+
MEET_SPACE (4):
315+
A Meet message rich link type. For example, a
316+
Meet chip.
317+
CALENDAR_EVENT (5):
318+
A Calendar message rich link type. For
319+
example, a Calendar chip.
298320
"""
299321
RICH_LINK_TYPE_UNSPECIFIED = 0
300322
DRIVE_FILE = 1
301323
CHAT_SPACE = 2
324+
MEET_SPACE = 4
325+
CALENDAR_EVENT = 5
302326

303327
uri: str = proto.Field(
304328
proto.STRING,
@@ -321,6 +345,18 @@ class RichLinkType(proto.Enum):
321345
oneof="data",
322346
message="ChatSpaceLinkData",
323347
)
348+
meet_space_link_data: "MeetSpaceLinkData" = proto.Field(
349+
proto.MESSAGE,
350+
number=5,
351+
oneof="data",
352+
message="MeetSpaceLinkData",
353+
)
354+
calendar_event_link_data: "CalendarEventLinkData" = proto.Field(
355+
proto.MESSAGE,
356+
number=6,
357+
oneof="data",
358+
message="CalendarEventLinkData",
359+
)
324360

325361

326362
class CustomEmojiMetadata(proto.Message):
@@ -394,4 +430,95 @@ class ChatSpaceLinkData(proto.Message):
394430
)
395431

396432

433+
class MeetSpaceLinkData(proto.Message):
434+
r"""Data for Meet space links.
435+
436+
Attributes:
437+
meeting_code (str):
438+
Meeting code of the linked Meet space.
439+
type_ (google.apps.chat_v1.types.MeetSpaceLinkData.Type):
440+
Indicates the type of the Meet space.
441+
huddle_status (google.apps.chat_v1.types.MeetSpaceLinkData.HuddleStatus):
442+
Optional. Output only. If the Meet is a
443+
Huddle, indicates the status of the huddle.
444+
Otherwise, this is unset.
445+
"""
446+
447+
class Type(proto.Enum):
448+
r"""The type of the Meet space.
449+
450+
Values:
451+
TYPE_UNSPECIFIED (0):
452+
Default value for the enum. Don't use.
453+
MEETING (1):
454+
The Meet space is a meeting.
455+
HUDDLE (2):
456+
The Meet space is a huddle.
457+
"""
458+
TYPE_UNSPECIFIED = 0
459+
MEETING = 1
460+
HUDDLE = 2
461+
462+
class HuddleStatus(proto.Enum):
463+
r"""The status of the huddle
464+
465+
Values:
466+
HUDDLE_STATUS_UNSPECIFIED (0):
467+
Default value for the enum. Don't use.
468+
STARTED (1):
469+
The huddle has started.
470+
ENDED (2):
471+
The huddle has ended. In this case the Meet
472+
space URI and identifiers will no longer be
473+
valid.
474+
MISSED (3):
475+
The huddle has been missed. In this case the
476+
Meet space URI and identifiers will no longer be
477+
valid.
478+
"""
479+
HUDDLE_STATUS_UNSPECIFIED = 0
480+
STARTED = 1
481+
ENDED = 2
482+
MISSED = 3
483+
484+
meeting_code: str = proto.Field(
485+
proto.STRING,
486+
number=1,
487+
)
488+
type_: Type = proto.Field(
489+
proto.ENUM,
490+
number=2,
491+
enum=Type,
492+
)
493+
huddle_status: HuddleStatus = proto.Field(
494+
proto.ENUM,
495+
number=3,
496+
enum=HuddleStatus,
497+
)
498+
499+
500+
class CalendarEventLinkData(proto.Message):
501+
r"""Data for Calendar event links.
502+
503+
Attributes:
504+
calendar_id (str):
505+
The `Calendar
506+
identifier <https://developers.google.com/workspace/calendar/api/v3/reference/calendars>`__
507+
of the linked Calendar.
508+
event_id (str):
509+
The `Event
510+
identifier <https://developers.google.com/workspace/calendar/api/v3/reference/events>`__
511+
of the linked Calendar event.
512+
"""
513+
514+
calendar_id: str = proto.Field(
515+
proto.STRING,
516+
number=1,
517+
)
518+
event_id: str = proto.Field(
519+
proto.STRING,
520+
number=2,
521+
)
522+
523+
397524
__all__ = tuple(sorted(__protobuf__.manifest))

packages/google-apps-chat/google/apps/chat_v1/types/message.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,10 @@ class Message(proto.Message):
161161
`Card
162162
builder <https://addons.gsuite.google.com/uikit/builder>`__
163163
annotations (MutableSequence[google.apps.chat_v1.types.Annotation]):
164-
Output only. Annotations associated with the ``text`` in
165-
this message.
164+
Output only. Annotations can be associated with the
165+
plain-text body of the message or with chips that link to
166+
Google Workspace resources like Google Docs or Sheets with
167+
``start_index`` and ``length`` of 0.
166168
thread (google.apps.chat_v1.types.Thread):
167169
The thread the message belongs to. For example usage, see
168170
`Start or reply to a message

packages/google-apps-chat/samples/generated_samples/snippet_metadata_google.chat.v1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-apps-chat",
11-
"version": "0.2.6"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

packages/google-apps-chat/tests/unit/gapic/chat_v1/test_chat_service.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22186,6 +22186,15 @@ def test_create_message_rest_call_success(request_type):
2218622186
"thread": "thread_value",
2218722187
"message": "message_value",
2218822188
},
22189+
"meet_space_link_data": {
22190+
"meeting_code": "meeting_code_value",
22191+
"type_": 1,
22192+
"huddle_status": 1,
22193+
},
22194+
"calendar_event_link_data": {
22195+
"calendar_id": "calendar_id_value",
22196+
"event_id": "event_id_value",
22197+
},
2218922198
},
2219022199
"custom_emoji_metadata": {
2219122200
"custom_emoji": {
@@ -23302,6 +23311,15 @@ def test_update_message_rest_call_success(request_type):
2330223311
"thread": "thread_value",
2330323312
"message": "message_value",
2330423313
},
23314+
"meet_space_link_data": {
23315+
"meeting_code": "meeting_code_value",
23316+
"type_": 1,
23317+
"huddle_status": 1,
23318+
},
23319+
"calendar_event_link_data": {
23320+
"calendar_id": "calendar_id_value",
23321+
"event_id": "event_id_value",
23322+
},
2330523323
},
2330623324
"custom_emoji_metadata": {
2330723325
"custom_emoji": {

0 commit comments

Comments
 (0)