@wireapp/protocol-messaging 1.51.0 → 1.53.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.
package/web/messages.js CHANGED
@@ -25,6 +25,7 @@ $root.GenericMessage = (function() {
25
25
  * @property {ClientAction|null} [clientAction] GenericMessage clientAction
26
26
  * @property {ICalling|null} [calling] GenericMessage calling
27
27
  * @property {IAsset|null} [asset] GenericMessage asset
28
+ * @property {IMultipart|null} [multipart] GenericMessage multipart
28
29
  * @property {IMessageHide|null} [hidden] GenericMessage hidden
29
30
  * @property {ILocation|null} [location] GenericMessage location
30
31
  * @property {IMessageDelete|null} [deleted] GenericMessage deleted
@@ -137,6 +138,14 @@ $root.GenericMessage = (function() {
137
138
  */
138
139
  GenericMessage.prototype.asset = null;
139
140
 
141
+ /**
142
+ * GenericMessage multipart.
143
+ * @member {IMultipart|null|undefined} multipart
144
+ * @memberof GenericMessage
145
+ * @instance
146
+ */
147
+ GenericMessage.prototype.multipart = null;
148
+
140
149
  /**
141
150
  * GenericMessage hidden.
142
151
  * @member {IMessageHide|null|undefined} hidden
@@ -262,12 +271,12 @@ $root.GenericMessage = (function() {
262
271
 
263
272
  /**
264
273
  * GenericMessage content.
265
- * @member {"text"|"image"|"knock"|"lastRead"|"cleared"|"external"|"clientAction"|"calling"|"asset"|"hidden"|"location"|"deleted"|"edited"|"confirmation"|"reaction"|"ephemeral"|"availability"|"composite"|"buttonAction"|"buttonActionConfirmation"|"dataTransfer"|"inCallEmoji"|"inCallHandRaise"|undefined} content
274
+ * @member {"text"|"image"|"knock"|"lastRead"|"cleared"|"external"|"clientAction"|"calling"|"asset"|"multipart"|"hidden"|"location"|"deleted"|"edited"|"confirmation"|"reaction"|"ephemeral"|"availability"|"composite"|"buttonAction"|"buttonActionConfirmation"|"dataTransfer"|"inCallEmoji"|"inCallHandRaise"|undefined} content
266
275
  * @memberof GenericMessage
267
276
  * @instance
268
277
  */
269
278
  Object.defineProperty(GenericMessage.prototype, "content", {
270
- get: $util.oneOfGetter($oneOfFields = ["text", "image", "knock", "lastRead", "cleared", "external", "clientAction", "calling", "asset", "hidden", "location", "deleted", "edited", "confirmation", "reaction", "ephemeral", "availability", "composite", "buttonAction", "buttonActionConfirmation", "dataTransfer", "inCallEmoji", "inCallHandRaise"]),
279
+ get: $util.oneOfGetter($oneOfFields = ["text", "image", "knock", "lastRead", "cleared", "external", "clientAction", "calling", "asset", "multipart", "hidden", "location", "deleted", "edited", "confirmation", "reaction", "ephemeral", "availability", "composite", "buttonAction", "buttonActionConfirmation", "dataTransfer", "inCallEmoji", "inCallHandRaise"]),
271
280
  set: $util.oneOfSetter($oneOfFields)
272
281
  });
273
282
 
@@ -344,6 +353,8 @@ $root.GenericMessage = (function() {
344
353
  writer.uint32(/* id 25, wireType 0 =*/200).int32(message.unknownStrategy);
345
354
  if (message.inCallHandRaise != null && Object.hasOwnProperty.call(message, "inCallHandRaise"))
346
355
  $root.InCallHandRaise.encode(message.inCallHandRaise, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim();
356
+ if (message.multipart != null && Object.hasOwnProperty.call(message, "multipart"))
357
+ $root.Multipart.encode(message.multipart, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim();
347
358
  return writer;
348
359
  };
349
360
 
@@ -418,6 +429,10 @@ $root.GenericMessage = (function() {
418
429
  message.asset = $root.Asset.decode(reader, reader.uint32());
419
430
  break;
420
431
  }
432
+ case 27: {
433
+ message.multipart = $root.Multipart.decode(reader, reader.uint32());
434
+ break;
435
+ }
421
436
  case 12: {
422
437
  message.hidden = $root.MessageHide.decode(reader, reader.uint32());
423
438
  break;
@@ -607,6 +622,16 @@ $root.GenericMessage = (function() {
607
622
  return "asset." + error;
608
623
  }
609
624
  }
625
+ if (message.multipart != null && message.hasOwnProperty("multipart")) {
626
+ if (properties.content === 1)
627
+ return "content: multiple values";
628
+ properties.content = 1;
629
+ {
630
+ var error = $root.Multipart.verify(message.multipart);
631
+ if (error)
632
+ return "multipart." + error;
633
+ }
634
+ }
610
635
  if (message.hidden != null && message.hasOwnProperty("hidden")) {
611
636
  if (properties.content === 1)
612
637
  return "content: multiple values";
@@ -825,6 +850,11 @@ $root.GenericMessage = (function() {
825
850
  throw TypeError(".GenericMessage.asset: object expected");
826
851
  message.asset = $root.Asset.fromObject(object.asset);
827
852
  }
853
+ if (object.multipart != null) {
854
+ if (typeof object.multipart !== "object")
855
+ throw TypeError(".GenericMessage.multipart: object expected");
856
+ message.multipart = $root.Multipart.fromObject(object.multipart);
857
+ }
828
858
  if (object.hidden != null) {
829
859
  if (typeof object.hidden !== "object")
830
860
  throw TypeError(".GenericMessage.hidden: object expected");
@@ -1054,6 +1084,11 @@ $root.GenericMessage = (function() {
1054
1084
  if (options.oneofs)
1055
1085
  object.content = "inCallHandRaise";
1056
1086
  }
1087
+ if (message.multipart != null && message.hasOwnProperty("multipart")) {
1088
+ object.multipart = $root.Multipart.toObject(message.multipart, options);
1089
+ if (options.oneofs)
1090
+ object.content = "multipart";
1091
+ }
1057
1092
  return object;
1058
1093
  };
1059
1094
 
@@ -7965,6 +8000,1738 @@ $root.ImageAsset = (function() {
7965
8000
  return ImageAsset;
7966
8001
  })();
7967
8002
 
8003
+ $root.Attachment = (function() {
8004
+
8005
+ /**
8006
+ * Properties of an Attachment.
8007
+ * @exports IAttachment
8008
+ * @interface IAttachment
8009
+ * @property {IAsset|null} [asset] Attachment asset
8010
+ * @property {ICellAsset|null} [cellAsset] Attachment cellAsset
8011
+ */
8012
+
8013
+ /**
8014
+ * Constructs a new Attachment.
8015
+ * @exports Attachment
8016
+ * @classdesc Represents an Attachment.
8017
+ * @implements IAttachment
8018
+ * @constructor
8019
+ * @param {IAttachment=} [properties] Properties to set
8020
+ */
8021
+ function Attachment(properties) {
8022
+ if (properties)
8023
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
8024
+ if (properties[keys[i]] != null)
8025
+ this[keys[i]] = properties[keys[i]];
8026
+ }
8027
+
8028
+ /**
8029
+ * Attachment asset.
8030
+ * @member {IAsset|null|undefined} asset
8031
+ * @memberof Attachment
8032
+ * @instance
8033
+ */
8034
+ Attachment.prototype.asset = null;
8035
+
8036
+ /**
8037
+ * Attachment cellAsset.
8038
+ * @member {ICellAsset|null|undefined} cellAsset
8039
+ * @memberof Attachment
8040
+ * @instance
8041
+ */
8042
+ Attachment.prototype.cellAsset = null;
8043
+
8044
+ // OneOf field names bound to virtual getters and setters
8045
+ var $oneOfFields;
8046
+
8047
+ /**
8048
+ * Attachment content.
8049
+ * @member {"asset"|"cellAsset"|undefined} content
8050
+ * @memberof Attachment
8051
+ * @instance
8052
+ */
8053
+ Object.defineProperty(Attachment.prototype, "content", {
8054
+ get: $util.oneOfGetter($oneOfFields = ["asset", "cellAsset"]),
8055
+ set: $util.oneOfSetter($oneOfFields)
8056
+ });
8057
+
8058
+ /**
8059
+ * Creates a new Attachment instance using the specified properties.
8060
+ * @function create
8061
+ * @memberof Attachment
8062
+ * @static
8063
+ * @param {IAttachment=} [properties] Properties to set
8064
+ * @returns {Attachment} Attachment instance
8065
+ */
8066
+ Attachment.create = function create(properties) {
8067
+ return new Attachment(properties);
8068
+ };
8069
+
8070
+ /**
8071
+ * Encodes the specified Attachment message. Does not implicitly {@link Attachment.verify|verify} messages.
8072
+ * @function encode
8073
+ * @memberof Attachment
8074
+ * @static
8075
+ * @param {IAttachment} message Attachment message or plain object to encode
8076
+ * @param {$protobuf.Writer} [writer] Writer to encode to
8077
+ * @returns {$protobuf.Writer} Writer
8078
+ */
8079
+ Attachment.encode = function encode(message, writer) {
8080
+ if (!writer)
8081
+ writer = $Writer.create();
8082
+ if (message.asset != null && Object.hasOwnProperty.call(message, "asset"))
8083
+ $root.Asset.encode(message.asset, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
8084
+ if (message.cellAsset != null && Object.hasOwnProperty.call(message, "cellAsset"))
8085
+ $root.CellAsset.encode(message.cellAsset, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
8086
+ return writer;
8087
+ };
8088
+
8089
+ /**
8090
+ * Encodes the specified Attachment message, length delimited. Does not implicitly {@link Attachment.verify|verify} messages.
8091
+ * @function encodeDelimited
8092
+ * @memberof Attachment
8093
+ * @static
8094
+ * @param {IAttachment} message Attachment message or plain object to encode
8095
+ * @param {$protobuf.Writer} [writer] Writer to encode to
8096
+ * @returns {$protobuf.Writer} Writer
8097
+ */
8098
+ Attachment.encodeDelimited = function encodeDelimited(message, writer) {
8099
+ return this.encode(message, writer).ldelim();
8100
+ };
8101
+
8102
+ /**
8103
+ * Decodes an Attachment message from the specified reader or buffer.
8104
+ * @function decode
8105
+ * @memberof Attachment
8106
+ * @static
8107
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
8108
+ * @param {number} [length] Message length if known beforehand
8109
+ * @returns {Attachment} Attachment
8110
+ * @throws {Error} If the payload is not a reader or valid buffer
8111
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
8112
+ */
8113
+ Attachment.decode = function decode(reader, length) {
8114
+ if (!(reader instanceof $Reader))
8115
+ reader = $Reader.create(reader);
8116
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Attachment();
8117
+ while (reader.pos < end) {
8118
+ var tag = reader.uint32();
8119
+ switch (tag >>> 3) {
8120
+ case 1: {
8121
+ message.asset = $root.Asset.decode(reader, reader.uint32());
8122
+ break;
8123
+ }
8124
+ case 2: {
8125
+ message.cellAsset = $root.CellAsset.decode(reader, reader.uint32());
8126
+ break;
8127
+ }
8128
+ default:
8129
+ reader.skipType(tag & 7);
8130
+ break;
8131
+ }
8132
+ }
8133
+ return message;
8134
+ };
8135
+
8136
+ /**
8137
+ * Decodes an Attachment message from the specified reader or buffer, length delimited.
8138
+ * @function decodeDelimited
8139
+ * @memberof Attachment
8140
+ * @static
8141
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
8142
+ * @returns {Attachment} Attachment
8143
+ * @throws {Error} If the payload is not a reader or valid buffer
8144
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
8145
+ */
8146
+ Attachment.decodeDelimited = function decodeDelimited(reader) {
8147
+ if (!(reader instanceof $Reader))
8148
+ reader = new $Reader(reader);
8149
+ return this.decode(reader, reader.uint32());
8150
+ };
8151
+
8152
+ /**
8153
+ * Verifies an Attachment message.
8154
+ * @function verify
8155
+ * @memberof Attachment
8156
+ * @static
8157
+ * @param {Object.<string,*>} message Plain object to verify
8158
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
8159
+ */
8160
+ Attachment.verify = function verify(message) {
8161
+ if (typeof message !== "object" || message === null)
8162
+ return "object expected";
8163
+ var properties = {};
8164
+ if (message.asset != null && message.hasOwnProperty("asset")) {
8165
+ properties.content = 1;
8166
+ {
8167
+ var error = $root.Asset.verify(message.asset);
8168
+ if (error)
8169
+ return "asset." + error;
8170
+ }
8171
+ }
8172
+ if (message.cellAsset != null && message.hasOwnProperty("cellAsset")) {
8173
+ if (properties.content === 1)
8174
+ return "content: multiple values";
8175
+ properties.content = 1;
8176
+ {
8177
+ var error = $root.CellAsset.verify(message.cellAsset);
8178
+ if (error)
8179
+ return "cellAsset." + error;
8180
+ }
8181
+ }
8182
+ return null;
8183
+ };
8184
+
8185
+ /**
8186
+ * Creates an Attachment message from a plain object. Also converts values to their respective internal types.
8187
+ * @function fromObject
8188
+ * @memberof Attachment
8189
+ * @static
8190
+ * @param {Object.<string,*>} object Plain object
8191
+ * @returns {Attachment} Attachment
8192
+ */
8193
+ Attachment.fromObject = function fromObject(object) {
8194
+ if (object instanceof $root.Attachment)
8195
+ return object;
8196
+ var message = new $root.Attachment();
8197
+ if (object.asset != null) {
8198
+ if (typeof object.asset !== "object")
8199
+ throw TypeError(".Attachment.asset: object expected");
8200
+ message.asset = $root.Asset.fromObject(object.asset);
8201
+ }
8202
+ if (object.cellAsset != null) {
8203
+ if (typeof object.cellAsset !== "object")
8204
+ throw TypeError(".Attachment.cellAsset: object expected");
8205
+ message.cellAsset = $root.CellAsset.fromObject(object.cellAsset);
8206
+ }
8207
+ return message;
8208
+ };
8209
+
8210
+ /**
8211
+ * Creates a plain object from an Attachment message. Also converts values to other types if specified.
8212
+ * @function toObject
8213
+ * @memberof Attachment
8214
+ * @static
8215
+ * @param {Attachment} message Attachment
8216
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
8217
+ * @returns {Object.<string,*>} Plain object
8218
+ */
8219
+ Attachment.toObject = function toObject(message, options) {
8220
+ if (!options)
8221
+ options = {};
8222
+ var object = {};
8223
+ if (message.asset != null && message.hasOwnProperty("asset")) {
8224
+ object.asset = $root.Asset.toObject(message.asset, options);
8225
+ if (options.oneofs)
8226
+ object.content = "asset";
8227
+ }
8228
+ if (message.cellAsset != null && message.hasOwnProperty("cellAsset")) {
8229
+ object.cellAsset = $root.CellAsset.toObject(message.cellAsset, options);
8230
+ if (options.oneofs)
8231
+ object.content = "cellAsset";
8232
+ }
8233
+ return object;
8234
+ };
8235
+
8236
+ /**
8237
+ * Converts this Attachment to JSON.
8238
+ * @function toJSON
8239
+ * @memberof Attachment
8240
+ * @instance
8241
+ * @returns {Object.<string,*>} JSON object
8242
+ */
8243
+ Attachment.prototype.toJSON = function toJSON() {
8244
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
8245
+ };
8246
+
8247
+ /**
8248
+ * Gets the default type url for Attachment
8249
+ * @function getTypeUrl
8250
+ * @memberof Attachment
8251
+ * @static
8252
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
8253
+ * @returns {string} The default type url
8254
+ */
8255
+ Attachment.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
8256
+ if (typeUrlPrefix === undefined) {
8257
+ typeUrlPrefix = "type.googleapis.com";
8258
+ }
8259
+ return typeUrlPrefix + "/Attachment";
8260
+ };
8261
+
8262
+ return Attachment;
8263
+ })();
8264
+
8265
+ $root.Multipart = (function() {
8266
+
8267
+ /**
8268
+ * Properties of a Multipart.
8269
+ * @exports IMultipart
8270
+ * @interface IMultipart
8271
+ * @property {IText|null} [text] Multipart text
8272
+ * @property {Array.<IAttachment>|null} [attachments] Multipart attachments
8273
+ * @property {boolean|null} [expectsReadConfirmation] Multipart expectsReadConfirmation
8274
+ * @property {LegalHoldStatus|null} [legalHoldStatus] Multipart legalHoldStatus
8275
+ */
8276
+
8277
+ /**
8278
+ * Constructs a new Multipart.
8279
+ * @exports Multipart
8280
+ * @classdesc Represents a Multipart.
8281
+ * @implements IMultipart
8282
+ * @constructor
8283
+ * @param {IMultipart=} [properties] Properties to set
8284
+ */
8285
+ function Multipart(properties) {
8286
+ this.attachments = [];
8287
+ if (properties)
8288
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
8289
+ if (properties[keys[i]] != null)
8290
+ this[keys[i]] = properties[keys[i]];
8291
+ }
8292
+
8293
+ /**
8294
+ * Multipart text.
8295
+ * @member {IText|null|undefined} text
8296
+ * @memberof Multipart
8297
+ * @instance
8298
+ */
8299
+ Multipart.prototype.text = null;
8300
+
8301
+ /**
8302
+ * Multipart attachments.
8303
+ * @member {Array.<IAttachment>} attachments
8304
+ * @memberof Multipart
8305
+ * @instance
8306
+ */
8307
+ Multipart.prototype.attachments = $util.emptyArray;
8308
+
8309
+ /**
8310
+ * Multipart expectsReadConfirmation.
8311
+ * @member {boolean} expectsReadConfirmation
8312
+ * @memberof Multipart
8313
+ * @instance
8314
+ */
8315
+ Multipart.prototype.expectsReadConfirmation = false;
8316
+
8317
+ /**
8318
+ * Multipart legalHoldStatus.
8319
+ * @member {LegalHoldStatus} legalHoldStatus
8320
+ * @memberof Multipart
8321
+ * @instance
8322
+ */
8323
+ Multipart.prototype.legalHoldStatus = 0;
8324
+
8325
+ /**
8326
+ * Creates a new Multipart instance using the specified properties.
8327
+ * @function create
8328
+ * @memberof Multipart
8329
+ * @static
8330
+ * @param {IMultipart=} [properties] Properties to set
8331
+ * @returns {Multipart} Multipart instance
8332
+ */
8333
+ Multipart.create = function create(properties) {
8334
+ return new Multipart(properties);
8335
+ };
8336
+
8337
+ /**
8338
+ * Encodes the specified Multipart message. Does not implicitly {@link Multipart.verify|verify} messages.
8339
+ * @function encode
8340
+ * @memberof Multipart
8341
+ * @static
8342
+ * @param {IMultipart} message Multipart message or plain object to encode
8343
+ * @param {$protobuf.Writer} [writer] Writer to encode to
8344
+ * @returns {$protobuf.Writer} Writer
8345
+ */
8346
+ Multipart.encode = function encode(message, writer) {
8347
+ if (!writer)
8348
+ writer = $Writer.create();
8349
+ if (message.text != null && Object.hasOwnProperty.call(message, "text"))
8350
+ $root.Text.encode(message.text, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
8351
+ if (message.attachments != null && message.attachments.length)
8352
+ for (var i = 0; i < message.attachments.length; ++i)
8353
+ $root.Attachment.encode(message.attachments[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
8354
+ if (message.expectsReadConfirmation != null && Object.hasOwnProperty.call(message, "expectsReadConfirmation"))
8355
+ writer.uint32(/* id 3, wireType 0 =*/24).bool(message.expectsReadConfirmation);
8356
+ if (message.legalHoldStatus != null && Object.hasOwnProperty.call(message, "legalHoldStatus"))
8357
+ writer.uint32(/* id 4, wireType 0 =*/32).int32(message.legalHoldStatus);
8358
+ return writer;
8359
+ };
8360
+
8361
+ /**
8362
+ * Encodes the specified Multipart message, length delimited. Does not implicitly {@link Multipart.verify|verify} messages.
8363
+ * @function encodeDelimited
8364
+ * @memberof Multipart
8365
+ * @static
8366
+ * @param {IMultipart} message Multipart message or plain object to encode
8367
+ * @param {$protobuf.Writer} [writer] Writer to encode to
8368
+ * @returns {$protobuf.Writer} Writer
8369
+ */
8370
+ Multipart.encodeDelimited = function encodeDelimited(message, writer) {
8371
+ return this.encode(message, writer).ldelim();
8372
+ };
8373
+
8374
+ /**
8375
+ * Decodes a Multipart message from the specified reader or buffer.
8376
+ * @function decode
8377
+ * @memberof Multipart
8378
+ * @static
8379
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
8380
+ * @param {number} [length] Message length if known beforehand
8381
+ * @returns {Multipart} Multipart
8382
+ * @throws {Error} If the payload is not a reader or valid buffer
8383
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
8384
+ */
8385
+ Multipart.decode = function decode(reader, length) {
8386
+ if (!(reader instanceof $Reader))
8387
+ reader = $Reader.create(reader);
8388
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Multipart();
8389
+ while (reader.pos < end) {
8390
+ var tag = reader.uint32();
8391
+ switch (tag >>> 3) {
8392
+ case 1: {
8393
+ message.text = $root.Text.decode(reader, reader.uint32());
8394
+ break;
8395
+ }
8396
+ case 2: {
8397
+ if (!(message.attachments && message.attachments.length))
8398
+ message.attachments = [];
8399
+ message.attachments.push($root.Attachment.decode(reader, reader.uint32()));
8400
+ break;
8401
+ }
8402
+ case 3: {
8403
+ message.expectsReadConfirmation = reader.bool();
8404
+ break;
8405
+ }
8406
+ case 4: {
8407
+ message.legalHoldStatus = reader.int32();
8408
+ break;
8409
+ }
8410
+ default:
8411
+ reader.skipType(tag & 7);
8412
+ break;
8413
+ }
8414
+ }
8415
+ return message;
8416
+ };
8417
+
8418
+ /**
8419
+ * Decodes a Multipart message from the specified reader or buffer, length delimited.
8420
+ * @function decodeDelimited
8421
+ * @memberof Multipart
8422
+ * @static
8423
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
8424
+ * @returns {Multipart} Multipart
8425
+ * @throws {Error} If the payload is not a reader or valid buffer
8426
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
8427
+ */
8428
+ Multipart.decodeDelimited = function decodeDelimited(reader) {
8429
+ if (!(reader instanceof $Reader))
8430
+ reader = new $Reader(reader);
8431
+ return this.decode(reader, reader.uint32());
8432
+ };
8433
+
8434
+ /**
8435
+ * Verifies a Multipart message.
8436
+ * @function verify
8437
+ * @memberof Multipart
8438
+ * @static
8439
+ * @param {Object.<string,*>} message Plain object to verify
8440
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
8441
+ */
8442
+ Multipart.verify = function verify(message) {
8443
+ if (typeof message !== "object" || message === null)
8444
+ return "object expected";
8445
+ if (message.text != null && message.hasOwnProperty("text")) {
8446
+ var error = $root.Text.verify(message.text);
8447
+ if (error)
8448
+ return "text." + error;
8449
+ }
8450
+ if (message.attachments != null && message.hasOwnProperty("attachments")) {
8451
+ if (!Array.isArray(message.attachments))
8452
+ return "attachments: array expected";
8453
+ for (var i = 0; i < message.attachments.length; ++i) {
8454
+ var error = $root.Attachment.verify(message.attachments[i]);
8455
+ if (error)
8456
+ return "attachments." + error;
8457
+ }
8458
+ }
8459
+ if (message.expectsReadConfirmation != null && message.hasOwnProperty("expectsReadConfirmation"))
8460
+ if (typeof message.expectsReadConfirmation !== "boolean")
8461
+ return "expectsReadConfirmation: boolean expected";
8462
+ if (message.legalHoldStatus != null && message.hasOwnProperty("legalHoldStatus"))
8463
+ switch (message.legalHoldStatus) {
8464
+ default:
8465
+ return "legalHoldStatus: enum value expected";
8466
+ case 0:
8467
+ case 1:
8468
+ case 2:
8469
+ break;
8470
+ }
8471
+ return null;
8472
+ };
8473
+
8474
+ /**
8475
+ * Creates a Multipart message from a plain object. Also converts values to their respective internal types.
8476
+ * @function fromObject
8477
+ * @memberof Multipart
8478
+ * @static
8479
+ * @param {Object.<string,*>} object Plain object
8480
+ * @returns {Multipart} Multipart
8481
+ */
8482
+ Multipart.fromObject = function fromObject(object) {
8483
+ if (object instanceof $root.Multipart)
8484
+ return object;
8485
+ var message = new $root.Multipart();
8486
+ if (object.text != null) {
8487
+ if (typeof object.text !== "object")
8488
+ throw TypeError(".Multipart.text: object expected");
8489
+ message.text = $root.Text.fromObject(object.text);
8490
+ }
8491
+ if (object.attachments) {
8492
+ if (!Array.isArray(object.attachments))
8493
+ throw TypeError(".Multipart.attachments: array expected");
8494
+ message.attachments = [];
8495
+ for (var i = 0; i < object.attachments.length; ++i) {
8496
+ if (typeof object.attachments[i] !== "object")
8497
+ throw TypeError(".Multipart.attachments: object expected");
8498
+ message.attachments[i] = $root.Attachment.fromObject(object.attachments[i]);
8499
+ }
8500
+ }
8501
+ if (object.expectsReadConfirmation != null)
8502
+ message.expectsReadConfirmation = Boolean(object.expectsReadConfirmation);
8503
+ switch (object.legalHoldStatus) {
8504
+ default:
8505
+ if (typeof object.legalHoldStatus === "number") {
8506
+ message.legalHoldStatus = object.legalHoldStatus;
8507
+ break;
8508
+ }
8509
+ break;
8510
+ case "UNKNOWN":
8511
+ case 0:
8512
+ message.legalHoldStatus = 0;
8513
+ break;
8514
+ case "DISABLED":
8515
+ case 1:
8516
+ message.legalHoldStatus = 1;
8517
+ break;
8518
+ case "ENABLED":
8519
+ case 2:
8520
+ message.legalHoldStatus = 2;
8521
+ break;
8522
+ }
8523
+ return message;
8524
+ };
8525
+
8526
+ /**
8527
+ * Creates a plain object from a Multipart message. Also converts values to other types if specified.
8528
+ * @function toObject
8529
+ * @memberof Multipart
8530
+ * @static
8531
+ * @param {Multipart} message Multipart
8532
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
8533
+ * @returns {Object.<string,*>} Plain object
8534
+ */
8535
+ Multipart.toObject = function toObject(message, options) {
8536
+ if (!options)
8537
+ options = {};
8538
+ var object = {};
8539
+ if (options.arrays || options.defaults)
8540
+ object.attachments = [];
8541
+ if (options.defaults) {
8542
+ object.text = null;
8543
+ object.expectsReadConfirmation = false;
8544
+ object.legalHoldStatus = options.enums === String ? "UNKNOWN" : 0;
8545
+ }
8546
+ if (message.text != null && message.hasOwnProperty("text"))
8547
+ object.text = $root.Text.toObject(message.text, options);
8548
+ if (message.attachments && message.attachments.length) {
8549
+ object.attachments = [];
8550
+ for (var j = 0; j < message.attachments.length; ++j)
8551
+ object.attachments[j] = $root.Attachment.toObject(message.attachments[j], options);
8552
+ }
8553
+ if (message.expectsReadConfirmation != null && message.hasOwnProperty("expectsReadConfirmation"))
8554
+ object.expectsReadConfirmation = message.expectsReadConfirmation;
8555
+ if (message.legalHoldStatus != null && message.hasOwnProperty("legalHoldStatus"))
8556
+ object.legalHoldStatus = options.enums === String ? $root.LegalHoldStatus[message.legalHoldStatus] === undefined ? message.legalHoldStatus : $root.LegalHoldStatus[message.legalHoldStatus] : message.legalHoldStatus;
8557
+ return object;
8558
+ };
8559
+
8560
+ /**
8561
+ * Converts this Multipart to JSON.
8562
+ * @function toJSON
8563
+ * @memberof Multipart
8564
+ * @instance
8565
+ * @returns {Object.<string,*>} JSON object
8566
+ */
8567
+ Multipart.prototype.toJSON = function toJSON() {
8568
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
8569
+ };
8570
+
8571
+ /**
8572
+ * Gets the default type url for Multipart
8573
+ * @function getTypeUrl
8574
+ * @memberof Multipart
8575
+ * @static
8576
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
8577
+ * @returns {string} The default type url
8578
+ */
8579
+ Multipart.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
8580
+ if (typeUrlPrefix === undefined) {
8581
+ typeUrlPrefix = "type.googleapis.com";
8582
+ }
8583
+ return typeUrlPrefix + "/Multipart";
8584
+ };
8585
+
8586
+ return Multipart;
8587
+ })();
8588
+
8589
+ $root.CellAsset = (function() {
8590
+
8591
+ /**
8592
+ * Properties of a CellAsset.
8593
+ * @exports ICellAsset
8594
+ * @interface ICellAsset
8595
+ * @property {string} uuid CellAsset uuid
8596
+ * @property {string} contentType CellAsset contentType
8597
+ * @property {string|null} [initialName] CellAsset initialName
8598
+ * @property {number|Long|null} [initialSize] CellAsset initialSize
8599
+ * @property {CellAsset.IImageMetaData|null} [image] CellAsset image
8600
+ * @property {CellAsset.IVideoMetaData|null} [video] CellAsset video
8601
+ * @property {CellAsset.IAudioMetaData|null} [audio] CellAsset audio
8602
+ */
8603
+
8604
+ /**
8605
+ * Constructs a new CellAsset.
8606
+ * @exports CellAsset
8607
+ * @classdesc Represents a CellAsset.
8608
+ * @implements ICellAsset
8609
+ * @constructor
8610
+ * @param {ICellAsset=} [properties] Properties to set
8611
+ */
8612
+ function CellAsset(properties) {
8613
+ if (properties)
8614
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
8615
+ if (properties[keys[i]] != null)
8616
+ this[keys[i]] = properties[keys[i]];
8617
+ }
8618
+
8619
+ /**
8620
+ * CellAsset uuid.
8621
+ * @member {string} uuid
8622
+ * @memberof CellAsset
8623
+ * @instance
8624
+ */
8625
+ CellAsset.prototype.uuid = "";
8626
+
8627
+ /**
8628
+ * CellAsset contentType.
8629
+ * @member {string} contentType
8630
+ * @memberof CellAsset
8631
+ * @instance
8632
+ */
8633
+ CellAsset.prototype.contentType = "";
8634
+
8635
+ /**
8636
+ * CellAsset initialName.
8637
+ * @member {string} initialName
8638
+ * @memberof CellAsset
8639
+ * @instance
8640
+ */
8641
+ CellAsset.prototype.initialName = "";
8642
+
8643
+ /**
8644
+ * CellAsset initialSize.
8645
+ * @member {number|Long} initialSize
8646
+ * @memberof CellAsset
8647
+ * @instance
8648
+ */
8649
+ CellAsset.prototype.initialSize = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
8650
+
8651
+ /**
8652
+ * CellAsset image.
8653
+ * @member {CellAsset.IImageMetaData|null|undefined} image
8654
+ * @memberof CellAsset
8655
+ * @instance
8656
+ */
8657
+ CellAsset.prototype.image = null;
8658
+
8659
+ /**
8660
+ * CellAsset video.
8661
+ * @member {CellAsset.IVideoMetaData|null|undefined} video
8662
+ * @memberof CellAsset
8663
+ * @instance
8664
+ */
8665
+ CellAsset.prototype.video = null;
8666
+
8667
+ /**
8668
+ * CellAsset audio.
8669
+ * @member {CellAsset.IAudioMetaData|null|undefined} audio
8670
+ * @memberof CellAsset
8671
+ * @instance
8672
+ */
8673
+ CellAsset.prototype.audio = null;
8674
+
8675
+ // OneOf field names bound to virtual getters and setters
8676
+ var $oneOfFields;
8677
+
8678
+ /**
8679
+ * CellAsset initialMetaData.
8680
+ * @member {"image"|"video"|"audio"|undefined} initialMetaData
8681
+ * @memberof CellAsset
8682
+ * @instance
8683
+ */
8684
+ Object.defineProperty(CellAsset.prototype, "initialMetaData", {
8685
+ get: $util.oneOfGetter($oneOfFields = ["image", "video", "audio"]),
8686
+ set: $util.oneOfSetter($oneOfFields)
8687
+ });
8688
+
8689
+ /**
8690
+ * Creates a new CellAsset instance using the specified properties.
8691
+ * @function create
8692
+ * @memberof CellAsset
8693
+ * @static
8694
+ * @param {ICellAsset=} [properties] Properties to set
8695
+ * @returns {CellAsset} CellAsset instance
8696
+ */
8697
+ CellAsset.create = function create(properties) {
8698
+ return new CellAsset(properties);
8699
+ };
8700
+
8701
+ /**
8702
+ * Encodes the specified CellAsset message. Does not implicitly {@link CellAsset.verify|verify} messages.
8703
+ * @function encode
8704
+ * @memberof CellAsset
8705
+ * @static
8706
+ * @param {ICellAsset} message CellAsset message or plain object to encode
8707
+ * @param {$protobuf.Writer} [writer] Writer to encode to
8708
+ * @returns {$protobuf.Writer} Writer
8709
+ */
8710
+ CellAsset.encode = function encode(message, writer) {
8711
+ if (!writer)
8712
+ writer = $Writer.create();
8713
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.uuid);
8714
+ writer.uint32(/* id 2, wireType 2 =*/18).string(message.contentType);
8715
+ if (message.initialName != null && Object.hasOwnProperty.call(message, "initialName"))
8716
+ writer.uint32(/* id 3, wireType 2 =*/26).string(message.initialName);
8717
+ if (message.initialSize != null && Object.hasOwnProperty.call(message, "initialSize"))
8718
+ writer.uint32(/* id 4, wireType 0 =*/32).int64(message.initialSize);
8719
+ if (message.image != null && Object.hasOwnProperty.call(message, "image"))
8720
+ $root.CellAsset.ImageMetaData.encode(message.image, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
8721
+ if (message.video != null && Object.hasOwnProperty.call(message, "video"))
8722
+ $root.CellAsset.VideoMetaData.encode(message.video, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
8723
+ if (message.audio != null && Object.hasOwnProperty.call(message, "audio"))
8724
+ $root.CellAsset.AudioMetaData.encode(message.audio, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
8725
+ return writer;
8726
+ };
8727
+
8728
+ /**
8729
+ * Encodes the specified CellAsset message, length delimited. Does not implicitly {@link CellAsset.verify|verify} messages.
8730
+ * @function encodeDelimited
8731
+ * @memberof CellAsset
8732
+ * @static
8733
+ * @param {ICellAsset} message CellAsset message or plain object to encode
8734
+ * @param {$protobuf.Writer} [writer] Writer to encode to
8735
+ * @returns {$protobuf.Writer} Writer
8736
+ */
8737
+ CellAsset.encodeDelimited = function encodeDelimited(message, writer) {
8738
+ return this.encode(message, writer).ldelim();
8739
+ };
8740
+
8741
+ /**
8742
+ * Decodes a CellAsset message from the specified reader or buffer.
8743
+ * @function decode
8744
+ * @memberof CellAsset
8745
+ * @static
8746
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
8747
+ * @param {number} [length] Message length if known beforehand
8748
+ * @returns {CellAsset} CellAsset
8749
+ * @throws {Error} If the payload is not a reader or valid buffer
8750
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
8751
+ */
8752
+ CellAsset.decode = function decode(reader, length) {
8753
+ if (!(reader instanceof $Reader))
8754
+ reader = $Reader.create(reader);
8755
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CellAsset();
8756
+ while (reader.pos < end) {
8757
+ var tag = reader.uint32();
8758
+ switch (tag >>> 3) {
8759
+ case 1: {
8760
+ message.uuid = reader.string();
8761
+ break;
8762
+ }
8763
+ case 2: {
8764
+ message.contentType = reader.string();
8765
+ break;
8766
+ }
8767
+ case 3: {
8768
+ message.initialName = reader.string();
8769
+ break;
8770
+ }
8771
+ case 4: {
8772
+ message.initialSize = reader.int64();
8773
+ break;
8774
+ }
8775
+ case 5: {
8776
+ message.image = $root.CellAsset.ImageMetaData.decode(reader, reader.uint32());
8777
+ break;
8778
+ }
8779
+ case 6: {
8780
+ message.video = $root.CellAsset.VideoMetaData.decode(reader, reader.uint32());
8781
+ break;
8782
+ }
8783
+ case 7: {
8784
+ message.audio = $root.CellAsset.AudioMetaData.decode(reader, reader.uint32());
8785
+ break;
8786
+ }
8787
+ default:
8788
+ reader.skipType(tag & 7);
8789
+ break;
8790
+ }
8791
+ }
8792
+ if (!message.hasOwnProperty("uuid"))
8793
+ throw $util.ProtocolError("missing required 'uuid'", { instance: message });
8794
+ if (!message.hasOwnProperty("contentType"))
8795
+ throw $util.ProtocolError("missing required 'contentType'", { instance: message });
8796
+ return message;
8797
+ };
8798
+
8799
+ /**
8800
+ * Decodes a CellAsset message from the specified reader or buffer, length delimited.
8801
+ * @function decodeDelimited
8802
+ * @memberof CellAsset
8803
+ * @static
8804
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
8805
+ * @returns {CellAsset} CellAsset
8806
+ * @throws {Error} If the payload is not a reader or valid buffer
8807
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
8808
+ */
8809
+ CellAsset.decodeDelimited = function decodeDelimited(reader) {
8810
+ if (!(reader instanceof $Reader))
8811
+ reader = new $Reader(reader);
8812
+ return this.decode(reader, reader.uint32());
8813
+ };
8814
+
8815
+ /**
8816
+ * Verifies a CellAsset message.
8817
+ * @function verify
8818
+ * @memberof CellAsset
8819
+ * @static
8820
+ * @param {Object.<string,*>} message Plain object to verify
8821
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
8822
+ */
8823
+ CellAsset.verify = function verify(message) {
8824
+ if (typeof message !== "object" || message === null)
8825
+ return "object expected";
8826
+ var properties = {};
8827
+ if (!$util.isString(message.uuid))
8828
+ return "uuid: string expected";
8829
+ if (!$util.isString(message.contentType))
8830
+ return "contentType: string expected";
8831
+ if (message.initialName != null && message.hasOwnProperty("initialName"))
8832
+ if (!$util.isString(message.initialName))
8833
+ return "initialName: string expected";
8834
+ if (message.initialSize != null && message.hasOwnProperty("initialSize"))
8835
+ if (!$util.isInteger(message.initialSize) && !(message.initialSize && $util.isInteger(message.initialSize.low) && $util.isInteger(message.initialSize.high)))
8836
+ return "initialSize: integer|Long expected";
8837
+ if (message.image != null && message.hasOwnProperty("image")) {
8838
+ properties.initialMetaData = 1;
8839
+ {
8840
+ var error = $root.CellAsset.ImageMetaData.verify(message.image);
8841
+ if (error)
8842
+ return "image." + error;
8843
+ }
8844
+ }
8845
+ if (message.video != null && message.hasOwnProperty("video")) {
8846
+ if (properties.initialMetaData === 1)
8847
+ return "initialMetaData: multiple values";
8848
+ properties.initialMetaData = 1;
8849
+ {
8850
+ var error = $root.CellAsset.VideoMetaData.verify(message.video);
8851
+ if (error)
8852
+ return "video." + error;
8853
+ }
8854
+ }
8855
+ if (message.audio != null && message.hasOwnProperty("audio")) {
8856
+ if (properties.initialMetaData === 1)
8857
+ return "initialMetaData: multiple values";
8858
+ properties.initialMetaData = 1;
8859
+ {
8860
+ var error = $root.CellAsset.AudioMetaData.verify(message.audio);
8861
+ if (error)
8862
+ return "audio." + error;
8863
+ }
8864
+ }
8865
+ return null;
8866
+ };
8867
+
8868
+ /**
8869
+ * Creates a CellAsset message from a plain object. Also converts values to their respective internal types.
8870
+ * @function fromObject
8871
+ * @memberof CellAsset
8872
+ * @static
8873
+ * @param {Object.<string,*>} object Plain object
8874
+ * @returns {CellAsset} CellAsset
8875
+ */
8876
+ CellAsset.fromObject = function fromObject(object) {
8877
+ if (object instanceof $root.CellAsset)
8878
+ return object;
8879
+ var message = new $root.CellAsset();
8880
+ if (object.uuid != null)
8881
+ message.uuid = String(object.uuid);
8882
+ if (object.contentType != null)
8883
+ message.contentType = String(object.contentType);
8884
+ if (object.initialName != null)
8885
+ message.initialName = String(object.initialName);
8886
+ if (object.initialSize != null)
8887
+ if ($util.Long)
8888
+ (message.initialSize = $util.Long.fromValue(object.initialSize)).unsigned = false;
8889
+ else if (typeof object.initialSize === "string")
8890
+ message.initialSize = parseInt(object.initialSize, 10);
8891
+ else if (typeof object.initialSize === "number")
8892
+ message.initialSize = object.initialSize;
8893
+ else if (typeof object.initialSize === "object")
8894
+ message.initialSize = new $util.LongBits(object.initialSize.low >>> 0, object.initialSize.high >>> 0).toNumber();
8895
+ if (object.image != null) {
8896
+ if (typeof object.image !== "object")
8897
+ throw TypeError(".CellAsset.image: object expected");
8898
+ message.image = $root.CellAsset.ImageMetaData.fromObject(object.image);
8899
+ }
8900
+ if (object.video != null) {
8901
+ if (typeof object.video !== "object")
8902
+ throw TypeError(".CellAsset.video: object expected");
8903
+ message.video = $root.CellAsset.VideoMetaData.fromObject(object.video);
8904
+ }
8905
+ if (object.audio != null) {
8906
+ if (typeof object.audio !== "object")
8907
+ throw TypeError(".CellAsset.audio: object expected");
8908
+ message.audio = $root.CellAsset.AudioMetaData.fromObject(object.audio);
8909
+ }
8910
+ return message;
8911
+ };
8912
+
8913
+ /**
8914
+ * Creates a plain object from a CellAsset message. Also converts values to other types if specified.
8915
+ * @function toObject
8916
+ * @memberof CellAsset
8917
+ * @static
8918
+ * @param {CellAsset} message CellAsset
8919
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
8920
+ * @returns {Object.<string,*>} Plain object
8921
+ */
8922
+ CellAsset.toObject = function toObject(message, options) {
8923
+ if (!options)
8924
+ options = {};
8925
+ var object = {};
8926
+ if (options.defaults) {
8927
+ object.uuid = "";
8928
+ object.contentType = "";
8929
+ object.initialName = "";
8930
+ if ($util.Long) {
8931
+ var long = new $util.Long(0, 0, false);
8932
+ object.initialSize = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
8933
+ } else
8934
+ object.initialSize = options.longs === String ? "0" : 0;
8935
+ }
8936
+ if (message.uuid != null && message.hasOwnProperty("uuid"))
8937
+ object.uuid = message.uuid;
8938
+ if (message.contentType != null && message.hasOwnProperty("contentType"))
8939
+ object.contentType = message.contentType;
8940
+ if (message.initialName != null && message.hasOwnProperty("initialName"))
8941
+ object.initialName = message.initialName;
8942
+ if (message.initialSize != null && message.hasOwnProperty("initialSize"))
8943
+ if (typeof message.initialSize === "number")
8944
+ object.initialSize = options.longs === String ? String(message.initialSize) : message.initialSize;
8945
+ else
8946
+ object.initialSize = options.longs === String ? $util.Long.prototype.toString.call(message.initialSize) : options.longs === Number ? new $util.LongBits(message.initialSize.low >>> 0, message.initialSize.high >>> 0).toNumber() : message.initialSize;
8947
+ if (message.image != null && message.hasOwnProperty("image")) {
8948
+ object.image = $root.CellAsset.ImageMetaData.toObject(message.image, options);
8949
+ if (options.oneofs)
8950
+ object.initialMetaData = "image";
8951
+ }
8952
+ if (message.video != null && message.hasOwnProperty("video")) {
8953
+ object.video = $root.CellAsset.VideoMetaData.toObject(message.video, options);
8954
+ if (options.oneofs)
8955
+ object.initialMetaData = "video";
8956
+ }
8957
+ if (message.audio != null && message.hasOwnProperty("audio")) {
8958
+ object.audio = $root.CellAsset.AudioMetaData.toObject(message.audio, options);
8959
+ if (options.oneofs)
8960
+ object.initialMetaData = "audio";
8961
+ }
8962
+ return object;
8963
+ };
8964
+
8965
+ /**
8966
+ * Converts this CellAsset to JSON.
8967
+ * @function toJSON
8968
+ * @memberof CellAsset
8969
+ * @instance
8970
+ * @returns {Object.<string,*>} JSON object
8971
+ */
8972
+ CellAsset.prototype.toJSON = function toJSON() {
8973
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
8974
+ };
8975
+
8976
+ /**
8977
+ * Gets the default type url for CellAsset
8978
+ * @function getTypeUrl
8979
+ * @memberof CellAsset
8980
+ * @static
8981
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
8982
+ * @returns {string} The default type url
8983
+ */
8984
+ CellAsset.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
8985
+ if (typeUrlPrefix === undefined) {
8986
+ typeUrlPrefix = "type.googleapis.com";
8987
+ }
8988
+ return typeUrlPrefix + "/CellAsset";
8989
+ };
8990
+
8991
+ CellAsset.ImageMetaData = (function() {
8992
+
8993
+ /**
8994
+ * Properties of an ImageMetaData.
8995
+ * @memberof CellAsset
8996
+ * @interface IImageMetaData
8997
+ * @property {number} width ImageMetaData width
8998
+ * @property {number} height ImageMetaData height
8999
+ */
9000
+
9001
+ /**
9002
+ * Constructs a new ImageMetaData.
9003
+ * @memberof CellAsset
9004
+ * @classdesc Represents an ImageMetaData.
9005
+ * @implements IImageMetaData
9006
+ * @constructor
9007
+ * @param {CellAsset.IImageMetaData=} [properties] Properties to set
9008
+ */
9009
+ function ImageMetaData(properties) {
9010
+ if (properties)
9011
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
9012
+ if (properties[keys[i]] != null)
9013
+ this[keys[i]] = properties[keys[i]];
9014
+ }
9015
+
9016
+ /**
9017
+ * ImageMetaData width.
9018
+ * @member {number} width
9019
+ * @memberof CellAsset.ImageMetaData
9020
+ * @instance
9021
+ */
9022
+ ImageMetaData.prototype.width = 0;
9023
+
9024
+ /**
9025
+ * ImageMetaData height.
9026
+ * @member {number} height
9027
+ * @memberof CellAsset.ImageMetaData
9028
+ * @instance
9029
+ */
9030
+ ImageMetaData.prototype.height = 0;
9031
+
9032
+ /**
9033
+ * Creates a new ImageMetaData instance using the specified properties.
9034
+ * @function create
9035
+ * @memberof CellAsset.ImageMetaData
9036
+ * @static
9037
+ * @param {CellAsset.IImageMetaData=} [properties] Properties to set
9038
+ * @returns {CellAsset.ImageMetaData} ImageMetaData instance
9039
+ */
9040
+ ImageMetaData.create = function create(properties) {
9041
+ return new ImageMetaData(properties);
9042
+ };
9043
+
9044
+ /**
9045
+ * Encodes the specified ImageMetaData message. Does not implicitly {@link CellAsset.ImageMetaData.verify|verify} messages.
9046
+ * @function encode
9047
+ * @memberof CellAsset.ImageMetaData
9048
+ * @static
9049
+ * @param {CellAsset.IImageMetaData} message ImageMetaData message or plain object to encode
9050
+ * @param {$protobuf.Writer} [writer] Writer to encode to
9051
+ * @returns {$protobuf.Writer} Writer
9052
+ */
9053
+ ImageMetaData.encode = function encode(message, writer) {
9054
+ if (!writer)
9055
+ writer = $Writer.create();
9056
+ writer.uint32(/* id 1, wireType 0 =*/8).int32(message.width);
9057
+ writer.uint32(/* id 2, wireType 0 =*/16).int32(message.height);
9058
+ return writer;
9059
+ };
9060
+
9061
+ /**
9062
+ * Encodes the specified ImageMetaData message, length delimited. Does not implicitly {@link CellAsset.ImageMetaData.verify|verify} messages.
9063
+ * @function encodeDelimited
9064
+ * @memberof CellAsset.ImageMetaData
9065
+ * @static
9066
+ * @param {CellAsset.IImageMetaData} message ImageMetaData message or plain object to encode
9067
+ * @param {$protobuf.Writer} [writer] Writer to encode to
9068
+ * @returns {$protobuf.Writer} Writer
9069
+ */
9070
+ ImageMetaData.encodeDelimited = function encodeDelimited(message, writer) {
9071
+ return this.encode(message, writer).ldelim();
9072
+ };
9073
+
9074
+ /**
9075
+ * Decodes an ImageMetaData message from the specified reader or buffer.
9076
+ * @function decode
9077
+ * @memberof CellAsset.ImageMetaData
9078
+ * @static
9079
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
9080
+ * @param {number} [length] Message length if known beforehand
9081
+ * @returns {CellAsset.ImageMetaData} ImageMetaData
9082
+ * @throws {Error} If the payload is not a reader or valid buffer
9083
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
9084
+ */
9085
+ ImageMetaData.decode = function decode(reader, length) {
9086
+ if (!(reader instanceof $Reader))
9087
+ reader = $Reader.create(reader);
9088
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CellAsset.ImageMetaData();
9089
+ while (reader.pos < end) {
9090
+ var tag = reader.uint32();
9091
+ switch (tag >>> 3) {
9092
+ case 1: {
9093
+ message.width = reader.int32();
9094
+ break;
9095
+ }
9096
+ case 2: {
9097
+ message.height = reader.int32();
9098
+ break;
9099
+ }
9100
+ default:
9101
+ reader.skipType(tag & 7);
9102
+ break;
9103
+ }
9104
+ }
9105
+ if (!message.hasOwnProperty("width"))
9106
+ throw $util.ProtocolError("missing required 'width'", { instance: message });
9107
+ if (!message.hasOwnProperty("height"))
9108
+ throw $util.ProtocolError("missing required 'height'", { instance: message });
9109
+ return message;
9110
+ };
9111
+
9112
+ /**
9113
+ * Decodes an ImageMetaData message from the specified reader or buffer, length delimited.
9114
+ * @function decodeDelimited
9115
+ * @memberof CellAsset.ImageMetaData
9116
+ * @static
9117
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
9118
+ * @returns {CellAsset.ImageMetaData} ImageMetaData
9119
+ * @throws {Error} If the payload is not a reader or valid buffer
9120
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
9121
+ */
9122
+ ImageMetaData.decodeDelimited = function decodeDelimited(reader) {
9123
+ if (!(reader instanceof $Reader))
9124
+ reader = new $Reader(reader);
9125
+ return this.decode(reader, reader.uint32());
9126
+ };
9127
+
9128
+ /**
9129
+ * Verifies an ImageMetaData message.
9130
+ * @function verify
9131
+ * @memberof CellAsset.ImageMetaData
9132
+ * @static
9133
+ * @param {Object.<string,*>} message Plain object to verify
9134
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
9135
+ */
9136
+ ImageMetaData.verify = function verify(message) {
9137
+ if (typeof message !== "object" || message === null)
9138
+ return "object expected";
9139
+ if (!$util.isInteger(message.width))
9140
+ return "width: integer expected";
9141
+ if (!$util.isInteger(message.height))
9142
+ return "height: integer expected";
9143
+ return null;
9144
+ };
9145
+
9146
+ /**
9147
+ * Creates an ImageMetaData message from a plain object. Also converts values to their respective internal types.
9148
+ * @function fromObject
9149
+ * @memberof CellAsset.ImageMetaData
9150
+ * @static
9151
+ * @param {Object.<string,*>} object Plain object
9152
+ * @returns {CellAsset.ImageMetaData} ImageMetaData
9153
+ */
9154
+ ImageMetaData.fromObject = function fromObject(object) {
9155
+ if (object instanceof $root.CellAsset.ImageMetaData)
9156
+ return object;
9157
+ var message = new $root.CellAsset.ImageMetaData();
9158
+ if (object.width != null)
9159
+ message.width = object.width | 0;
9160
+ if (object.height != null)
9161
+ message.height = object.height | 0;
9162
+ return message;
9163
+ };
9164
+
9165
+ /**
9166
+ * Creates a plain object from an ImageMetaData message. Also converts values to other types if specified.
9167
+ * @function toObject
9168
+ * @memberof CellAsset.ImageMetaData
9169
+ * @static
9170
+ * @param {CellAsset.ImageMetaData} message ImageMetaData
9171
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
9172
+ * @returns {Object.<string,*>} Plain object
9173
+ */
9174
+ ImageMetaData.toObject = function toObject(message, options) {
9175
+ if (!options)
9176
+ options = {};
9177
+ var object = {};
9178
+ if (options.defaults) {
9179
+ object.width = 0;
9180
+ object.height = 0;
9181
+ }
9182
+ if (message.width != null && message.hasOwnProperty("width"))
9183
+ object.width = message.width;
9184
+ if (message.height != null && message.hasOwnProperty("height"))
9185
+ object.height = message.height;
9186
+ return object;
9187
+ };
9188
+
9189
+ /**
9190
+ * Converts this ImageMetaData to JSON.
9191
+ * @function toJSON
9192
+ * @memberof CellAsset.ImageMetaData
9193
+ * @instance
9194
+ * @returns {Object.<string,*>} JSON object
9195
+ */
9196
+ ImageMetaData.prototype.toJSON = function toJSON() {
9197
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
9198
+ };
9199
+
9200
+ /**
9201
+ * Gets the default type url for ImageMetaData
9202
+ * @function getTypeUrl
9203
+ * @memberof CellAsset.ImageMetaData
9204
+ * @static
9205
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
9206
+ * @returns {string} The default type url
9207
+ */
9208
+ ImageMetaData.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
9209
+ if (typeUrlPrefix === undefined) {
9210
+ typeUrlPrefix = "type.googleapis.com";
9211
+ }
9212
+ return typeUrlPrefix + "/CellAsset.ImageMetaData";
9213
+ };
9214
+
9215
+ return ImageMetaData;
9216
+ })();
9217
+
9218
+ CellAsset.VideoMetaData = (function() {
9219
+
9220
+ /**
9221
+ * Properties of a VideoMetaData.
9222
+ * @memberof CellAsset
9223
+ * @interface IVideoMetaData
9224
+ * @property {number|null} [width] VideoMetaData width
9225
+ * @property {number|null} [height] VideoMetaData height
9226
+ * @property {number|Long|null} [durationInMillis] VideoMetaData durationInMillis
9227
+ */
9228
+
9229
+ /**
9230
+ * Constructs a new VideoMetaData.
9231
+ * @memberof CellAsset
9232
+ * @classdesc Represents a VideoMetaData.
9233
+ * @implements IVideoMetaData
9234
+ * @constructor
9235
+ * @param {CellAsset.IVideoMetaData=} [properties] Properties to set
9236
+ */
9237
+ function VideoMetaData(properties) {
9238
+ if (properties)
9239
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
9240
+ if (properties[keys[i]] != null)
9241
+ this[keys[i]] = properties[keys[i]];
9242
+ }
9243
+
9244
+ /**
9245
+ * VideoMetaData width.
9246
+ * @member {number} width
9247
+ * @memberof CellAsset.VideoMetaData
9248
+ * @instance
9249
+ */
9250
+ VideoMetaData.prototype.width = 0;
9251
+
9252
+ /**
9253
+ * VideoMetaData height.
9254
+ * @member {number} height
9255
+ * @memberof CellAsset.VideoMetaData
9256
+ * @instance
9257
+ */
9258
+ VideoMetaData.prototype.height = 0;
9259
+
9260
+ /**
9261
+ * VideoMetaData durationInMillis.
9262
+ * @member {number|Long} durationInMillis
9263
+ * @memberof CellAsset.VideoMetaData
9264
+ * @instance
9265
+ */
9266
+ VideoMetaData.prototype.durationInMillis = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
9267
+
9268
+ /**
9269
+ * Creates a new VideoMetaData instance using the specified properties.
9270
+ * @function create
9271
+ * @memberof CellAsset.VideoMetaData
9272
+ * @static
9273
+ * @param {CellAsset.IVideoMetaData=} [properties] Properties to set
9274
+ * @returns {CellAsset.VideoMetaData} VideoMetaData instance
9275
+ */
9276
+ VideoMetaData.create = function create(properties) {
9277
+ return new VideoMetaData(properties);
9278
+ };
9279
+
9280
+ /**
9281
+ * Encodes the specified VideoMetaData message. Does not implicitly {@link CellAsset.VideoMetaData.verify|verify} messages.
9282
+ * @function encode
9283
+ * @memberof CellAsset.VideoMetaData
9284
+ * @static
9285
+ * @param {CellAsset.IVideoMetaData} message VideoMetaData message or plain object to encode
9286
+ * @param {$protobuf.Writer} [writer] Writer to encode to
9287
+ * @returns {$protobuf.Writer} Writer
9288
+ */
9289
+ VideoMetaData.encode = function encode(message, writer) {
9290
+ if (!writer)
9291
+ writer = $Writer.create();
9292
+ if (message.width != null && Object.hasOwnProperty.call(message, "width"))
9293
+ writer.uint32(/* id 1, wireType 0 =*/8).int32(message.width);
9294
+ if (message.height != null && Object.hasOwnProperty.call(message, "height"))
9295
+ writer.uint32(/* id 2, wireType 0 =*/16).int32(message.height);
9296
+ if (message.durationInMillis != null && Object.hasOwnProperty.call(message, "durationInMillis"))
9297
+ writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.durationInMillis);
9298
+ return writer;
9299
+ };
9300
+
9301
+ /**
9302
+ * Encodes the specified VideoMetaData message, length delimited. Does not implicitly {@link CellAsset.VideoMetaData.verify|verify} messages.
9303
+ * @function encodeDelimited
9304
+ * @memberof CellAsset.VideoMetaData
9305
+ * @static
9306
+ * @param {CellAsset.IVideoMetaData} message VideoMetaData message or plain object to encode
9307
+ * @param {$protobuf.Writer} [writer] Writer to encode to
9308
+ * @returns {$protobuf.Writer} Writer
9309
+ */
9310
+ VideoMetaData.encodeDelimited = function encodeDelimited(message, writer) {
9311
+ return this.encode(message, writer).ldelim();
9312
+ };
9313
+
9314
+ /**
9315
+ * Decodes a VideoMetaData message from the specified reader or buffer.
9316
+ * @function decode
9317
+ * @memberof CellAsset.VideoMetaData
9318
+ * @static
9319
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
9320
+ * @param {number} [length] Message length if known beforehand
9321
+ * @returns {CellAsset.VideoMetaData} VideoMetaData
9322
+ * @throws {Error} If the payload is not a reader or valid buffer
9323
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
9324
+ */
9325
+ VideoMetaData.decode = function decode(reader, length) {
9326
+ if (!(reader instanceof $Reader))
9327
+ reader = $Reader.create(reader);
9328
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CellAsset.VideoMetaData();
9329
+ while (reader.pos < end) {
9330
+ var tag = reader.uint32();
9331
+ switch (tag >>> 3) {
9332
+ case 1: {
9333
+ message.width = reader.int32();
9334
+ break;
9335
+ }
9336
+ case 2: {
9337
+ message.height = reader.int32();
9338
+ break;
9339
+ }
9340
+ case 3: {
9341
+ message.durationInMillis = reader.uint64();
9342
+ break;
9343
+ }
9344
+ default:
9345
+ reader.skipType(tag & 7);
9346
+ break;
9347
+ }
9348
+ }
9349
+ return message;
9350
+ };
9351
+
9352
+ /**
9353
+ * Decodes a VideoMetaData message from the specified reader or buffer, length delimited.
9354
+ * @function decodeDelimited
9355
+ * @memberof CellAsset.VideoMetaData
9356
+ * @static
9357
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
9358
+ * @returns {CellAsset.VideoMetaData} VideoMetaData
9359
+ * @throws {Error} If the payload is not a reader or valid buffer
9360
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
9361
+ */
9362
+ VideoMetaData.decodeDelimited = function decodeDelimited(reader) {
9363
+ if (!(reader instanceof $Reader))
9364
+ reader = new $Reader(reader);
9365
+ return this.decode(reader, reader.uint32());
9366
+ };
9367
+
9368
+ /**
9369
+ * Verifies a VideoMetaData message.
9370
+ * @function verify
9371
+ * @memberof CellAsset.VideoMetaData
9372
+ * @static
9373
+ * @param {Object.<string,*>} message Plain object to verify
9374
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
9375
+ */
9376
+ VideoMetaData.verify = function verify(message) {
9377
+ if (typeof message !== "object" || message === null)
9378
+ return "object expected";
9379
+ if (message.width != null && message.hasOwnProperty("width"))
9380
+ if (!$util.isInteger(message.width))
9381
+ return "width: integer expected";
9382
+ if (message.height != null && message.hasOwnProperty("height"))
9383
+ if (!$util.isInteger(message.height))
9384
+ return "height: integer expected";
9385
+ if (message.durationInMillis != null && message.hasOwnProperty("durationInMillis"))
9386
+ if (!$util.isInteger(message.durationInMillis) && !(message.durationInMillis && $util.isInteger(message.durationInMillis.low) && $util.isInteger(message.durationInMillis.high)))
9387
+ return "durationInMillis: integer|Long expected";
9388
+ return null;
9389
+ };
9390
+
9391
+ /**
9392
+ * Creates a VideoMetaData message from a plain object. Also converts values to their respective internal types.
9393
+ * @function fromObject
9394
+ * @memberof CellAsset.VideoMetaData
9395
+ * @static
9396
+ * @param {Object.<string,*>} object Plain object
9397
+ * @returns {CellAsset.VideoMetaData} VideoMetaData
9398
+ */
9399
+ VideoMetaData.fromObject = function fromObject(object) {
9400
+ if (object instanceof $root.CellAsset.VideoMetaData)
9401
+ return object;
9402
+ var message = new $root.CellAsset.VideoMetaData();
9403
+ if (object.width != null)
9404
+ message.width = object.width | 0;
9405
+ if (object.height != null)
9406
+ message.height = object.height | 0;
9407
+ if (object.durationInMillis != null)
9408
+ if ($util.Long)
9409
+ (message.durationInMillis = $util.Long.fromValue(object.durationInMillis)).unsigned = true;
9410
+ else if (typeof object.durationInMillis === "string")
9411
+ message.durationInMillis = parseInt(object.durationInMillis, 10);
9412
+ else if (typeof object.durationInMillis === "number")
9413
+ message.durationInMillis = object.durationInMillis;
9414
+ else if (typeof object.durationInMillis === "object")
9415
+ message.durationInMillis = new $util.LongBits(object.durationInMillis.low >>> 0, object.durationInMillis.high >>> 0).toNumber(true);
9416
+ return message;
9417
+ };
9418
+
9419
+ /**
9420
+ * Creates a plain object from a VideoMetaData message. Also converts values to other types if specified.
9421
+ * @function toObject
9422
+ * @memberof CellAsset.VideoMetaData
9423
+ * @static
9424
+ * @param {CellAsset.VideoMetaData} message VideoMetaData
9425
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
9426
+ * @returns {Object.<string,*>} Plain object
9427
+ */
9428
+ VideoMetaData.toObject = function toObject(message, options) {
9429
+ if (!options)
9430
+ options = {};
9431
+ var object = {};
9432
+ if (options.defaults) {
9433
+ object.width = 0;
9434
+ object.height = 0;
9435
+ if ($util.Long) {
9436
+ var long = new $util.Long(0, 0, true);
9437
+ object.durationInMillis = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
9438
+ } else
9439
+ object.durationInMillis = options.longs === String ? "0" : 0;
9440
+ }
9441
+ if (message.width != null && message.hasOwnProperty("width"))
9442
+ object.width = message.width;
9443
+ if (message.height != null && message.hasOwnProperty("height"))
9444
+ object.height = message.height;
9445
+ if (message.durationInMillis != null && message.hasOwnProperty("durationInMillis"))
9446
+ if (typeof message.durationInMillis === "number")
9447
+ object.durationInMillis = options.longs === String ? String(message.durationInMillis) : message.durationInMillis;
9448
+ else
9449
+ object.durationInMillis = options.longs === String ? $util.Long.prototype.toString.call(message.durationInMillis) : options.longs === Number ? new $util.LongBits(message.durationInMillis.low >>> 0, message.durationInMillis.high >>> 0).toNumber(true) : message.durationInMillis;
9450
+ return object;
9451
+ };
9452
+
9453
+ /**
9454
+ * Converts this VideoMetaData to JSON.
9455
+ * @function toJSON
9456
+ * @memberof CellAsset.VideoMetaData
9457
+ * @instance
9458
+ * @returns {Object.<string,*>} JSON object
9459
+ */
9460
+ VideoMetaData.prototype.toJSON = function toJSON() {
9461
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
9462
+ };
9463
+
9464
+ /**
9465
+ * Gets the default type url for VideoMetaData
9466
+ * @function getTypeUrl
9467
+ * @memberof CellAsset.VideoMetaData
9468
+ * @static
9469
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
9470
+ * @returns {string} The default type url
9471
+ */
9472
+ VideoMetaData.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
9473
+ if (typeUrlPrefix === undefined) {
9474
+ typeUrlPrefix = "type.googleapis.com";
9475
+ }
9476
+ return typeUrlPrefix + "/CellAsset.VideoMetaData";
9477
+ };
9478
+
9479
+ return VideoMetaData;
9480
+ })();
9481
+
9482
+ CellAsset.AudioMetaData = (function() {
9483
+
9484
+ /**
9485
+ * Properties of an AudioMetaData.
9486
+ * @memberof CellAsset
9487
+ * @interface IAudioMetaData
9488
+ * @property {number|Long|null} [durationInMillis] AudioMetaData durationInMillis
9489
+ * @property {Uint8Array|null} [normalizedLoudness] AudioMetaData normalizedLoudness
9490
+ */
9491
+
9492
+ /**
9493
+ * Constructs a new AudioMetaData.
9494
+ * @memberof CellAsset
9495
+ * @classdesc Represents an AudioMetaData.
9496
+ * @implements IAudioMetaData
9497
+ * @constructor
9498
+ * @param {CellAsset.IAudioMetaData=} [properties] Properties to set
9499
+ */
9500
+ function AudioMetaData(properties) {
9501
+ if (properties)
9502
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
9503
+ if (properties[keys[i]] != null)
9504
+ this[keys[i]] = properties[keys[i]];
9505
+ }
9506
+
9507
+ /**
9508
+ * AudioMetaData durationInMillis.
9509
+ * @member {number|Long} durationInMillis
9510
+ * @memberof CellAsset.AudioMetaData
9511
+ * @instance
9512
+ */
9513
+ AudioMetaData.prototype.durationInMillis = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
9514
+
9515
+ /**
9516
+ * AudioMetaData normalizedLoudness.
9517
+ * @member {Uint8Array} normalizedLoudness
9518
+ * @memberof CellAsset.AudioMetaData
9519
+ * @instance
9520
+ */
9521
+ AudioMetaData.prototype.normalizedLoudness = $util.newBuffer([]);
9522
+
9523
+ /**
9524
+ * Creates a new AudioMetaData instance using the specified properties.
9525
+ * @function create
9526
+ * @memberof CellAsset.AudioMetaData
9527
+ * @static
9528
+ * @param {CellAsset.IAudioMetaData=} [properties] Properties to set
9529
+ * @returns {CellAsset.AudioMetaData} AudioMetaData instance
9530
+ */
9531
+ AudioMetaData.create = function create(properties) {
9532
+ return new AudioMetaData(properties);
9533
+ };
9534
+
9535
+ /**
9536
+ * Encodes the specified AudioMetaData message. Does not implicitly {@link CellAsset.AudioMetaData.verify|verify} messages.
9537
+ * @function encode
9538
+ * @memberof CellAsset.AudioMetaData
9539
+ * @static
9540
+ * @param {CellAsset.IAudioMetaData} message AudioMetaData message or plain object to encode
9541
+ * @param {$protobuf.Writer} [writer] Writer to encode to
9542
+ * @returns {$protobuf.Writer} Writer
9543
+ */
9544
+ AudioMetaData.encode = function encode(message, writer) {
9545
+ if (!writer)
9546
+ writer = $Writer.create();
9547
+ if (message.durationInMillis != null && Object.hasOwnProperty.call(message, "durationInMillis"))
9548
+ writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.durationInMillis);
9549
+ if (message.normalizedLoudness != null && Object.hasOwnProperty.call(message, "normalizedLoudness"))
9550
+ writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.normalizedLoudness);
9551
+ return writer;
9552
+ };
9553
+
9554
+ /**
9555
+ * Encodes the specified AudioMetaData message, length delimited. Does not implicitly {@link CellAsset.AudioMetaData.verify|verify} messages.
9556
+ * @function encodeDelimited
9557
+ * @memberof CellAsset.AudioMetaData
9558
+ * @static
9559
+ * @param {CellAsset.IAudioMetaData} message AudioMetaData message or plain object to encode
9560
+ * @param {$protobuf.Writer} [writer] Writer to encode to
9561
+ * @returns {$protobuf.Writer} Writer
9562
+ */
9563
+ AudioMetaData.encodeDelimited = function encodeDelimited(message, writer) {
9564
+ return this.encode(message, writer).ldelim();
9565
+ };
9566
+
9567
+ /**
9568
+ * Decodes an AudioMetaData message from the specified reader or buffer.
9569
+ * @function decode
9570
+ * @memberof CellAsset.AudioMetaData
9571
+ * @static
9572
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
9573
+ * @param {number} [length] Message length if known beforehand
9574
+ * @returns {CellAsset.AudioMetaData} AudioMetaData
9575
+ * @throws {Error} If the payload is not a reader or valid buffer
9576
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
9577
+ */
9578
+ AudioMetaData.decode = function decode(reader, length) {
9579
+ if (!(reader instanceof $Reader))
9580
+ reader = $Reader.create(reader);
9581
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CellAsset.AudioMetaData();
9582
+ while (reader.pos < end) {
9583
+ var tag = reader.uint32();
9584
+ switch (tag >>> 3) {
9585
+ case 1: {
9586
+ message.durationInMillis = reader.uint64();
9587
+ break;
9588
+ }
9589
+ case 2: {
9590
+ message.normalizedLoudness = reader.bytes();
9591
+ break;
9592
+ }
9593
+ default:
9594
+ reader.skipType(tag & 7);
9595
+ break;
9596
+ }
9597
+ }
9598
+ return message;
9599
+ };
9600
+
9601
+ /**
9602
+ * Decodes an AudioMetaData message from the specified reader or buffer, length delimited.
9603
+ * @function decodeDelimited
9604
+ * @memberof CellAsset.AudioMetaData
9605
+ * @static
9606
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
9607
+ * @returns {CellAsset.AudioMetaData} AudioMetaData
9608
+ * @throws {Error} If the payload is not a reader or valid buffer
9609
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
9610
+ */
9611
+ AudioMetaData.decodeDelimited = function decodeDelimited(reader) {
9612
+ if (!(reader instanceof $Reader))
9613
+ reader = new $Reader(reader);
9614
+ return this.decode(reader, reader.uint32());
9615
+ };
9616
+
9617
+ /**
9618
+ * Verifies an AudioMetaData message.
9619
+ * @function verify
9620
+ * @memberof CellAsset.AudioMetaData
9621
+ * @static
9622
+ * @param {Object.<string,*>} message Plain object to verify
9623
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
9624
+ */
9625
+ AudioMetaData.verify = function verify(message) {
9626
+ if (typeof message !== "object" || message === null)
9627
+ return "object expected";
9628
+ if (message.durationInMillis != null && message.hasOwnProperty("durationInMillis"))
9629
+ if (!$util.isInteger(message.durationInMillis) && !(message.durationInMillis && $util.isInteger(message.durationInMillis.low) && $util.isInteger(message.durationInMillis.high)))
9630
+ return "durationInMillis: integer|Long expected";
9631
+ if (message.normalizedLoudness != null && message.hasOwnProperty("normalizedLoudness"))
9632
+ if (!(message.normalizedLoudness && typeof message.normalizedLoudness.length === "number" || $util.isString(message.normalizedLoudness)))
9633
+ return "normalizedLoudness: buffer expected";
9634
+ return null;
9635
+ };
9636
+
9637
+ /**
9638
+ * Creates an AudioMetaData message from a plain object. Also converts values to their respective internal types.
9639
+ * @function fromObject
9640
+ * @memberof CellAsset.AudioMetaData
9641
+ * @static
9642
+ * @param {Object.<string,*>} object Plain object
9643
+ * @returns {CellAsset.AudioMetaData} AudioMetaData
9644
+ */
9645
+ AudioMetaData.fromObject = function fromObject(object) {
9646
+ if (object instanceof $root.CellAsset.AudioMetaData)
9647
+ return object;
9648
+ var message = new $root.CellAsset.AudioMetaData();
9649
+ if (object.durationInMillis != null)
9650
+ if ($util.Long)
9651
+ (message.durationInMillis = $util.Long.fromValue(object.durationInMillis)).unsigned = true;
9652
+ else if (typeof object.durationInMillis === "string")
9653
+ message.durationInMillis = parseInt(object.durationInMillis, 10);
9654
+ else if (typeof object.durationInMillis === "number")
9655
+ message.durationInMillis = object.durationInMillis;
9656
+ else if (typeof object.durationInMillis === "object")
9657
+ message.durationInMillis = new $util.LongBits(object.durationInMillis.low >>> 0, object.durationInMillis.high >>> 0).toNumber(true);
9658
+ if (object.normalizedLoudness != null)
9659
+ if (typeof object.normalizedLoudness === "string")
9660
+ $util.base64.decode(object.normalizedLoudness, message.normalizedLoudness = $util.newBuffer($util.base64.length(object.normalizedLoudness)), 0);
9661
+ else if (object.normalizedLoudness.length >= 0)
9662
+ message.normalizedLoudness = object.normalizedLoudness;
9663
+ return message;
9664
+ };
9665
+
9666
+ /**
9667
+ * Creates a plain object from an AudioMetaData message. Also converts values to other types if specified.
9668
+ * @function toObject
9669
+ * @memberof CellAsset.AudioMetaData
9670
+ * @static
9671
+ * @param {CellAsset.AudioMetaData} message AudioMetaData
9672
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
9673
+ * @returns {Object.<string,*>} Plain object
9674
+ */
9675
+ AudioMetaData.toObject = function toObject(message, options) {
9676
+ if (!options)
9677
+ options = {};
9678
+ var object = {};
9679
+ if (options.defaults) {
9680
+ if ($util.Long) {
9681
+ var long = new $util.Long(0, 0, true);
9682
+ object.durationInMillis = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
9683
+ } else
9684
+ object.durationInMillis = options.longs === String ? "0" : 0;
9685
+ if (options.bytes === String)
9686
+ object.normalizedLoudness = "";
9687
+ else {
9688
+ object.normalizedLoudness = [];
9689
+ if (options.bytes !== Array)
9690
+ object.normalizedLoudness = $util.newBuffer(object.normalizedLoudness);
9691
+ }
9692
+ }
9693
+ if (message.durationInMillis != null && message.hasOwnProperty("durationInMillis"))
9694
+ if (typeof message.durationInMillis === "number")
9695
+ object.durationInMillis = options.longs === String ? String(message.durationInMillis) : message.durationInMillis;
9696
+ else
9697
+ object.durationInMillis = options.longs === String ? $util.Long.prototype.toString.call(message.durationInMillis) : options.longs === Number ? new $util.LongBits(message.durationInMillis.low >>> 0, message.durationInMillis.high >>> 0).toNumber(true) : message.durationInMillis;
9698
+ if (message.normalizedLoudness != null && message.hasOwnProperty("normalizedLoudness"))
9699
+ object.normalizedLoudness = options.bytes === String ? $util.base64.encode(message.normalizedLoudness, 0, message.normalizedLoudness.length) : options.bytes === Array ? Array.prototype.slice.call(message.normalizedLoudness) : message.normalizedLoudness;
9700
+ return object;
9701
+ };
9702
+
9703
+ /**
9704
+ * Converts this AudioMetaData to JSON.
9705
+ * @function toJSON
9706
+ * @memberof CellAsset.AudioMetaData
9707
+ * @instance
9708
+ * @returns {Object.<string,*>} JSON object
9709
+ */
9710
+ AudioMetaData.prototype.toJSON = function toJSON() {
9711
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
9712
+ };
9713
+
9714
+ /**
9715
+ * Gets the default type url for AudioMetaData
9716
+ * @function getTypeUrl
9717
+ * @memberof CellAsset.AudioMetaData
9718
+ * @static
9719
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
9720
+ * @returns {string} The default type url
9721
+ */
9722
+ AudioMetaData.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
9723
+ if (typeUrlPrefix === undefined) {
9724
+ typeUrlPrefix = "type.googleapis.com";
9725
+ }
9726
+ return typeUrlPrefix + "/CellAsset.AudioMetaData";
9727
+ };
9728
+
9729
+ return AudioMetaData;
9730
+ })();
9731
+
9732
+ return CellAsset;
9733
+ })();
9734
+
7968
9735
  $root.Asset = (function() {
7969
9736
 
7970
9737
  /**