@headspace/protos-events 1.319.0 → 1.321.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/lib/index.d.ts +908 -0
- package/lib/index.js +2482 -0
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -18637,6 +18637,2082 @@ $root.googleReceipt = (function() {
|
|
|
18637
18637
|
return googleReceipt;
|
|
18638
18638
|
})();
|
|
18639
18639
|
|
|
18640
|
+
$root.productcatalog = (function() {
|
|
18641
|
+
|
|
18642
|
+
/**
|
|
18643
|
+
* Namespace productcatalog.
|
|
18644
|
+
* @exports productcatalog
|
|
18645
|
+
* @namespace
|
|
18646
|
+
*/
|
|
18647
|
+
var productcatalog = {};
|
|
18648
|
+
|
|
18649
|
+
productcatalog.ProductSku = (function() {
|
|
18650
|
+
|
|
18651
|
+
/**
|
|
18652
|
+
* Properties of a ProductSku.
|
|
18653
|
+
* @memberof productcatalog
|
|
18654
|
+
* @interface IProductSku
|
|
18655
|
+
* @property {string|null} [id] product sku id
|
|
18656
|
+
* @property {string|null} [slug] product sku slug
|
|
18657
|
+
* @property {number|null} [version] product sku version
|
|
18658
|
+
* @property {productcatalog.ProductSkuPlatform|null} [platform] platform, e.g "APPLE", "GOOGLE", "ZUORA"
|
|
18659
|
+
* @property {productcatalog.ProductSkuBillingCategory|null} [billingCategory] how the user paid, e.g. "PARTNER_PAID", "DIRECT", "FREE_TRIAL"
|
|
18660
|
+
* @property {productcatalog.ITermConfiguration|null} [initialTerm] length of the first term
|
|
18661
|
+
* @property {productcatalog.ITermConfiguration|null} [renewalTerm] length of all terms after the first
|
|
18662
|
+
* @property {productcatalog.ITermConfiguration|null} [billingDelay] length of time to wait before we start billing the user
|
|
18663
|
+
* @property {productcatalog.IBillingPlan|null} [billingPlan] billing information
|
|
18664
|
+
* @property {Array.<productcatalog.ProductSkuTag>|null} [tags] extra information (e.g. student, family)
|
|
18665
|
+
*/
|
|
18666
|
+
|
|
18667
|
+
/**
|
|
18668
|
+
* Constructs a new ProductSku.
|
|
18669
|
+
* @memberof productcatalog
|
|
18670
|
+
* @classdesc Represents a ProductSku.
|
|
18671
|
+
* @implements IProductSku
|
|
18672
|
+
* @constructor
|
|
18673
|
+
* @param {productcatalog.IProductSku=} [properties] Properties to set
|
|
18674
|
+
*/
|
|
18675
|
+
function ProductSku(properties) {
|
|
18676
|
+
this.tags = [];
|
|
18677
|
+
if (properties)
|
|
18678
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
18679
|
+
if (properties[keys[i]] != null)
|
|
18680
|
+
this[keys[i]] = properties[keys[i]];
|
|
18681
|
+
}
|
|
18682
|
+
|
|
18683
|
+
/**
|
|
18684
|
+
* product sku id
|
|
18685
|
+
* @member {string} id
|
|
18686
|
+
* @memberof productcatalog.ProductSku
|
|
18687
|
+
* @instance
|
|
18688
|
+
*/
|
|
18689
|
+
ProductSku.prototype.id = "";
|
|
18690
|
+
|
|
18691
|
+
/**
|
|
18692
|
+
* product sku slug
|
|
18693
|
+
* @member {string} slug
|
|
18694
|
+
* @memberof productcatalog.ProductSku
|
|
18695
|
+
* @instance
|
|
18696
|
+
*/
|
|
18697
|
+
ProductSku.prototype.slug = "";
|
|
18698
|
+
|
|
18699
|
+
/**
|
|
18700
|
+
* product sku version
|
|
18701
|
+
* @member {number} version
|
|
18702
|
+
* @memberof productcatalog.ProductSku
|
|
18703
|
+
* @instance
|
|
18704
|
+
*/
|
|
18705
|
+
ProductSku.prototype.version = 0;
|
|
18706
|
+
|
|
18707
|
+
/**
|
|
18708
|
+
* platform, e.g "APPLE", "GOOGLE", "ZUORA"
|
|
18709
|
+
* @member {productcatalog.ProductSkuPlatform} platform
|
|
18710
|
+
* @memberof productcatalog.ProductSku
|
|
18711
|
+
* @instance
|
|
18712
|
+
*/
|
|
18713
|
+
ProductSku.prototype.platform = 0;
|
|
18714
|
+
|
|
18715
|
+
/**
|
|
18716
|
+
* how the user paid, e.g. "PARTNER_PAID", "DIRECT", "FREE_TRIAL"
|
|
18717
|
+
* @member {productcatalog.ProductSkuBillingCategory} billingCategory
|
|
18718
|
+
* @memberof productcatalog.ProductSku
|
|
18719
|
+
* @instance
|
|
18720
|
+
*/
|
|
18721
|
+
ProductSku.prototype.billingCategory = 0;
|
|
18722
|
+
|
|
18723
|
+
/**
|
|
18724
|
+
* length of the first term
|
|
18725
|
+
* @member {productcatalog.ITermConfiguration|null|undefined} initialTerm
|
|
18726
|
+
* @memberof productcatalog.ProductSku
|
|
18727
|
+
* @instance
|
|
18728
|
+
*/
|
|
18729
|
+
ProductSku.prototype.initialTerm = null;
|
|
18730
|
+
|
|
18731
|
+
/**
|
|
18732
|
+
* length of all terms after the first
|
|
18733
|
+
* @member {productcatalog.ITermConfiguration|null|undefined} renewalTerm
|
|
18734
|
+
* @memberof productcatalog.ProductSku
|
|
18735
|
+
* @instance
|
|
18736
|
+
*/
|
|
18737
|
+
ProductSku.prototype.renewalTerm = null;
|
|
18738
|
+
|
|
18739
|
+
/**
|
|
18740
|
+
* length of time to wait before we start billing the user
|
|
18741
|
+
* @member {productcatalog.ITermConfiguration|null|undefined} billingDelay
|
|
18742
|
+
* @memberof productcatalog.ProductSku
|
|
18743
|
+
* @instance
|
|
18744
|
+
*/
|
|
18745
|
+
ProductSku.prototype.billingDelay = null;
|
|
18746
|
+
|
|
18747
|
+
/**
|
|
18748
|
+
* billing information
|
|
18749
|
+
* @member {productcatalog.IBillingPlan|null|undefined} billingPlan
|
|
18750
|
+
* @memberof productcatalog.ProductSku
|
|
18751
|
+
* @instance
|
|
18752
|
+
*/
|
|
18753
|
+
ProductSku.prototype.billingPlan = null;
|
|
18754
|
+
|
|
18755
|
+
/**
|
|
18756
|
+
* extra information (e.g. student, family)
|
|
18757
|
+
* @member {Array.<productcatalog.ProductSkuTag>} tags
|
|
18758
|
+
* @memberof productcatalog.ProductSku
|
|
18759
|
+
* @instance
|
|
18760
|
+
*/
|
|
18761
|
+
ProductSku.prototype.tags = $util.emptyArray;
|
|
18762
|
+
|
|
18763
|
+
/**
|
|
18764
|
+
* Creates a new ProductSku instance using the specified properties.
|
|
18765
|
+
* @function create
|
|
18766
|
+
* @memberof productcatalog.ProductSku
|
|
18767
|
+
* @static
|
|
18768
|
+
* @param {productcatalog.IProductSku=} [properties] Properties to set
|
|
18769
|
+
* @returns {productcatalog.ProductSku} ProductSku instance
|
|
18770
|
+
*/
|
|
18771
|
+
ProductSku.create = function create(properties) {
|
|
18772
|
+
return new ProductSku(properties);
|
|
18773
|
+
};
|
|
18774
|
+
|
|
18775
|
+
/**
|
|
18776
|
+
* Encodes the specified ProductSku message. Does not implicitly {@link productcatalog.ProductSku.verify|verify} messages.
|
|
18777
|
+
* @function encode
|
|
18778
|
+
* @memberof productcatalog.ProductSku
|
|
18779
|
+
* @static
|
|
18780
|
+
* @param {productcatalog.IProductSku} message ProductSku message or plain object to encode
|
|
18781
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
18782
|
+
* @returns {$protobuf.Writer} Writer
|
|
18783
|
+
*/
|
|
18784
|
+
ProductSku.encode = function encode(message, writer) {
|
|
18785
|
+
if (!writer)
|
|
18786
|
+
writer = $Writer.create();
|
|
18787
|
+
if (message.id != null && message.hasOwnProperty("id"))
|
|
18788
|
+
writer.uint32(/* id 1, wireType 2 =*/10).string(message.id);
|
|
18789
|
+
if (message.slug != null && message.hasOwnProperty("slug"))
|
|
18790
|
+
writer.uint32(/* id 2, wireType 2 =*/18).string(message.slug);
|
|
18791
|
+
if (message.version != null && message.hasOwnProperty("version"))
|
|
18792
|
+
writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.version);
|
|
18793
|
+
if (message.platform != null && message.hasOwnProperty("platform"))
|
|
18794
|
+
writer.uint32(/* id 4, wireType 0 =*/32).int32(message.platform);
|
|
18795
|
+
if (message.billingCategory != null && message.hasOwnProperty("billingCategory"))
|
|
18796
|
+
writer.uint32(/* id 5, wireType 0 =*/40).int32(message.billingCategory);
|
|
18797
|
+
if (message.initialTerm != null && message.hasOwnProperty("initialTerm"))
|
|
18798
|
+
$root.productcatalog.TermConfiguration.encode(message.initialTerm, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
|
|
18799
|
+
if (message.renewalTerm != null && message.hasOwnProperty("renewalTerm"))
|
|
18800
|
+
$root.productcatalog.TermConfiguration.encode(message.renewalTerm, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
|
|
18801
|
+
if (message.billingDelay != null && message.hasOwnProperty("billingDelay"))
|
|
18802
|
+
$root.productcatalog.TermConfiguration.encode(message.billingDelay, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
|
|
18803
|
+
if (message.billingPlan != null && message.hasOwnProperty("billingPlan"))
|
|
18804
|
+
$root.productcatalog.BillingPlan.encode(message.billingPlan, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim();
|
|
18805
|
+
if (message.tags != null && message.tags.length) {
|
|
18806
|
+
writer.uint32(/* id 10, wireType 2 =*/82).fork();
|
|
18807
|
+
for (var i = 0; i < message.tags.length; ++i)
|
|
18808
|
+
writer.int32(message.tags[i]);
|
|
18809
|
+
writer.ldelim();
|
|
18810
|
+
}
|
|
18811
|
+
return writer;
|
|
18812
|
+
};
|
|
18813
|
+
|
|
18814
|
+
/**
|
|
18815
|
+
* Encodes the specified ProductSku message, length delimited. Does not implicitly {@link productcatalog.ProductSku.verify|verify} messages.
|
|
18816
|
+
* @function encodeDelimited
|
|
18817
|
+
* @memberof productcatalog.ProductSku
|
|
18818
|
+
* @static
|
|
18819
|
+
* @param {productcatalog.IProductSku} message ProductSku message or plain object to encode
|
|
18820
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
18821
|
+
* @returns {$protobuf.Writer} Writer
|
|
18822
|
+
*/
|
|
18823
|
+
ProductSku.encodeDelimited = function encodeDelimited(message, writer) {
|
|
18824
|
+
return this.encode(message, writer).ldelim();
|
|
18825
|
+
};
|
|
18826
|
+
|
|
18827
|
+
/**
|
|
18828
|
+
* Decodes a ProductSku message from the specified reader or buffer.
|
|
18829
|
+
* @function decode
|
|
18830
|
+
* @memberof productcatalog.ProductSku
|
|
18831
|
+
* @static
|
|
18832
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
18833
|
+
* @param {number} [length] Message length if known beforehand
|
|
18834
|
+
* @returns {productcatalog.ProductSku} ProductSku
|
|
18835
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
18836
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
18837
|
+
*/
|
|
18838
|
+
ProductSku.decode = function decode(reader, length) {
|
|
18839
|
+
if (!(reader instanceof $Reader))
|
|
18840
|
+
reader = $Reader.create(reader);
|
|
18841
|
+
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.productcatalog.ProductSku();
|
|
18842
|
+
while (reader.pos < end) {
|
|
18843
|
+
var tag = reader.uint32();
|
|
18844
|
+
switch (tag >>> 3) {
|
|
18845
|
+
case 1:
|
|
18846
|
+
message.id = reader.string();
|
|
18847
|
+
break;
|
|
18848
|
+
case 2:
|
|
18849
|
+
message.slug = reader.string();
|
|
18850
|
+
break;
|
|
18851
|
+
case 3:
|
|
18852
|
+
message.version = reader.uint32();
|
|
18853
|
+
break;
|
|
18854
|
+
case 4:
|
|
18855
|
+
message.platform = reader.int32();
|
|
18856
|
+
break;
|
|
18857
|
+
case 5:
|
|
18858
|
+
message.billingCategory = reader.int32();
|
|
18859
|
+
break;
|
|
18860
|
+
case 6:
|
|
18861
|
+
message.initialTerm = $root.productcatalog.TermConfiguration.decode(reader, reader.uint32());
|
|
18862
|
+
break;
|
|
18863
|
+
case 7:
|
|
18864
|
+
message.renewalTerm = $root.productcatalog.TermConfiguration.decode(reader, reader.uint32());
|
|
18865
|
+
break;
|
|
18866
|
+
case 8:
|
|
18867
|
+
message.billingDelay = $root.productcatalog.TermConfiguration.decode(reader, reader.uint32());
|
|
18868
|
+
break;
|
|
18869
|
+
case 9:
|
|
18870
|
+
message.billingPlan = $root.productcatalog.BillingPlan.decode(reader, reader.uint32());
|
|
18871
|
+
break;
|
|
18872
|
+
case 10:
|
|
18873
|
+
if (!(message.tags && message.tags.length))
|
|
18874
|
+
message.tags = [];
|
|
18875
|
+
if ((tag & 7) === 2) {
|
|
18876
|
+
var end2 = reader.uint32() + reader.pos;
|
|
18877
|
+
while (reader.pos < end2)
|
|
18878
|
+
message.tags.push(reader.int32());
|
|
18879
|
+
} else
|
|
18880
|
+
message.tags.push(reader.int32());
|
|
18881
|
+
break;
|
|
18882
|
+
default:
|
|
18883
|
+
reader.skipType(tag & 7);
|
|
18884
|
+
break;
|
|
18885
|
+
}
|
|
18886
|
+
}
|
|
18887
|
+
return message;
|
|
18888
|
+
};
|
|
18889
|
+
|
|
18890
|
+
/**
|
|
18891
|
+
* Decodes a ProductSku message from the specified reader or buffer, length delimited.
|
|
18892
|
+
* @function decodeDelimited
|
|
18893
|
+
* @memberof productcatalog.ProductSku
|
|
18894
|
+
* @static
|
|
18895
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
18896
|
+
* @returns {productcatalog.ProductSku} ProductSku
|
|
18897
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
18898
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
18899
|
+
*/
|
|
18900
|
+
ProductSku.decodeDelimited = function decodeDelimited(reader) {
|
|
18901
|
+
if (!(reader instanceof $Reader))
|
|
18902
|
+
reader = new $Reader(reader);
|
|
18903
|
+
return this.decode(reader, reader.uint32());
|
|
18904
|
+
};
|
|
18905
|
+
|
|
18906
|
+
/**
|
|
18907
|
+
* Verifies a ProductSku message.
|
|
18908
|
+
* @function verify
|
|
18909
|
+
* @memberof productcatalog.ProductSku
|
|
18910
|
+
* @static
|
|
18911
|
+
* @param {Object.<string,*>} message Plain object to verify
|
|
18912
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
18913
|
+
*/
|
|
18914
|
+
ProductSku.verify = function verify(message) {
|
|
18915
|
+
if (typeof message !== "object" || message === null)
|
|
18916
|
+
return "object expected";
|
|
18917
|
+
if (message.id != null && message.hasOwnProperty("id"))
|
|
18918
|
+
if (!$util.isString(message.id))
|
|
18919
|
+
return "id: string expected";
|
|
18920
|
+
if (message.slug != null && message.hasOwnProperty("slug"))
|
|
18921
|
+
if (!$util.isString(message.slug))
|
|
18922
|
+
return "slug: string expected";
|
|
18923
|
+
if (message.version != null && message.hasOwnProperty("version"))
|
|
18924
|
+
if (!$util.isInteger(message.version))
|
|
18925
|
+
return "version: integer expected";
|
|
18926
|
+
if (message.platform != null && message.hasOwnProperty("platform"))
|
|
18927
|
+
switch (message.platform) {
|
|
18928
|
+
default:
|
|
18929
|
+
return "platform: enum value expected";
|
|
18930
|
+
case 0:
|
|
18931
|
+
case 1:
|
|
18932
|
+
case 2:
|
|
18933
|
+
case 3:
|
|
18934
|
+
case 4:
|
|
18935
|
+
case 5:
|
|
18936
|
+
case 6:
|
|
18937
|
+
break;
|
|
18938
|
+
}
|
|
18939
|
+
if (message.billingCategory != null && message.hasOwnProperty("billingCategory"))
|
|
18940
|
+
switch (message.billingCategory) {
|
|
18941
|
+
default:
|
|
18942
|
+
return "billingCategory: enum value expected";
|
|
18943
|
+
case 0:
|
|
18944
|
+
case 1:
|
|
18945
|
+
case 2:
|
|
18946
|
+
case 3:
|
|
18947
|
+
case 4:
|
|
18948
|
+
case 5:
|
|
18949
|
+
case 6:
|
|
18950
|
+
break;
|
|
18951
|
+
}
|
|
18952
|
+
if (message.initialTerm != null && message.hasOwnProperty("initialTerm")) {
|
|
18953
|
+
var error = $root.productcatalog.TermConfiguration.verify(message.initialTerm);
|
|
18954
|
+
if (error)
|
|
18955
|
+
return "initialTerm." + error;
|
|
18956
|
+
}
|
|
18957
|
+
if (message.renewalTerm != null && message.hasOwnProperty("renewalTerm")) {
|
|
18958
|
+
var error = $root.productcatalog.TermConfiguration.verify(message.renewalTerm);
|
|
18959
|
+
if (error)
|
|
18960
|
+
return "renewalTerm." + error;
|
|
18961
|
+
}
|
|
18962
|
+
if (message.billingDelay != null && message.hasOwnProperty("billingDelay")) {
|
|
18963
|
+
var error = $root.productcatalog.TermConfiguration.verify(message.billingDelay);
|
|
18964
|
+
if (error)
|
|
18965
|
+
return "billingDelay." + error;
|
|
18966
|
+
}
|
|
18967
|
+
if (message.billingPlan != null && message.hasOwnProperty("billingPlan")) {
|
|
18968
|
+
var error = $root.productcatalog.BillingPlan.verify(message.billingPlan);
|
|
18969
|
+
if (error)
|
|
18970
|
+
return "billingPlan." + error;
|
|
18971
|
+
}
|
|
18972
|
+
if (message.tags != null && message.hasOwnProperty("tags")) {
|
|
18973
|
+
if (!Array.isArray(message.tags))
|
|
18974
|
+
return "tags: array expected";
|
|
18975
|
+
for (var i = 0; i < message.tags.length; ++i)
|
|
18976
|
+
switch (message.tags[i]) {
|
|
18977
|
+
default:
|
|
18978
|
+
return "tags: enum value[] expected";
|
|
18979
|
+
case 0:
|
|
18980
|
+
case 1:
|
|
18981
|
+
case 2:
|
|
18982
|
+
break;
|
|
18983
|
+
}
|
|
18984
|
+
}
|
|
18985
|
+
return null;
|
|
18986
|
+
};
|
|
18987
|
+
|
|
18988
|
+
/**
|
|
18989
|
+
* Creates a ProductSku message from a plain object. Also converts values to their respective internal types.
|
|
18990
|
+
* @function fromObject
|
|
18991
|
+
* @memberof productcatalog.ProductSku
|
|
18992
|
+
* @static
|
|
18993
|
+
* @param {Object.<string,*>} object Plain object
|
|
18994
|
+
* @returns {productcatalog.ProductSku} ProductSku
|
|
18995
|
+
*/
|
|
18996
|
+
ProductSku.fromObject = function fromObject(object) {
|
|
18997
|
+
if (object instanceof $root.productcatalog.ProductSku)
|
|
18998
|
+
return object;
|
|
18999
|
+
var message = new $root.productcatalog.ProductSku();
|
|
19000
|
+
if (object.id != null)
|
|
19001
|
+
message.id = String(object.id);
|
|
19002
|
+
if (object.slug != null)
|
|
19003
|
+
message.slug = String(object.slug);
|
|
19004
|
+
if (object.version != null)
|
|
19005
|
+
message.version = object.version >>> 0;
|
|
19006
|
+
switch (object.platform) {
|
|
19007
|
+
case "PLATFORM_UNKNOWN":
|
|
19008
|
+
case 0:
|
|
19009
|
+
message.platform = 0;
|
|
19010
|
+
break;
|
|
19011
|
+
case "PLATFORM_APPLE":
|
|
19012
|
+
case 1:
|
|
19013
|
+
message.platform = 1;
|
|
19014
|
+
break;
|
|
19015
|
+
case "PLATFORM_GOOGLE":
|
|
19016
|
+
case 2:
|
|
19017
|
+
message.platform = 2;
|
|
19018
|
+
break;
|
|
19019
|
+
case "PLATFORM_HEADSPACE":
|
|
19020
|
+
case 3:
|
|
19021
|
+
message.platform = 3;
|
|
19022
|
+
break;
|
|
19023
|
+
case "PLATFORM_SPOTIFY":
|
|
19024
|
+
case 4:
|
|
19025
|
+
message.platform = 4;
|
|
19026
|
+
break;
|
|
19027
|
+
case "PLATFORM_ZUORA":
|
|
19028
|
+
case 5:
|
|
19029
|
+
message.platform = 5;
|
|
19030
|
+
break;
|
|
19031
|
+
case "PLATFORM_B2B_ORG":
|
|
19032
|
+
case 6:
|
|
19033
|
+
message.platform = 6;
|
|
19034
|
+
break;
|
|
19035
|
+
}
|
|
19036
|
+
switch (object.billingCategory) {
|
|
19037
|
+
case "BC_UNKNOWN":
|
|
19038
|
+
case 0:
|
|
19039
|
+
message.billingCategory = 0;
|
|
19040
|
+
break;
|
|
19041
|
+
case "BC_GIFT_CODE":
|
|
19042
|
+
case 1:
|
|
19043
|
+
message.billingCategory = 1;
|
|
19044
|
+
break;
|
|
19045
|
+
case "BC_GIFT_PURCHASE":
|
|
19046
|
+
case 2:
|
|
19047
|
+
message.billingCategory = 2;
|
|
19048
|
+
break;
|
|
19049
|
+
case "BC_FREE_CODE":
|
|
19050
|
+
case 3:
|
|
19051
|
+
message.billingCategory = 3;
|
|
19052
|
+
break;
|
|
19053
|
+
case "BC_FREE_TRIAL":
|
|
19054
|
+
case 4:
|
|
19055
|
+
message.billingCategory = 4;
|
|
19056
|
+
break;
|
|
19057
|
+
case "BC_PARTNER_PAID":
|
|
19058
|
+
case 5:
|
|
19059
|
+
message.billingCategory = 5;
|
|
19060
|
+
break;
|
|
19061
|
+
case "BC_DIRECT":
|
|
19062
|
+
case 6:
|
|
19063
|
+
message.billingCategory = 6;
|
|
19064
|
+
break;
|
|
19065
|
+
}
|
|
19066
|
+
if (object.initialTerm != null) {
|
|
19067
|
+
if (typeof object.initialTerm !== "object")
|
|
19068
|
+
throw TypeError(".productcatalog.ProductSku.initialTerm: object expected");
|
|
19069
|
+
message.initialTerm = $root.productcatalog.TermConfiguration.fromObject(object.initialTerm);
|
|
19070
|
+
}
|
|
19071
|
+
if (object.renewalTerm != null) {
|
|
19072
|
+
if (typeof object.renewalTerm !== "object")
|
|
19073
|
+
throw TypeError(".productcatalog.ProductSku.renewalTerm: object expected");
|
|
19074
|
+
message.renewalTerm = $root.productcatalog.TermConfiguration.fromObject(object.renewalTerm);
|
|
19075
|
+
}
|
|
19076
|
+
if (object.billingDelay != null) {
|
|
19077
|
+
if (typeof object.billingDelay !== "object")
|
|
19078
|
+
throw TypeError(".productcatalog.ProductSku.billingDelay: object expected");
|
|
19079
|
+
message.billingDelay = $root.productcatalog.TermConfiguration.fromObject(object.billingDelay);
|
|
19080
|
+
}
|
|
19081
|
+
if (object.billingPlan != null) {
|
|
19082
|
+
if (typeof object.billingPlan !== "object")
|
|
19083
|
+
throw TypeError(".productcatalog.ProductSku.billingPlan: object expected");
|
|
19084
|
+
message.billingPlan = $root.productcatalog.BillingPlan.fromObject(object.billingPlan);
|
|
19085
|
+
}
|
|
19086
|
+
if (object.tags) {
|
|
19087
|
+
if (!Array.isArray(object.tags))
|
|
19088
|
+
throw TypeError(".productcatalog.ProductSku.tags: array expected");
|
|
19089
|
+
message.tags = [];
|
|
19090
|
+
for (var i = 0; i < object.tags.length; ++i)
|
|
19091
|
+
switch (object.tags[i]) {
|
|
19092
|
+
default:
|
|
19093
|
+
case "TAG_UNKNOWN":
|
|
19094
|
+
case 0:
|
|
19095
|
+
message.tags[i] = 0;
|
|
19096
|
+
break;
|
|
19097
|
+
case "TAG_STUDENT":
|
|
19098
|
+
case 1:
|
|
19099
|
+
message.tags[i] = 1;
|
|
19100
|
+
break;
|
|
19101
|
+
case "TAG_FAMILY":
|
|
19102
|
+
case 2:
|
|
19103
|
+
message.tags[i] = 2;
|
|
19104
|
+
break;
|
|
19105
|
+
}
|
|
19106
|
+
}
|
|
19107
|
+
return message;
|
|
19108
|
+
};
|
|
19109
|
+
|
|
19110
|
+
/**
|
|
19111
|
+
* Creates a plain object from a ProductSku message. Also converts values to other types if specified.
|
|
19112
|
+
* @function toObject
|
|
19113
|
+
* @memberof productcatalog.ProductSku
|
|
19114
|
+
* @static
|
|
19115
|
+
* @param {productcatalog.ProductSku} message ProductSku
|
|
19116
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
19117
|
+
* @returns {Object.<string,*>} Plain object
|
|
19118
|
+
*/
|
|
19119
|
+
ProductSku.toObject = function toObject(message, options) {
|
|
19120
|
+
if (!options)
|
|
19121
|
+
options = {};
|
|
19122
|
+
var object = {};
|
|
19123
|
+
if (options.arrays || options.defaults)
|
|
19124
|
+
object.tags = [];
|
|
19125
|
+
if (options.defaults) {
|
|
19126
|
+
object.id = "";
|
|
19127
|
+
object.slug = "";
|
|
19128
|
+
object.version = 0;
|
|
19129
|
+
object.platform = options.enums === String ? "PLATFORM_UNKNOWN" : 0;
|
|
19130
|
+
object.billingCategory = options.enums === String ? "BC_UNKNOWN" : 0;
|
|
19131
|
+
object.initialTerm = null;
|
|
19132
|
+
object.renewalTerm = null;
|
|
19133
|
+
object.billingDelay = null;
|
|
19134
|
+
object.billingPlan = null;
|
|
19135
|
+
}
|
|
19136
|
+
if (message.id != null && message.hasOwnProperty("id"))
|
|
19137
|
+
object.id = message.id;
|
|
19138
|
+
if (message.slug != null && message.hasOwnProperty("slug"))
|
|
19139
|
+
object.slug = message.slug;
|
|
19140
|
+
if (message.version != null && message.hasOwnProperty("version"))
|
|
19141
|
+
object.version = message.version;
|
|
19142
|
+
if (message.platform != null && message.hasOwnProperty("platform"))
|
|
19143
|
+
object.platform = options.enums === String ? $root.productcatalog.ProductSkuPlatform[message.platform] : message.platform;
|
|
19144
|
+
if (message.billingCategory != null && message.hasOwnProperty("billingCategory"))
|
|
19145
|
+
object.billingCategory = options.enums === String ? $root.productcatalog.ProductSkuBillingCategory[message.billingCategory] : message.billingCategory;
|
|
19146
|
+
if (message.initialTerm != null && message.hasOwnProperty("initialTerm"))
|
|
19147
|
+
object.initialTerm = $root.productcatalog.TermConfiguration.toObject(message.initialTerm, options);
|
|
19148
|
+
if (message.renewalTerm != null && message.hasOwnProperty("renewalTerm"))
|
|
19149
|
+
object.renewalTerm = $root.productcatalog.TermConfiguration.toObject(message.renewalTerm, options);
|
|
19150
|
+
if (message.billingDelay != null && message.hasOwnProperty("billingDelay"))
|
|
19151
|
+
object.billingDelay = $root.productcatalog.TermConfiguration.toObject(message.billingDelay, options);
|
|
19152
|
+
if (message.billingPlan != null && message.hasOwnProperty("billingPlan"))
|
|
19153
|
+
object.billingPlan = $root.productcatalog.BillingPlan.toObject(message.billingPlan, options);
|
|
19154
|
+
if (message.tags && message.tags.length) {
|
|
19155
|
+
object.tags = [];
|
|
19156
|
+
for (var j = 0; j < message.tags.length; ++j)
|
|
19157
|
+
object.tags[j] = options.enums === String ? $root.productcatalog.ProductSkuTag[message.tags[j]] : message.tags[j];
|
|
19158
|
+
}
|
|
19159
|
+
return object;
|
|
19160
|
+
};
|
|
19161
|
+
|
|
19162
|
+
/**
|
|
19163
|
+
* Converts this ProductSku to JSON.
|
|
19164
|
+
* @function toJSON
|
|
19165
|
+
* @memberof productcatalog.ProductSku
|
|
19166
|
+
* @instance
|
|
19167
|
+
* @returns {Object.<string,*>} JSON object
|
|
19168
|
+
*/
|
|
19169
|
+
ProductSku.prototype.toJSON = function toJSON() {
|
|
19170
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
19171
|
+
};
|
|
19172
|
+
|
|
19173
|
+
return ProductSku;
|
|
19174
|
+
})();
|
|
19175
|
+
|
|
19176
|
+
productcatalog.TermConfiguration = (function() {
|
|
19177
|
+
|
|
19178
|
+
/**
|
|
19179
|
+
* Properties of a TermConfiguration.
|
|
19180
|
+
* @memberof productcatalog
|
|
19181
|
+
* @interface ITermConfiguration
|
|
19182
|
+
* @property {productcatalog.ProductSkuCalendarPeriod|null} [period] type of calendar period, e.g. "MONTH", "DAY", "YEAR"
|
|
19183
|
+
* @property {number|null} [numPeriods] number of calendar periods
|
|
19184
|
+
*/
|
|
19185
|
+
|
|
19186
|
+
/**
|
|
19187
|
+
* Constructs a new TermConfiguration.
|
|
19188
|
+
* @memberof productcatalog
|
|
19189
|
+
* @classdesc Represents a TermConfiguration.
|
|
19190
|
+
* @implements ITermConfiguration
|
|
19191
|
+
* @constructor
|
|
19192
|
+
* @param {productcatalog.ITermConfiguration=} [properties] Properties to set
|
|
19193
|
+
*/
|
|
19194
|
+
function TermConfiguration(properties) {
|
|
19195
|
+
if (properties)
|
|
19196
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
19197
|
+
if (properties[keys[i]] != null)
|
|
19198
|
+
this[keys[i]] = properties[keys[i]];
|
|
19199
|
+
}
|
|
19200
|
+
|
|
19201
|
+
/**
|
|
19202
|
+
* type of calendar period, e.g. "MONTH", "DAY", "YEAR"
|
|
19203
|
+
* @member {productcatalog.ProductSkuCalendarPeriod} period
|
|
19204
|
+
* @memberof productcatalog.TermConfiguration
|
|
19205
|
+
* @instance
|
|
19206
|
+
*/
|
|
19207
|
+
TermConfiguration.prototype.period = 0;
|
|
19208
|
+
|
|
19209
|
+
/**
|
|
19210
|
+
* number of calendar periods
|
|
19211
|
+
* @member {number} numPeriods
|
|
19212
|
+
* @memberof productcatalog.TermConfiguration
|
|
19213
|
+
* @instance
|
|
19214
|
+
*/
|
|
19215
|
+
TermConfiguration.prototype.numPeriods = 0;
|
|
19216
|
+
|
|
19217
|
+
/**
|
|
19218
|
+
* Creates a new TermConfiguration instance using the specified properties.
|
|
19219
|
+
* @function create
|
|
19220
|
+
* @memberof productcatalog.TermConfiguration
|
|
19221
|
+
* @static
|
|
19222
|
+
* @param {productcatalog.ITermConfiguration=} [properties] Properties to set
|
|
19223
|
+
* @returns {productcatalog.TermConfiguration} TermConfiguration instance
|
|
19224
|
+
*/
|
|
19225
|
+
TermConfiguration.create = function create(properties) {
|
|
19226
|
+
return new TermConfiguration(properties);
|
|
19227
|
+
};
|
|
19228
|
+
|
|
19229
|
+
/**
|
|
19230
|
+
* Encodes the specified TermConfiguration message. Does not implicitly {@link productcatalog.TermConfiguration.verify|verify} messages.
|
|
19231
|
+
* @function encode
|
|
19232
|
+
* @memberof productcatalog.TermConfiguration
|
|
19233
|
+
* @static
|
|
19234
|
+
* @param {productcatalog.ITermConfiguration} message TermConfiguration message or plain object to encode
|
|
19235
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
19236
|
+
* @returns {$protobuf.Writer} Writer
|
|
19237
|
+
*/
|
|
19238
|
+
TermConfiguration.encode = function encode(message, writer) {
|
|
19239
|
+
if (!writer)
|
|
19240
|
+
writer = $Writer.create();
|
|
19241
|
+
if (message.period != null && message.hasOwnProperty("period"))
|
|
19242
|
+
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.period);
|
|
19243
|
+
if (message.numPeriods != null && message.hasOwnProperty("numPeriods"))
|
|
19244
|
+
writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.numPeriods);
|
|
19245
|
+
return writer;
|
|
19246
|
+
};
|
|
19247
|
+
|
|
19248
|
+
/**
|
|
19249
|
+
* Encodes the specified TermConfiguration message, length delimited. Does not implicitly {@link productcatalog.TermConfiguration.verify|verify} messages.
|
|
19250
|
+
* @function encodeDelimited
|
|
19251
|
+
* @memberof productcatalog.TermConfiguration
|
|
19252
|
+
* @static
|
|
19253
|
+
* @param {productcatalog.ITermConfiguration} message TermConfiguration message or plain object to encode
|
|
19254
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
19255
|
+
* @returns {$protobuf.Writer} Writer
|
|
19256
|
+
*/
|
|
19257
|
+
TermConfiguration.encodeDelimited = function encodeDelimited(message, writer) {
|
|
19258
|
+
return this.encode(message, writer).ldelim();
|
|
19259
|
+
};
|
|
19260
|
+
|
|
19261
|
+
/**
|
|
19262
|
+
* Decodes a TermConfiguration message from the specified reader or buffer.
|
|
19263
|
+
* @function decode
|
|
19264
|
+
* @memberof productcatalog.TermConfiguration
|
|
19265
|
+
* @static
|
|
19266
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
19267
|
+
* @param {number} [length] Message length if known beforehand
|
|
19268
|
+
* @returns {productcatalog.TermConfiguration} TermConfiguration
|
|
19269
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
19270
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
19271
|
+
*/
|
|
19272
|
+
TermConfiguration.decode = function decode(reader, length) {
|
|
19273
|
+
if (!(reader instanceof $Reader))
|
|
19274
|
+
reader = $Reader.create(reader);
|
|
19275
|
+
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.productcatalog.TermConfiguration();
|
|
19276
|
+
while (reader.pos < end) {
|
|
19277
|
+
var tag = reader.uint32();
|
|
19278
|
+
switch (tag >>> 3) {
|
|
19279
|
+
case 1:
|
|
19280
|
+
message.period = reader.int32();
|
|
19281
|
+
break;
|
|
19282
|
+
case 2:
|
|
19283
|
+
message.numPeriods = reader.uint32();
|
|
19284
|
+
break;
|
|
19285
|
+
default:
|
|
19286
|
+
reader.skipType(tag & 7);
|
|
19287
|
+
break;
|
|
19288
|
+
}
|
|
19289
|
+
}
|
|
19290
|
+
return message;
|
|
19291
|
+
};
|
|
19292
|
+
|
|
19293
|
+
/**
|
|
19294
|
+
* Decodes a TermConfiguration message from the specified reader or buffer, length delimited.
|
|
19295
|
+
* @function decodeDelimited
|
|
19296
|
+
* @memberof productcatalog.TermConfiguration
|
|
19297
|
+
* @static
|
|
19298
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
19299
|
+
* @returns {productcatalog.TermConfiguration} TermConfiguration
|
|
19300
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
19301
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
19302
|
+
*/
|
|
19303
|
+
TermConfiguration.decodeDelimited = function decodeDelimited(reader) {
|
|
19304
|
+
if (!(reader instanceof $Reader))
|
|
19305
|
+
reader = new $Reader(reader);
|
|
19306
|
+
return this.decode(reader, reader.uint32());
|
|
19307
|
+
};
|
|
19308
|
+
|
|
19309
|
+
/**
|
|
19310
|
+
* Verifies a TermConfiguration message.
|
|
19311
|
+
* @function verify
|
|
19312
|
+
* @memberof productcatalog.TermConfiguration
|
|
19313
|
+
* @static
|
|
19314
|
+
* @param {Object.<string,*>} message Plain object to verify
|
|
19315
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
19316
|
+
*/
|
|
19317
|
+
TermConfiguration.verify = function verify(message) {
|
|
19318
|
+
if (typeof message !== "object" || message === null)
|
|
19319
|
+
return "object expected";
|
|
19320
|
+
if (message.period != null && message.hasOwnProperty("period"))
|
|
19321
|
+
switch (message.period) {
|
|
19322
|
+
default:
|
|
19323
|
+
return "period: enum value expected";
|
|
19324
|
+
case 0:
|
|
19325
|
+
case 1:
|
|
19326
|
+
case 2:
|
|
19327
|
+
case 3:
|
|
19328
|
+
case 4:
|
|
19329
|
+
case 5:
|
|
19330
|
+
case 7:
|
|
19331
|
+
case 8:
|
|
19332
|
+
case 9:
|
|
19333
|
+
break;
|
|
19334
|
+
}
|
|
19335
|
+
if (message.numPeriods != null && message.hasOwnProperty("numPeriods"))
|
|
19336
|
+
if (!$util.isInteger(message.numPeriods))
|
|
19337
|
+
return "numPeriods: integer expected";
|
|
19338
|
+
return null;
|
|
19339
|
+
};
|
|
19340
|
+
|
|
19341
|
+
/**
|
|
19342
|
+
* Creates a TermConfiguration message from a plain object. Also converts values to their respective internal types.
|
|
19343
|
+
* @function fromObject
|
|
19344
|
+
* @memberof productcatalog.TermConfiguration
|
|
19345
|
+
* @static
|
|
19346
|
+
* @param {Object.<string,*>} object Plain object
|
|
19347
|
+
* @returns {productcatalog.TermConfiguration} TermConfiguration
|
|
19348
|
+
*/
|
|
19349
|
+
TermConfiguration.fromObject = function fromObject(object) {
|
|
19350
|
+
if (object instanceof $root.productcatalog.TermConfiguration)
|
|
19351
|
+
return object;
|
|
19352
|
+
var message = new $root.productcatalog.TermConfiguration();
|
|
19353
|
+
switch (object.period) {
|
|
19354
|
+
case "CP_UNKNOWN":
|
|
19355
|
+
case 0:
|
|
19356
|
+
message.period = 0;
|
|
19357
|
+
break;
|
|
19358
|
+
case "CP_DAY":
|
|
19359
|
+
case 1:
|
|
19360
|
+
message.period = 1;
|
|
19361
|
+
break;
|
|
19362
|
+
case "CP_MONTH":
|
|
19363
|
+
case 2:
|
|
19364
|
+
message.period = 2;
|
|
19365
|
+
break;
|
|
19366
|
+
case "CP_YEAR":
|
|
19367
|
+
case 3:
|
|
19368
|
+
message.period = 3;
|
|
19369
|
+
break;
|
|
19370
|
+
case "CP_LIFETIME":
|
|
19371
|
+
case 4:
|
|
19372
|
+
message.period = 4;
|
|
19373
|
+
break;
|
|
19374
|
+
case "CP_ONE_TIME":
|
|
19375
|
+
case 5:
|
|
19376
|
+
message.period = 5;
|
|
19377
|
+
break;
|
|
19378
|
+
case "CP_HALF_YEAR":
|
|
19379
|
+
case 7:
|
|
19380
|
+
message.period = 7;
|
|
19381
|
+
break;
|
|
19382
|
+
case "CP_TWO_YEARS":
|
|
19383
|
+
case 8:
|
|
19384
|
+
message.period = 8;
|
|
19385
|
+
break;
|
|
19386
|
+
case "CP_FIVE_YEARS":
|
|
19387
|
+
case 9:
|
|
19388
|
+
message.period = 9;
|
|
19389
|
+
break;
|
|
19390
|
+
}
|
|
19391
|
+
if (object.numPeriods != null)
|
|
19392
|
+
message.numPeriods = object.numPeriods >>> 0;
|
|
19393
|
+
return message;
|
|
19394
|
+
};
|
|
19395
|
+
|
|
19396
|
+
/**
|
|
19397
|
+
* Creates a plain object from a TermConfiguration message. Also converts values to other types if specified.
|
|
19398
|
+
* @function toObject
|
|
19399
|
+
* @memberof productcatalog.TermConfiguration
|
|
19400
|
+
* @static
|
|
19401
|
+
* @param {productcatalog.TermConfiguration} message TermConfiguration
|
|
19402
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
19403
|
+
* @returns {Object.<string,*>} Plain object
|
|
19404
|
+
*/
|
|
19405
|
+
TermConfiguration.toObject = function toObject(message, options) {
|
|
19406
|
+
if (!options)
|
|
19407
|
+
options = {};
|
|
19408
|
+
var object = {};
|
|
19409
|
+
if (options.defaults) {
|
|
19410
|
+
object.period = options.enums === String ? "CP_UNKNOWN" : 0;
|
|
19411
|
+
object.numPeriods = 0;
|
|
19412
|
+
}
|
|
19413
|
+
if (message.period != null && message.hasOwnProperty("period"))
|
|
19414
|
+
object.period = options.enums === String ? $root.productcatalog.ProductSkuCalendarPeriod[message.period] : message.period;
|
|
19415
|
+
if (message.numPeriods != null && message.hasOwnProperty("numPeriods"))
|
|
19416
|
+
object.numPeriods = message.numPeriods;
|
|
19417
|
+
return object;
|
|
19418
|
+
};
|
|
19419
|
+
|
|
19420
|
+
/**
|
|
19421
|
+
* Converts this TermConfiguration to JSON.
|
|
19422
|
+
* @function toJSON
|
|
19423
|
+
* @memberof productcatalog.TermConfiguration
|
|
19424
|
+
* @instance
|
|
19425
|
+
* @returns {Object.<string,*>} JSON object
|
|
19426
|
+
*/
|
|
19427
|
+
TermConfiguration.prototype.toJSON = function toJSON() {
|
|
19428
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
19429
|
+
};
|
|
19430
|
+
|
|
19431
|
+
return TermConfiguration;
|
|
19432
|
+
})();
|
|
19433
|
+
|
|
19434
|
+
productcatalog.BillingPlan = (function() {
|
|
19435
|
+
|
|
19436
|
+
/**
|
|
19437
|
+
* Properties of a BillingPlan.
|
|
19438
|
+
* @memberof productcatalog
|
|
19439
|
+
* @interface IBillingPlan
|
|
19440
|
+
* @property {Array.<productcatalog.IRatePlan>|null} [taxInclusive] BillingPlan taxInclusive
|
|
19441
|
+
* @property {Array.<productcatalog.IRatePlan>|null} [taxExclusive] BillingPlan taxExclusive
|
|
19442
|
+
*/
|
|
19443
|
+
|
|
19444
|
+
/**
|
|
19445
|
+
* Constructs a new BillingPlan.
|
|
19446
|
+
* @memberof productcatalog
|
|
19447
|
+
* @classdesc Represents a BillingPlan.
|
|
19448
|
+
* @implements IBillingPlan
|
|
19449
|
+
* @constructor
|
|
19450
|
+
* @param {productcatalog.IBillingPlan=} [properties] Properties to set
|
|
19451
|
+
*/
|
|
19452
|
+
function BillingPlan(properties) {
|
|
19453
|
+
this.taxInclusive = [];
|
|
19454
|
+
this.taxExclusive = [];
|
|
19455
|
+
if (properties)
|
|
19456
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
19457
|
+
if (properties[keys[i]] != null)
|
|
19458
|
+
this[keys[i]] = properties[keys[i]];
|
|
19459
|
+
}
|
|
19460
|
+
|
|
19461
|
+
/**
|
|
19462
|
+
* BillingPlan taxInclusive.
|
|
19463
|
+
* @member {Array.<productcatalog.IRatePlan>} taxInclusive
|
|
19464
|
+
* @memberof productcatalog.BillingPlan
|
|
19465
|
+
* @instance
|
|
19466
|
+
*/
|
|
19467
|
+
BillingPlan.prototype.taxInclusive = $util.emptyArray;
|
|
19468
|
+
|
|
19469
|
+
/**
|
|
19470
|
+
* BillingPlan taxExclusive.
|
|
19471
|
+
* @member {Array.<productcatalog.IRatePlan>} taxExclusive
|
|
19472
|
+
* @memberof productcatalog.BillingPlan
|
|
19473
|
+
* @instance
|
|
19474
|
+
*/
|
|
19475
|
+
BillingPlan.prototype.taxExclusive = $util.emptyArray;
|
|
19476
|
+
|
|
19477
|
+
/**
|
|
19478
|
+
* Creates a new BillingPlan instance using the specified properties.
|
|
19479
|
+
* @function create
|
|
19480
|
+
* @memberof productcatalog.BillingPlan
|
|
19481
|
+
* @static
|
|
19482
|
+
* @param {productcatalog.IBillingPlan=} [properties] Properties to set
|
|
19483
|
+
* @returns {productcatalog.BillingPlan} BillingPlan instance
|
|
19484
|
+
*/
|
|
19485
|
+
BillingPlan.create = function create(properties) {
|
|
19486
|
+
return new BillingPlan(properties);
|
|
19487
|
+
};
|
|
19488
|
+
|
|
19489
|
+
/**
|
|
19490
|
+
* Encodes the specified BillingPlan message. Does not implicitly {@link productcatalog.BillingPlan.verify|verify} messages.
|
|
19491
|
+
* @function encode
|
|
19492
|
+
* @memberof productcatalog.BillingPlan
|
|
19493
|
+
* @static
|
|
19494
|
+
* @param {productcatalog.IBillingPlan} message BillingPlan message or plain object to encode
|
|
19495
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
19496
|
+
* @returns {$protobuf.Writer} Writer
|
|
19497
|
+
*/
|
|
19498
|
+
BillingPlan.encode = function encode(message, writer) {
|
|
19499
|
+
if (!writer)
|
|
19500
|
+
writer = $Writer.create();
|
|
19501
|
+
if (message.taxInclusive != null && message.taxInclusive.length)
|
|
19502
|
+
for (var i = 0; i < message.taxInclusive.length; ++i)
|
|
19503
|
+
$root.productcatalog.RatePlan.encode(message.taxInclusive[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
|
19504
|
+
if (message.taxExclusive != null && message.taxExclusive.length)
|
|
19505
|
+
for (var i = 0; i < message.taxExclusive.length; ++i)
|
|
19506
|
+
$root.productcatalog.RatePlan.encode(message.taxExclusive[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
|
19507
|
+
return writer;
|
|
19508
|
+
};
|
|
19509
|
+
|
|
19510
|
+
/**
|
|
19511
|
+
* Encodes the specified BillingPlan message, length delimited. Does not implicitly {@link productcatalog.BillingPlan.verify|verify} messages.
|
|
19512
|
+
* @function encodeDelimited
|
|
19513
|
+
* @memberof productcatalog.BillingPlan
|
|
19514
|
+
* @static
|
|
19515
|
+
* @param {productcatalog.IBillingPlan} message BillingPlan message or plain object to encode
|
|
19516
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
19517
|
+
* @returns {$protobuf.Writer} Writer
|
|
19518
|
+
*/
|
|
19519
|
+
BillingPlan.encodeDelimited = function encodeDelimited(message, writer) {
|
|
19520
|
+
return this.encode(message, writer).ldelim();
|
|
19521
|
+
};
|
|
19522
|
+
|
|
19523
|
+
/**
|
|
19524
|
+
* Decodes a BillingPlan message from the specified reader or buffer.
|
|
19525
|
+
* @function decode
|
|
19526
|
+
* @memberof productcatalog.BillingPlan
|
|
19527
|
+
* @static
|
|
19528
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
19529
|
+
* @param {number} [length] Message length if known beforehand
|
|
19530
|
+
* @returns {productcatalog.BillingPlan} BillingPlan
|
|
19531
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
19532
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
19533
|
+
*/
|
|
19534
|
+
BillingPlan.decode = function decode(reader, length) {
|
|
19535
|
+
if (!(reader instanceof $Reader))
|
|
19536
|
+
reader = $Reader.create(reader);
|
|
19537
|
+
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.productcatalog.BillingPlan();
|
|
19538
|
+
while (reader.pos < end) {
|
|
19539
|
+
var tag = reader.uint32();
|
|
19540
|
+
switch (tag >>> 3) {
|
|
19541
|
+
case 1:
|
|
19542
|
+
if (!(message.taxInclusive && message.taxInclusive.length))
|
|
19543
|
+
message.taxInclusive = [];
|
|
19544
|
+
message.taxInclusive.push($root.productcatalog.RatePlan.decode(reader, reader.uint32()));
|
|
19545
|
+
break;
|
|
19546
|
+
case 2:
|
|
19547
|
+
if (!(message.taxExclusive && message.taxExclusive.length))
|
|
19548
|
+
message.taxExclusive = [];
|
|
19549
|
+
message.taxExclusive.push($root.productcatalog.RatePlan.decode(reader, reader.uint32()));
|
|
19550
|
+
break;
|
|
19551
|
+
default:
|
|
19552
|
+
reader.skipType(tag & 7);
|
|
19553
|
+
break;
|
|
19554
|
+
}
|
|
19555
|
+
}
|
|
19556
|
+
return message;
|
|
19557
|
+
};
|
|
19558
|
+
|
|
19559
|
+
/**
|
|
19560
|
+
* Decodes a BillingPlan message from the specified reader or buffer, length delimited.
|
|
19561
|
+
* @function decodeDelimited
|
|
19562
|
+
* @memberof productcatalog.BillingPlan
|
|
19563
|
+
* @static
|
|
19564
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
19565
|
+
* @returns {productcatalog.BillingPlan} BillingPlan
|
|
19566
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
19567
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
19568
|
+
*/
|
|
19569
|
+
BillingPlan.decodeDelimited = function decodeDelimited(reader) {
|
|
19570
|
+
if (!(reader instanceof $Reader))
|
|
19571
|
+
reader = new $Reader(reader);
|
|
19572
|
+
return this.decode(reader, reader.uint32());
|
|
19573
|
+
};
|
|
19574
|
+
|
|
19575
|
+
/**
|
|
19576
|
+
* Verifies a BillingPlan message.
|
|
19577
|
+
* @function verify
|
|
19578
|
+
* @memberof productcatalog.BillingPlan
|
|
19579
|
+
* @static
|
|
19580
|
+
* @param {Object.<string,*>} message Plain object to verify
|
|
19581
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
19582
|
+
*/
|
|
19583
|
+
BillingPlan.verify = function verify(message) {
|
|
19584
|
+
if (typeof message !== "object" || message === null)
|
|
19585
|
+
return "object expected";
|
|
19586
|
+
if (message.taxInclusive != null && message.hasOwnProperty("taxInclusive")) {
|
|
19587
|
+
if (!Array.isArray(message.taxInclusive))
|
|
19588
|
+
return "taxInclusive: array expected";
|
|
19589
|
+
for (var i = 0; i < message.taxInclusive.length; ++i) {
|
|
19590
|
+
var error = $root.productcatalog.RatePlan.verify(message.taxInclusive[i]);
|
|
19591
|
+
if (error)
|
|
19592
|
+
return "taxInclusive." + error;
|
|
19593
|
+
}
|
|
19594
|
+
}
|
|
19595
|
+
if (message.taxExclusive != null && message.hasOwnProperty("taxExclusive")) {
|
|
19596
|
+
if (!Array.isArray(message.taxExclusive))
|
|
19597
|
+
return "taxExclusive: array expected";
|
|
19598
|
+
for (var i = 0; i < message.taxExclusive.length; ++i) {
|
|
19599
|
+
var error = $root.productcatalog.RatePlan.verify(message.taxExclusive[i]);
|
|
19600
|
+
if (error)
|
|
19601
|
+
return "taxExclusive." + error;
|
|
19602
|
+
}
|
|
19603
|
+
}
|
|
19604
|
+
return null;
|
|
19605
|
+
};
|
|
19606
|
+
|
|
19607
|
+
/**
|
|
19608
|
+
* Creates a BillingPlan message from a plain object. Also converts values to their respective internal types.
|
|
19609
|
+
* @function fromObject
|
|
19610
|
+
* @memberof productcatalog.BillingPlan
|
|
19611
|
+
* @static
|
|
19612
|
+
* @param {Object.<string,*>} object Plain object
|
|
19613
|
+
* @returns {productcatalog.BillingPlan} BillingPlan
|
|
19614
|
+
*/
|
|
19615
|
+
BillingPlan.fromObject = function fromObject(object) {
|
|
19616
|
+
if (object instanceof $root.productcatalog.BillingPlan)
|
|
19617
|
+
return object;
|
|
19618
|
+
var message = new $root.productcatalog.BillingPlan();
|
|
19619
|
+
if (object.taxInclusive) {
|
|
19620
|
+
if (!Array.isArray(object.taxInclusive))
|
|
19621
|
+
throw TypeError(".productcatalog.BillingPlan.taxInclusive: array expected");
|
|
19622
|
+
message.taxInclusive = [];
|
|
19623
|
+
for (var i = 0; i < object.taxInclusive.length; ++i) {
|
|
19624
|
+
if (typeof object.taxInclusive[i] !== "object")
|
|
19625
|
+
throw TypeError(".productcatalog.BillingPlan.taxInclusive: object expected");
|
|
19626
|
+
message.taxInclusive[i] = $root.productcatalog.RatePlan.fromObject(object.taxInclusive[i]);
|
|
19627
|
+
}
|
|
19628
|
+
}
|
|
19629
|
+
if (object.taxExclusive) {
|
|
19630
|
+
if (!Array.isArray(object.taxExclusive))
|
|
19631
|
+
throw TypeError(".productcatalog.BillingPlan.taxExclusive: array expected");
|
|
19632
|
+
message.taxExclusive = [];
|
|
19633
|
+
for (var i = 0; i < object.taxExclusive.length; ++i) {
|
|
19634
|
+
if (typeof object.taxExclusive[i] !== "object")
|
|
19635
|
+
throw TypeError(".productcatalog.BillingPlan.taxExclusive: object expected");
|
|
19636
|
+
message.taxExclusive[i] = $root.productcatalog.RatePlan.fromObject(object.taxExclusive[i]);
|
|
19637
|
+
}
|
|
19638
|
+
}
|
|
19639
|
+
return message;
|
|
19640
|
+
};
|
|
19641
|
+
|
|
19642
|
+
/**
|
|
19643
|
+
* Creates a plain object from a BillingPlan message. Also converts values to other types if specified.
|
|
19644
|
+
* @function toObject
|
|
19645
|
+
* @memberof productcatalog.BillingPlan
|
|
19646
|
+
* @static
|
|
19647
|
+
* @param {productcatalog.BillingPlan} message BillingPlan
|
|
19648
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
19649
|
+
* @returns {Object.<string,*>} Plain object
|
|
19650
|
+
*/
|
|
19651
|
+
BillingPlan.toObject = function toObject(message, options) {
|
|
19652
|
+
if (!options)
|
|
19653
|
+
options = {};
|
|
19654
|
+
var object = {};
|
|
19655
|
+
if (options.arrays || options.defaults) {
|
|
19656
|
+
object.taxInclusive = [];
|
|
19657
|
+
object.taxExclusive = [];
|
|
19658
|
+
}
|
|
19659
|
+
if (message.taxInclusive && message.taxInclusive.length) {
|
|
19660
|
+
object.taxInclusive = [];
|
|
19661
|
+
for (var j = 0; j < message.taxInclusive.length; ++j)
|
|
19662
|
+
object.taxInclusive[j] = $root.productcatalog.RatePlan.toObject(message.taxInclusive[j], options);
|
|
19663
|
+
}
|
|
19664
|
+
if (message.taxExclusive && message.taxExclusive.length) {
|
|
19665
|
+
object.taxExclusive = [];
|
|
19666
|
+
for (var j = 0; j < message.taxExclusive.length; ++j)
|
|
19667
|
+
object.taxExclusive[j] = $root.productcatalog.RatePlan.toObject(message.taxExclusive[j], options);
|
|
19668
|
+
}
|
|
19669
|
+
return object;
|
|
19670
|
+
};
|
|
19671
|
+
|
|
19672
|
+
/**
|
|
19673
|
+
* Converts this BillingPlan to JSON.
|
|
19674
|
+
* @function toJSON
|
|
19675
|
+
* @memberof productcatalog.BillingPlan
|
|
19676
|
+
* @instance
|
|
19677
|
+
* @returns {Object.<string,*>} JSON object
|
|
19678
|
+
*/
|
|
19679
|
+
BillingPlan.prototype.toJSON = function toJSON() {
|
|
19680
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
19681
|
+
};
|
|
19682
|
+
|
|
19683
|
+
return BillingPlan;
|
|
19684
|
+
})();
|
|
19685
|
+
|
|
19686
|
+
productcatalog.RatePlan = (function() {
|
|
19687
|
+
|
|
19688
|
+
/**
|
|
19689
|
+
* Properties of a RatePlan.
|
|
19690
|
+
* @memberof productcatalog
|
|
19691
|
+
* @interface IRatePlan
|
|
19692
|
+
* @property {string|null} [name] name of the rate plan
|
|
19693
|
+
* @property {Array.<productcatalog.IRatePlanCharge>|null} [charges] charges in the rate plan
|
|
19694
|
+
*/
|
|
19695
|
+
|
|
19696
|
+
/**
|
|
19697
|
+
* Constructs a new RatePlan.
|
|
19698
|
+
* @memberof productcatalog
|
|
19699
|
+
* @classdesc Represents a RatePlan.
|
|
19700
|
+
* @implements IRatePlan
|
|
19701
|
+
* @constructor
|
|
19702
|
+
* @param {productcatalog.IRatePlan=} [properties] Properties to set
|
|
19703
|
+
*/
|
|
19704
|
+
function RatePlan(properties) {
|
|
19705
|
+
this.charges = [];
|
|
19706
|
+
if (properties)
|
|
19707
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
19708
|
+
if (properties[keys[i]] != null)
|
|
19709
|
+
this[keys[i]] = properties[keys[i]];
|
|
19710
|
+
}
|
|
19711
|
+
|
|
19712
|
+
/**
|
|
19713
|
+
* name of the rate plan
|
|
19714
|
+
* @member {string} name
|
|
19715
|
+
* @memberof productcatalog.RatePlan
|
|
19716
|
+
* @instance
|
|
19717
|
+
*/
|
|
19718
|
+
RatePlan.prototype.name = "";
|
|
19719
|
+
|
|
19720
|
+
/**
|
|
19721
|
+
* charges in the rate plan
|
|
19722
|
+
* @member {Array.<productcatalog.IRatePlanCharge>} charges
|
|
19723
|
+
* @memberof productcatalog.RatePlan
|
|
19724
|
+
* @instance
|
|
19725
|
+
*/
|
|
19726
|
+
RatePlan.prototype.charges = $util.emptyArray;
|
|
19727
|
+
|
|
19728
|
+
/**
|
|
19729
|
+
* Creates a new RatePlan instance using the specified properties.
|
|
19730
|
+
* @function create
|
|
19731
|
+
* @memberof productcatalog.RatePlan
|
|
19732
|
+
* @static
|
|
19733
|
+
* @param {productcatalog.IRatePlan=} [properties] Properties to set
|
|
19734
|
+
* @returns {productcatalog.RatePlan} RatePlan instance
|
|
19735
|
+
*/
|
|
19736
|
+
RatePlan.create = function create(properties) {
|
|
19737
|
+
return new RatePlan(properties);
|
|
19738
|
+
};
|
|
19739
|
+
|
|
19740
|
+
/**
|
|
19741
|
+
* Encodes the specified RatePlan message. Does not implicitly {@link productcatalog.RatePlan.verify|verify} messages.
|
|
19742
|
+
* @function encode
|
|
19743
|
+
* @memberof productcatalog.RatePlan
|
|
19744
|
+
* @static
|
|
19745
|
+
* @param {productcatalog.IRatePlan} message RatePlan message or plain object to encode
|
|
19746
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
19747
|
+
* @returns {$protobuf.Writer} Writer
|
|
19748
|
+
*/
|
|
19749
|
+
RatePlan.encode = function encode(message, writer) {
|
|
19750
|
+
if (!writer)
|
|
19751
|
+
writer = $Writer.create();
|
|
19752
|
+
if (message.name != null && message.hasOwnProperty("name"))
|
|
19753
|
+
writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
|
19754
|
+
if (message.charges != null && message.charges.length)
|
|
19755
|
+
for (var i = 0; i < message.charges.length; ++i)
|
|
19756
|
+
$root.productcatalog.RatePlanCharge.encode(message.charges[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
|
19757
|
+
return writer;
|
|
19758
|
+
};
|
|
19759
|
+
|
|
19760
|
+
/**
|
|
19761
|
+
* Encodes the specified RatePlan message, length delimited. Does not implicitly {@link productcatalog.RatePlan.verify|verify} messages.
|
|
19762
|
+
* @function encodeDelimited
|
|
19763
|
+
* @memberof productcatalog.RatePlan
|
|
19764
|
+
* @static
|
|
19765
|
+
* @param {productcatalog.IRatePlan} message RatePlan message or plain object to encode
|
|
19766
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
19767
|
+
* @returns {$protobuf.Writer} Writer
|
|
19768
|
+
*/
|
|
19769
|
+
RatePlan.encodeDelimited = function encodeDelimited(message, writer) {
|
|
19770
|
+
return this.encode(message, writer).ldelim();
|
|
19771
|
+
};
|
|
19772
|
+
|
|
19773
|
+
/**
|
|
19774
|
+
* Decodes a RatePlan message from the specified reader or buffer.
|
|
19775
|
+
* @function decode
|
|
19776
|
+
* @memberof productcatalog.RatePlan
|
|
19777
|
+
* @static
|
|
19778
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
19779
|
+
* @param {number} [length] Message length if known beforehand
|
|
19780
|
+
* @returns {productcatalog.RatePlan} RatePlan
|
|
19781
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
19782
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
19783
|
+
*/
|
|
19784
|
+
RatePlan.decode = function decode(reader, length) {
|
|
19785
|
+
if (!(reader instanceof $Reader))
|
|
19786
|
+
reader = $Reader.create(reader);
|
|
19787
|
+
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.productcatalog.RatePlan();
|
|
19788
|
+
while (reader.pos < end) {
|
|
19789
|
+
var tag = reader.uint32();
|
|
19790
|
+
switch (tag >>> 3) {
|
|
19791
|
+
case 1:
|
|
19792
|
+
message.name = reader.string();
|
|
19793
|
+
break;
|
|
19794
|
+
case 2:
|
|
19795
|
+
if (!(message.charges && message.charges.length))
|
|
19796
|
+
message.charges = [];
|
|
19797
|
+
message.charges.push($root.productcatalog.RatePlanCharge.decode(reader, reader.uint32()));
|
|
19798
|
+
break;
|
|
19799
|
+
default:
|
|
19800
|
+
reader.skipType(tag & 7);
|
|
19801
|
+
break;
|
|
19802
|
+
}
|
|
19803
|
+
}
|
|
19804
|
+
return message;
|
|
19805
|
+
};
|
|
19806
|
+
|
|
19807
|
+
/**
|
|
19808
|
+
* Decodes a RatePlan message from the specified reader or buffer, length delimited.
|
|
19809
|
+
* @function decodeDelimited
|
|
19810
|
+
* @memberof productcatalog.RatePlan
|
|
19811
|
+
* @static
|
|
19812
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
19813
|
+
* @returns {productcatalog.RatePlan} RatePlan
|
|
19814
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
19815
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
19816
|
+
*/
|
|
19817
|
+
RatePlan.decodeDelimited = function decodeDelimited(reader) {
|
|
19818
|
+
if (!(reader instanceof $Reader))
|
|
19819
|
+
reader = new $Reader(reader);
|
|
19820
|
+
return this.decode(reader, reader.uint32());
|
|
19821
|
+
};
|
|
19822
|
+
|
|
19823
|
+
/**
|
|
19824
|
+
* Verifies a RatePlan message.
|
|
19825
|
+
* @function verify
|
|
19826
|
+
* @memberof productcatalog.RatePlan
|
|
19827
|
+
* @static
|
|
19828
|
+
* @param {Object.<string,*>} message Plain object to verify
|
|
19829
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
19830
|
+
*/
|
|
19831
|
+
RatePlan.verify = function verify(message) {
|
|
19832
|
+
if (typeof message !== "object" || message === null)
|
|
19833
|
+
return "object expected";
|
|
19834
|
+
if (message.name != null && message.hasOwnProperty("name"))
|
|
19835
|
+
if (!$util.isString(message.name))
|
|
19836
|
+
return "name: string expected";
|
|
19837
|
+
if (message.charges != null && message.hasOwnProperty("charges")) {
|
|
19838
|
+
if (!Array.isArray(message.charges))
|
|
19839
|
+
return "charges: array expected";
|
|
19840
|
+
for (var i = 0; i < message.charges.length; ++i) {
|
|
19841
|
+
var error = $root.productcatalog.RatePlanCharge.verify(message.charges[i]);
|
|
19842
|
+
if (error)
|
|
19843
|
+
return "charges." + error;
|
|
19844
|
+
}
|
|
19845
|
+
}
|
|
19846
|
+
return null;
|
|
19847
|
+
};
|
|
19848
|
+
|
|
19849
|
+
/**
|
|
19850
|
+
* Creates a RatePlan message from a plain object. Also converts values to their respective internal types.
|
|
19851
|
+
* @function fromObject
|
|
19852
|
+
* @memberof productcatalog.RatePlan
|
|
19853
|
+
* @static
|
|
19854
|
+
* @param {Object.<string,*>} object Plain object
|
|
19855
|
+
* @returns {productcatalog.RatePlan} RatePlan
|
|
19856
|
+
*/
|
|
19857
|
+
RatePlan.fromObject = function fromObject(object) {
|
|
19858
|
+
if (object instanceof $root.productcatalog.RatePlan)
|
|
19859
|
+
return object;
|
|
19860
|
+
var message = new $root.productcatalog.RatePlan();
|
|
19861
|
+
if (object.name != null)
|
|
19862
|
+
message.name = String(object.name);
|
|
19863
|
+
if (object.charges) {
|
|
19864
|
+
if (!Array.isArray(object.charges))
|
|
19865
|
+
throw TypeError(".productcatalog.RatePlan.charges: array expected");
|
|
19866
|
+
message.charges = [];
|
|
19867
|
+
for (var i = 0; i < object.charges.length; ++i) {
|
|
19868
|
+
if (typeof object.charges[i] !== "object")
|
|
19869
|
+
throw TypeError(".productcatalog.RatePlan.charges: object expected");
|
|
19870
|
+
message.charges[i] = $root.productcatalog.RatePlanCharge.fromObject(object.charges[i]);
|
|
19871
|
+
}
|
|
19872
|
+
}
|
|
19873
|
+
return message;
|
|
19874
|
+
};
|
|
19875
|
+
|
|
19876
|
+
/**
|
|
19877
|
+
* Creates a plain object from a RatePlan message. Also converts values to other types if specified.
|
|
19878
|
+
* @function toObject
|
|
19879
|
+
* @memberof productcatalog.RatePlan
|
|
19880
|
+
* @static
|
|
19881
|
+
* @param {productcatalog.RatePlan} message RatePlan
|
|
19882
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
19883
|
+
* @returns {Object.<string,*>} Plain object
|
|
19884
|
+
*/
|
|
19885
|
+
RatePlan.toObject = function toObject(message, options) {
|
|
19886
|
+
if (!options)
|
|
19887
|
+
options = {};
|
|
19888
|
+
var object = {};
|
|
19889
|
+
if (options.arrays || options.defaults)
|
|
19890
|
+
object.charges = [];
|
|
19891
|
+
if (options.defaults)
|
|
19892
|
+
object.name = "";
|
|
19893
|
+
if (message.name != null && message.hasOwnProperty("name"))
|
|
19894
|
+
object.name = message.name;
|
|
19895
|
+
if (message.charges && message.charges.length) {
|
|
19896
|
+
object.charges = [];
|
|
19897
|
+
for (var j = 0; j < message.charges.length; ++j)
|
|
19898
|
+
object.charges[j] = $root.productcatalog.RatePlanCharge.toObject(message.charges[j], options);
|
|
19899
|
+
}
|
|
19900
|
+
return object;
|
|
19901
|
+
};
|
|
19902
|
+
|
|
19903
|
+
/**
|
|
19904
|
+
* Converts this RatePlan to JSON.
|
|
19905
|
+
* @function toJSON
|
|
19906
|
+
* @memberof productcatalog.RatePlan
|
|
19907
|
+
* @instance
|
|
19908
|
+
* @returns {Object.<string,*>} JSON object
|
|
19909
|
+
*/
|
|
19910
|
+
RatePlan.prototype.toJSON = function toJSON() {
|
|
19911
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
19912
|
+
};
|
|
19913
|
+
|
|
19914
|
+
return RatePlan;
|
|
19915
|
+
})();
|
|
19916
|
+
|
|
19917
|
+
productcatalog.RatePlanCharge = (function() {
|
|
19918
|
+
|
|
19919
|
+
/**
|
|
19920
|
+
* Properties of a RatePlanCharge.
|
|
19921
|
+
* @memberof productcatalog
|
|
19922
|
+
* @interface IRatePlanCharge
|
|
19923
|
+
* @property {productcatalog.ProductSkuCalendarPeriod|null} [period] type of calendar period, e.g. "MONTH", "DAY", "YEAR"
|
|
19924
|
+
* @property {productcatalog.ProductSkuChargeModel|null} [chargeModel] how to interpret this charge, eg. "FLAT_FEE", "DISCOUNT_FIXED", "DISCOUNT_PCT"
|
|
19925
|
+
* @property {productcatalog.ProductSkuEndDateCondition|null} [endDateCondition] when to end this charge, eg. "END_OF_SUBSCRIPTION", "FIXED_PERIODS"
|
|
19926
|
+
* @property {string|null} [endDatePeriods] when 'end_date_condition' is "FIXED_PERIOD", the number of periods to charge before ending
|
|
19927
|
+
* @property {Array.<productcatalog.IRatePlanChargeTier>|null} [tiers] country & currency specific configuration
|
|
19928
|
+
*/
|
|
19929
|
+
|
|
19930
|
+
/**
|
|
19931
|
+
* Constructs a new RatePlanCharge.
|
|
19932
|
+
* @memberof productcatalog
|
|
19933
|
+
* @classdesc Represents a RatePlanCharge.
|
|
19934
|
+
* @implements IRatePlanCharge
|
|
19935
|
+
* @constructor
|
|
19936
|
+
* @param {productcatalog.IRatePlanCharge=} [properties] Properties to set
|
|
19937
|
+
*/
|
|
19938
|
+
function RatePlanCharge(properties) {
|
|
19939
|
+
this.tiers = [];
|
|
19940
|
+
if (properties)
|
|
19941
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
19942
|
+
if (properties[keys[i]] != null)
|
|
19943
|
+
this[keys[i]] = properties[keys[i]];
|
|
19944
|
+
}
|
|
19945
|
+
|
|
19946
|
+
/**
|
|
19947
|
+
* type of calendar period, e.g. "MONTH", "DAY", "YEAR"
|
|
19948
|
+
* @member {productcatalog.ProductSkuCalendarPeriod} period
|
|
19949
|
+
* @memberof productcatalog.RatePlanCharge
|
|
19950
|
+
* @instance
|
|
19951
|
+
*/
|
|
19952
|
+
RatePlanCharge.prototype.period = 0;
|
|
19953
|
+
|
|
19954
|
+
/**
|
|
19955
|
+
* how to interpret this charge, eg. "FLAT_FEE", "DISCOUNT_FIXED", "DISCOUNT_PCT"
|
|
19956
|
+
* @member {productcatalog.ProductSkuChargeModel} chargeModel
|
|
19957
|
+
* @memberof productcatalog.RatePlanCharge
|
|
19958
|
+
* @instance
|
|
19959
|
+
*/
|
|
19960
|
+
RatePlanCharge.prototype.chargeModel = 0;
|
|
19961
|
+
|
|
19962
|
+
/**
|
|
19963
|
+
* when to end this charge, eg. "END_OF_SUBSCRIPTION", "FIXED_PERIODS"
|
|
19964
|
+
* @member {productcatalog.ProductSkuEndDateCondition} endDateCondition
|
|
19965
|
+
* @memberof productcatalog.RatePlanCharge
|
|
19966
|
+
* @instance
|
|
19967
|
+
*/
|
|
19968
|
+
RatePlanCharge.prototype.endDateCondition = 0;
|
|
19969
|
+
|
|
19970
|
+
/**
|
|
19971
|
+
* when 'end_date_condition' is "FIXED_PERIOD", the number of periods to charge before ending
|
|
19972
|
+
* @member {string} endDatePeriods
|
|
19973
|
+
* @memberof productcatalog.RatePlanCharge
|
|
19974
|
+
* @instance
|
|
19975
|
+
*/
|
|
19976
|
+
RatePlanCharge.prototype.endDatePeriods = "";
|
|
19977
|
+
|
|
19978
|
+
/**
|
|
19979
|
+
* country & currency specific configuration
|
|
19980
|
+
* @member {Array.<productcatalog.IRatePlanChargeTier>} tiers
|
|
19981
|
+
* @memberof productcatalog.RatePlanCharge
|
|
19982
|
+
* @instance
|
|
19983
|
+
*/
|
|
19984
|
+
RatePlanCharge.prototype.tiers = $util.emptyArray;
|
|
19985
|
+
|
|
19986
|
+
/**
|
|
19987
|
+
* Creates a new RatePlanCharge instance using the specified properties.
|
|
19988
|
+
* @function create
|
|
19989
|
+
* @memberof productcatalog.RatePlanCharge
|
|
19990
|
+
* @static
|
|
19991
|
+
* @param {productcatalog.IRatePlanCharge=} [properties] Properties to set
|
|
19992
|
+
* @returns {productcatalog.RatePlanCharge} RatePlanCharge instance
|
|
19993
|
+
*/
|
|
19994
|
+
RatePlanCharge.create = function create(properties) {
|
|
19995
|
+
return new RatePlanCharge(properties);
|
|
19996
|
+
};
|
|
19997
|
+
|
|
19998
|
+
/**
|
|
19999
|
+
* Encodes the specified RatePlanCharge message. Does not implicitly {@link productcatalog.RatePlanCharge.verify|verify} messages.
|
|
20000
|
+
* @function encode
|
|
20001
|
+
* @memberof productcatalog.RatePlanCharge
|
|
20002
|
+
* @static
|
|
20003
|
+
* @param {productcatalog.IRatePlanCharge} message RatePlanCharge message or plain object to encode
|
|
20004
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
20005
|
+
* @returns {$protobuf.Writer} Writer
|
|
20006
|
+
*/
|
|
20007
|
+
RatePlanCharge.encode = function encode(message, writer) {
|
|
20008
|
+
if (!writer)
|
|
20009
|
+
writer = $Writer.create();
|
|
20010
|
+
if (message.period != null && message.hasOwnProperty("period"))
|
|
20011
|
+
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.period);
|
|
20012
|
+
if (message.chargeModel != null && message.hasOwnProperty("chargeModel"))
|
|
20013
|
+
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.chargeModel);
|
|
20014
|
+
if (message.endDateCondition != null && message.hasOwnProperty("endDateCondition"))
|
|
20015
|
+
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.endDateCondition);
|
|
20016
|
+
if (message.endDatePeriods != null && message.hasOwnProperty("endDatePeriods"))
|
|
20017
|
+
writer.uint32(/* id 4, wireType 2 =*/34).string(message.endDatePeriods);
|
|
20018
|
+
if (message.tiers != null && message.tiers.length)
|
|
20019
|
+
for (var i = 0; i < message.tiers.length; ++i)
|
|
20020
|
+
$root.productcatalog.RatePlanChargeTier.encode(message.tiers[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
|
|
20021
|
+
return writer;
|
|
20022
|
+
};
|
|
20023
|
+
|
|
20024
|
+
/**
|
|
20025
|
+
* Encodes the specified RatePlanCharge message, length delimited. Does not implicitly {@link productcatalog.RatePlanCharge.verify|verify} messages.
|
|
20026
|
+
* @function encodeDelimited
|
|
20027
|
+
* @memberof productcatalog.RatePlanCharge
|
|
20028
|
+
* @static
|
|
20029
|
+
* @param {productcatalog.IRatePlanCharge} message RatePlanCharge message or plain object to encode
|
|
20030
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
20031
|
+
* @returns {$protobuf.Writer} Writer
|
|
20032
|
+
*/
|
|
20033
|
+
RatePlanCharge.encodeDelimited = function encodeDelimited(message, writer) {
|
|
20034
|
+
return this.encode(message, writer).ldelim();
|
|
20035
|
+
};
|
|
20036
|
+
|
|
20037
|
+
/**
|
|
20038
|
+
* Decodes a RatePlanCharge message from the specified reader or buffer.
|
|
20039
|
+
* @function decode
|
|
20040
|
+
* @memberof productcatalog.RatePlanCharge
|
|
20041
|
+
* @static
|
|
20042
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
20043
|
+
* @param {number} [length] Message length if known beforehand
|
|
20044
|
+
* @returns {productcatalog.RatePlanCharge} RatePlanCharge
|
|
20045
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
20046
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
20047
|
+
*/
|
|
20048
|
+
RatePlanCharge.decode = function decode(reader, length) {
|
|
20049
|
+
if (!(reader instanceof $Reader))
|
|
20050
|
+
reader = $Reader.create(reader);
|
|
20051
|
+
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.productcatalog.RatePlanCharge();
|
|
20052
|
+
while (reader.pos < end) {
|
|
20053
|
+
var tag = reader.uint32();
|
|
20054
|
+
switch (tag >>> 3) {
|
|
20055
|
+
case 1:
|
|
20056
|
+
message.period = reader.int32();
|
|
20057
|
+
break;
|
|
20058
|
+
case 2:
|
|
20059
|
+
message.chargeModel = reader.int32();
|
|
20060
|
+
break;
|
|
20061
|
+
case 3:
|
|
20062
|
+
message.endDateCondition = reader.int32();
|
|
20063
|
+
break;
|
|
20064
|
+
case 4:
|
|
20065
|
+
message.endDatePeriods = reader.string();
|
|
20066
|
+
break;
|
|
20067
|
+
case 5:
|
|
20068
|
+
if (!(message.tiers && message.tiers.length))
|
|
20069
|
+
message.tiers = [];
|
|
20070
|
+
message.tiers.push($root.productcatalog.RatePlanChargeTier.decode(reader, reader.uint32()));
|
|
20071
|
+
break;
|
|
20072
|
+
default:
|
|
20073
|
+
reader.skipType(tag & 7);
|
|
20074
|
+
break;
|
|
20075
|
+
}
|
|
20076
|
+
}
|
|
20077
|
+
return message;
|
|
20078
|
+
};
|
|
20079
|
+
|
|
20080
|
+
/**
|
|
20081
|
+
* Decodes a RatePlanCharge message from the specified reader or buffer, length delimited.
|
|
20082
|
+
* @function decodeDelimited
|
|
20083
|
+
* @memberof productcatalog.RatePlanCharge
|
|
20084
|
+
* @static
|
|
20085
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
20086
|
+
* @returns {productcatalog.RatePlanCharge} RatePlanCharge
|
|
20087
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
20088
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
20089
|
+
*/
|
|
20090
|
+
RatePlanCharge.decodeDelimited = function decodeDelimited(reader) {
|
|
20091
|
+
if (!(reader instanceof $Reader))
|
|
20092
|
+
reader = new $Reader(reader);
|
|
20093
|
+
return this.decode(reader, reader.uint32());
|
|
20094
|
+
};
|
|
20095
|
+
|
|
20096
|
+
/**
|
|
20097
|
+
* Verifies a RatePlanCharge message.
|
|
20098
|
+
* @function verify
|
|
20099
|
+
* @memberof productcatalog.RatePlanCharge
|
|
20100
|
+
* @static
|
|
20101
|
+
* @param {Object.<string,*>} message Plain object to verify
|
|
20102
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
20103
|
+
*/
|
|
20104
|
+
RatePlanCharge.verify = function verify(message) {
|
|
20105
|
+
if (typeof message !== "object" || message === null)
|
|
20106
|
+
return "object expected";
|
|
20107
|
+
if (message.period != null && message.hasOwnProperty("period"))
|
|
20108
|
+
switch (message.period) {
|
|
20109
|
+
default:
|
|
20110
|
+
return "period: enum value expected";
|
|
20111
|
+
case 0:
|
|
20112
|
+
case 1:
|
|
20113
|
+
case 2:
|
|
20114
|
+
case 3:
|
|
20115
|
+
case 4:
|
|
20116
|
+
case 5:
|
|
20117
|
+
case 7:
|
|
20118
|
+
case 8:
|
|
20119
|
+
case 9:
|
|
20120
|
+
break;
|
|
20121
|
+
}
|
|
20122
|
+
if (message.chargeModel != null && message.hasOwnProperty("chargeModel"))
|
|
20123
|
+
switch (message.chargeModel) {
|
|
20124
|
+
default:
|
|
20125
|
+
return "chargeModel: enum value expected";
|
|
20126
|
+
case 0:
|
|
20127
|
+
case 1:
|
|
20128
|
+
case 2:
|
|
20129
|
+
case 3:
|
|
20130
|
+
break;
|
|
20131
|
+
}
|
|
20132
|
+
if (message.endDateCondition != null && message.hasOwnProperty("endDateCondition"))
|
|
20133
|
+
switch (message.endDateCondition) {
|
|
20134
|
+
default:
|
|
20135
|
+
return "endDateCondition: enum value expected";
|
|
20136
|
+
case 0:
|
|
20137
|
+
case 1:
|
|
20138
|
+
case 2:
|
|
20139
|
+
case 3:
|
|
20140
|
+
break;
|
|
20141
|
+
}
|
|
20142
|
+
if (message.endDatePeriods != null && message.hasOwnProperty("endDatePeriods"))
|
|
20143
|
+
if (!$util.isString(message.endDatePeriods))
|
|
20144
|
+
return "endDatePeriods: string expected";
|
|
20145
|
+
if (message.tiers != null && message.hasOwnProperty("tiers")) {
|
|
20146
|
+
if (!Array.isArray(message.tiers))
|
|
20147
|
+
return "tiers: array expected";
|
|
20148
|
+
for (var i = 0; i < message.tiers.length; ++i) {
|
|
20149
|
+
var error = $root.productcatalog.RatePlanChargeTier.verify(message.tiers[i]);
|
|
20150
|
+
if (error)
|
|
20151
|
+
return "tiers." + error;
|
|
20152
|
+
}
|
|
20153
|
+
}
|
|
20154
|
+
return null;
|
|
20155
|
+
};
|
|
20156
|
+
|
|
20157
|
+
/**
|
|
20158
|
+
* Creates a RatePlanCharge message from a plain object. Also converts values to their respective internal types.
|
|
20159
|
+
* @function fromObject
|
|
20160
|
+
* @memberof productcatalog.RatePlanCharge
|
|
20161
|
+
* @static
|
|
20162
|
+
* @param {Object.<string,*>} object Plain object
|
|
20163
|
+
* @returns {productcatalog.RatePlanCharge} RatePlanCharge
|
|
20164
|
+
*/
|
|
20165
|
+
RatePlanCharge.fromObject = function fromObject(object) {
|
|
20166
|
+
if (object instanceof $root.productcatalog.RatePlanCharge)
|
|
20167
|
+
return object;
|
|
20168
|
+
var message = new $root.productcatalog.RatePlanCharge();
|
|
20169
|
+
switch (object.period) {
|
|
20170
|
+
case "CP_UNKNOWN":
|
|
20171
|
+
case 0:
|
|
20172
|
+
message.period = 0;
|
|
20173
|
+
break;
|
|
20174
|
+
case "CP_DAY":
|
|
20175
|
+
case 1:
|
|
20176
|
+
message.period = 1;
|
|
20177
|
+
break;
|
|
20178
|
+
case "CP_MONTH":
|
|
20179
|
+
case 2:
|
|
20180
|
+
message.period = 2;
|
|
20181
|
+
break;
|
|
20182
|
+
case "CP_YEAR":
|
|
20183
|
+
case 3:
|
|
20184
|
+
message.period = 3;
|
|
20185
|
+
break;
|
|
20186
|
+
case "CP_LIFETIME":
|
|
20187
|
+
case 4:
|
|
20188
|
+
message.period = 4;
|
|
20189
|
+
break;
|
|
20190
|
+
case "CP_ONE_TIME":
|
|
20191
|
+
case 5:
|
|
20192
|
+
message.period = 5;
|
|
20193
|
+
break;
|
|
20194
|
+
case "CP_HALF_YEAR":
|
|
20195
|
+
case 7:
|
|
20196
|
+
message.period = 7;
|
|
20197
|
+
break;
|
|
20198
|
+
case "CP_TWO_YEARS":
|
|
20199
|
+
case 8:
|
|
20200
|
+
message.period = 8;
|
|
20201
|
+
break;
|
|
20202
|
+
case "CP_FIVE_YEARS":
|
|
20203
|
+
case 9:
|
|
20204
|
+
message.period = 9;
|
|
20205
|
+
break;
|
|
20206
|
+
}
|
|
20207
|
+
switch (object.chargeModel) {
|
|
20208
|
+
case "CM_UNKNOWN":
|
|
20209
|
+
case 0:
|
|
20210
|
+
message.chargeModel = 0;
|
|
20211
|
+
break;
|
|
20212
|
+
case "CM_FLAT_FEE":
|
|
20213
|
+
case 1:
|
|
20214
|
+
message.chargeModel = 1;
|
|
20215
|
+
break;
|
|
20216
|
+
case "CM_DISCOUNT_FIXED":
|
|
20217
|
+
case 2:
|
|
20218
|
+
message.chargeModel = 2;
|
|
20219
|
+
break;
|
|
20220
|
+
case "CM_DISCOUNT_PERCENT":
|
|
20221
|
+
case 3:
|
|
20222
|
+
message.chargeModel = 3;
|
|
20223
|
+
break;
|
|
20224
|
+
}
|
|
20225
|
+
switch (object.endDateCondition) {
|
|
20226
|
+
case "EDC_UNKNOWN":
|
|
20227
|
+
case 0:
|
|
20228
|
+
message.endDateCondition = 0;
|
|
20229
|
+
break;
|
|
20230
|
+
case "EDC_END_OF_SUBSCRIPTION":
|
|
20231
|
+
case 1:
|
|
20232
|
+
message.endDateCondition = 1;
|
|
20233
|
+
break;
|
|
20234
|
+
case "EDC_FIXED_NUM_PERIODS":
|
|
20235
|
+
case 2:
|
|
20236
|
+
message.endDateCondition = 2;
|
|
20237
|
+
break;
|
|
20238
|
+
case "EDC_ONE_TIME":
|
|
20239
|
+
case 3:
|
|
20240
|
+
message.endDateCondition = 3;
|
|
20241
|
+
break;
|
|
20242
|
+
}
|
|
20243
|
+
if (object.endDatePeriods != null)
|
|
20244
|
+
message.endDatePeriods = String(object.endDatePeriods);
|
|
20245
|
+
if (object.tiers) {
|
|
20246
|
+
if (!Array.isArray(object.tiers))
|
|
20247
|
+
throw TypeError(".productcatalog.RatePlanCharge.tiers: array expected");
|
|
20248
|
+
message.tiers = [];
|
|
20249
|
+
for (var i = 0; i < object.tiers.length; ++i) {
|
|
20250
|
+
if (typeof object.tiers[i] !== "object")
|
|
20251
|
+
throw TypeError(".productcatalog.RatePlanCharge.tiers: object expected");
|
|
20252
|
+
message.tiers[i] = $root.productcatalog.RatePlanChargeTier.fromObject(object.tiers[i]);
|
|
20253
|
+
}
|
|
20254
|
+
}
|
|
20255
|
+
return message;
|
|
20256
|
+
};
|
|
20257
|
+
|
|
20258
|
+
/**
|
|
20259
|
+
* Creates a plain object from a RatePlanCharge message. Also converts values to other types if specified.
|
|
20260
|
+
* @function toObject
|
|
20261
|
+
* @memberof productcatalog.RatePlanCharge
|
|
20262
|
+
* @static
|
|
20263
|
+
* @param {productcatalog.RatePlanCharge} message RatePlanCharge
|
|
20264
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
20265
|
+
* @returns {Object.<string,*>} Plain object
|
|
20266
|
+
*/
|
|
20267
|
+
RatePlanCharge.toObject = function toObject(message, options) {
|
|
20268
|
+
if (!options)
|
|
20269
|
+
options = {};
|
|
20270
|
+
var object = {};
|
|
20271
|
+
if (options.arrays || options.defaults)
|
|
20272
|
+
object.tiers = [];
|
|
20273
|
+
if (options.defaults) {
|
|
20274
|
+
object.period = options.enums === String ? "CP_UNKNOWN" : 0;
|
|
20275
|
+
object.chargeModel = options.enums === String ? "CM_UNKNOWN" : 0;
|
|
20276
|
+
object.endDateCondition = options.enums === String ? "EDC_UNKNOWN" : 0;
|
|
20277
|
+
object.endDatePeriods = "";
|
|
20278
|
+
}
|
|
20279
|
+
if (message.period != null && message.hasOwnProperty("period"))
|
|
20280
|
+
object.period = options.enums === String ? $root.productcatalog.ProductSkuCalendarPeriod[message.period] : message.period;
|
|
20281
|
+
if (message.chargeModel != null && message.hasOwnProperty("chargeModel"))
|
|
20282
|
+
object.chargeModel = options.enums === String ? $root.productcatalog.ProductSkuChargeModel[message.chargeModel] : message.chargeModel;
|
|
20283
|
+
if (message.endDateCondition != null && message.hasOwnProperty("endDateCondition"))
|
|
20284
|
+
object.endDateCondition = options.enums === String ? $root.productcatalog.ProductSkuEndDateCondition[message.endDateCondition] : message.endDateCondition;
|
|
20285
|
+
if (message.endDatePeriods != null && message.hasOwnProperty("endDatePeriods"))
|
|
20286
|
+
object.endDatePeriods = message.endDatePeriods;
|
|
20287
|
+
if (message.tiers && message.tiers.length) {
|
|
20288
|
+
object.tiers = [];
|
|
20289
|
+
for (var j = 0; j < message.tiers.length; ++j)
|
|
20290
|
+
object.tiers[j] = $root.productcatalog.RatePlanChargeTier.toObject(message.tiers[j], options);
|
|
20291
|
+
}
|
|
20292
|
+
return object;
|
|
20293
|
+
};
|
|
20294
|
+
|
|
20295
|
+
/**
|
|
20296
|
+
* Converts this RatePlanCharge to JSON.
|
|
20297
|
+
* @function toJSON
|
|
20298
|
+
* @memberof productcatalog.RatePlanCharge
|
|
20299
|
+
* @instance
|
|
20300
|
+
* @returns {Object.<string,*>} JSON object
|
|
20301
|
+
*/
|
|
20302
|
+
RatePlanCharge.prototype.toJSON = function toJSON() {
|
|
20303
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
20304
|
+
};
|
|
20305
|
+
|
|
20306
|
+
return RatePlanCharge;
|
|
20307
|
+
})();
|
|
20308
|
+
|
|
20309
|
+
productcatalog.RatePlanChargeTier = (function() {
|
|
20310
|
+
|
|
20311
|
+
/**
|
|
20312
|
+
* Properties of a RatePlanChargeTier.
|
|
20313
|
+
* @memberof productcatalog
|
|
20314
|
+
* @interface IRatePlanChargeTier
|
|
20315
|
+
* @property {string|null} [currency] 3-letter currency code, eg. USD, MXN, AUD, EUR, etc...
|
|
20316
|
+
* @property {string|null} [country] 2-letter country code, eg. US, CA, IN
|
|
20317
|
+
* @property {number|null} [discountAmount] discount amount if the charge_model is DISCOUNT_FIXED
|
|
20318
|
+
* @property {number|null} [discountPercent] discount percentage if the charge_model is DISCOUNT_PCT
|
|
20319
|
+
* @property {number|null} [listPrice] amount to be charged if charge_model is "FLAT_FEE"
|
|
20320
|
+
*/
|
|
20321
|
+
|
|
20322
|
+
/**
|
|
20323
|
+
* Constructs a new RatePlanChargeTier.
|
|
20324
|
+
* @memberof productcatalog
|
|
20325
|
+
* @classdesc Represents a RatePlanChargeTier.
|
|
20326
|
+
* @implements IRatePlanChargeTier
|
|
20327
|
+
* @constructor
|
|
20328
|
+
* @param {productcatalog.IRatePlanChargeTier=} [properties] Properties to set
|
|
20329
|
+
*/
|
|
20330
|
+
function RatePlanChargeTier(properties) {
|
|
20331
|
+
if (properties)
|
|
20332
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
20333
|
+
if (properties[keys[i]] != null)
|
|
20334
|
+
this[keys[i]] = properties[keys[i]];
|
|
20335
|
+
}
|
|
20336
|
+
|
|
20337
|
+
/**
|
|
20338
|
+
* 3-letter currency code, eg. USD, MXN, AUD, EUR, etc...
|
|
20339
|
+
* @member {string} currency
|
|
20340
|
+
* @memberof productcatalog.RatePlanChargeTier
|
|
20341
|
+
* @instance
|
|
20342
|
+
*/
|
|
20343
|
+
RatePlanChargeTier.prototype.currency = "";
|
|
20344
|
+
|
|
20345
|
+
/**
|
|
20346
|
+
* 2-letter country code, eg. US, CA, IN
|
|
20347
|
+
* @member {string} country
|
|
20348
|
+
* @memberof productcatalog.RatePlanChargeTier
|
|
20349
|
+
* @instance
|
|
20350
|
+
*/
|
|
20351
|
+
RatePlanChargeTier.prototype.country = "";
|
|
20352
|
+
|
|
20353
|
+
/**
|
|
20354
|
+
* discount amount if the charge_model is DISCOUNT_FIXED
|
|
20355
|
+
* @member {number} discountAmount
|
|
20356
|
+
* @memberof productcatalog.RatePlanChargeTier
|
|
20357
|
+
* @instance
|
|
20358
|
+
*/
|
|
20359
|
+
RatePlanChargeTier.prototype.discountAmount = 0;
|
|
20360
|
+
|
|
20361
|
+
/**
|
|
20362
|
+
* discount percentage if the charge_model is DISCOUNT_PCT
|
|
20363
|
+
* @member {number} discountPercent
|
|
20364
|
+
* @memberof productcatalog.RatePlanChargeTier
|
|
20365
|
+
* @instance
|
|
20366
|
+
*/
|
|
20367
|
+
RatePlanChargeTier.prototype.discountPercent = 0;
|
|
20368
|
+
|
|
20369
|
+
/**
|
|
20370
|
+
* amount to be charged if charge_model is "FLAT_FEE"
|
|
20371
|
+
* @member {number} listPrice
|
|
20372
|
+
* @memberof productcatalog.RatePlanChargeTier
|
|
20373
|
+
* @instance
|
|
20374
|
+
*/
|
|
20375
|
+
RatePlanChargeTier.prototype.listPrice = 0;
|
|
20376
|
+
|
|
20377
|
+
/**
|
|
20378
|
+
* Creates a new RatePlanChargeTier instance using the specified properties.
|
|
20379
|
+
* @function create
|
|
20380
|
+
* @memberof productcatalog.RatePlanChargeTier
|
|
20381
|
+
* @static
|
|
20382
|
+
* @param {productcatalog.IRatePlanChargeTier=} [properties] Properties to set
|
|
20383
|
+
* @returns {productcatalog.RatePlanChargeTier} RatePlanChargeTier instance
|
|
20384
|
+
*/
|
|
20385
|
+
RatePlanChargeTier.create = function create(properties) {
|
|
20386
|
+
return new RatePlanChargeTier(properties);
|
|
20387
|
+
};
|
|
20388
|
+
|
|
20389
|
+
/**
|
|
20390
|
+
* Encodes the specified RatePlanChargeTier message. Does not implicitly {@link productcatalog.RatePlanChargeTier.verify|verify} messages.
|
|
20391
|
+
* @function encode
|
|
20392
|
+
* @memberof productcatalog.RatePlanChargeTier
|
|
20393
|
+
* @static
|
|
20394
|
+
* @param {productcatalog.IRatePlanChargeTier} message RatePlanChargeTier message or plain object to encode
|
|
20395
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
20396
|
+
* @returns {$protobuf.Writer} Writer
|
|
20397
|
+
*/
|
|
20398
|
+
RatePlanChargeTier.encode = function encode(message, writer) {
|
|
20399
|
+
if (!writer)
|
|
20400
|
+
writer = $Writer.create();
|
|
20401
|
+
if (message.currency != null && message.hasOwnProperty("currency"))
|
|
20402
|
+
writer.uint32(/* id 1, wireType 2 =*/10).string(message.currency);
|
|
20403
|
+
if (message.country != null && message.hasOwnProperty("country"))
|
|
20404
|
+
writer.uint32(/* id 2, wireType 2 =*/18).string(message.country);
|
|
20405
|
+
if (message.discountAmount != null && message.hasOwnProperty("discountAmount"))
|
|
20406
|
+
writer.uint32(/* id 3, wireType 1 =*/25).double(message.discountAmount);
|
|
20407
|
+
if (message.discountPercent != null && message.hasOwnProperty("discountPercent"))
|
|
20408
|
+
writer.uint32(/* id 4, wireType 1 =*/33).double(message.discountPercent);
|
|
20409
|
+
if (message.listPrice != null && message.hasOwnProperty("listPrice"))
|
|
20410
|
+
writer.uint32(/* id 5, wireType 1 =*/41).double(message.listPrice);
|
|
20411
|
+
return writer;
|
|
20412
|
+
};
|
|
20413
|
+
|
|
20414
|
+
/**
|
|
20415
|
+
* Encodes the specified RatePlanChargeTier message, length delimited. Does not implicitly {@link productcatalog.RatePlanChargeTier.verify|verify} messages.
|
|
20416
|
+
* @function encodeDelimited
|
|
20417
|
+
* @memberof productcatalog.RatePlanChargeTier
|
|
20418
|
+
* @static
|
|
20419
|
+
* @param {productcatalog.IRatePlanChargeTier} message RatePlanChargeTier message or plain object to encode
|
|
20420
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
20421
|
+
* @returns {$protobuf.Writer} Writer
|
|
20422
|
+
*/
|
|
20423
|
+
RatePlanChargeTier.encodeDelimited = function encodeDelimited(message, writer) {
|
|
20424
|
+
return this.encode(message, writer).ldelim();
|
|
20425
|
+
};
|
|
20426
|
+
|
|
20427
|
+
/**
|
|
20428
|
+
* Decodes a RatePlanChargeTier message from the specified reader or buffer.
|
|
20429
|
+
* @function decode
|
|
20430
|
+
* @memberof productcatalog.RatePlanChargeTier
|
|
20431
|
+
* @static
|
|
20432
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
20433
|
+
* @param {number} [length] Message length if known beforehand
|
|
20434
|
+
* @returns {productcatalog.RatePlanChargeTier} RatePlanChargeTier
|
|
20435
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
20436
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
20437
|
+
*/
|
|
20438
|
+
RatePlanChargeTier.decode = function decode(reader, length) {
|
|
20439
|
+
if (!(reader instanceof $Reader))
|
|
20440
|
+
reader = $Reader.create(reader);
|
|
20441
|
+
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.productcatalog.RatePlanChargeTier();
|
|
20442
|
+
while (reader.pos < end) {
|
|
20443
|
+
var tag = reader.uint32();
|
|
20444
|
+
switch (tag >>> 3) {
|
|
20445
|
+
case 1:
|
|
20446
|
+
message.currency = reader.string();
|
|
20447
|
+
break;
|
|
20448
|
+
case 2:
|
|
20449
|
+
message.country = reader.string();
|
|
20450
|
+
break;
|
|
20451
|
+
case 3:
|
|
20452
|
+
message.discountAmount = reader.double();
|
|
20453
|
+
break;
|
|
20454
|
+
case 4:
|
|
20455
|
+
message.discountPercent = reader.double();
|
|
20456
|
+
break;
|
|
20457
|
+
case 5:
|
|
20458
|
+
message.listPrice = reader.double();
|
|
20459
|
+
break;
|
|
20460
|
+
default:
|
|
20461
|
+
reader.skipType(tag & 7);
|
|
20462
|
+
break;
|
|
20463
|
+
}
|
|
20464
|
+
}
|
|
20465
|
+
return message;
|
|
20466
|
+
};
|
|
20467
|
+
|
|
20468
|
+
/**
|
|
20469
|
+
* Decodes a RatePlanChargeTier message from the specified reader or buffer, length delimited.
|
|
20470
|
+
* @function decodeDelimited
|
|
20471
|
+
* @memberof productcatalog.RatePlanChargeTier
|
|
20472
|
+
* @static
|
|
20473
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
20474
|
+
* @returns {productcatalog.RatePlanChargeTier} RatePlanChargeTier
|
|
20475
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
20476
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
20477
|
+
*/
|
|
20478
|
+
RatePlanChargeTier.decodeDelimited = function decodeDelimited(reader) {
|
|
20479
|
+
if (!(reader instanceof $Reader))
|
|
20480
|
+
reader = new $Reader(reader);
|
|
20481
|
+
return this.decode(reader, reader.uint32());
|
|
20482
|
+
};
|
|
20483
|
+
|
|
20484
|
+
/**
|
|
20485
|
+
* Verifies a RatePlanChargeTier message.
|
|
20486
|
+
* @function verify
|
|
20487
|
+
* @memberof productcatalog.RatePlanChargeTier
|
|
20488
|
+
* @static
|
|
20489
|
+
* @param {Object.<string,*>} message Plain object to verify
|
|
20490
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
20491
|
+
*/
|
|
20492
|
+
RatePlanChargeTier.verify = function verify(message) {
|
|
20493
|
+
if (typeof message !== "object" || message === null)
|
|
20494
|
+
return "object expected";
|
|
20495
|
+
if (message.currency != null && message.hasOwnProperty("currency"))
|
|
20496
|
+
if (!$util.isString(message.currency))
|
|
20497
|
+
return "currency: string expected";
|
|
20498
|
+
if (message.country != null && message.hasOwnProperty("country"))
|
|
20499
|
+
if (!$util.isString(message.country))
|
|
20500
|
+
return "country: string expected";
|
|
20501
|
+
if (message.discountAmount != null && message.hasOwnProperty("discountAmount"))
|
|
20502
|
+
if (typeof message.discountAmount !== "number")
|
|
20503
|
+
return "discountAmount: number expected";
|
|
20504
|
+
if (message.discountPercent != null && message.hasOwnProperty("discountPercent"))
|
|
20505
|
+
if (typeof message.discountPercent !== "number")
|
|
20506
|
+
return "discountPercent: number expected";
|
|
20507
|
+
if (message.listPrice != null && message.hasOwnProperty("listPrice"))
|
|
20508
|
+
if (typeof message.listPrice !== "number")
|
|
20509
|
+
return "listPrice: number expected";
|
|
20510
|
+
return null;
|
|
20511
|
+
};
|
|
20512
|
+
|
|
20513
|
+
/**
|
|
20514
|
+
* Creates a RatePlanChargeTier message from a plain object. Also converts values to their respective internal types.
|
|
20515
|
+
* @function fromObject
|
|
20516
|
+
* @memberof productcatalog.RatePlanChargeTier
|
|
20517
|
+
* @static
|
|
20518
|
+
* @param {Object.<string,*>} object Plain object
|
|
20519
|
+
* @returns {productcatalog.RatePlanChargeTier} RatePlanChargeTier
|
|
20520
|
+
*/
|
|
20521
|
+
RatePlanChargeTier.fromObject = function fromObject(object) {
|
|
20522
|
+
if (object instanceof $root.productcatalog.RatePlanChargeTier)
|
|
20523
|
+
return object;
|
|
20524
|
+
var message = new $root.productcatalog.RatePlanChargeTier();
|
|
20525
|
+
if (object.currency != null)
|
|
20526
|
+
message.currency = String(object.currency);
|
|
20527
|
+
if (object.country != null)
|
|
20528
|
+
message.country = String(object.country);
|
|
20529
|
+
if (object.discountAmount != null)
|
|
20530
|
+
message.discountAmount = Number(object.discountAmount);
|
|
20531
|
+
if (object.discountPercent != null)
|
|
20532
|
+
message.discountPercent = Number(object.discountPercent);
|
|
20533
|
+
if (object.listPrice != null)
|
|
20534
|
+
message.listPrice = Number(object.listPrice);
|
|
20535
|
+
return message;
|
|
20536
|
+
};
|
|
20537
|
+
|
|
20538
|
+
/**
|
|
20539
|
+
* Creates a plain object from a RatePlanChargeTier message. Also converts values to other types if specified.
|
|
20540
|
+
* @function toObject
|
|
20541
|
+
* @memberof productcatalog.RatePlanChargeTier
|
|
20542
|
+
* @static
|
|
20543
|
+
* @param {productcatalog.RatePlanChargeTier} message RatePlanChargeTier
|
|
20544
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
20545
|
+
* @returns {Object.<string,*>} Plain object
|
|
20546
|
+
*/
|
|
20547
|
+
RatePlanChargeTier.toObject = function toObject(message, options) {
|
|
20548
|
+
if (!options)
|
|
20549
|
+
options = {};
|
|
20550
|
+
var object = {};
|
|
20551
|
+
if (options.defaults) {
|
|
20552
|
+
object.currency = "";
|
|
20553
|
+
object.country = "";
|
|
20554
|
+
object.discountAmount = 0;
|
|
20555
|
+
object.discountPercent = 0;
|
|
20556
|
+
object.listPrice = 0;
|
|
20557
|
+
}
|
|
20558
|
+
if (message.currency != null && message.hasOwnProperty("currency"))
|
|
20559
|
+
object.currency = message.currency;
|
|
20560
|
+
if (message.country != null && message.hasOwnProperty("country"))
|
|
20561
|
+
object.country = message.country;
|
|
20562
|
+
if (message.discountAmount != null && message.hasOwnProperty("discountAmount"))
|
|
20563
|
+
object.discountAmount = options.json && !isFinite(message.discountAmount) ? String(message.discountAmount) : message.discountAmount;
|
|
20564
|
+
if (message.discountPercent != null && message.hasOwnProperty("discountPercent"))
|
|
20565
|
+
object.discountPercent = options.json && !isFinite(message.discountPercent) ? String(message.discountPercent) : message.discountPercent;
|
|
20566
|
+
if (message.listPrice != null && message.hasOwnProperty("listPrice"))
|
|
20567
|
+
object.listPrice = options.json && !isFinite(message.listPrice) ? String(message.listPrice) : message.listPrice;
|
|
20568
|
+
return object;
|
|
20569
|
+
};
|
|
20570
|
+
|
|
20571
|
+
/**
|
|
20572
|
+
* Converts this RatePlanChargeTier to JSON.
|
|
20573
|
+
* @function toJSON
|
|
20574
|
+
* @memberof productcatalog.RatePlanChargeTier
|
|
20575
|
+
* @instance
|
|
20576
|
+
* @returns {Object.<string,*>} JSON object
|
|
20577
|
+
*/
|
|
20578
|
+
RatePlanChargeTier.prototype.toJSON = function toJSON() {
|
|
20579
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
20580
|
+
};
|
|
20581
|
+
|
|
20582
|
+
return RatePlanChargeTier;
|
|
20583
|
+
})();
|
|
20584
|
+
|
|
20585
|
+
/**
|
|
20586
|
+
* ProductSkuPlatform enum.
|
|
20587
|
+
* @name productcatalog.ProductSkuPlatform
|
|
20588
|
+
* @enum {string}
|
|
20589
|
+
* @property {number} PLATFORM_UNKNOWN=0 PLATFORM_UNKNOWN value
|
|
20590
|
+
* @property {number} PLATFORM_APPLE=1 PLATFORM_APPLE value
|
|
20591
|
+
* @property {number} PLATFORM_GOOGLE=2 PLATFORM_GOOGLE value
|
|
20592
|
+
* @property {number} PLATFORM_HEADSPACE=3 PLATFORM_HEADSPACE value
|
|
20593
|
+
* @property {number} PLATFORM_SPOTIFY=4 PLATFORM_SPOTIFY value
|
|
20594
|
+
* @property {number} PLATFORM_ZUORA=5 PLATFORM_ZUORA value
|
|
20595
|
+
* @property {number} PLATFORM_B2B_ORG=6 PLATFORM_B2B_ORG value
|
|
20596
|
+
*/
|
|
20597
|
+
productcatalog.ProductSkuPlatform = (function() {
|
|
20598
|
+
var valuesById = {}, values = Object.create(valuesById);
|
|
20599
|
+
values[valuesById[0] = "PLATFORM_UNKNOWN"] = 0;
|
|
20600
|
+
values[valuesById[1] = "PLATFORM_APPLE"] = 1;
|
|
20601
|
+
values[valuesById[2] = "PLATFORM_GOOGLE"] = 2;
|
|
20602
|
+
values[valuesById[3] = "PLATFORM_HEADSPACE"] = 3;
|
|
20603
|
+
values[valuesById[4] = "PLATFORM_SPOTIFY"] = 4;
|
|
20604
|
+
values[valuesById[5] = "PLATFORM_ZUORA"] = 5;
|
|
20605
|
+
values[valuesById[6] = "PLATFORM_B2B_ORG"] = 6;
|
|
20606
|
+
return values;
|
|
20607
|
+
})();
|
|
20608
|
+
|
|
20609
|
+
/**
|
|
20610
|
+
* ProductSkuBillingCategory enum.
|
|
20611
|
+
* @name productcatalog.ProductSkuBillingCategory
|
|
20612
|
+
* @enum {string}
|
|
20613
|
+
* @property {number} BC_UNKNOWN=0 BC_UNKNOWN value
|
|
20614
|
+
* @property {number} BC_GIFT_CODE=1 BC_GIFT_CODE value
|
|
20615
|
+
* @property {number} BC_GIFT_PURCHASE=2 BC_GIFT_PURCHASE value
|
|
20616
|
+
* @property {number} BC_FREE_CODE=3 BC_FREE_CODE value
|
|
20617
|
+
* @property {number} BC_FREE_TRIAL=4 BC_FREE_TRIAL value
|
|
20618
|
+
* @property {number} BC_PARTNER_PAID=5 BC_PARTNER_PAID value
|
|
20619
|
+
* @property {number} BC_DIRECT=6 BC_DIRECT value
|
|
20620
|
+
*/
|
|
20621
|
+
productcatalog.ProductSkuBillingCategory = (function() {
|
|
20622
|
+
var valuesById = {}, values = Object.create(valuesById);
|
|
20623
|
+
values[valuesById[0] = "BC_UNKNOWN"] = 0;
|
|
20624
|
+
values[valuesById[1] = "BC_GIFT_CODE"] = 1;
|
|
20625
|
+
values[valuesById[2] = "BC_GIFT_PURCHASE"] = 2;
|
|
20626
|
+
values[valuesById[3] = "BC_FREE_CODE"] = 3;
|
|
20627
|
+
values[valuesById[4] = "BC_FREE_TRIAL"] = 4;
|
|
20628
|
+
values[valuesById[5] = "BC_PARTNER_PAID"] = 5;
|
|
20629
|
+
values[valuesById[6] = "BC_DIRECT"] = 6;
|
|
20630
|
+
return values;
|
|
20631
|
+
})();
|
|
20632
|
+
|
|
20633
|
+
/**
|
|
20634
|
+
* ProductSkuCalendarPeriod enum.
|
|
20635
|
+
* @name productcatalog.ProductSkuCalendarPeriod
|
|
20636
|
+
* @enum {string}
|
|
20637
|
+
* @property {number} CP_UNKNOWN=0 CP_UNKNOWN value
|
|
20638
|
+
* @property {number} CP_DAY=1 CP_DAY value
|
|
20639
|
+
* @property {number} CP_MONTH=2 CP_MONTH value
|
|
20640
|
+
* @property {number} CP_YEAR=3 CP_YEAR value
|
|
20641
|
+
* @property {number} CP_LIFETIME=4 CP_LIFETIME value
|
|
20642
|
+
* @property {number} CP_ONE_TIME=5 CP_ONE_TIME value
|
|
20643
|
+
* @property {number} CP_HALF_YEAR=7 CP_HALF_YEAR value
|
|
20644
|
+
* @property {number} CP_TWO_YEARS=8 CP_TWO_YEARS value
|
|
20645
|
+
* @property {number} CP_FIVE_YEARS=9 CP_FIVE_YEARS value
|
|
20646
|
+
*/
|
|
20647
|
+
productcatalog.ProductSkuCalendarPeriod = (function() {
|
|
20648
|
+
var valuesById = {}, values = Object.create(valuesById);
|
|
20649
|
+
values[valuesById[0] = "CP_UNKNOWN"] = 0;
|
|
20650
|
+
values[valuesById[1] = "CP_DAY"] = 1;
|
|
20651
|
+
values[valuesById[2] = "CP_MONTH"] = 2;
|
|
20652
|
+
values[valuesById[3] = "CP_YEAR"] = 3;
|
|
20653
|
+
values[valuesById[4] = "CP_LIFETIME"] = 4;
|
|
20654
|
+
values[valuesById[5] = "CP_ONE_TIME"] = 5;
|
|
20655
|
+
values[valuesById[7] = "CP_HALF_YEAR"] = 7;
|
|
20656
|
+
values[valuesById[8] = "CP_TWO_YEARS"] = 8;
|
|
20657
|
+
values[valuesById[9] = "CP_FIVE_YEARS"] = 9;
|
|
20658
|
+
return values;
|
|
20659
|
+
})();
|
|
20660
|
+
|
|
20661
|
+
/**
|
|
20662
|
+
* ProductSkuChargeModel enum.
|
|
20663
|
+
* @name productcatalog.ProductSkuChargeModel
|
|
20664
|
+
* @enum {string}
|
|
20665
|
+
* @property {number} CM_UNKNOWN=0 CM_UNKNOWN value
|
|
20666
|
+
* @property {number} CM_FLAT_FEE=1 CM_FLAT_FEE value
|
|
20667
|
+
* @property {number} CM_DISCOUNT_FIXED=2 CM_DISCOUNT_FIXED value
|
|
20668
|
+
* @property {number} CM_DISCOUNT_PERCENT=3 CM_DISCOUNT_PERCENT value
|
|
20669
|
+
*/
|
|
20670
|
+
productcatalog.ProductSkuChargeModel = (function() {
|
|
20671
|
+
var valuesById = {}, values = Object.create(valuesById);
|
|
20672
|
+
values[valuesById[0] = "CM_UNKNOWN"] = 0;
|
|
20673
|
+
values[valuesById[1] = "CM_FLAT_FEE"] = 1;
|
|
20674
|
+
values[valuesById[2] = "CM_DISCOUNT_FIXED"] = 2;
|
|
20675
|
+
values[valuesById[3] = "CM_DISCOUNT_PERCENT"] = 3;
|
|
20676
|
+
return values;
|
|
20677
|
+
})();
|
|
20678
|
+
|
|
20679
|
+
/**
|
|
20680
|
+
* ProductSkuEndDateCondition enum.
|
|
20681
|
+
* @name productcatalog.ProductSkuEndDateCondition
|
|
20682
|
+
* @enum {string}
|
|
20683
|
+
* @property {number} EDC_UNKNOWN=0 EDC_UNKNOWN value
|
|
20684
|
+
* @property {number} EDC_END_OF_SUBSCRIPTION=1 EDC_END_OF_SUBSCRIPTION value
|
|
20685
|
+
* @property {number} EDC_FIXED_NUM_PERIODS=2 EDC_FIXED_NUM_PERIODS value
|
|
20686
|
+
* @property {number} EDC_ONE_TIME=3 EDC_ONE_TIME value
|
|
20687
|
+
*/
|
|
20688
|
+
productcatalog.ProductSkuEndDateCondition = (function() {
|
|
20689
|
+
var valuesById = {}, values = Object.create(valuesById);
|
|
20690
|
+
values[valuesById[0] = "EDC_UNKNOWN"] = 0;
|
|
20691
|
+
values[valuesById[1] = "EDC_END_OF_SUBSCRIPTION"] = 1;
|
|
20692
|
+
values[valuesById[2] = "EDC_FIXED_NUM_PERIODS"] = 2;
|
|
20693
|
+
values[valuesById[3] = "EDC_ONE_TIME"] = 3;
|
|
20694
|
+
return values;
|
|
20695
|
+
})();
|
|
20696
|
+
|
|
20697
|
+
/**
|
|
20698
|
+
* ProductSkuTag enum.
|
|
20699
|
+
* @name productcatalog.ProductSkuTag
|
|
20700
|
+
* @enum {string}
|
|
20701
|
+
* @property {number} TAG_UNKNOWN=0 TAG_UNKNOWN value
|
|
20702
|
+
* @property {number} TAG_STUDENT=1 TAG_STUDENT value
|
|
20703
|
+
* @property {number} TAG_FAMILY=2 TAG_FAMILY value
|
|
20704
|
+
*/
|
|
20705
|
+
productcatalog.ProductSkuTag = (function() {
|
|
20706
|
+
var valuesById = {}, values = Object.create(valuesById);
|
|
20707
|
+
values[valuesById[0] = "TAG_UNKNOWN"] = 0;
|
|
20708
|
+
values[valuesById[1] = "TAG_STUDENT"] = 1;
|
|
20709
|
+
values[valuesById[2] = "TAG_FAMILY"] = 2;
|
|
20710
|
+
return values;
|
|
20711
|
+
})();
|
|
20712
|
+
|
|
20713
|
+
return productcatalog;
|
|
20714
|
+
})();
|
|
20715
|
+
|
|
18640
20716
|
$root.b2b = (function() {
|
|
18641
20717
|
|
|
18642
20718
|
/**
|
|
@@ -76868,6 +78944,7 @@ $root.EligibilityFileProcessed = (function() {
|
|
|
76868
78944
|
* @property {number|null} [numMembersRemoved] EligibilityFileProcessed numMembersRemoved
|
|
76869
78945
|
* @property {number|null} [orgId] EligibilityFileProcessed orgId
|
|
76870
78946
|
* @property {Object.<string,number>|null} [numMembers] EligibilityFileProcessed numMembers
|
|
78947
|
+
* @property {number|null} [numMembersProcessed] EligibilityFileProcessed numMembersProcessed
|
|
76871
78948
|
*/
|
|
76872
78949
|
|
|
76873
78950
|
/**
|
|
@@ -76966,6 +79043,14 @@ $root.EligibilityFileProcessed = (function() {
|
|
|
76966
79043
|
*/
|
|
76967
79044
|
EligibilityFileProcessed.prototype.numMembers = $util.emptyObject;
|
|
76968
79045
|
|
|
79046
|
+
/**
|
|
79047
|
+
* EligibilityFileProcessed numMembersProcessed.
|
|
79048
|
+
* @member {number} numMembersProcessed
|
|
79049
|
+
* @memberof EligibilityFileProcessed
|
|
79050
|
+
* @instance
|
|
79051
|
+
*/
|
|
79052
|
+
EligibilityFileProcessed.prototype.numMembersProcessed = 0;
|
|
79053
|
+
|
|
76969
79054
|
/**
|
|
76970
79055
|
* Creates a new EligibilityFileProcessed instance using the specified properties.
|
|
76971
79056
|
* @function create
|
|
@@ -77011,6 +79096,8 @@ $root.EligibilityFileProcessed = (function() {
|
|
|
77011
79096
|
if (message.numMembers != null && message.hasOwnProperty("numMembers"))
|
|
77012
79097
|
for (var keys = Object.keys(message.numMembers), i = 0; i < keys.length; ++i)
|
|
77013
79098
|
writer.uint32(/* id 10, wireType 2 =*/82).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 0 =*/16).int32(message.numMembers[keys[i]]).ldelim();
|
|
79099
|
+
if (message.numMembersProcessed != null && message.hasOwnProperty("numMembersProcessed"))
|
|
79100
|
+
writer.uint32(/* id 11, wireType 0 =*/88).uint32(message.numMembersProcessed);
|
|
77014
79101
|
return writer;
|
|
77015
79102
|
};
|
|
77016
79103
|
|
|
@@ -77080,6 +79167,9 @@ $root.EligibilityFileProcessed = (function() {
|
|
|
77080
79167
|
reader.pos++;
|
|
77081
79168
|
message.numMembers[key] = reader.int32();
|
|
77082
79169
|
break;
|
|
79170
|
+
case 11:
|
|
79171
|
+
message.numMembersProcessed = reader.uint32();
|
|
79172
|
+
break;
|
|
77083
79173
|
default:
|
|
77084
79174
|
reader.skipType(tag & 7);
|
|
77085
79175
|
break;
|
|
@@ -77152,6 +79242,9 @@ $root.EligibilityFileProcessed = (function() {
|
|
|
77152
79242
|
if (!$util.isInteger(message.numMembers[key[i]]))
|
|
77153
79243
|
return "numMembers: integer{k:string} expected";
|
|
77154
79244
|
}
|
|
79245
|
+
if (message.numMembersProcessed != null && message.hasOwnProperty("numMembersProcessed"))
|
|
79246
|
+
if (!$util.isInteger(message.numMembersProcessed))
|
|
79247
|
+
return "numMembersProcessed: integer expected";
|
|
77155
79248
|
return null;
|
|
77156
79249
|
};
|
|
77157
79250
|
|
|
@@ -77202,6 +79295,8 @@ $root.EligibilityFileProcessed = (function() {
|
|
|
77202
79295
|
for (var keys = Object.keys(object.numMembers), i = 0; i < keys.length; ++i)
|
|
77203
79296
|
message.numMembers[keys[i]] = object.numMembers[keys[i]] | 0;
|
|
77204
79297
|
}
|
|
79298
|
+
if (object.numMembersProcessed != null)
|
|
79299
|
+
message.numMembersProcessed = object.numMembersProcessed >>> 0;
|
|
77205
79300
|
return message;
|
|
77206
79301
|
};
|
|
77207
79302
|
|
|
@@ -77234,6 +79329,7 @@ $root.EligibilityFileProcessed = (function() {
|
|
|
77234
79329
|
object.numBadEmails = 0;
|
|
77235
79330
|
object.numMembersRemoved = 0;
|
|
77236
79331
|
object.orgId = 0;
|
|
79332
|
+
object.numMembersProcessed = 0;
|
|
77237
79333
|
}
|
|
77238
79334
|
if (message.email != null && message.hasOwnProperty("email"))
|
|
77239
79335
|
object.email = $root.Email.toObject(message.email, options);
|
|
@@ -77262,6 +79358,8 @@ $root.EligibilityFileProcessed = (function() {
|
|
|
77262
79358
|
for (var j = 0; j < keys2.length; ++j)
|
|
77263
79359
|
object.numMembers[keys2[j]] = message.numMembers[keys2[j]];
|
|
77264
79360
|
}
|
|
79361
|
+
if (message.numMembersProcessed != null && message.hasOwnProperty("numMembersProcessed"))
|
|
79362
|
+
object.numMembersProcessed = message.numMembersProcessed;
|
|
77265
79363
|
return object;
|
|
77266
79364
|
};
|
|
77267
79365
|
|
|
@@ -102726,6 +104824,390 @@ $root.ExperimentAccessGroupMapDeleted = (function() {
|
|
|
102726
104824
|
return ExperimentAccessGroupMapDeleted;
|
|
102727
104825
|
})();
|
|
102728
104826
|
|
|
104827
|
+
$root.ProductSkuCreated = (function() {
|
|
104828
|
+
|
|
104829
|
+
/**
|
|
104830
|
+
* Properties of a ProductSkuCreated.
|
|
104831
|
+
* @exports IProductSkuCreated
|
|
104832
|
+
* @interface IProductSkuCreated
|
|
104833
|
+
* @property {productcatalog.IProductSku|null} [productSku] ProductSkuCreated productSku
|
|
104834
|
+
*/
|
|
104835
|
+
|
|
104836
|
+
/**
|
|
104837
|
+
* Constructs a new ProductSkuCreated.
|
|
104838
|
+
* @exports ProductSkuCreated
|
|
104839
|
+
* @classdesc Represents a ProductSkuCreated.
|
|
104840
|
+
* @implements IProductSkuCreated
|
|
104841
|
+
* @constructor
|
|
104842
|
+
* @param {IProductSkuCreated=} [properties] Properties to set
|
|
104843
|
+
*/
|
|
104844
|
+
function ProductSkuCreated(properties) {
|
|
104845
|
+
if (properties)
|
|
104846
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
104847
|
+
if (properties[keys[i]] != null)
|
|
104848
|
+
this[keys[i]] = properties[keys[i]];
|
|
104849
|
+
}
|
|
104850
|
+
|
|
104851
|
+
/**
|
|
104852
|
+
* ProductSkuCreated productSku.
|
|
104853
|
+
* @member {productcatalog.IProductSku|null|undefined} productSku
|
|
104854
|
+
* @memberof ProductSkuCreated
|
|
104855
|
+
* @instance
|
|
104856
|
+
*/
|
|
104857
|
+
ProductSkuCreated.prototype.productSku = null;
|
|
104858
|
+
|
|
104859
|
+
/**
|
|
104860
|
+
* Creates a new ProductSkuCreated instance using the specified properties.
|
|
104861
|
+
* @function create
|
|
104862
|
+
* @memberof ProductSkuCreated
|
|
104863
|
+
* @static
|
|
104864
|
+
* @param {IProductSkuCreated=} [properties] Properties to set
|
|
104865
|
+
* @returns {ProductSkuCreated} ProductSkuCreated instance
|
|
104866
|
+
*/
|
|
104867
|
+
ProductSkuCreated.create = function create(properties) {
|
|
104868
|
+
return new ProductSkuCreated(properties);
|
|
104869
|
+
};
|
|
104870
|
+
|
|
104871
|
+
/**
|
|
104872
|
+
* Encodes the specified ProductSkuCreated message. Does not implicitly {@link ProductSkuCreated.verify|verify} messages.
|
|
104873
|
+
* @function encode
|
|
104874
|
+
* @memberof ProductSkuCreated
|
|
104875
|
+
* @static
|
|
104876
|
+
* @param {IProductSkuCreated} message ProductSkuCreated message or plain object to encode
|
|
104877
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
104878
|
+
* @returns {$protobuf.Writer} Writer
|
|
104879
|
+
*/
|
|
104880
|
+
ProductSkuCreated.encode = function encode(message, writer) {
|
|
104881
|
+
if (!writer)
|
|
104882
|
+
writer = $Writer.create();
|
|
104883
|
+
if (message.productSku != null && message.hasOwnProperty("productSku"))
|
|
104884
|
+
$root.productcatalog.ProductSku.encode(message.productSku, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
|
104885
|
+
return writer;
|
|
104886
|
+
};
|
|
104887
|
+
|
|
104888
|
+
/**
|
|
104889
|
+
* Encodes the specified ProductSkuCreated message, length delimited. Does not implicitly {@link ProductSkuCreated.verify|verify} messages.
|
|
104890
|
+
* @function encodeDelimited
|
|
104891
|
+
* @memberof ProductSkuCreated
|
|
104892
|
+
* @static
|
|
104893
|
+
* @param {IProductSkuCreated} message ProductSkuCreated message or plain object to encode
|
|
104894
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
104895
|
+
* @returns {$protobuf.Writer} Writer
|
|
104896
|
+
*/
|
|
104897
|
+
ProductSkuCreated.encodeDelimited = function encodeDelimited(message, writer) {
|
|
104898
|
+
return this.encode(message, writer).ldelim();
|
|
104899
|
+
};
|
|
104900
|
+
|
|
104901
|
+
/**
|
|
104902
|
+
* Decodes a ProductSkuCreated message from the specified reader or buffer.
|
|
104903
|
+
* @function decode
|
|
104904
|
+
* @memberof ProductSkuCreated
|
|
104905
|
+
* @static
|
|
104906
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
104907
|
+
* @param {number} [length] Message length if known beforehand
|
|
104908
|
+
* @returns {ProductSkuCreated} ProductSkuCreated
|
|
104909
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
104910
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
104911
|
+
*/
|
|
104912
|
+
ProductSkuCreated.decode = function decode(reader, length) {
|
|
104913
|
+
if (!(reader instanceof $Reader))
|
|
104914
|
+
reader = $Reader.create(reader);
|
|
104915
|
+
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ProductSkuCreated();
|
|
104916
|
+
while (reader.pos < end) {
|
|
104917
|
+
var tag = reader.uint32();
|
|
104918
|
+
switch (tag >>> 3) {
|
|
104919
|
+
case 1:
|
|
104920
|
+
message.productSku = $root.productcatalog.ProductSku.decode(reader, reader.uint32());
|
|
104921
|
+
break;
|
|
104922
|
+
default:
|
|
104923
|
+
reader.skipType(tag & 7);
|
|
104924
|
+
break;
|
|
104925
|
+
}
|
|
104926
|
+
}
|
|
104927
|
+
return message;
|
|
104928
|
+
};
|
|
104929
|
+
|
|
104930
|
+
/**
|
|
104931
|
+
* Decodes a ProductSkuCreated message from the specified reader or buffer, length delimited.
|
|
104932
|
+
* @function decodeDelimited
|
|
104933
|
+
* @memberof ProductSkuCreated
|
|
104934
|
+
* @static
|
|
104935
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
104936
|
+
* @returns {ProductSkuCreated} ProductSkuCreated
|
|
104937
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
104938
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
104939
|
+
*/
|
|
104940
|
+
ProductSkuCreated.decodeDelimited = function decodeDelimited(reader) {
|
|
104941
|
+
if (!(reader instanceof $Reader))
|
|
104942
|
+
reader = new $Reader(reader);
|
|
104943
|
+
return this.decode(reader, reader.uint32());
|
|
104944
|
+
};
|
|
104945
|
+
|
|
104946
|
+
/**
|
|
104947
|
+
* Verifies a ProductSkuCreated message.
|
|
104948
|
+
* @function verify
|
|
104949
|
+
* @memberof ProductSkuCreated
|
|
104950
|
+
* @static
|
|
104951
|
+
* @param {Object.<string,*>} message Plain object to verify
|
|
104952
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
104953
|
+
*/
|
|
104954
|
+
ProductSkuCreated.verify = function verify(message) {
|
|
104955
|
+
if (typeof message !== "object" || message === null)
|
|
104956
|
+
return "object expected";
|
|
104957
|
+
if (message.productSku != null && message.hasOwnProperty("productSku")) {
|
|
104958
|
+
var error = $root.productcatalog.ProductSku.verify(message.productSku);
|
|
104959
|
+
if (error)
|
|
104960
|
+
return "productSku." + error;
|
|
104961
|
+
}
|
|
104962
|
+
return null;
|
|
104963
|
+
};
|
|
104964
|
+
|
|
104965
|
+
/**
|
|
104966
|
+
* Creates a ProductSkuCreated message from a plain object. Also converts values to their respective internal types.
|
|
104967
|
+
* @function fromObject
|
|
104968
|
+
* @memberof ProductSkuCreated
|
|
104969
|
+
* @static
|
|
104970
|
+
* @param {Object.<string,*>} object Plain object
|
|
104971
|
+
* @returns {ProductSkuCreated} ProductSkuCreated
|
|
104972
|
+
*/
|
|
104973
|
+
ProductSkuCreated.fromObject = function fromObject(object) {
|
|
104974
|
+
if (object instanceof $root.ProductSkuCreated)
|
|
104975
|
+
return object;
|
|
104976
|
+
var message = new $root.ProductSkuCreated();
|
|
104977
|
+
if (object.productSku != null) {
|
|
104978
|
+
if (typeof object.productSku !== "object")
|
|
104979
|
+
throw TypeError(".ProductSkuCreated.productSku: object expected");
|
|
104980
|
+
message.productSku = $root.productcatalog.ProductSku.fromObject(object.productSku);
|
|
104981
|
+
}
|
|
104982
|
+
return message;
|
|
104983
|
+
};
|
|
104984
|
+
|
|
104985
|
+
/**
|
|
104986
|
+
* Creates a plain object from a ProductSkuCreated message. Also converts values to other types if specified.
|
|
104987
|
+
* @function toObject
|
|
104988
|
+
* @memberof ProductSkuCreated
|
|
104989
|
+
* @static
|
|
104990
|
+
* @param {ProductSkuCreated} message ProductSkuCreated
|
|
104991
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
104992
|
+
* @returns {Object.<string,*>} Plain object
|
|
104993
|
+
*/
|
|
104994
|
+
ProductSkuCreated.toObject = function toObject(message, options) {
|
|
104995
|
+
if (!options)
|
|
104996
|
+
options = {};
|
|
104997
|
+
var object = {};
|
|
104998
|
+
if (options.defaults)
|
|
104999
|
+
object.productSku = null;
|
|
105000
|
+
if (message.productSku != null && message.hasOwnProperty("productSku"))
|
|
105001
|
+
object.productSku = $root.productcatalog.ProductSku.toObject(message.productSku, options);
|
|
105002
|
+
return object;
|
|
105003
|
+
};
|
|
105004
|
+
|
|
105005
|
+
/**
|
|
105006
|
+
* Converts this ProductSkuCreated to JSON.
|
|
105007
|
+
* @function toJSON
|
|
105008
|
+
* @memberof ProductSkuCreated
|
|
105009
|
+
* @instance
|
|
105010
|
+
* @returns {Object.<string,*>} JSON object
|
|
105011
|
+
*/
|
|
105012
|
+
ProductSkuCreated.prototype.toJSON = function toJSON() {
|
|
105013
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
105014
|
+
};
|
|
105015
|
+
|
|
105016
|
+
return ProductSkuCreated;
|
|
105017
|
+
})();
|
|
105018
|
+
|
|
105019
|
+
$root.ProductSkuVersioned = (function() {
|
|
105020
|
+
|
|
105021
|
+
/**
|
|
105022
|
+
* Properties of a ProductSkuVersioned.
|
|
105023
|
+
* @exports IProductSkuVersioned
|
|
105024
|
+
* @interface IProductSkuVersioned
|
|
105025
|
+
* @property {productcatalog.IProductSku|null} [productSku] ProductSkuVersioned productSku
|
|
105026
|
+
*/
|
|
105027
|
+
|
|
105028
|
+
/**
|
|
105029
|
+
* Constructs a new ProductSkuVersioned.
|
|
105030
|
+
* @exports ProductSkuVersioned
|
|
105031
|
+
* @classdesc Represents a ProductSkuVersioned.
|
|
105032
|
+
* @implements IProductSkuVersioned
|
|
105033
|
+
* @constructor
|
|
105034
|
+
* @param {IProductSkuVersioned=} [properties] Properties to set
|
|
105035
|
+
*/
|
|
105036
|
+
function ProductSkuVersioned(properties) {
|
|
105037
|
+
if (properties)
|
|
105038
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
105039
|
+
if (properties[keys[i]] != null)
|
|
105040
|
+
this[keys[i]] = properties[keys[i]];
|
|
105041
|
+
}
|
|
105042
|
+
|
|
105043
|
+
/**
|
|
105044
|
+
* ProductSkuVersioned productSku.
|
|
105045
|
+
* @member {productcatalog.IProductSku|null|undefined} productSku
|
|
105046
|
+
* @memberof ProductSkuVersioned
|
|
105047
|
+
* @instance
|
|
105048
|
+
*/
|
|
105049
|
+
ProductSkuVersioned.prototype.productSku = null;
|
|
105050
|
+
|
|
105051
|
+
/**
|
|
105052
|
+
* Creates a new ProductSkuVersioned instance using the specified properties.
|
|
105053
|
+
* @function create
|
|
105054
|
+
* @memberof ProductSkuVersioned
|
|
105055
|
+
* @static
|
|
105056
|
+
* @param {IProductSkuVersioned=} [properties] Properties to set
|
|
105057
|
+
* @returns {ProductSkuVersioned} ProductSkuVersioned instance
|
|
105058
|
+
*/
|
|
105059
|
+
ProductSkuVersioned.create = function create(properties) {
|
|
105060
|
+
return new ProductSkuVersioned(properties);
|
|
105061
|
+
};
|
|
105062
|
+
|
|
105063
|
+
/**
|
|
105064
|
+
* Encodes the specified ProductSkuVersioned message. Does not implicitly {@link ProductSkuVersioned.verify|verify} messages.
|
|
105065
|
+
* @function encode
|
|
105066
|
+
* @memberof ProductSkuVersioned
|
|
105067
|
+
* @static
|
|
105068
|
+
* @param {IProductSkuVersioned} message ProductSkuVersioned message or plain object to encode
|
|
105069
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
105070
|
+
* @returns {$protobuf.Writer} Writer
|
|
105071
|
+
*/
|
|
105072
|
+
ProductSkuVersioned.encode = function encode(message, writer) {
|
|
105073
|
+
if (!writer)
|
|
105074
|
+
writer = $Writer.create();
|
|
105075
|
+
if (message.productSku != null && message.hasOwnProperty("productSku"))
|
|
105076
|
+
$root.productcatalog.ProductSku.encode(message.productSku, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
|
105077
|
+
return writer;
|
|
105078
|
+
};
|
|
105079
|
+
|
|
105080
|
+
/**
|
|
105081
|
+
* Encodes the specified ProductSkuVersioned message, length delimited. Does not implicitly {@link ProductSkuVersioned.verify|verify} messages.
|
|
105082
|
+
* @function encodeDelimited
|
|
105083
|
+
* @memberof ProductSkuVersioned
|
|
105084
|
+
* @static
|
|
105085
|
+
* @param {IProductSkuVersioned} message ProductSkuVersioned message or plain object to encode
|
|
105086
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
105087
|
+
* @returns {$protobuf.Writer} Writer
|
|
105088
|
+
*/
|
|
105089
|
+
ProductSkuVersioned.encodeDelimited = function encodeDelimited(message, writer) {
|
|
105090
|
+
return this.encode(message, writer).ldelim();
|
|
105091
|
+
};
|
|
105092
|
+
|
|
105093
|
+
/**
|
|
105094
|
+
* Decodes a ProductSkuVersioned message from the specified reader or buffer.
|
|
105095
|
+
* @function decode
|
|
105096
|
+
* @memberof ProductSkuVersioned
|
|
105097
|
+
* @static
|
|
105098
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
105099
|
+
* @param {number} [length] Message length if known beforehand
|
|
105100
|
+
* @returns {ProductSkuVersioned} ProductSkuVersioned
|
|
105101
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
105102
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
105103
|
+
*/
|
|
105104
|
+
ProductSkuVersioned.decode = function decode(reader, length) {
|
|
105105
|
+
if (!(reader instanceof $Reader))
|
|
105106
|
+
reader = $Reader.create(reader);
|
|
105107
|
+
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ProductSkuVersioned();
|
|
105108
|
+
while (reader.pos < end) {
|
|
105109
|
+
var tag = reader.uint32();
|
|
105110
|
+
switch (tag >>> 3) {
|
|
105111
|
+
case 1:
|
|
105112
|
+
message.productSku = $root.productcatalog.ProductSku.decode(reader, reader.uint32());
|
|
105113
|
+
break;
|
|
105114
|
+
default:
|
|
105115
|
+
reader.skipType(tag & 7);
|
|
105116
|
+
break;
|
|
105117
|
+
}
|
|
105118
|
+
}
|
|
105119
|
+
return message;
|
|
105120
|
+
};
|
|
105121
|
+
|
|
105122
|
+
/**
|
|
105123
|
+
* Decodes a ProductSkuVersioned message from the specified reader or buffer, length delimited.
|
|
105124
|
+
* @function decodeDelimited
|
|
105125
|
+
* @memberof ProductSkuVersioned
|
|
105126
|
+
* @static
|
|
105127
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
105128
|
+
* @returns {ProductSkuVersioned} ProductSkuVersioned
|
|
105129
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
105130
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
105131
|
+
*/
|
|
105132
|
+
ProductSkuVersioned.decodeDelimited = function decodeDelimited(reader) {
|
|
105133
|
+
if (!(reader instanceof $Reader))
|
|
105134
|
+
reader = new $Reader(reader);
|
|
105135
|
+
return this.decode(reader, reader.uint32());
|
|
105136
|
+
};
|
|
105137
|
+
|
|
105138
|
+
/**
|
|
105139
|
+
* Verifies a ProductSkuVersioned message.
|
|
105140
|
+
* @function verify
|
|
105141
|
+
* @memberof ProductSkuVersioned
|
|
105142
|
+
* @static
|
|
105143
|
+
* @param {Object.<string,*>} message Plain object to verify
|
|
105144
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
105145
|
+
*/
|
|
105146
|
+
ProductSkuVersioned.verify = function verify(message) {
|
|
105147
|
+
if (typeof message !== "object" || message === null)
|
|
105148
|
+
return "object expected";
|
|
105149
|
+
if (message.productSku != null && message.hasOwnProperty("productSku")) {
|
|
105150
|
+
var error = $root.productcatalog.ProductSku.verify(message.productSku);
|
|
105151
|
+
if (error)
|
|
105152
|
+
return "productSku." + error;
|
|
105153
|
+
}
|
|
105154
|
+
return null;
|
|
105155
|
+
};
|
|
105156
|
+
|
|
105157
|
+
/**
|
|
105158
|
+
* Creates a ProductSkuVersioned message from a plain object. Also converts values to their respective internal types.
|
|
105159
|
+
* @function fromObject
|
|
105160
|
+
* @memberof ProductSkuVersioned
|
|
105161
|
+
* @static
|
|
105162
|
+
* @param {Object.<string,*>} object Plain object
|
|
105163
|
+
* @returns {ProductSkuVersioned} ProductSkuVersioned
|
|
105164
|
+
*/
|
|
105165
|
+
ProductSkuVersioned.fromObject = function fromObject(object) {
|
|
105166
|
+
if (object instanceof $root.ProductSkuVersioned)
|
|
105167
|
+
return object;
|
|
105168
|
+
var message = new $root.ProductSkuVersioned();
|
|
105169
|
+
if (object.productSku != null) {
|
|
105170
|
+
if (typeof object.productSku !== "object")
|
|
105171
|
+
throw TypeError(".ProductSkuVersioned.productSku: object expected");
|
|
105172
|
+
message.productSku = $root.productcatalog.ProductSku.fromObject(object.productSku);
|
|
105173
|
+
}
|
|
105174
|
+
return message;
|
|
105175
|
+
};
|
|
105176
|
+
|
|
105177
|
+
/**
|
|
105178
|
+
* Creates a plain object from a ProductSkuVersioned message. Also converts values to other types if specified.
|
|
105179
|
+
* @function toObject
|
|
105180
|
+
* @memberof ProductSkuVersioned
|
|
105181
|
+
* @static
|
|
105182
|
+
* @param {ProductSkuVersioned} message ProductSkuVersioned
|
|
105183
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
105184
|
+
* @returns {Object.<string,*>} Plain object
|
|
105185
|
+
*/
|
|
105186
|
+
ProductSkuVersioned.toObject = function toObject(message, options) {
|
|
105187
|
+
if (!options)
|
|
105188
|
+
options = {};
|
|
105189
|
+
var object = {};
|
|
105190
|
+
if (options.defaults)
|
|
105191
|
+
object.productSku = null;
|
|
105192
|
+
if (message.productSku != null && message.hasOwnProperty("productSku"))
|
|
105193
|
+
object.productSku = $root.productcatalog.ProductSku.toObject(message.productSku, options);
|
|
105194
|
+
return object;
|
|
105195
|
+
};
|
|
105196
|
+
|
|
105197
|
+
/**
|
|
105198
|
+
* Converts this ProductSkuVersioned to JSON.
|
|
105199
|
+
* @function toJSON
|
|
105200
|
+
* @memberof ProductSkuVersioned
|
|
105201
|
+
* @instance
|
|
105202
|
+
* @returns {Object.<string,*>} JSON object
|
|
105203
|
+
*/
|
|
105204
|
+
ProductSkuVersioned.prototype.toJSON = function toJSON() {
|
|
105205
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
105206
|
+
};
|
|
105207
|
+
|
|
105208
|
+
return ProductSkuVersioned;
|
|
105209
|
+
})();
|
|
105210
|
+
|
|
102729
105211
|
$root.ReferralSignedUp = (function() {
|
|
102730
105212
|
|
|
102731
105213
|
/**
|