@google-apps/chat 0.1.0 → 0.2.0

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.
@@ -26163,6 +26163,7 @@
26163
26163
  * @property {number|null} [length] Annotation length
26164
26164
  * @property {google.chat.v1.IUserMentionMetadata|null} [userMention] Annotation userMention
26165
26165
  * @property {google.chat.v1.ISlashCommandMetadata|null} [slashCommand] Annotation slashCommand
26166
+ * @property {google.chat.v1.IRichLinkMetadata|null} [richLinkMetadata] Annotation richLinkMetadata
26166
26167
  */
26167
26168
 
26168
26169
  /**
@@ -26220,6 +26221,14 @@
26220
26221
  */
26221
26222
  Annotation.prototype.slashCommand = null;
26222
26223
 
26224
+ /**
26225
+ * Annotation richLinkMetadata.
26226
+ * @member {google.chat.v1.IRichLinkMetadata|null|undefined} richLinkMetadata
26227
+ * @memberof google.chat.v1.Annotation
26228
+ * @instance
26229
+ */
26230
+ Annotation.prototype.richLinkMetadata = null;
26231
+
26223
26232
  // OneOf field names bound to virtual getters and setters
26224
26233
  var $oneOfFields;
26225
26234
 
@@ -26236,12 +26245,12 @@
26236
26245
 
26237
26246
  /**
26238
26247
  * Annotation metadata.
26239
- * @member {"userMention"|"slashCommand"|undefined} metadata
26248
+ * @member {"userMention"|"slashCommand"|"richLinkMetadata"|undefined} metadata
26240
26249
  * @memberof google.chat.v1.Annotation
26241
26250
  * @instance
26242
26251
  */
26243
26252
  Object.defineProperty(Annotation.prototype, "metadata", {
26244
- get: $util.oneOfGetter($oneOfFields = ["userMention", "slashCommand"]),
26253
+ get: $util.oneOfGetter($oneOfFields = ["userMention", "slashCommand", "richLinkMetadata"]),
26245
26254
  set: $util.oneOfSetter($oneOfFields)
26246
26255
  });
26247
26256
 
@@ -26279,6 +26288,8 @@
26279
26288
  $root.google.chat.v1.UserMentionMetadata.encode(message.userMention, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
26280
26289
  if (message.slashCommand != null && Object.hasOwnProperty.call(message, "slashCommand"))
26281
26290
  $root.google.chat.v1.SlashCommandMetadata.encode(message.slashCommand, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
26291
+ if (message.richLinkMetadata != null && Object.hasOwnProperty.call(message, "richLinkMetadata"))
26292
+ $root.google.chat.v1.RichLinkMetadata.encode(message.richLinkMetadata, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
26282
26293
  return writer;
26283
26294
  };
26284
26295
 
@@ -26333,6 +26344,10 @@
26333
26344
  message.slashCommand = $root.google.chat.v1.SlashCommandMetadata.decode(reader, reader.uint32());
26334
26345
  break;
26335
26346
  }
26347
+ case 6: {
26348
+ message.richLinkMetadata = $root.google.chat.v1.RichLinkMetadata.decode(reader, reader.uint32());
26349
+ break;
26350
+ }
26336
26351
  default:
26337
26352
  reader.skipType(tag & 7);
26338
26353
  break;
@@ -26376,6 +26391,7 @@
26376
26391
  case 0:
26377
26392
  case 1:
26378
26393
  case 2:
26394
+ case 3:
26379
26395
  break;
26380
26396
  }
26381
26397
  if (message.startIndex != null && message.hasOwnProperty("startIndex")) {
@@ -26404,6 +26420,16 @@
26404
26420
  return "slashCommand." + error;
26405
26421
  }
26406
26422
  }
26423
+ if (message.richLinkMetadata != null && message.hasOwnProperty("richLinkMetadata")) {
26424
+ if (properties.metadata === 1)
26425
+ return "metadata: multiple values";
26426
+ properties.metadata = 1;
26427
+ {
26428
+ var error = $root.google.chat.v1.RichLinkMetadata.verify(message.richLinkMetadata);
26429
+ if (error)
26430
+ return "richLinkMetadata." + error;
26431
+ }
26432
+ }
26407
26433
  return null;
26408
26434
  };
26409
26435
 
@@ -26438,6 +26464,10 @@
26438
26464
  case 2:
26439
26465
  message.type = 2;
26440
26466
  break;
26467
+ case "RICH_LINK":
26468
+ case 3:
26469
+ message.type = 3;
26470
+ break;
26441
26471
  }
26442
26472
  if (object.startIndex != null)
26443
26473
  message.startIndex = object.startIndex | 0;
@@ -26453,6 +26483,11 @@
26453
26483
  throw TypeError(".google.chat.v1.Annotation.slashCommand: object expected");
26454
26484
  message.slashCommand = $root.google.chat.v1.SlashCommandMetadata.fromObject(object.slashCommand);
26455
26485
  }
26486
+ if (object.richLinkMetadata != null) {
26487
+ if (typeof object.richLinkMetadata !== "object")
26488
+ throw TypeError(".google.chat.v1.Annotation.richLinkMetadata: object expected");
26489
+ message.richLinkMetadata = $root.google.chat.v1.RichLinkMetadata.fromObject(object.richLinkMetadata);
26490
+ }
26456
26491
  return message;
26457
26492
  };
26458
26493
 
@@ -26492,6 +26527,11 @@
26492
26527
  if (options.oneofs)
26493
26528
  object.metadata = "slashCommand";
26494
26529
  }
26530
+ if (message.richLinkMetadata != null && message.hasOwnProperty("richLinkMetadata")) {
26531
+ object.richLinkMetadata = $root.google.chat.v1.RichLinkMetadata.toObject(message.richLinkMetadata, options);
26532
+ if (options.oneofs)
26533
+ object.metadata = "richLinkMetadata";
26534
+ }
26495
26535
  return object;
26496
26536
  };
26497
26537
 
@@ -27151,44 +27191,26 @@
27151
27191
  return SlashCommandMetadata;
27152
27192
  })();
27153
27193
 
