@google-shopping/reports 0.4.0 → 0.5.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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.5.0](https://github.com/googleapis/google-cloud-node/compare/reports-v0.4.0...reports-v0.5.0) (2024-05-02)
4
+
5
+
6
+ ### Features
7
+
8
+ * [shopping] add `Weight` to common types for Shopping APIs to be used for accounts bundle ([#5291](https://github.com/googleapis/google-cloud-node/issues/5291)) ([27a72a6](https://github.com/googleapis/google-cloud-node/commit/27a72a6d16079ff025b4a9ac702c6d1bffd017ce))
9
+
3
10
  ## [0.4.0](https://github.com/googleapis/google-cloud-node/compare/reports-v0.3.0...reports-v0.4.0) (2024-04-16)
4
11
 
5
12
 
@@ -22,13 +22,37 @@ option java_multiple_files = true;
22
22
  option java_outer_classname = "TypesProto";
23
23
  option java_package = "com.google.shopping.type";
24
24
 
25
+ // The weight represented as the value in string and the unit.
26
+ message Weight {
27
+ // The weight unit.
28
+ enum WeightUnit {
29
+ // unit unspecified
30
+ WEIGHT_UNIT_UNSPECIFIED = 0;
31
+
32
+ // lb unit.
33
+ POUND = 1;
34
+
35
+ // kg unit.
36
+ KILOGRAM = 2;
37
+ }
38
+
39
+ // Required. The weight represented as a number in micros (1 million micros is
40
+ // an equivalent to one's currency standard unit, for example, 1 kg = 1000000
41
+ // micros).
42
+ // This field can also be set as infinity by setting to -1.
43
+ // This field only support -1 and positive value.
44
+ optional int64 amount_micros = 1;
45
+
46
+ // Required. The weight unit.
47
+ // Acceptable values are: kg and lb
48
+ WeightUnit unit = 2;
49
+ }
50
+
25
51
  // The price represented as a number and currency.
26
52
  message Price {
27
53
  // The price represented as a number in micros (1 million micros is an
28
54
  // equivalent to one's currency standard unit, for example, 1 USD = 1000000
29
55
  // micros).
30
- // This field can also be set as infinity by setting to -1.
31
- // This field only support -1 and positive value.
32
56
  optional int64 amount_micros = 1;
33
57
 
34
58
  // The currency of the price using three-letter acronyms according to [ISO
@@ -3556,6 +3556,122 @@ export namespace google {
3556
3556
  /** Namespace type. */
3557
3557
  namespace type {
3558
3558
 
3559
+ /** Properties of a Weight. */
3560
+ interface IWeight {
3561
+
3562
+ /** Weight amountMicros */
3563
+ amountMicros?: (number|Long|string|null);
3564
+
3565
+ /** Weight unit */
3566
+ unit?: (google.shopping.type.Weight.WeightUnit|keyof typeof google.shopping.type.Weight.WeightUnit|null);
3567
+ }
3568
+
3569
+ /** Represents a Weight. */
3570
+ class Weight implements IWeight {
3571
+
3572
+ /**
3573
+ * Constructs a new Weight.
3574
+ * @param [properties] Properties to set
3575
+ */
3576
+ constructor(properties?: google.shopping.type.IWeight);
3577
+
3578
+ /** Weight amountMicros. */
3579
+ public amountMicros?: (number|Long|string|null);
3580
+
3581
+ /** Weight unit. */
3582
+ public unit: (google.shopping.type.Weight.WeightUnit|keyof typeof google.shopping.type.Weight.WeightUnit);
3583
+
3584
+ /** Weight _amountMicros. */
3585
+ public _amountMicros?: "amountMicros";
3586
+
3587
+ /**
3588
+ * Creates a new Weight instance using the specified properties.
3589
+ * @param [properties] Properties to set
3590
+ * @returns Weight instance
3591
+ */
3592
+ public static create(properties?: google.shopping.type.IWeight): google.shopping.type.Weight;
3593
+
3594
+ /**
3595
+ * Encodes the specified Weight message. Does not implicitly {@link google.shopping.type.Weight.verify|verify} messages.
3596
+ * @param message Weight message or plain object to encode
3597
+ * @param [writer] Writer to encode to
3598
+ * @returns Writer
3599
+ */
3600
+ public static encode(message: google.shopping.type.IWeight, writer?: $protobuf.Writer): $protobuf.Writer;
3601
+
3602
+ /**
3603
+ * Encodes the specified Weight message, length delimited. Does not implicitly {@link google.shopping.type.Weight.verify|verify} messages.
3604
+ * @param message Weight message or plain object to encode
3605
+ * @param [writer] Writer to encode to
3606
+ * @returns Writer
3607
+ */
3608
+ public static encodeDelimited(message: google.shopping.type.IWeight, writer?: $protobuf.Writer): $protobuf.Writer;
3609
+
3610
+ /**
3611
+ * Decodes a Weight message from the specified reader or buffer.
3612
+ * @param reader Reader or buffer to decode from
3613
+ * @param [length] Message length if known beforehand
3614
+ * @returns Weight
3615
+ * @throws {Error} If the payload is not a reader or valid buffer
3616
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
3617
+ */
3618
+ public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.shopping.type.Weight;
3619
+
3620
+ /**
3621
+ * Decodes a Weight message from the specified reader or buffer, length delimited.
3622
+ * @param reader Reader or buffer to decode from
3623
+ * @returns Weight
3624
+ * @throws {Error} If the payload is not a reader or valid buffer
3625
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
3626
+ */
3627
+ public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.shopping.type.Weight;
3628
+
3629
+ /**
3630
+ * Verifies a Weight message.
3631
+ * @param message Plain object to verify
3632
+ * @returns `null` if valid, otherwise the reason why it is not
3633
+ */
3634
+ public static verify(message: { [k: string]: any }): (string|null);
3635
+
3636
+ /**
3637
+ * Creates a Weight message from a plain object. Also converts values to their respective internal types.
3638
+ * @param object Plain object
3639
+ * @returns Weight
3640
+ */
3641
+ public static fromObject(object: { [k: string]: any }): google.shopping.type.Weight;
3642
+
3643
+ /**
3644
+ * Creates a plain object from a Weight message. Also converts values to other types if specified.
3645
+ * @param message Weight
3646
+ * @param [options] Conversion options
3647
+ * @returns Plain object
3648
+ */
3649
+ public static toObject(message: google.shopping.type.Weight, options?: $protobuf.IConversionOptions): { [k: string]: any };
3650
+
3651
+ /**
3652
+ * Converts this Weight to JSON.
3653
+ * @returns JSON object
3654
+ */
3655
+ public toJSON(): { [k: string]: any };
3656
+
3657
+ /**
3658
+ * Gets the default type url for Weight
3659
+ * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
3660
+ * @returns The default type url
3661
+ */
3662
+ public static getTypeUrl(typeUrlPrefix?: string): string;
3663
+ }
3664
+
3665
+ namespace Weight {
3666
+
3667
+ /** WeightUnit enum. */
3668
+ enum WeightUnit {
3669
+ WEIGHT_UNIT_UNSPECIFIED = 0,
3670
+ POUND = 1,
3671
+ KILOGRAM = 2
3672
+ }
3673
+ }
3674
+
3559
3675
  /** Properties of a Price. */
3560
3676
  interface IPrice {
3561
3677
 
@@ -11276,6 +11276,301 @@
11276
11276
  */
11277
11277
  var type = {};
11278
11278
 
11279
+ type.Weight = (function() {
11280
+
11281
+ /**
11282
+ * Properties of a Weight.
11283
+ * @memberof google.shopping.type
11284
+ * @interface IWeight
11285
+ * @property {number|Long|null} [amountMicros] Weight amountMicros
11286
+ * @property {google.shopping.type.Weight.WeightUnit|null} [unit] Weight unit
11287
+ */
11288
+
11289
+ /**
11290
+ * Constructs a new Weight.
11291
+ * @memberof google.shopping.type
11292
+ * @classdesc Represents a Weight.
11293
+ * @implements IWeight
11294
+ * @constructor
11295
+ * @param {google.shopping.type.IWeight=} [properties] Properties to set
11296
+ */
11297
+ function Weight(properties) {
11298
+ if (properties)
11299
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
11300
+ if (properties[keys[i]] != null)
11301
+ this[keys[i]] = properties[keys[i]];
11302
+ }
11303
+
11304
+ /**
11305
+ * Weight amountMicros.
11306
+ * @member {number|Long|null|undefined} amountMicros
11307
+ * @memberof google.shopping.type.Weight
11308
+ * @instance
11309
+ */
11310
+ Weight.prototype.amountMicros = null;
11311
+
11312
+ /**
11313
+ * Weight unit.
11314
+ * @member {google.shopping.type.Weight.WeightUnit} unit
11315
+ * @memberof google.shopping.type.Weight
11316
+ * @instance
11317
+ */
11318
+ Weight.prototype.unit = 0;
11319
+
11320
+ // OneOf field names bound to virtual getters and setters
11321
+ var $oneOfFields;
11322
+
11323
+ /**
11324
+ * Weight _amountMicros.
11325
+ * @member {"amountMicros"|undefined} _amountMicros
11326
+ * @memberof google.shopping.type.Weight
11327
+ * @instance
11328
+ */
11329
+ Object.defineProperty(Weight.prototype, "_amountMicros", {
11330
+ get: $util.oneOfGetter($oneOfFields = ["amountMicros"]),
11331
+ set: $util.oneOfSetter($oneOfFields)
11332
+ });
11333
+
11334
+ /**
11335
+ * Creates a new Weight instance using the specified properties.
11336
+ * @function create
11337
+ * @memberof google.shopping.type.Weight
11338
+ * @static
11339
+ * @param {google.shopping.type.IWeight=} [properties] Properties to set
11340
+ * @returns {google.shopping.type.Weight} Weight instance
11341
+ */
11342
+ Weight.create = function create(properties) {
11343
+ return new Weight(properties);
11344
+ };
11345
+
11346
+ /**
11347
+ * Encodes the specified Weight message. Does not implicitly {@link google.shopping.type.Weight.verify|verify} messages.
11348
+ * @function encode
11349
+ * @memberof google.shopping.type.Weight
11350
+ * @static
11351
+ * @param {google.shopping.type.IWeight} message Weight message or plain object to encode
11352
+ * @param {$protobuf.Writer} [writer] Writer to encode to
11353
+ * @returns {$protobuf.Writer} Writer
11354
+ */
11355
+ Weight.encode = function encode(message, writer) {
11356
+ if (!writer)
11357
+ writer = $Writer.create();
11358
+ if (message.amountMicros != null && Object.hasOwnProperty.call(message, "amountMicros"))
11359
+ writer.uint32(/* id 1, wireType 0 =*/8).int64(message.amountMicros);
11360
+ if (message.unit != null && Object.hasOwnProperty.call(message, "unit"))
11361
+ writer.uint32(/* id 2, wireType 0 =*/16).int32(message.unit);
11362
+ return writer;
11363
+ };
11364
+
11365
+ /**
11366
+ * Encodes the specified Weight message, length delimited. Does not implicitly {@link google.shopping.type.Weight.verify|verify} messages.
11367
+ * @function encodeDelimited
11368
+ * @memberof google.shopping.type.Weight
11369
+ * @static
11370
+ * @param {google.shopping.type.IWeight} message Weight message or plain object to encode
11371
+ * @param {$protobuf.Writer} [writer] Writer to encode to
11372
+ * @returns {$protobuf.Writer} Writer
11373
+ */
11374
+ Weight.encodeDelimited = function encodeDelimited(message, writer) {
11375
+ return this.encode(message, writer).ldelim();
11376
+ };
11377
+
11378
+ /**
11379
+ * Decodes a Weight message from the specified reader or buffer.
11380
+ * @function decode
11381
+ * @memberof google.shopping.type.Weight
11382
+ * @static
11383
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
11384
+ * @param {number} [length] Message length if known beforehand
11385
+ * @returns {google.shopping.type.Weight} Weight
11386
+ * @throws {Error} If the payload is not a reader or valid buffer
11387
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
11388
+ */
11389
+ Weight.decode = function decode(reader, length) {
11390
+ if (!(reader instanceof $Reader))
11391
+ reader = $Reader.create(reader);
11392
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.shopping.type.Weight();
11393
+ while (reader.pos < end) {
11394
+ var tag = reader.uint32();
11395
+ switch (tag >>> 3) {
11396
+ case 1: {
11397
+ message.amountMicros = reader.int64();
11398
+ break;
11399
+ }
11400
+ case 2: {
11401
+ message.unit = reader.int32();
11402
+ break;
11403
+ }
11404
+ default:
11405
+ reader.skipType(tag & 7);
11406
+ break;
11407
+ }
11408
+ }
11409
+ return message;
11410
+ };
11411
+
11412
+ /**
11413
+ * Decodes a Weight message from the specified reader or buffer, length delimited.
11414
+ * @function decodeDelimited
11415
+ * @memberof google.shopping.type.Weight
11416
+ * @static
11417
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
11418
+ * @returns {google.shopping.type.Weight} Weight
11419
+ * @throws {Error} If the payload is not a reader or valid buffer
11420
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
11421
+ */
11422
+ Weight.decodeDelimited = function decodeDelimited(reader) {
11423
+ if (!(reader instanceof $Reader))
11424
+ reader = new $Reader(reader);
11425
+ return this.decode(reader, reader.uint32());
11426
+ };
11427
+
11428
+ /**
11429
+ * Verifies a Weight message.
11430
+ * @function verify
11431
+ * @memberof google.shopping.type.Weight
11432
+ * @static
11433
+ * @param {Object.<string,*>} message Plain object to verify
11434
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
11435
+ */
11436
+ Weight.verify = function verify(message) {
11437
+ if (typeof message !== "object" || message === null)
11438
+ return "object expected";
11439
+ var properties = {};
11440
+ if (message.amountMicros != null && message.hasOwnProperty("amountMicros")) {
11441
+ properties._amountMicros = 1;
11442
+ if (!$util.isInteger(message.amountMicros) && !(message.amountMicros && $util.isInteger(message.amountMicros.low) && $util.isInteger(message.amountMicros.high)))
11443
+ return "amountMicros: integer|Long expected";
11444
+ }
11445
+ if (message.unit != null && message.hasOwnProperty("unit"))
11446
+ switch (message.unit) {
11447
+ default:
11448
+ return "unit: enum value expected";
11449
+ case 0:
11450
+ case 1:
11451
+ case 2:
11452
+ break;
11453
+ }
11454
+ return null;
11455
+ };
11456
+
11457
+ /**
11458
+ * Creates a Weight message from a plain object. Also converts values to their respective internal types.
11459
+ * @function fromObject
11460
+ * @memberof google.shopping.type.Weight
11461
+ * @static
11462
+ * @param {Object.<string,*>} object Plain object
11463
+ * @returns {google.shopping.type.Weight} Weight
11464
+ */
11465
+ Weight.fromObject = function fromObject(object) {
11466
+ if (object instanceof $root.google.shopping.type.Weight)
11467
+ return object;
11468
+ var message = new $root.google.shopping.type.Weight();
11469
+ if (object.amountMicros != null)
11470
+ if ($util.Long)
11471
+ (message.amountMicros = $util.Long.fromValue(object.amountMicros)).unsigned = false;
11472
+ else if (typeof object.amountMicros === "string")
11473
+ message.amountMicros = parseInt(object.amountMicros, 10);
11474
+ else if (typeof object.amountMicros === "number")
11475
+ message.amountMicros = object.amountMicros;
11476
+ else if (typeof object.amountMicros === "object")
11477
+ message.amountMicros = new $util.LongBits(object.amountMicros.low >>> 0, object.amountMicros.high >>> 0).toNumber();
11478
+ switch (object.unit) {
11479
+ default:
11480
+ if (typeof object.unit === "number") {
11481
+ message.unit = object.unit;
11482
+ break;
11483
+ }
11484
+ break;
11485
+ case "WEIGHT_UNIT_UNSPECIFIED":
11486
+ case 0:
11487
+ message.unit = 0;
11488
+ break;
11489
+ case "POUND":
11490
+ case 1:
11491
+ message.unit = 1;
11492
+ break;
11493
+ case "KILOGRAM":
11494
+ case 2:
11495
+ message.unit = 2;
11496
+ break;
11497
+ }
11498
+ return message;
11499
+ };
11500
+
11501
+ /**
11502
+ * Creates a plain object from a Weight message. Also converts values to other types if specified.
11503
+ * @function toObject
11504
+ * @memberof google.shopping.type.Weight
11505
+ * @static
11506
+ * @param {google.shopping.type.Weight} message Weight
11507
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
11508
+ * @returns {Object.<string,*>} Plain object
11509
+ */
11510
+ Weight.toObject = function toObject(message, options) {
11511
+ if (!options)
11512
+ options = {};
11513
+ var object = {};
11514
+ if (options.defaults)
11515
+ object.unit = options.enums === String ? "WEIGHT_UNIT_UNSPECIFIED" : 0;
11516
+ if (message.amountMicros != null && message.hasOwnProperty("amountMicros")) {
11517
+ if (typeof message.amountMicros === "number")
11518
+ object.amountMicros = options.longs === String ? String(message.amountMicros) : message.amountMicros;
11519
+ else
11520
+ object.amountMicros = options.longs === String ? $util.Long.prototype.toString.call(message.amountMicros) : options.longs === Number ? new $util.LongBits(message.amountMicros.low >>> 0, message.amountMicros.high >>> 0).toNumber() : message.amountMicros;
11521
+ if (options.oneofs)
11522
+ object._amountMicros = "amountMicros";
11523
+ }
11524
+ if (message.unit != null && message.hasOwnProperty("unit"))
11525
+ object.unit = options.enums === String ? $root.google.shopping.type.Weight.WeightUnit[message.unit] === undefined ? message.unit : $root.google.shopping.type.Weight.WeightUnit[message.unit] : message.unit;
11526
+ return object;
11527
+ };
11528
+
11529
+ /**
11530
+ * Converts this Weight to JSON.
11531
+ * @function toJSON
11532
+ * @memberof google.shopping.type.Weight
11533
+ * @instance
11534
+ * @returns {Object.<string,*>} JSON object
11535
+ */
11536
+ Weight.prototype.toJSON = function toJSON() {
11537
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
11538
+ };
11539
+
11540
+ /**
11541
+ * Gets the default type url for Weight
11542
+ * @function getTypeUrl
11543
+ * @memberof google.shopping.type.Weight
11544
+ * @static
11545
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
11546
+ * @returns {string} The default type url
11547
+ */
11548
+ Weight.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
11549
+ if (typeUrlPrefix === undefined) {
11550
+ typeUrlPrefix = "type.googleapis.com";
11551
+ }
11552
+ return typeUrlPrefix + "/google.shopping.type.Weight";
11553
+ };
11554
+
11555
+ /**
11556
+ * WeightUnit enum.
11557
+ * @name google.shopping.type.Weight.WeightUnit
11558
+ * @enum {number}
11559
+ * @property {number} WEIGHT_UNIT_UNSPECIFIED=0 WEIGHT_UNIT_UNSPECIFIED value
11560
+ * @property {number} POUND=1 POUND value
11561
+ * @property {number} KILOGRAM=2 KILOGRAM value
11562
+ */
11563
+ Weight.WeightUnit = (function() {
11564
+ var valuesById = {}, values = Object.create(valuesById);
11565
+ values[valuesById[0] = "WEIGHT_UNIT_UNSPECIFIED"] = 0;
11566
+ values[valuesById[1] = "POUND"] = 1;
11567
+ values[valuesById[2] = "KILOGRAM"] = 2;
11568
+ return values;
11569
+ })();
11570
+
11571
+ return Weight;
11572
+ })();
11573
+
11279
11574
  type.Price = (function() {
11280
11575
 
11281
11576
  /**
@@ -2069,6 +2069,37 @@
2069
2069
  "java_package": "com.google.shopping.type"
2070
2070
  },
2071
2071
  "nested": {
2072
+ "Weight": {
2073
+ "oneofs": {
2074
+ "_amountMicros": {
2075
+ "oneof": [
2076
+ "amountMicros"
2077
+ ]
2078
+ }
2079
+ },
2080
+ "fields": {
2081
+ "amountMicros": {
2082
+ "type": "int64",
2083
+ "id": 1,
2084
+ "options": {
2085
+ "proto3_optional": true
2086
+ }
2087
+ },
2088
+ "unit": {
2089
+ "type": "WeightUnit",
2090
+ "id": 2
2091
+ }
2092
+ },
2093
+ "nested": {
2094
+ "WeightUnit": {
2095
+ "values": {
2096
+ "WEIGHT_UNIT_UNSPECIFIED": 0,
2097
+ "POUND": 1,
2098
+ "KILOGRAM": 2
2099
+ }
2100
+ }
2101
+ }
2102
+ },
2072
2103
  "Price": {
2073
2104
  "oneofs": {
2074
2105
  "_amountMicros": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@google-shopping/reports",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "Merchant API client for Node.js",
5
5
  "repository": {
6
6
  "type": "git",