27154
- /**
27155
- * AnnotationType enum.
27156
- * @name google.chat.v1.AnnotationType
27157
- * @enum {number}
27158
- * @property {number} ANNOTATION_TYPE_UNSPECIFIED=0 ANNOTATION_TYPE_UNSPECIFIED value
27159
- * @property {number} USER_MENTION=1 USER_MENTION value
27160
- * @property {number} SLASH_COMMAND=2 SLASH_COMMAND value
27161
- */
27162
- v1.AnnotationType = (function() {
27163
- var valuesById = {}, values = Object.create(valuesById);
27164
- values[valuesById[0] = "ANNOTATION_TYPE_UNSPECIFIED"] = 0;
27165
- values[valuesById[1] = "USER_MENTION"] = 1;
27166
- values[valuesById[2] = "SLASH_COMMAND"] = 2;
27167
- return values;
27168
- })();
27169
-
27170
- v1.User = (function() {
27194
+ v1.RichLinkMetadata = (function() {
27171
27195
 
27172
27196
  /**
27173
- * Properties of a User.
27197
+ * Properties of a RichLinkMetadata.
27174
27198
  * @memberof google.chat.v1
27175
- * @interface IUser
27176
- * @property {string|null} [name] User name
27177
- * @property {string|null} [displayName] User displayName
27178
- * @property {string|null} [domainId] User domainId
27179
- * @property {google.chat.v1.User.Type|null} [type] User type
27180
- * @property {boolean|null} [isAnonymous] User isAnonymous
27199
+ * @interface IRichLinkMetadata
27200
+ * @property {string|null} [uri] RichLinkMetadata uri
27201
+ * @property {google.chat.v1.RichLinkMetadata.RichLinkType|null} [richLinkType] RichLinkMetadata richLinkType
27202
+ * @property {google.chat.v1.IDriveLinkData|null} [driveLinkData] RichLinkMetadata driveLinkData
27181
27203
  */
27182
27204
 
27183
27205
  /**
27184
- * Constructs a new User.
27206
+ * Constructs a new RichLinkMetadata.
27185
27207
  * @memberof google.chat.v1
27186
- * @classdesc Represents a User.
27187
- * @implements IUser
27208
+ * @classdesc Represents a RichLinkMetadata.
27209
+ * @implements IRichLinkMetadata
27188
27210
  * @constructor
27189
- * @param {google.chat.v1.IUser=} [properties] Properties to set
27211
+ * @param {google.chat.v1.IRichLinkMetadata=} [properties] Properties to set
27190
27212
  */
27191
- function User(properties) {
27213
+ function RichLinkMetadata(properties) {
27192
27214
  if (properties)
27193
27215
  for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
27194
27216
  if (properties[keys[i]] != null)
@@ -27196,131 +27218,117 @@
27196
27218
  }
27197
27219
 
27198
27220
  /**
27199
- * User name.
27200
- * @member {string} name
27201
- * @memberof google.chat.v1.User
27221
+ * RichLinkMetadata uri.
27222
+ * @member {string} uri
27223
+ * @memberof google.chat.v1.RichLinkMetadata
27202
27224
  * @instance
27203
27225
  */
27204
- User.prototype.name = "";
27226
+ RichLinkMetadata.prototype.uri = "";
27205
27227
 
27206
27228
  /**
27207
- * User displayName.
27208
- * @member {string} displayName
27209
- * @memberof google.chat.v1.User
27229
+ * RichLinkMetadata richLinkType.
27230
+ * @member {google.chat.v1.RichLinkMetadata.RichLinkType} richLinkType
27231
+ * @memberof google.chat.v1.RichLinkMetadata
27210
27232
  * @instance
27211
27233
  */
27212
- User.prototype.displayName = "";
27234
+ RichLinkMetadata.prototype.richLinkType = 0;
27213
27235
 
27214
27236
  /**
27215
- * User domainId.
27216
- * @member {string} domainId
27217
- * @memberof google.chat.v1.User
27237
+ * RichLinkMetadata driveLinkData.
27238
+ * @member {google.chat.v1.IDriveLinkData|null|undefined} driveLinkData
27239
+ * @memberof google.chat.v1.RichLinkMetadata
27218
27240
  * @instance
27219
27241
  */
27220
- User.prototype.domainId = "";
27242
+ RichLinkMetadata.prototype.driveLinkData = null;
27221
27243
 
27222
- /**
27223
- * User type.
27224
- * @member {google.chat.v1.User.Type} type
27225
- * @memberof google.chat.v1.User
27226
- * @instance
27227
- */
27228
- User.prototype.type = 0;
27244
+ // OneOf field names bound to virtual getters and setters
27245
+ var $oneOfFields;
27229
27246
 
27230
27247
  /**
27231
- * User isAnonymous.
27232
- * @member {boolean} isAnonymous
27233
- * @memberof google.chat.v1.User
27248
+ * RichLinkMetadata data.
27249
+ * @member {"driveLinkData"|undefined} data
27250
+ * @memberof google.chat.v1.RichLinkMetadata
27234
27251
  * @instance
27235
27252
  */
27236
- User.prototype.isAnonymous = false;
27253
+ Object.defineProperty(RichLinkMetadata.prototype, "data", {
27254
+ get: $util.oneOfGetter($oneOfFields = ["driveLinkData"]),
27255
+ set: $util.oneOfSetter($oneOfFields)
27256
+ });
27237
27257
 
27238
27258
  /**
27239
- * Creates a new User instance using the specified properties.
27259
+ * Creates a new RichLinkMetadata instance using the specified properties.
27240
27260
  * @function create
27241
- * @memberof google.chat.v1.User
27261
+ * @memberof google.chat.v1.RichLinkMetadata
27242
27262
  * @static
27243
- * @param {google.chat.v1.IUser=} [properties] Properties to set
27244
- * @returns {google.chat.v1.User} User instance
27263
+ * @param {google.chat.v1.IRichLinkMetadata=} [properties] Properties to set
27264
+ * @returns {google.chat.v1.RichLinkMetadata} RichLinkMetadata instance
27245
27265
  */
27246
- User.create = function create(properties) {
27247
- return new User(properties);
27266
+ RichLinkMetadata.create = function create(properties) {
27267
+ return new RichLinkMetadata(properties);
27248
27268
  };
27249
27269
 
27250
27270
  /**
27251
- * Encodes the specified User message. Does not implicitly {@link google.chat.v1.User.verify|verify} messages.
27271
+ * Encodes the specified RichLinkMetadata message. Does not implicitly {@link google.chat.v1.RichLinkMetadata.verify|verify} messages.
27252
27272
  * @function encode
27253
- * @memberof google.chat.v1.User
27273
+ * @memberof google.chat.v1.RichLinkMetadata
27254
27274
  * @static
27255
- * @param {google.chat.v1.IUser} message User message or plain object to encode
27275
+ * @param {google.chat.v1.IRichLinkMetadata} message RichLinkMetadata message or plain object to encode
27256
27276
  * @param {$protobuf.Writer} [writer] Writer to encode to
27257
27277
  * @returns {$protobuf.Writer} Writer
27258
27278
  */
27259
- User.encode = function encode(message, writer) {
27279
+ RichLinkMetadata.encode = function encode(message, writer) {
27260
27280
  if (!writer)
27261
27281
  writer = $Writer.create();
27262
- if (message.name != null && Object.hasOwnProperty.call(message, "name"))
27263
- writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
27264
- if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName"))
27265
- writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName);
27266
- if (message.type != null && Object.hasOwnProperty.call(message, "type"))
27267
- writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type);
27268
- if (message.domainId != null && Object.hasOwnProperty.call(message, "domainId"))
27269
- writer.uint32(/* id 6, wireType 2 =*/50).string(message.domainId);
27270
- if (message.isAnonymous != null && Object.hasOwnProperty.call(message, "isAnonymous"))
27271
- writer.uint32(/* id 7, wireType 0 =*/56).bool(message.isAnonymous);
27282
+ if (message.uri != null && Object.hasOwnProperty.call(message, "uri"))
27283
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri);
27284
+ if (message.richLinkType != null && Object.hasOwnProperty.call(message, "richLinkType"))
27285
+ writer.uint32(/* id 2, wireType 0 =*/16).int32(message.richLinkType);
27286
+ if (message.driveLinkData != null && Object.hasOwnProperty.call(message, "driveLinkData"))
27287
+ $root.google.chat.v1.DriveLinkData.encode(message.driveLinkData, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
27272
27288
  return writer;
27273
27289
  };
27274
27290
 
27275
27291
  /**
27276
- * Encodes the specified User message, length delimited. Does not implicitly {@link google.chat.v1.User.verify|verify} messages.
27292
+ * Encodes the specified RichLinkMetadata message, length delimited. Does not implicitly {@link google.chat.v1.RichLinkMetadata.verify|verify} messages.
27277
27293
  * @function encodeDelimited
27278
- * @memberof google.chat.v1.User
27294
+ * @memberof google.chat.v1.RichLinkMetadata
27279
27295
  * @static
27280
- * @param {google.chat.v1.IUser} message User message or plain object to encode
27296
+ * @param {google.chat.v1.IRichLinkMetadata} message RichLinkMetadata message or plain object to encode
27281
27297
  * @param {$protobuf.Writer} [writer] Writer to encode to
27282
27298
  * @returns {$protobuf.Writer} Writer
27283
27299
  */
27284
- User.encodeDelimited = function encodeDelimited(message, writer) {
27300
+ RichLinkMetadata.encodeDelimited = function encodeDelimited(message, writer) {
27285
27301
  return this.encode(message, writer).ldelim();
27286
27302
  };
27287
27303
 
27288
27304
  /**
27289
- * Decodes a User message from the specified reader or buffer.
27305
+ * Decodes a RichLinkMetadata message from the specified reader or buffer.
27290
27306
  * @function decode
27291
- * @memberof google.chat.v1.User
27307
+ * @memberof google.chat.v1.RichLinkMetadata
27292
27308
  * @static
27293
27309
  * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
27294
27310
  * @param {number} [length] Message length if known beforehand
27295
- * @returns {google.chat.v1.User} User
27311
+ * @returns {google.chat.v1.RichLinkMetadata} RichLinkMetadata
27296
27312
  * @throws {Error} If the payload is not a reader or valid buffer
27297
27313
  * @throws {$protobuf.util.ProtocolError} If required fields are missing
27298
27314
  */
27299
- User.decode = function decode(reader, length) {
27315
+ RichLinkMetadata.decode = function decode(reader, length) {
27300
27316
  if (!(reader instanceof $Reader))
27301
27317
  reader = $Reader.create(reader);
27302
- var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.User();
27318
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.RichLinkMetadata();
27303
27319
  while (reader.pos < end) {
27304
27320
  var tag = reader.uint32();
27305
27321
  switch (tag >>> 3) {
27306
27322
  case 1: {
27307
- message.name = reader.string();
27323
+ message.uri = reader.string();
27308
27324
  break;
27309
27325
  }
27310
27326
  case 2: {
27311
- message.displayName = reader.string();
27312
- break;
27313
- }
27314
- case 6: {
27315
- message.domainId = reader.string();
27316
- break;
27317
- }
27318
- case 5: {
27319
- message.type = reader.int32();
27327
+ message.richLinkType = reader.int32();
27320
27328
  break;
27321
27329
  }
27322
- case 7: {
27323
- message.isAnonymous = reader.bool();
27330
+ case 3: {
27331
+ message.driveLinkData = $root.google.chat.v1.DriveLinkData.decode(reader, reader.uint32());
27324
27332
  break;
27325
27333
  }
27326
27334
  default:
@@ -27332,202 +27340,184 @@
27332
27340
  };
27333
27341
 
27334
27342
  /**
27335
- * Decodes a User message from the specified reader or buffer, length delimited.
27343
+ * Decodes a RichLinkMetadata message from the specified reader or buffer, length delimited.
27336
27344
  * @function decodeDelimited
27337
- * @memberof google.chat.v1.User
27345
+ * @memberof google.chat.v1.RichLinkMetadata
27338
27346
  * @static
27339
27347
  * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
27340
- * @returns {google.chat.v1.User} User
27348
+ * @returns {google.chat.v1.RichLinkMetadata} RichLinkMetadata
27341
27349
  * @throws {Error} If the payload is not a reader or valid buffer
27342
27350
  * @throws {$protobuf.util.ProtocolError} If required fields are missing
27343
27351
  */
27344
- User.decodeDelimited = function decodeDelimited(reader) {
27352
+ RichLinkMetadata.decodeDelimited = function decodeDelimited(reader) {
27345
27353
  if (!(reader instanceof $Reader))
27346
27354
  reader = new $Reader(reader);
27347
27355
  return this.decode(reader, reader.uint32());
27348
27356
  };
27349
27357
 
27350
27358
  /**
27351
- * Verifies a User message.
27359
+ * Verifies a RichLinkMetadata message.
27352
27360
  * @function verify
27353
- * @memberof google.chat.v1.User
27361
+ * @memberof google.chat.v1.RichLinkMetadata
27354
27362
  * @static
27355
27363
  * @param {Object.<string,*>} message Plain object to verify
27356
27364
  * @returns {string|null} `null` if valid, otherwise the reason why it is not
27357
27365
  */
27358
- User.verify = function verify(message) {
27366
+ RichLinkMetadata.verify = function verify(message) {
27359
27367
  if (typeof message !== "object" || message === null)
27360
27368
  return "object expected";
27361
- if (message.name != null && message.hasOwnProperty("name"))
27362
- if (!$util.isString(message.name))
27363
- return "name: string expected";
27364
- if (message.displayName != null && message.hasOwnProperty("displayName"))
27365
- if (!$util.isString(message.displayName))
27366
- return "displayName: string expected";
27367
- if (message.domainId != null && message.hasOwnProperty("domainId"))
27368
- if (!$util.isString(message.domainId))
27369
- return "domainId: string expected";
27370
- if (message.type != null && message.hasOwnProperty("type"))
27371
- switch (message.type) {
27369
+ var properties = {};
27370
+ if (message.uri != null && message.hasOwnProperty("uri"))
27371
+ if (!$util.isString(message.uri))
27372
+ return "uri: string expected";
27373
+ if (message.richLinkType != null && message.hasOwnProperty("richLinkType"))
27374
+ switch (message.richLinkType) {
27372
27375
  default:
27373
- return "type: enum value expected";
27376
+ return "richLinkType: enum value expected";
27374
27377
  case 0:
27375
27378
  case 1:
27376
- case 2:
27377
27379
  break;
27378
27380
  }
27379
- if (message.isAnonymous != null && message.hasOwnProperty("isAnonymous"))
27380
- if (typeof message.isAnonymous !== "boolean")
27381
- return "isAnonymous: boolean expected";
27381
+ if (message.driveLinkData != null && message.hasOwnProperty("driveLinkData")) {
27382
+ properties.data = 1;
27383
+ {
27384
+ var error = $root.google.chat.v1.DriveLinkData.verify(message.driveLinkData);
27385
+ if (error)
27386
+ return "driveLinkData." + error;
27387
+ }
27388
+ }
27382
27389
  return null;
27383
27390
  };
27384
27391
 
27385
27392
  /**
27386
- * Creates a User message from a plain object. Also converts values to their respective internal types.
27393
+ * Creates a RichLinkMetadata message from a plain object. Also converts values to their respective internal types.
27387
27394
  * @function fromObject
27388
- * @memberof google.chat.v1.User
27395
+ * @memberof google.chat.v1.RichLinkMetadata
27389
27396
  * @static
27390
27397
  * @param {Object.<string,*>} object Plain object
27391
- * @returns {google.chat.v1.User} User
27398
+ * @returns {google.chat.v1.RichLinkMetadata} RichLinkMetadata
27392
27399
  */
27393
- User.fromObject = function fromObject(object) {
27394
- if (object instanceof $root.google.chat.v1.User)
27400
+ RichLinkMetadata.fromObject = function fromObject(object) {
27401
+ if (object instanceof $root.google.chat.v1.RichLinkMetadata)
27395
27402
  return object;
27396
- var message = new $root.google.chat.v1.User();
27397
- if (object.name != null)
27398
- message.name = String(object.name);
27399
- if (object.displayName != null)
27400
- message.displayName = String(object.displayName);
27401
- if (object.domainId != null)
27402
- message.domainId = String(object.domainId);
27403
- switch (object.type) {
27403
+ var message = new $root.google.chat.v1.RichLinkMetadata();
27404
+ if (object.uri != null)
27405
+ message.uri = String(object.uri);
27406
+ switch (object.richLinkType) {
27404
27407
  default:
27405
- if (typeof object.type === "number") {
27406
- message.type = object.type;
27408
+ if (typeof object.richLinkType === "number") {
27409
+ message.richLinkType = object.richLinkType;
27407
27410
  break;
27408
27411
  }
27409
27412
  break;
27410
- case "TYPE_UNSPECIFIED":
27413
+ case "RICH_LINK_TYPE_UNSPECIFIED":
27411
27414
  case 0:
27412
- message.type = 0;
27415
+ message.richLinkType = 0;
27413
27416
  break;
27414
- case "HUMAN":
27417
+ case "DRIVE_FILE":
27415
27418
  case 1:
27416
- message.type = 1;
27417
- break;
27418
- case "BOT":
27419
- case 2:
27420
- message.type = 2;
27419
+ message.richLinkType = 1;
27421
27420
  break;
27422
27421
  }
27423
- if (object.isAnonymous != null)
27424
- message.isAnonymous = Boolean(object.isAnonymous);
27422
+ if (object.driveLinkData != null) {
27423
+ if (typeof object.driveLinkData !== "object")
27424
+ throw TypeError(".google.chat.v1.RichLinkMetadata.driveLinkData: object expected");
27425
+ message.driveLinkData = $root.google.chat.v1.DriveLinkData.fromObject(object.driveLinkData);
27426
+ }
27425
27427
  return message;
27426
27428
  };
27427
27429
 
27428
27430
  /**
27429
- * Creates a plain object from a User message. Also converts values to other types if specified.
27431
+ * Creates a plain object from a RichLinkMetadata message. Also converts values to other types if specified.
27430
27432
  * @function toObject
27431
- * @memberof google.chat.v1.User
27433
+ * @memberof google.chat.v1.RichLinkMetadata
27432
27434
  * @static
27433
- * @param {google.chat.v1.User} message User
27435
+ * @param {google.chat.v1.RichLinkMetadata} message RichLinkMetadata
27434
27436
  * @param {$protobuf.IConversionOptions} [options] Conversion options
27435
27437
  * @returns {Object.<string,*>} Plain object
27436
27438
  */
27437
- User.toObject = function toObject(message, options) {
27439
+ RichLinkMetadata.toObject = function toObject(message, options) {
27438
27440
  if (!options)
27439
27441
  options = {};
27440
27442
  var object = {};
27441
27443
  if (options.defaults) {
27442
- object.name = "";
27443
- object.displayName = "";
27444
- object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0;
27445
- object.domainId = "";
27446
- object.isAnonymous = false;
27444
+ object.uri = "";
27445
+ object.richLinkType = options.enums === String ? "RICH_LINK_TYPE_UNSPECIFIED" : 0;
27446
+ }
27447
+ if (message.uri != null && message.hasOwnProperty("uri"))
27448
+ object.uri = message.uri;
27449
+ if (message.richLinkType != null && message.hasOwnProperty("richLinkType"))
27450
+ object.richLinkType = options.enums === String ? $root.google.chat.v1.RichLinkMetadata.RichLinkType[message.richLinkType] === undefined ? message.richLinkType : $root.google.chat.v1.RichLinkMetadata.RichLinkType[message.richLinkType] : message.richLinkType;
27451
+ if (message.driveLinkData != null && message.hasOwnProperty("driveLinkData")) {
27452
+ object.driveLinkData = $root.google.chat.v1.DriveLinkData.toObject(message.driveLinkData, options);
27453
+ if (options.oneofs)
27454
+ object.data = "driveLinkData";
27447
27455
  }
27448
- if (message.name != null && message.hasOwnProperty("name"))
27449
- object.name = message.name;
27450
- if (message.displayName != null && message.hasOwnProperty("displayName"))
27451
- object.displayName = message.displayName;
27452
- if (message.type != null && message.hasOwnProperty("type"))
27453
- object.type = options.enums === String ? $root.google.chat.v1.User.Type[message.type] === undefined ? message.type : $root.google.chat.v1.User.Type[message.type] : message.type;
27454
- if (message.domainId != null && message.hasOwnProperty("domainId"))
27455
- object.domainId = message.domainId;
27456
- if (message.isAnonymous != null && message.hasOwnProperty("isAnonymous"))
27457
- object.isAnonymous = message.isAnonymous;
27458
27456
  return object;
27459
27457
  };
27460
27458
 
27461
27459
  /**
27462
- * Converts this User to JSON.
27460
+ * Converts this RichLinkMetadata to JSON.
27463
27461
  * @function toJSON
27464
- * @memberof google.chat.v1.User
27462
+ * @memberof google.chat.v1.RichLinkMetadata
27465
27463
  * @instance
27466
27464
  * @returns {Object.<string,*>} JSON object
27467
27465
  */
27468
- User.prototype.toJSON = function toJSON() {
27466
+ RichLinkMetadata.prototype.toJSON = function toJSON() {
27469
27467
  return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
27470
27468
  };
27471
27469
 
27472
27470
  /**
27473
- * Gets the default type url for User
27471
+ * Gets the default type url for RichLinkMetadata
27474
27472
  * @function getTypeUrl
27475
- * @memberof google.chat.v1.User
27473
+ * @memberof google.chat.v1.RichLinkMetadata
27476
27474
  * @static
27477
27475
  * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
27478
27476
  * @returns {string} The default type url
27479
27477
  */
27480
- User.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
27478
+ RichLinkMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
27481
27479
  if (typeUrlPrefix === undefined) {
27482
27480
  typeUrlPrefix = "type.googleapis.com";
27483
27481
  }
27484
- return typeUrlPrefix + "/google.chat.v1.User";
27482
+ return typeUrlPrefix + "/google.chat.v1.RichLinkMetadata";
27485
27483
  };
27486
27484
 
27487
27485
  /**
27488
- * Type enum.
27489
- * @name google.chat.v1.User.Type
27486
+ * RichLinkType enum.
27487
+ * @name google.chat.v1.RichLinkMetadata.RichLinkType
27490
27488
  * @enum {number}
27491
- * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value
27492
- * @property {number} HUMAN=1 HUMAN value
27493
- * @property {number} BOT=2 BOT value
27489
+ * @property {number} RICH_LINK_TYPE_UNSPECIFIED=0 RICH_LINK_TYPE_UNSPECIFIED value
27490
+ * @property {number} DRIVE_FILE=1 DRIVE_FILE value
27494
27491
  */
27495
- User.Type = (function() {
27492
+ RichLinkMetadata.RichLinkType = (function() {
27496
27493
  var valuesById = {}, values = Object.create(valuesById);
27497
- values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0;
27498
- values[valuesById[1] = "HUMAN"] = 1;
27499
- values[valuesById[2] = "BOT"] = 2;
27494
+ values[valuesById[0] = "RICH_LINK_TYPE_UNSPECIFIED"] = 0;
27495
+ values[valuesById[1] = "DRIVE_FILE"] = 1;
27500
27496
  return values;
27501
27497
  })();
27502
27498
 
27503
- return User;
27499
+ return RichLinkMetadata;
27504
27500
  })();
27505
27501
 
27506
- v1.Attachment = (function() {
27502
+ v1.DriveLinkData = (function() {
27507
27503
 
27508
27504
  /**
27509
- * Properties of an Attachment.
27505
+ * Properties of a DriveLinkData.
27510
27506
  * @memberof google.chat.v1
27511
- * @interface IAttachment
27512
- * @property {string|null} [name] Attachment name
27513
- * @property {string|null} [contentName] Attachment contentName
27514
- * @property {string|null} [contentType] Attachment contentType
27515
- * @property {google.chat.v1.IAttachmentDataRef|null} [attachmentDataRef] Attachment attachmentDataRef
27516
- * @property {google.chat.v1.IDriveDataRef|null} [driveDataRef] Attachment driveDataRef
27517
- * @property {string|null} [thumbnailUri] Attachment thumbnailUri
27518
- * @property {string|null} [downloadUri] Attachment downloadUri
27519
- * @property {google.chat.v1.Attachment.Source|null} [source] Attachment source
27507
+ * @interface IDriveLinkData
27508
+ * @property {google.chat.v1.IDriveDataRef|null} [driveDataRef] DriveLinkData driveDataRef
27509
+ * @property {string|null} [mimeType] DriveLinkData mimeType
27520
27510
  */
27521
27511
 
27522
27512
  /**
27523
- * Constructs a new Attachment.
27513
+ * Constructs a new DriveLinkData.
27524
27514
  * @memberof google.chat.v1
27525
- * @classdesc Represents an Attachment.
27526
- * @implements IAttachment
27515
+ * @classdesc Represents a DriveLinkData.
27516
+ * @implements IDriveLinkData
27527
27517
  * @constructor
27528
- * @param {google.chat.v1.IAttachment=} [properties] Properties to set
27518
+ * @param {google.chat.v1.IDriveLinkData=} [properties] Properties to set
27529
27519
  */
27530
- function Attachment(properties) {
27520
+ function DriveLinkData(properties) {
27531
27521
  if (properties)
27532
27522
  for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
27533
27523
  if (properties[keys[i]] != null)
@@ -27535,25 +27525,281 @@
27535
27525
  }
27536
27526
 
27537
27527
  /**
27538
- * Attachment name.
27539
- * @member {string} name
27540
- * @memberof google.chat.v1.Attachment
27528
+ * DriveLinkData driveDataRef.
27529
+ * @member {google.chat.v1.IDriveDataRef|null|undefined} driveDataRef
27530
+ * @memberof google.chat.v1.DriveLinkData
27541
27531
  * @instance
27542
27532
  */
27543
- Attachment.prototype.name = "";
27533
+ DriveLinkData.prototype.driveDataRef = null;
27544
27534
 
27545
27535
  /**
27546
- * Attachment contentName.
27547
- * @member {string} contentName
27548
- * @memberof google.chat.v1.Attachment
27536
+ * DriveLinkData mimeType.
27537
+ * @member {string} mimeType
27538
+ * @memberof google.chat.v1.DriveLinkData
27549
27539
  * @instance
27550
27540
  */
27551
- Attachment.prototype.contentName = "";
27541
+ DriveLinkData.prototype.mimeType = "";
27552
27542
 
27553
27543
  /**
27554
- * Attachment contentType.
27555
- * @member {string} contentType
27556
- * @memberof google.chat.v1.Attachment
27544
+ * Creates a new DriveLinkData instance using the specified properties.
27545
+ * @function create
27546
+ * @memberof google.chat.v1.DriveLinkData
27547
+ * @static
27548
+ * @param {google.chat.v1.IDriveLinkData=} [properties] Properties to set
27549
+ * @returns {google.chat.v1.DriveLinkData} DriveLinkData instance
27550
+ */
27551
+ DriveLinkData.create = function create(properties) {
27552
+ return new DriveLinkData(properties);
27553
+ };
27554
+
27555
+ /**
27556
+ * Encodes the specified DriveLinkData message. Does not implicitly {@link google.chat.v1.DriveLinkData.verify|verify} messages.
27557
+ * @function encode
27558
+ * @memberof google.chat.v1.DriveLinkData
27559
+ * @static
27560
+ * @param {google.chat.v1.IDriveLinkData} message DriveLinkData message or plain object to encode
27561
+ * @param {$protobuf.Writer} [writer] Writer to encode to
27562
+ * @returns {$protobuf.Writer} Writer
27563
+ */
27564
+ DriveLinkData.encode = function encode(message, writer) {
27565
+ if (!writer)
27566
+ writer = $Writer.create();
27567
+ if (message.driveDataRef != null && Object.hasOwnProperty.call(message, "driveDataRef"))
27568
+ $root.google.chat.v1.DriveDataRef.encode(message.driveDataRef, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
27569
+ if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType"))
27570
+ writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimeType);
27571
+ return writer;
27572
+ };
27573
+
27574
+ /**
27575
+ * Encodes the specified DriveLinkData message, length delimited. Does not implicitly {@link google.chat.v1.DriveLinkData.verify|verify} messages.
27576
+ * @function encodeDelimited
27577
+ * @memberof google.chat.v1.DriveLinkData
27578
+ * @static
27579
+ * @param {google.chat.v1.IDriveLinkData} message DriveLinkData message or plain object to encode
27580
+ * @param {$protobuf.Writer} [writer] Writer to encode to
27581
+ * @returns {$protobuf.Writer} Writer
27582
+ */
27583
+ DriveLinkData.encodeDelimited = function encodeDelimited(message, writer) {
27584
+ return this.encode(message, writer).ldelim();
27585
+ };
27586
+
27587
+ /**
27588
+ * Decodes a DriveLinkData message from the specified reader or buffer.
27589
+ * @function decode
27590
+ * @memberof google.chat.v1.DriveLinkData
27591
+ * @static
27592
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
27593
+ * @param {number} [length] Message length if known beforehand
27594
+ * @returns {google.chat.v1.DriveLinkData} DriveLinkData
27595
+ * @throws {Error} If the payload is not a reader or valid buffer
27596
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
27597
+ */
27598
+ DriveLinkData.decode = function decode(reader, length) {
27599
+ if (!(reader instanceof $Reader))
27600
+ reader = $Reader.create(reader);
27601
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.DriveLinkData();
27602
+ while (reader.pos < end) {
27603
+ var tag = reader.uint32();
27604
+ switch (tag >>> 3) {
27605
+ case 1: {
27606
+ message.driveDataRef = $root.google.chat.v1.DriveDataRef.decode(reader, reader.uint32());
27607
+ break;
27608
+ }
27609
+ case 2: {
27610
+ message.mimeType = reader.string();
27611
+ break;
27612
+ }
27613
+ default:
27614
+ reader.skipType(tag & 7);
27615
+ break;
27616
+ }
27617
+ }
27618
+ return message;
27619
+ };
27620
+
27621
+ /**
27622
+ * Decodes a DriveLinkData message from the specified reader or buffer, length delimited.
27623
+ * @function decodeDelimited
27624
+ * @memberof google.chat.v1.DriveLinkData
27625
+ * @static
27626
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
27627
+ * @returns {google.chat.v1.DriveLinkData} DriveLinkData
27628
+ * @throws {Error} If the payload is not a reader or valid buffer
27629
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
27630
+ */
27631
+ DriveLinkData.decodeDelimited = function decodeDelimited(reader) {
27632
+ if (!(reader instanceof $Reader))
27633
+ reader = new $Reader(reader);
27634
+ return this.decode(reader, reader.uint32());
27635
+ };
27636
+
27637
+ /**
27638
+ * Verifies a DriveLinkData message.
27639
+ * @function verify
27640
+ * @memberof google.chat.v1.DriveLinkData
27641
+ * @static
27642
+ * @param {Object.<string,*>} message Plain object to verify
27643
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
27644
+ */
27645
+ DriveLinkData.verify = function verify(message) {
27646
+ if (typeof message !== "object" || message === null)
27647
+ return "object expected";
27648
+ if (message.driveDataRef != null && message.hasOwnProperty("driveDataRef")) {
27649
+ var error = $root.google.chat.v1.DriveDataRef.verify(message.driveDataRef);
27650
+ if (error)
27651
+ return "driveDataRef." + error;
27652
+ }
27653
+ if (message.mimeType != null && message.hasOwnProperty("mimeType"))
27654
+ if (!$util.isString(message.mimeType))
27655
+ return "mimeType: string expected";
27656
+ return null;
27657
+ };
27658
+
27659
+ /**
27660
+ * Creates a DriveLinkData message from a plain object. Also converts values to their respective internal types.
27661
+ * @function fromObject
27662
+ * @memberof google.chat.v1.DriveLinkData
27663
+ * @static
27664
+ * @param {Object.<string,*>} object Plain object
27665
+ * @returns {google.chat.v1.DriveLinkData} DriveLinkData
27666
+ */
27667
+ DriveLinkData.fromObject = function fromObject(object) {
27668
+ if (object instanceof $root.google.chat.v1.DriveLinkData)
27669
+ return object;
27670
+ var message = new $root.google.chat.v1.DriveLinkData();
27671
+ if (object.driveDataRef != null) {
27672
+ if (typeof object.driveDataRef !== "object")
27673
+ throw TypeError(".google.chat.v1.DriveLinkData.driveDataRef: object expected");
27674
+ message.driveDataRef = $root.google.chat.v1.DriveDataRef.fromObject(object.driveDataRef);
27675
+ }
27676
+ if (object.mimeType != null)
27677
+ message.mimeType = String(object.mimeType);
27678
+ return message;
27679
+ };
27680
+
27681
+ /**
27682
+ * Creates a plain object from a DriveLinkData message. Also converts values to other types if specified.
27683
+ * @function toObject
27684
+ * @memberof google.chat.v1.DriveLinkData
27685
+ * @static
27686
+ * @param {google.chat.v1.DriveLinkData} message DriveLinkData
27687
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
27688
+ * @returns {Object.<string,*>} Plain object
27689
+ */
27690
+ DriveLinkData.toObject = function toObject(message, options) {
27691
+ if (!options)
27692
+ options = {};
27693
+ var object = {};
27694
+ if (options.defaults) {
27695
+ object.driveDataRef = null;
27696
+ object.mimeType = "";
27697
+ }
27698
+ if (message.driveDataRef != null && message.hasOwnProperty("driveDataRef"))
27699
+ object.driveDataRef = $root.google.chat.v1.DriveDataRef.toObject(message.driveDataRef, options);
27700
+ if (message.mimeType != null && message.hasOwnProperty("mimeType"))
27701
+ object.mimeType = message.mimeType;
27702
+ return object;
27703
+ };
27704
+
27705
+ /**
27706
+ * Converts this DriveLinkData to JSON.
27707
+ * @function toJSON
27708
+ * @memberof google.chat.v1.DriveLinkData
27709
+ * @instance
27710
+ * @returns {Object.<string,*>} JSON object
27711
+ */
27712
+ DriveLinkData.prototype.toJSON = function toJSON() {
27713
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
27714
+ };
27715
+
27716
+ /**
27717
+ * Gets the default type url for DriveLinkData
27718
+ * @function getTypeUrl
27719
+ * @memberof google.chat.v1.DriveLinkData
27720
+ * @static
27721
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
27722
+ * @returns {string} The default type url
27723
+ */
27724
+ DriveLinkData.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
27725
+ if (typeUrlPrefix === undefined) {
27726
+ typeUrlPrefix = "type.googleapis.com";
27727
+ }
27728
+ return typeUrlPrefix + "/google.chat.v1.DriveLinkData";
27729
+ };
27730
+
27731
+ return DriveLinkData;
27732
+ })();
27733
+
27734
+ /**
27735
+ * AnnotationType enum.
27736
+ * @name google.chat.v1.AnnotationType
27737
+ * @enum {number}
27738
+ * @property {number} ANNOTATION_TYPE_UNSPECIFIED=0 ANNOTATION_TYPE_UNSPECIFIED value
27739
+ * @property {number} USER_MENTION=1 USER_MENTION value
27740
+ * @property {number} SLASH_COMMAND=2 SLASH_COMMAND value
27741
+ * @property {number} RICH_LINK=3 RICH_LINK value
27742
+ */
27743
+ v1.AnnotationType = (function() {
27744
+ var valuesById = {}, values = Object.create(valuesById);
27745
+ values[valuesById[0] = "ANNOTATION_TYPE_UNSPECIFIED"] = 0;
27746
+ values[valuesById[1] = "USER_MENTION"] = 1;
27747
+ values[valuesById[2] = "SLASH_COMMAND"] = 2;
27748
+ values[valuesById[3] = "RICH_LINK"] = 3;
27749
+ return values;
27750
+ })();
27751
+
27752
+ v1.Attachment = (function() {
27753
+
27754
+ /**
27755
+ * Properties of an Attachment.
27756
+ * @memberof google.chat.v1
27757
+ * @interface IAttachment
27758
+ * @property {string|null} [name] Attachment name
27759
+ * @property {string|null} [contentName] Attachment contentName
27760
+ * @property {string|null} [contentType] Attachment contentType
27761
+ * @property {google.chat.v1.IAttachmentDataRef|null} [attachmentDataRef] Attachment attachmentDataRef
27762
+ * @property {google.chat.v1.IDriveDataRef|null} [driveDataRef] Attachment driveDataRef
27763
+ * @property {string|null} [thumbnailUri] Attachment thumbnailUri
27764
+ * @property {string|null} [downloadUri] Attachment downloadUri
27765
+ * @property {google.chat.v1.Attachment.Source|null} [source] Attachment source
27766
+ */
27767
+
27768
+ /**
27769
+ * Constructs a new Attachment.
27770
+ * @memberof google.chat.v1
27771
+ * @classdesc Represents an Attachment.
27772
+ * @implements IAttachment
27773
+ * @constructor
27774
+ * @param {google.chat.v1.IAttachment=} [properties] Properties to set
27775
+ */
27776
+ function Attachment(properties) {
27777
+ if (properties)
27778
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
27779
+ if (properties[keys[i]] != null)
27780
+ this[keys[i]] = properties[keys[i]];
27781
+ }
27782
+
27783
+ /**
27784
+ * Attachment name.
27785
+ * @member {string} name
27786
+ * @memberof google.chat.v1.Attachment
27787
+ * @instance
27788
+ */
27789
+ Attachment.prototype.name = "";
27790
+
27791
+ /**
27792
+ * Attachment contentName.
27793
+ * @member {string} contentName
27794
+ * @memberof google.chat.v1.Attachment
27795
+ * @instance
27796
+ */
27797
+ Attachment.prototype.contentName = "";
27798
+
27799
+ /**
27800
+ * Attachment contentType.
27801
+ * @member {string} contentType
27802
+ * @memberof google.chat.v1.Attachment
27557
27803
  * @instance
27558
27804
  */
27559
27805
  Attachment.prototype.contentType = "";
@@ -28965,52 +29211,388 @@
28965
29211
  };
28966
29212
 
28967
29213
  /**
28968
- * Creates a plain object from an UploadAttachmentResponse message. Also converts values to other types if specified.
29214
+ * Creates a plain object from an UploadAttachmentResponse message. Also converts values to other types if specified.
29215
+ * @function toObject
29216
+ * @memberof google.chat.v1.UploadAttachmentResponse
29217
+ * @static
29218
+ * @param {google.chat.v1.UploadAttachmentResponse} message UploadAttachmentResponse
29219
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
29220
+ * @returns {Object.<string,*>} Plain object
29221
+ */
29222
+ UploadAttachmentResponse.toObject = function toObject(message, options) {
29223
+ if (!options)
29224
+ options = {};
29225
+ var object = {};
29226
+ if (options.defaults)
29227
+ object.attachmentDataRef = null;
29228
+ if (message.attachmentDataRef != null && message.hasOwnProperty("attachmentDataRef"))
29229
+ object.attachmentDataRef = $root.google.chat.v1.AttachmentDataRef.toObject(message.attachmentDataRef, options);
29230
+ return object;
29231
+ };
29232
+
29233
+ /**
29234
+ * Converts this UploadAttachmentResponse to JSON.
29235
+ * @function toJSON
29236
+ * @memberof google.chat.v1.UploadAttachmentResponse
29237
+ * @instance
29238
+ * @returns {Object.<string,*>} JSON object
29239
+ */
29240
+ UploadAttachmentResponse.prototype.toJSON = function toJSON() {
29241
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
29242
+ };
29243
+
29244
+ /**
29245
+ * Gets the default type url for UploadAttachmentResponse
29246
+ * @function getTypeUrl
29247
+ * @memberof google.chat.v1.UploadAttachmentResponse
29248
+ * @static
29249
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
29250
+ * @returns {string} The default type url
29251
+ */
29252
+ UploadAttachmentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
29253
+ if (typeUrlPrefix === undefined) {
29254
+ typeUrlPrefix = "type.googleapis.com";
29255
+ }
29256
+ return typeUrlPrefix + "/google.chat.v1.UploadAttachmentResponse";
29257
+ };
29258
+
29259
+ return UploadAttachmentResponse;
29260
+ })();
29261
+
29262
+ v1.User = (function() {
29263
+
29264
+ /**
29265
+ * Properties of a User.
29266
+ * @memberof google.chat.v1
29267
+ * @interface IUser
29268
+ * @property {string|null} [name] User name
29269
+ * @property {string|null} [displayName] User displayName
29270
+ * @property {string|null} [domainId] User domainId
29271
+ * @property {google.chat.v1.User.Type|null} [type] User type
29272
+ * @property {boolean|null} [isAnonymous] User isAnonymous
29273
+ */
29274
+
29275
+ /**
29276
+ * Constructs a new User.
29277
+ * @memberof google.chat.v1
29278
+ * @classdesc Represents a User.
29279
+ * @implements IUser
29280
+ * @constructor
29281
+ * @param {google.chat.v1.IUser=} [properties] Properties to set
29282
+ */
29283
+ function User(properties) {
29284
+ if (properties)
29285
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
29286
+ if (properties[keys[i]] != null)
29287
+ this[keys[i]] = properties[keys[i]];
29288
+ }
29289
+
29290
+ /**
29291
+ * User name.
29292
+ * @member {string} name
29293
+ * @memberof google.chat.v1.User
29294
+ * @instance
29295
+ */
29296
+ User.prototype.name = "";
29297
+
29298
+ /**
29299
+ * User displayName.
29300
+ * @member {string} displayName
29301
+ * @memberof google.chat.v1.User
29302
+ * @instance
29303
+ */
29304
+ User.prototype.displayName = "";
29305
+
29306
+ /**
29307
+ * User domainId.
29308
+ * @member {string} domainId
29309
+ * @memberof google.chat.v1.User
29310
+ * @instance
29311
+ */
29312
+ User.prototype.domainId = "";
29313
+
29314
+ /**
29315
+ * User type.
29316
+ * @member {google.chat.v1.User.Type} type
29317
+ * @memberof google.chat.v1.User
29318
+ * @instance
29319
+ */
29320
+ User.prototype.type = 0;
29321
+
29322
+ /**
29323
+ * User isAnonymous.
29324
+ * @member {boolean} isAnonymous
29325
+ * @memberof google.chat.v1.User
29326
+ * @instance
29327
+ */
29328
+ User.prototype.isAnonymous = false;
29329
+
29330
+ /**
29331
+ * Creates a new User instance using the specified properties.
29332
+ * @function create
29333
+ * @memberof google.chat.v1.User
29334
+ * @static
29335
+ * @param {google.chat.v1.IUser=} [properties] Properties to set
29336
+ * @returns {google.chat.v1.User} User instance
29337
+ */
29338
+ User.create = function create(properties) {
29339
+ return new User(properties);
29340
+ };
29341
+
29342
+ /**
29343
+ * Encodes the specified User message. Does not implicitly {@link google.chat.v1.User.verify|verify} messages.
29344
+ * @function encode
29345
+ * @memberof google.chat.v1.User
29346
+ * @static
29347
+ * @param {google.chat.v1.IUser} message User message or plain object to encode
29348
+ * @param {$protobuf.Writer} [writer] Writer to encode to
29349
+ * @returns {$protobuf.Writer} Writer
29350
+ */
29351
+ User.encode = function encode(message, writer) {
29352
+ if (!writer)
29353
+ writer = $Writer.create();
29354
+ if (message.name != null && Object.hasOwnProperty.call(message, "name"))
29355
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
29356
+ if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName"))
29357
+ writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName);
29358
+ if (message.type != null && Object.hasOwnProperty.call(message, "type"))
29359
+ writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type);
29360
+ if (message.domainId != null && Object.hasOwnProperty.call(message, "domainId"))
29361
+ writer.uint32(/* id 6, wireType 2 =*/50).string(message.domainId);
29362
+ if (message.isAnonymous != null && Object.hasOwnProperty.call(message, "isAnonymous"))
29363
+ writer.uint32(/* id 7, wireType 0 =*/56).bool(message.isAnonymous);
29364
+ return writer;
29365
+ };
29366
+
29367
+ /**
29368
+ * Encodes the specified User message, length delimited. Does not implicitly {@link google.chat.v1.User.verify|verify} messages.
29369
+ * @function encodeDelimited
29370
+ * @memberof google.chat.v1.User
29371
+ * @static
29372
+ * @param {google.chat.v1.IUser} message User message or plain object to encode
29373
+ * @param {$protobuf.Writer} [writer] Writer to encode to
29374
+ * @returns {$protobuf.Writer} Writer
29375
+ */
29376
+ User.encodeDelimited = function encodeDelimited(message, writer) {
29377
+ return this.encode(message, writer).ldelim();
29378
+ };
29379
+
29380
+ /**
29381
+ * Decodes a User message from the specified reader or buffer.
29382
+ * @function decode
29383
+ * @memberof google.chat.v1.User
29384
+ * @static
29385
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
29386
+ * @param {number} [length] Message length if known beforehand
29387
+ * @returns {google.chat.v1.User} User
29388
+ * @throws {Error} If the payload is not a reader or valid buffer
29389
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
29390
+ */
29391
+ User.decode = function decode(reader, length) {
29392
+ if (!(reader instanceof $Reader))
29393
+ reader = $Reader.create(reader);
29394
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.User();
29395
+ while (reader.pos < end) {
29396
+ var tag = reader.uint32();
29397
+ switch (tag >>> 3) {
29398
+ case 1: {
29399
+ message.name = reader.string();
29400
+ break;
29401
+ }
29402
+ case 2: {
29403
+ message.displayName = reader.string();
29404
+ break;
29405
+ }
29406
+ case 6: {
29407
+ message.domainId = reader.string();
29408
+ break;
29409
+ }
29410
+ case 5: {
29411
+ message.type = reader.int32();
29412
+ break;
29413
+ }
29414
+ case 7: {
29415
+ message.isAnonymous = reader.bool();
29416
+ break;
29417
+ }
29418
+ default:
29419
+ reader.skipType(tag & 7);
29420
+ break;
29421
+ }
29422
+ }
29423
+ return message;
29424
+ };
29425
+
29426
+ /**
29427
+ * Decodes a User message from the specified reader or buffer, length delimited.
29428
+ * @function decodeDelimited
29429
+ * @memberof google.chat.v1.User
29430
+ * @static
29431
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
29432
+ * @returns {google.chat.v1.User} User
29433
+ * @throws {Error} If the payload is not a reader or valid buffer
29434
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
29435
+ */
29436
+ User.decodeDelimited = function decodeDelimited(reader) {
29437
+ if (!(reader instanceof $Reader))
29438
+ reader = new $Reader(reader);
29439
+ return this.decode(reader, reader.uint32());
29440
+ };
29441
+
29442
+ /**
29443
+ * Verifies a User message.
29444
+ * @function verify
29445
+ * @memberof google.chat.v1.User
29446
+ * @static
29447
+ * @param {Object.<string,*>} message Plain object to verify
29448
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
29449
+ */
29450
+ User.verify = function verify(message) {
29451
+ if (typeof message !== "object" || message === null)
29452
+ return "object expected";
29453
+ if (message.name != null && message.hasOwnProperty("name"))
29454
+ if (!$util.isString(message.name))
29455
+ return "name: string expected";
29456
+ if (message.displayName != null && message.hasOwnProperty("displayName"))
29457
+ if (!$util.isString(message.displayName))
29458
+ return "displayName: string expected";
29459
+ if (message.domainId != null && message.hasOwnProperty("domainId"))
29460
+ if (!$util.isString(message.domainId))
29461
+ return "domainId: string expected";
29462
+ if (message.type != null && message.hasOwnProperty("type"))
29463
+ switch (message.type) {
29464
+ default:
29465
+ return "type: enum value expected";
29466
+ case 0:
29467
+ case 1:
29468
+ case 2:
29469
+ break;
29470
+ }
29471
+ if (message.isAnonymous != null && message.hasOwnProperty("isAnonymous"))
29472
+ if (typeof message.isAnonymous !== "boolean")
29473
+ return "isAnonymous: boolean expected";
29474
+ return null;
29475
+ };
29476
+
29477
+ /**
29478
+ * Creates a User message from a plain object. Also converts values to their respective internal types.
29479
+ * @function fromObject
29480
+ * @memberof google.chat.v1.User
29481
+ * @static
29482
+ * @param {Object.<string,*>} object Plain object
29483
+ * @returns {google.chat.v1.User} User
29484
+ */
29485
+ User.fromObject = function fromObject(object) {
29486
+ if (object instanceof $root.google.chat.v1.User)
29487
+ return object;
29488
+ var message = new $root.google.chat.v1.User();
29489
+ if (object.name != null)
29490
+ message.name = String(object.name);
29491
+ if (object.displayName != null)
29492
+ message.displayName = String(object.displayName);
29493
+ if (object.domainId != null)
29494
+ message.domainId = String(object.domainId);
29495
+ switch (object.type) {
29496
+ default:
29497
+ if (typeof object.type === "number") {
29498
+ message.type = object.type;
29499
+ break;
29500
+ }
29501
+ break;
29502
+ case "TYPE_UNSPECIFIED":
29503
+ case 0:
29504
+ message.type = 0;
29505
+ break;
29506
+ case "HUMAN":
29507
+ case 1:
29508
+ message.type = 1;
29509
+ break;
29510
+ case "BOT":
29511
+ case 2:
29512
+ message.type = 2;
29513
+ break;
29514
+ }
29515
+ if (object.isAnonymous != null)
29516
+ message.isAnonymous = Boolean(object.isAnonymous);
29517
+ return message;
29518
+ };
29519
+
29520
+ /**
29521
+ * Creates a plain object from a User message. Also converts values to other types if specified.
28969
29522
  * @function toObject
28970
- * @memberof google.chat.v1.UploadAttachmentResponse
29523
+ * @memberof google.chat.v1.User
28971
29524
  * @static
28972
- * @param {google.chat.v1.UploadAttachmentResponse} message UploadAttachmentResponse
29525
+ * @param {google.chat.v1.User} message User
28973
29526
  * @param {$protobuf.IConversionOptions} [options] Conversion options
28974
29527
  * @returns {Object.<string,*>} Plain object
28975
29528
  */
28976
- UploadAttachmentResponse.toObject = function toObject(message, options) {
29529
+ User.toObject = function toObject(message, options) {
28977
29530
  if (!options)
28978
29531
  options = {};
28979
29532
  var object = {};
28980
- if (options.defaults)
28981
- object.attachmentDataRef = null;
28982
- if (message.attachmentDataRef != null && message.hasOwnProperty("attachmentDataRef"))
28983
- object.attachmentDataRef = $root.google.chat.v1.AttachmentDataRef.toObject(message.attachmentDataRef, options);
29533
+ if (options.defaults) {
29534
+ object.name = "";
29535
+ object.displayName = "";
29536
+ object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0;
29537
+ object.domainId = "";
29538
+ object.isAnonymous = false;
29539
+ }
29540
+ if (message.name != null && message.hasOwnProperty("name"))
29541
+ object.name = message.name;
29542
+ if (message.displayName != null && message.hasOwnProperty("displayName"))
29543
+ object.displayName = message.displayName;
29544
+ if (message.type != null && message.hasOwnProperty("type"))
29545
+ object.type = options.enums === String ? $root.google.chat.v1.User.Type[message.type] === undefined ? message.type : $root.google.chat.v1.User.Type[message.type] : message.type;
29546
+ if (message.domainId != null && message.hasOwnProperty("domainId"))
29547
+ object.domainId = message.domainId;
29548
+ if (message.isAnonymous != null && message.hasOwnProperty("isAnonymous"))
29549
+ object.isAnonymous = message.isAnonymous;
28984
29550
  return object;
28985
29551
  };
28986
29552
 
28987
29553
  /**
28988
- * Converts this UploadAttachmentResponse to JSON.
29554
+ * Converts this User to JSON.
28989
29555
  * @function toJSON
28990
- * @memberof google.chat.v1.UploadAttachmentResponse
29556
+ * @memberof google.chat.v1.User
28991
29557
  * @instance
28992
29558
  * @returns {Object.<string,*>} JSON object
28993
29559
  */
28994
- UploadAttachmentResponse.prototype.toJSON = function toJSON() {
29560
+ User.prototype.toJSON = function toJSON() {
28995
29561
  return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
28996
29562
  };
28997
29563
 
28998
29564
  /**
28999
- * Gets the default type url for UploadAttachmentResponse
29565
+ * Gets the default type url for User
29000
29566
  * @function getTypeUrl
29001
- * @memberof google.chat.v1.UploadAttachmentResponse
29567
+ * @memberof google.chat.v1.User
29002
29568
  * @static
29003
29569
  * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
29004
29570
  * @returns {string} The default type url
29005
29571
  */
29006
- UploadAttachmentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
29572
+ User.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
29007
29573
  if (typeUrlPrefix === undefined) {
29008
29574
  typeUrlPrefix = "type.googleapis.com";
29009
29575
  }
29010
- return typeUrlPrefix + "/google.chat.v1.UploadAttachmentResponse";
29576
+ return typeUrlPrefix + "/google.chat.v1.User";
29011
29577
  };
29012
29578
 
29013
- return UploadAttachmentResponse;
29579
+ /**
29580
+ * Type enum.
29581
+ * @name google.chat.v1.User.Type
29582
+ * @enum {number}
29583
+ * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value
29584
+ * @property {number} HUMAN=1 HUMAN value
29585
+ * @property {number} BOT=2 BOT value
29586
+ */
29587
+ User.Type = (function() {
29588
+ var valuesById = {}, values = Object.create(valuesById);
29589
+ values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0;
29590
+ values[valuesById[1] = "HUMAN"] = 1;
29591
+ values[valuesById[2] = "BOT"] = 2;
29592
+ return values;
29593
+ })();
29594
+
29595
+ return User;
29014
29596
  })();
29015
29597
 
29016
29598
  v1.ChatService = (function() {
@@ -31689,6 +32271,7 @@
31689
32271
  * @property {google.chat.v1.IDeletionMetadata|null} [deletionMetadata] Message deletionMetadata
31690
32272
  * @property {google.chat.v1.IQuotedMessageMetadata|null} [quotedMessageMetadata] Message quotedMessageMetadata
31691
32273
  * @property {Array.<google.chat.v1.IAttachedGif>|null} [attachedGifs] Message attachedGifs
32274
+ * @property {Array.<google.chat.v1.IAccessoryWidget>|null} [accessoryWidgets] Message accessoryWidgets
31692
32275
  */
31693
32276
 
31694
32277
  /**
@@ -31706,6 +32289,7 @@
31706
32289
  this.attachment = [];
31707
32290
  this.emojiReactionSummaries = [];
31708
32291
  this.attachedGifs = [];
32292
+ this.accessoryWidgets = [];
31709
32293
  if (properties)
31710
32294
  for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
31711
32295
  if (properties[keys[i]] != null)
@@ -31912,6 +32496,14 @@
31912
32496
  */
31913
32497
  Message.prototype.attachedGifs = $util.emptyArray;
31914
32498
 
32499
+ /**
32500
+ * Message accessoryWidgets.
32501
+ * @member {Array.<google.chat.v1.IAccessoryWidget>} accessoryWidgets
32502
+ * @memberof google.chat.v1.Message
32503
+ * @instance
32504
+ */
32505
+ Message.prototype.accessoryWidgets = $util.emptyArray;
32506
+
31915
32507
  /**
31916
32508
  * Creates a new Message instance using the specified properties.
31917
32509
  * @function create
@@ -31992,6 +32584,9 @@
31992
32584
  $root.google.chat.v1.AttachedGif.encode(message.attachedGifs[i], writer.uint32(/* id 42, wireType 2 =*/338).fork()).ldelim();
31993
32585
  if (message.formattedText != null && Object.hasOwnProperty.call(message, "formattedText"))
31994
32586
  writer.uint32(/* id 43, wireType 2 =*/346).string(message.formattedText);
32587
+ if (message.accessoryWidgets != null && message.accessoryWidgets.length)
32588
+ for (var i = 0; i < message.accessoryWidgets.length; ++i)
32589
+ $root.google.chat.v1.AccessoryWidget.encode(message.accessoryWidgets[i], writer.uint32(/* id 44, wireType 2 =*/354).fork()).ldelim();
31995
32590
  return writer;
31996
32591
  };
31997
32592
 
@@ -32138,6 +32733,12 @@
32138
32733
  message.attachedGifs.push($root.google.chat.v1.AttachedGif.decode(reader, reader.uint32()));
32139
32734
  break;
32140
32735
  }
32736
+ case 44: {
32737
+ if (!(message.accessoryWidgets && message.accessoryWidgets.length))
32738
+ message.accessoryWidgets = [];
32739
+ message.accessoryWidgets.push($root.google.chat.v1.AccessoryWidget.decode(reader, reader.uint32()));
32740
+ break;
32741
+ }
32141
32742
  default:
32142
32743
  reader.skipType(tag & 7);
32143
32744
  break;
@@ -32308,6 +32909,15 @@
32308
32909
  return "attachedGifs." + error;
32309
32910
  }
32310
32911
  }
32912
+ if (message.accessoryWidgets != null && message.hasOwnProperty("accessoryWidgets")) {
32913
+ if (!Array.isArray(message.accessoryWidgets))
32914
+ return "accessoryWidgets: array expected";
32915
+ for (var i = 0; i < message.accessoryWidgets.length; ++i) {
32916
+ var error = $root.google.chat.v1.AccessoryWidget.verify(message.accessoryWidgets[i]);
32917
+ if (error)
32918
+ return "accessoryWidgets." + error;
32919
+ }
32920
+ }
32311
32921
  return null;
32312
32922
  };
32313
32923
 
@@ -32457,6 +33067,16 @@
32457
33067
  message.attachedGifs[i] = $root.google.chat.v1.AttachedGif.fromObject(object.attachedGifs[i]);
32458
33068
  }
32459
33069
  }
33070
+ if (object.accessoryWidgets) {
33071
+ if (!Array.isArray(object.accessoryWidgets))
33072
+ throw TypeError(".google.chat.v1.Message.accessoryWidgets: array expected");
33073
+ message.accessoryWidgets = [];
33074
+ for (var i = 0; i < object.accessoryWidgets.length; ++i) {
33075
+ if (typeof object.accessoryWidgets[i] !== "object")
33076
+ throw TypeError(".google.chat.v1.Message.accessoryWidgets: object expected");
33077
+ message.accessoryWidgets[i] = $root.google.chat.v1.AccessoryWidget.fromObject(object.accessoryWidgets[i]);
33078
+ }
33079
+ }
32460
33080
  return message;
32461
33081
  };
32462
33082
 
@@ -32480,6 +33100,7 @@
32480
33100
  object.cardsV2 = [];
32481
33101
  object.emojiReactionSummaries = [];
32482
33102
  object.attachedGifs = [];
33103
+ object.accessoryWidgets = [];
32483
33104
  }
32484
33105
  if (options.defaults) {
32485
33106
  object.name = "";
@@ -32570,6 +33191,11 @@
32570
33191
  }
32571
33192
  if (message.formattedText != null && message.hasOwnProperty("formattedText"))
32572
33193
  object.formattedText = message.formattedText;
33194
+ if (message.accessoryWidgets && message.accessoryWidgets.length) {
33195
+ object.accessoryWidgets = [];
33196
+ for (var j = 0; j < message.accessoryWidgets.length; ++j)
33197
+ object.accessoryWidgets[j] = $root.google.chat.v1.AccessoryWidget.toObject(message.accessoryWidgets[j], options);
33198
+ }
32573
33199
  return object;
32574
33200
  };
32575
33201
 
@@ -34090,6 +34716,233 @@
34090
34716
  return ActionResponse;
34091
34717
  })();
34092
34718
 
34719
+ v1.AccessoryWidget = (function() {
34720
+
34721
+ /**
34722
+ * Properties of an AccessoryWidget.
34723
+ * @memberof google.chat.v1
34724
+ * @interface IAccessoryWidget
34725
+ * @property {google.apps.card.v1.IButtonList|null} [buttonList] AccessoryWidget buttonList
34726
+ */
34727
+
34728
+ /**
34729
+ * Constructs a new AccessoryWidget.
34730
+ * @memberof google.chat.v1
34731
+ * @classdesc Represents an AccessoryWidget.
34732
+ * @implements IAccessoryWidget
34733
+ * @constructor
34734
+ * @param {google.chat.v1.IAccessoryWidget=} [properties] Properties to set
34735
+ */
34736
+ function AccessoryWidget(properties) {
34737
+ if (properties)
34738
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
34739
+ if (properties[keys[i]] != null)
34740
+ this[keys[i]] = properties[keys[i]];
34741
+ }
34742
+
34743
+ /**
34744
+ * AccessoryWidget buttonList.
34745
+ * @member {google.apps.card.v1.IButtonList|null|undefined} buttonList
34746
+ * @memberof google.chat.v1.AccessoryWidget
34747
+ * @instance
34748
+ */
34749
+ AccessoryWidget.prototype.buttonList = null;
34750
+
34751
+ // OneOf field names bound to virtual getters and setters
34752
+ var $oneOfFields;
34753
+
34754
+ /**
34755
+ * AccessoryWidget action.
34756
+ * @member {"buttonList"|undefined} action
34757
+ * @memberof google.chat.v1.AccessoryWidget
34758
+ * @instance
34759
+ */
34760
+ Object.defineProperty(AccessoryWidget.prototype, "action", {
34761
+ get: $util.oneOfGetter($oneOfFields = ["buttonList"]),
34762
+ set: $util.oneOfSetter($oneOfFields)
34763
+ });
34764
+
34765
+ /**
34766
+ * Creates a new AccessoryWidget instance using the specified properties.
34767
+ * @function create
34768
+ * @memberof google.chat.v1.AccessoryWidget
34769
+ * @static
34770
+ * @param {google.chat.v1.IAccessoryWidget=} [properties] Properties to set
34771
+ * @returns {google.chat.v1.AccessoryWidget} AccessoryWidget instance
34772
+ */
34773
+ AccessoryWidget.create = function create(properties) {
34774
+ return new AccessoryWidget(properties);
34775
+ };
34776
+
34777
+ /**
34778
+ * Encodes the specified AccessoryWidget message. Does not implicitly {@link google.chat.v1.AccessoryWidget.verify|verify} messages.
34779
+ * @function encode
34780
+ * @memberof google.chat.v1.AccessoryWidget
34781
+ * @static
34782
+ * @param {google.chat.v1.IAccessoryWidget} message AccessoryWidget message or plain object to encode
34783
+ * @param {$protobuf.Writer} [writer] Writer to encode to
34784
+ * @returns {$protobuf.Writer} Writer
34785
+ */
34786
+ AccessoryWidget.encode = function encode(message, writer) {
34787
+ if (!writer)
34788
+ writer = $Writer.create();
34789
+ if (message.buttonList != null && Object.hasOwnProperty.call(message, "buttonList"))
34790
+ $root.google.apps.card.v1.ButtonList.encode(message.buttonList, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
34791
+ return writer;
34792
+ };
34793
+
34794
+ /**
34795
+ * Encodes the specified AccessoryWidget message, length delimited. Does not implicitly {@link google.chat.v1.AccessoryWidget.verify|verify} messages.
34796
+ * @function encodeDelimited
34797
+ * @memberof google.chat.v1.AccessoryWidget
34798
+ * @static
34799
+ * @param {google.chat.v1.IAccessoryWidget} message AccessoryWidget message or plain object to encode
34800
+ * @param {$protobuf.Writer} [writer] Writer to encode to
34801
+ * @returns {$protobuf.Writer} Writer
34802
+ */
34803
+ AccessoryWidget.encodeDelimited = function encodeDelimited(message, writer) {
34804
+ return this.encode(message, writer).ldelim();
34805
+ };
34806
+
34807
+ /**
34808
+ * Decodes an AccessoryWidget message from the specified reader or buffer.
34809
+ * @function decode
34810
+ * @memberof google.chat.v1.AccessoryWidget
34811
+ * @static
34812
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
34813
+ * @param {number} [length] Message length if known beforehand
34814
+ * @returns {google.chat.v1.AccessoryWidget} AccessoryWidget
34815
+ * @throws {Error} If the payload is not a reader or valid buffer
34816
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
34817
+ */
34818
+ AccessoryWidget.decode = function decode(reader, length) {
34819
+ if (!(reader instanceof $Reader))
34820
+ reader = $Reader.create(reader);
34821
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.AccessoryWidget();
34822
+ while (reader.pos < end) {
34823
+ var tag = reader.uint32();
34824
+ switch (tag >>> 3) {
34825
+ case 1: {
34826
+ message.buttonList = $root.google.apps.card.v1.ButtonList.decode(reader, reader.uint32());
34827
+ break;
34828
+ }
34829
+ default:
34830
+ reader.skipType(tag & 7);
34831
+ break;
34832
+ }
34833
+ }
34834
+ return message;
34835
+ };
34836
+
34837
+ /**
34838
+ * Decodes an AccessoryWidget message from the specified reader or buffer, length delimited.
34839
+ * @function decodeDelimited
34840
+ * @memberof google.chat.v1.AccessoryWidget
34841
+ * @static
34842
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
34843
+ * @returns {google.chat.v1.AccessoryWidget} AccessoryWidget
34844
+ * @throws {Error} If the payload is not a reader or valid buffer
34845
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
34846
+ */
34847
+ AccessoryWidget.decodeDelimited = function decodeDelimited(reader) {
34848
+ if (!(reader instanceof $Reader))
34849
+ reader = new $Reader(reader);
34850
+ return this.decode(reader, reader.uint32());
34851
+ };
34852
+
34853
+ /**
34854
+ * Verifies an AccessoryWidget message.
34855
+ * @function verify
34856
+ * @memberof google.chat.v1.AccessoryWidget
34857
+ * @static
34858
+ * @param {Object.<string,*>} message Plain object to verify
34859
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
34860
+ */
34861
+ AccessoryWidget.verify = function verify(message) {
34862
+ if (typeof message !== "object" || message === null)
34863
+ return "object expected";
34864
+ var properties = {};
34865
+ if (message.buttonList != null && message.hasOwnProperty("buttonList")) {
34866
+ properties.action = 1;
34867
+ {
34868
+ var error = $root.google.apps.card.v1.ButtonList.verify(message.buttonList);
34869
+ if (error)
34870
+ return "buttonList." + error;
34871
+ }
34872
+ }
34873
+ return null;
34874
+ };
34875
+
34876
+ /**
34877
+ * Creates an AccessoryWidget message from a plain object. Also converts values to their respective internal types.
34878
+ * @function fromObject
34879
+ * @memberof google.chat.v1.AccessoryWidget
34880
+ * @static
34881
+ * @param {Object.<string,*>} object Plain object
34882
+ * @returns {google.chat.v1.AccessoryWidget} AccessoryWidget
34883
+ */
34884
+ AccessoryWidget.fromObject = function fromObject(object) {
34885
+ if (object instanceof $root.google.chat.v1.AccessoryWidget)
34886
+ return object;
34887
+ var message = new $root.google.chat.v1.AccessoryWidget();
34888
+ if (object.buttonList != null) {
34889
+ if (typeof object.buttonList !== "object")
34890
+ throw TypeError(".google.chat.v1.AccessoryWidget.buttonList: object expected");
34891
+ message.buttonList = $root.google.apps.card.v1.ButtonList.fromObject(object.buttonList);
34892
+ }
34893
+ return message;
34894
+ };
34895
+
34896
+ /**
34897
+ * Creates a plain object from an AccessoryWidget message. Also converts values to other types if specified.
34898
+ * @function toObject
34899
+ * @memberof google.chat.v1.AccessoryWidget
34900
+ * @static
34901
+ * @param {google.chat.v1.AccessoryWidget} message AccessoryWidget
34902
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
34903
+ * @returns {Object.<string,*>} Plain object
34904
+ */
34905
+ AccessoryWidget.toObject = function toObject(message, options) {
34906
+ if (!options)
34907
+ options = {};
34908
+ var object = {};
34909
+ if (message.buttonList != null && message.hasOwnProperty("buttonList")) {
34910
+ object.buttonList = $root.google.apps.card.v1.ButtonList.toObject(message.buttonList, options);
34911
+ if (options.oneofs)
34912
+ object.action = "buttonList";
34913
+ }
34914
+ return object;
34915
+ };
34916
+
34917
+ /**
34918
+ * Converts this AccessoryWidget to JSON.
34919
+ * @function toJSON
34920
+ * @memberof google.chat.v1.AccessoryWidget
34921
+ * @instance
34922
+ * @returns {Object.<string,*>} JSON object
34923
+ */
34924
+ AccessoryWidget.prototype.toJSON = function toJSON() {
34925
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
34926
+ };
34927
+
34928
+ /**
34929
+ * Gets the default type url for AccessoryWidget
34930
+ * @function getTypeUrl
34931
+ * @memberof google.chat.v1.AccessoryWidget
34932
+ * @static
34933
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
34934
+ * @returns {string} The default type url
34935
+ */
34936
+ AccessoryWidget.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
34937
+ if (typeUrlPrefix === undefined) {
34938
+ typeUrlPrefix = "type.googleapis.com";
34939
+ }
34940
+ return typeUrlPrefix + "/google.chat.v1.AccessoryWidget";
34941
+ };
34942
+
34943
+ return AccessoryWidget;
34944
+ })();
34945
+
34093
34946
  v1.GetMessageRequest = (function() {
34094
34947
 
34095
34948
  /**