@salesforce/lds-adapters-revenue-usage-detail 0.1.0-dev1

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.
Files changed (36) hide show
  1. package/LICENSE.txt +82 -0
  2. package/dist/es/es2018/revenue-usage-detail.js +4359 -0
  3. package/dist/es/es2018/types/src/generated/adapters/adapter-utils.d.ts +62 -0
  4. package/dist/es/es2018/types/src/generated/adapters/getAssetUsageDetails.d.ts +29 -0
  5. package/dist/es/es2018/types/src/generated/adapters/getBindingObjectUsageDetails.d.ts +28 -0
  6. package/dist/es/es2018/types/src/generated/adapters/getOrderUsageDetails.d.ts +29 -0
  7. package/dist/es/es2018/types/src/generated/adapters/getQuoteUsageDetails.d.ts +29 -0
  8. package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +4 -0
  9. package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +9 -0
  10. package/dist/es/es2018/types/src/generated/resources/getAssetManagementAssetsUsageDetailsByAssetId.d.ts +19 -0
  11. package/dist/es/es2018/types/src/generated/resources/getCommerceQuotesLineItemsUsageDetailsByQuoteLineItemId.d.ts +19 -0
  12. package/dist/es/es2018/types/src/generated/resources/getCommerceSalesOrdersLineItemsUsageDetailsByOrderItemId.d.ts +19 -0
  13. package/dist/es/es2018/types/src/generated/resources/getRevenueUsageManagementBindingObjectsActionsUsageDetailsByBindingObjectId.d.ts +18 -0
  14. package/dist/es/es2018/types/src/generated/types/BindingObjectDetailOutputRepresentation.d.ts +34 -0
  15. package/dist/es/es2018/types/src/generated/types/BindingObjectGrantDetailOutputRepresentation.d.ts +63 -0
  16. package/dist/es/es2018/types/src/generated/types/BindingObjectRateAdjustmentsOutputRepresentation.d.ts +46 -0
  17. package/dist/es/es2018/types/src/generated/types/BindingObjectRateOutputRepresentation.d.ts +44 -0
  18. package/dist/es/es2018/types/src/generated/types/BindingObjectResourceGrantAndPolicyDetailOutputRepresentation.d.ts +32 -0
  19. package/dist/es/es2018/types/src/generated/types/BindingObjectResourcePolicyDetailOutputRepresentation.d.ts +44 -0
  20. package/dist/es/es2018/types/src/generated/types/FieldsOutputRepresentation.d.ts +31 -0
  21. package/dist/es/es2018/types/src/generated/types/LookupDetailOutputRepresentation.d.ts +28 -0
  22. package/dist/es/es2018/types/src/generated/types/NegotiatedGrantDetailOutputRepresentation.d.ts +50 -0
  23. package/dist/es/es2018/types/src/generated/types/PolicyDetailOutputRepresentation.d.ts +31 -0
  24. package/dist/es/es2018/types/src/generated/types/RateAdjustmentsOutputRepresentation.d.ts +56 -0
  25. package/dist/es/es2018/types/src/generated/types/RateCardEntryOutputRepresentation.d.ts +84 -0
  26. package/dist/es/es2018/types/src/generated/types/ResourcePolicyDetailOutputRepresentation.d.ts +41 -0
  27. package/dist/es/es2018/types/src/generated/types/UsageDetailBindingObjectOutputRepresentation.d.ts +34 -0
  28. package/dist/es/es2018/types/src/generated/types/UsageDetailErrorResponseRepresentation.d.ts +34 -0
  29. package/dist/es/es2018/types/src/generated/types/UsageDetailOutputRepresentation.d.ts +34 -0
  30. package/dist/es/es2018/types/src/generated/types/UsageResourceGrantAndPolicyDetailOutputRepresentation.d.ts +39 -0
  31. package/dist/es/es2018/types/src/generated/types/type-utils.d.ts +32 -0
  32. package/package.json +67 -0
  33. package/sfdc/index.d.ts +1 -0
  34. package/sfdc/index.js +4433 -0
  35. package/src/raml/api.raml +520 -0
  36. package/src/raml/luvio.raml +32 -0
package/sfdc/index.js ADDED
@@ -0,0 +1,4433 @@
1
+ /**
2
+ * Copyright (c) 2022, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+
7
+ /*
8
+ * ATTENTION!
9
+ * THIS IS A GENERATED FILE FROM https://github.com/salesforce-experience-platform-emu/lds-lightning-platform
10
+ * If you would like to contribute to LDS, please follow the steps outlined in the git repo.
11
+ * Any changes made to this file in p4 will be automatically overwritten.
12
+ * *******************************************************************************************
13
+ */
14
+ /* proxy-compat-disable */
15
+ import { createInstrumentedAdapter, createLDSAdapter, createWireAdapterConstructor, createImperativeAdapter } from 'force/ldsBindings';
16
+ import { withDefaultLuvio } from 'force/ldsEngine';
17
+ import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$4, typeCheckConfig as typeCheckConfig$4, StoreKeyMap, createResourceParams as createResourceParams$4 } from 'force/luvioEngine';
18
+
19
+ const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
20
+ const { keys: ObjectKeys$1, create: ObjectCreate$1 } = Object;
21
+ const { isArray: ArrayIsArray$1 } = Array;
22
+ /**
23
+ * Validates an adapter config is well-formed.
24
+ * @param config The config to validate.
25
+ * @param adapter The adapter validation configuration.
26
+ * @param oneOf The keys the config must contain at least one of.
27
+ * @throws A TypeError if config doesn't satisfy the adapter's config validation.
28
+ */
29
+ function validateConfig(config, adapter, oneOf) {
30
+ const { displayName } = adapter;
31
+ const { required, optional, unsupported } = adapter.parameters;
32
+ if (config === undefined ||
33
+ required.every(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
34
+ throw new TypeError(`adapter ${displayName} configuration must specify ${required.sort().join(', ')}`);
35
+ }
36
+ if (oneOf && oneOf.some(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
37
+ throw new TypeError(`adapter ${displayName} configuration must specify one of ${oneOf.sort().join(', ')}`);
38
+ }
39
+ if (unsupported !== undefined &&
40
+ unsupported.some(req => ObjectPrototypeHasOwnProperty.call(config, req))) {
41
+ throw new TypeError(`adapter ${displayName} does not yet support ${unsupported.sort().join(', ')}`);
42
+ }
43
+ const supported = required.concat(optional);
44
+ if (ObjectKeys$1(config).some(key => !supported.includes(key))) {
45
+ throw new TypeError(`adapter ${displayName} configuration supports only ${supported.sort().join(', ')}`);
46
+ }
47
+ }
48
+ function untrustedIsObject(untrusted) {
49
+ return typeof untrusted === 'object' && untrusted !== null && ArrayIsArray$1(untrusted) === false;
50
+ }
51
+ function areRequiredParametersPresent(config, configPropertyNames) {
52
+ return configPropertyNames.parameters.required.every(req => req in config);
53
+ }
54
+ const snapshotRefreshOptions = {
55
+ overrides: {
56
+ headers: {
57
+ 'Cache-Control': 'no-cache',
58
+ },
59
+ }
60
+ };
61
+ function generateParamConfigMetadata(name, required, resourceType, typeCheckShape, isArrayShape = false, coerceFn) {
62
+ return {
63
+ name,
64
+ required,
65
+ resourceType,
66
+ typeCheckShape,
67
+ isArrayShape,
68
+ coerceFn,
69
+ };
70
+ }
71
+ function buildAdapterValidationConfig(displayName, paramsMeta) {
72
+ const required = paramsMeta.filter(p => p.required).map(p => p.name);
73
+ const optional = paramsMeta.filter(p => !p.required).map(p => p.name);
74
+ return {
75
+ displayName,
76
+ parameters: {
77
+ required,
78
+ optional,
79
+ }
80
+ };
81
+ }
82
+ const keyPrefix = 'usage-detail';
83
+
84
+ const { keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
85
+ const { isArray: ArrayIsArray } = Array;
86
+ const { stringify: JSONStringify } = JSON;
87
+ function equalsArray(a, b, equalsItem) {
88
+ const aLength = a.length;
89
+ const bLength = b.length;
90
+ if (aLength !== bLength) {
91
+ return false;
92
+ }
93
+ for (let i = 0; i < aLength; i++) {
94
+ if (equalsItem(a[i], b[i]) === false) {
95
+ return false;
96
+ }
97
+ }
98
+ return true;
99
+ }
100
+ function equalsObject(a, b, equalsProp) {
101
+ const aKeys = ObjectKeys(a).sort();
102
+ const bKeys = ObjectKeys(b).sort();
103
+ const aKeysLength = aKeys.length;
104
+ const bKeysLength = bKeys.length;
105
+ if (aKeysLength !== bKeysLength) {
106
+ return false;
107
+ }
108
+ for (let i = 0; i < aKeys.length; i++) {
109
+ const key = aKeys[i];
110
+ if (key !== bKeys[i]) {
111
+ return false;
112
+ }
113
+ if (equalsProp(a[key], b[key]) === false) {
114
+ return false;
115
+ }
116
+ }
117
+ return true;
118
+ }
119
+ function createLink(ref) {
120
+ return {
121
+ __ref: serializeStructuredKey(ref),
122
+ };
123
+ }
124
+
125
+ const VERSION$f = "e0ac6bf27e20d64b8c2926f058c43ea4";
126
+ function validate$f(obj, path = 'UsageDetailErrorResponseRepresentation') {
127
+ const v_error = (() => {
128
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
129
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
130
+ }
131
+ const obj_errorCode = obj.errorCode;
132
+ const path_errorCode = path + '.errorCode';
133
+ if (typeof obj_errorCode !== 'string') {
134
+ return new TypeError('Expected "string" but received "' + typeof obj_errorCode + '" (at "' + path_errorCode + '")');
135
+ }
136
+ const obj_message = obj.message;
137
+ const path_message = path + '.message';
138
+ if (typeof obj_message !== 'string') {
139
+ return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
140
+ }
141
+ const obj_referenceId = obj.referenceId;
142
+ const path_referenceId = path + '.referenceId';
143
+ if (typeof obj_referenceId !== 'string') {
144
+ return new TypeError('Expected "string" but received "' + typeof obj_referenceId + '" (at "' + path_referenceId + '")');
145
+ }
146
+ })();
147
+ return v_error === undefined ? null : v_error;
148
+ }
149
+ const select$j = function UsageDetailErrorResponseRepresentationSelect() {
150
+ return {
151
+ kind: 'Fragment',
152
+ version: VERSION$f,
153
+ private: [],
154
+ selections: [
155
+ {
156
+ name: 'errorCode',
157
+ kind: 'Scalar'
158
+ },
159
+ {
160
+ name: 'message',
161
+ kind: 'Scalar'
162
+ },
163
+ {
164
+ name: 'referenceId',
165
+ kind: 'Scalar'
166
+ }
167
+ ]
168
+ };
169
+ };
170
+ function equals$f(existing, incoming) {
171
+ const existing_errorCode = existing.errorCode;
172
+ const incoming_errorCode = incoming.errorCode;
173
+ if (!(existing_errorCode === incoming_errorCode)) {
174
+ return false;
175
+ }
176
+ const existing_message = existing.message;
177
+ const incoming_message = incoming.message;
178
+ if (!(existing_message === incoming_message)) {
179
+ return false;
180
+ }
181
+ const existing_referenceId = existing.referenceId;
182
+ const incoming_referenceId = incoming.referenceId;
183
+ if (!(existing_referenceId === incoming_referenceId)) {
184
+ return false;
185
+ }
186
+ return true;
187
+ }
188
+
189
+ const VERSION$e = "52841d9c877e06c71e0dcddc6196cee0";
190
+ function validate$e(obj, path = 'RateAdjustmentsOutputRepresentation') {
191
+ const v_error = (() => {
192
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
193
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
194
+ }
195
+ if (obj.fields !== undefined) {
196
+ const obj_fields = obj.fields;
197
+ const path_fields = path + '.fields';
198
+ if (typeof obj_fields !== 'object' || ArrayIsArray(obj_fields) || obj_fields === null) {
199
+ return new TypeError('Expected "object" but received "' + typeof obj_fields + '" (at "' + path_fields + '")');
200
+ }
201
+ const obj_fields_keys = ObjectKeys(obj_fields);
202
+ for (let i = 0; i < obj_fields_keys.length; i++) {
203
+ const key = obj_fields_keys[i];
204
+ const obj_fields_prop = obj_fields[key];
205
+ const path_fields_prop = path_fields + '["' + key + '"]';
206
+ if (obj_fields_prop === undefined) {
207
+ return new TypeError('Expected "defined" but received "' + typeof obj_fields_prop + '" (at "' + path_fields_prop + '")');
208
+ }
209
+ }
210
+ }
211
+ const obj_lowerBound = obj.lowerBound;
212
+ const path_lowerBound = path + '.lowerBound';
213
+ let obj_lowerBound_union0 = null;
214
+ const obj_lowerBound_union0_error = (() => {
215
+ if (typeof obj_lowerBound !== 'number') {
216
+ return new TypeError('Expected "number" but received "' + typeof obj_lowerBound + '" (at "' + path_lowerBound + '")');
217
+ }
218
+ })();
219
+ if (obj_lowerBound_union0_error != null) {
220
+ obj_lowerBound_union0 = obj_lowerBound_union0_error.message;
221
+ }
222
+ let obj_lowerBound_union1 = null;
223
+ const obj_lowerBound_union1_error = (() => {
224
+ if (obj_lowerBound !== null) {
225
+ return new TypeError('Expected "null" but received "' + typeof obj_lowerBound + '" (at "' + path_lowerBound + '")');
226
+ }
227
+ })();
228
+ if (obj_lowerBound_union1_error != null) {
229
+ obj_lowerBound_union1 = obj_lowerBound_union1_error.message;
230
+ }
231
+ if (obj_lowerBound_union0 && obj_lowerBound_union1) {
232
+ let message = 'Object doesn\'t match union (at "' + path_lowerBound + '")';
233
+ message += '\n' + obj_lowerBound_union0.split('\n').map((line) => '\t' + line).join('\n');
234
+ message += '\n' + obj_lowerBound_union1.split('\n').map((line) => '\t' + line).join('\n');
235
+ return new TypeError(message);
236
+ }
237
+ const obj_name = obj.name;
238
+ const path_name = path + '.name';
239
+ let obj_name_union0 = null;
240
+ const obj_name_union0_error = (() => {
241
+ if (typeof obj_name !== 'string') {
242
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
243
+ }
244
+ })();
245
+ if (obj_name_union0_error != null) {
246
+ obj_name_union0 = obj_name_union0_error.message;
247
+ }
248
+ let obj_name_union1 = null;
249
+ const obj_name_union1_error = (() => {
250
+ if (obj_name !== null) {
251
+ return new TypeError('Expected "null" but received "' + typeof obj_name + '" (at "' + path_name + '")');
252
+ }
253
+ })();
254
+ if (obj_name_union1_error != null) {
255
+ obj_name_union1 = obj_name_union1_error.message;
256
+ }
257
+ if (obj_name_union0 && obj_name_union1) {
258
+ let message = 'Object doesn\'t match union (at "' + path_name + '")';
259
+ message += '\n' + obj_name_union0.split('\n').map((line) => '\t' + line).join('\n');
260
+ message += '\n' + obj_name_union1.split('\n').map((line) => '\t' + line).join('\n');
261
+ return new TypeError(message);
262
+ }
263
+ const obj_negotiatedRateAdjustmentId = obj.negotiatedRateAdjustmentId;
264
+ const path_negotiatedRateAdjustmentId = path + '.negotiatedRateAdjustmentId';
265
+ let obj_negotiatedRateAdjustmentId_union0 = null;
266
+ const obj_negotiatedRateAdjustmentId_union0_error = (() => {
267
+ if (typeof obj_negotiatedRateAdjustmentId !== 'string') {
268
+ return new TypeError('Expected "string" but received "' + typeof obj_negotiatedRateAdjustmentId + '" (at "' + path_negotiatedRateAdjustmentId + '")');
269
+ }
270
+ })();
271
+ if (obj_negotiatedRateAdjustmentId_union0_error != null) {
272
+ obj_negotiatedRateAdjustmentId_union0 = obj_negotiatedRateAdjustmentId_union0_error.message;
273
+ }
274
+ let obj_negotiatedRateAdjustmentId_union1 = null;
275
+ const obj_negotiatedRateAdjustmentId_union1_error = (() => {
276
+ if (obj_negotiatedRateAdjustmentId !== null) {
277
+ return new TypeError('Expected "null" but received "' + typeof obj_negotiatedRateAdjustmentId + '" (at "' + path_negotiatedRateAdjustmentId + '")');
278
+ }
279
+ })();
280
+ if (obj_negotiatedRateAdjustmentId_union1_error != null) {
281
+ obj_negotiatedRateAdjustmentId_union1 = obj_negotiatedRateAdjustmentId_union1_error.message;
282
+ }
283
+ if (obj_negotiatedRateAdjustmentId_union0 && obj_negotiatedRateAdjustmentId_union1) {
284
+ let message = 'Object doesn\'t match union (at "' + path_negotiatedRateAdjustmentId + '")';
285
+ message += '\n' + obj_negotiatedRateAdjustmentId_union0.split('\n').map((line) => '\t' + line).join('\n');
286
+ message += '\n' + obj_negotiatedRateAdjustmentId_union1.split('\n').map((line) => '\t' + line).join('\n');
287
+ return new TypeError(message);
288
+ }
289
+ const obj_rateAdjustmentId = obj.rateAdjustmentId;
290
+ const path_rateAdjustmentId = path + '.rateAdjustmentId';
291
+ if (typeof obj_rateAdjustmentId !== 'string') {
292
+ return new TypeError('Expected "string" but received "' + typeof obj_rateAdjustmentId + '" (at "' + path_rateAdjustmentId + '")');
293
+ }
294
+ const obj_rateAdjustmentType = obj.rateAdjustmentType;
295
+ const path_rateAdjustmentType = path + '.rateAdjustmentType';
296
+ let obj_rateAdjustmentType_union0 = null;
297
+ const obj_rateAdjustmentType_union0_error = (() => {
298
+ if (typeof obj_rateAdjustmentType !== 'string') {
299
+ return new TypeError('Expected "string" but received "' + typeof obj_rateAdjustmentType + '" (at "' + path_rateAdjustmentType + '")');
300
+ }
301
+ })();
302
+ if (obj_rateAdjustmentType_union0_error != null) {
303
+ obj_rateAdjustmentType_union0 = obj_rateAdjustmentType_union0_error.message;
304
+ }
305
+ let obj_rateAdjustmentType_union1 = null;
306
+ const obj_rateAdjustmentType_union1_error = (() => {
307
+ if (obj_rateAdjustmentType !== null) {
308
+ return new TypeError('Expected "null" but received "' + typeof obj_rateAdjustmentType + '" (at "' + path_rateAdjustmentType + '")');
309
+ }
310
+ })();
311
+ if (obj_rateAdjustmentType_union1_error != null) {
312
+ obj_rateAdjustmentType_union1 = obj_rateAdjustmentType_union1_error.message;
313
+ }
314
+ if (obj_rateAdjustmentType_union0 && obj_rateAdjustmentType_union1) {
315
+ let message = 'Object doesn\'t match union (at "' + path_rateAdjustmentType + '")';
316
+ message += '\n' + obj_rateAdjustmentType_union0.split('\n').map((line) => '\t' + line).join('\n');
317
+ message += '\n' + obj_rateAdjustmentType_union1.split('\n').map((line) => '\t' + line).join('\n');
318
+ return new TypeError(message);
319
+ }
320
+ const obj_rateAdjustmentValue = obj.rateAdjustmentValue;
321
+ const path_rateAdjustmentValue = path + '.rateAdjustmentValue';
322
+ let obj_rateAdjustmentValue_union0 = null;
323
+ const obj_rateAdjustmentValue_union0_error = (() => {
324
+ if (typeof obj_rateAdjustmentValue !== 'number') {
325
+ return new TypeError('Expected "number" but received "' + typeof obj_rateAdjustmentValue + '" (at "' + path_rateAdjustmentValue + '")');
326
+ }
327
+ })();
328
+ if (obj_rateAdjustmentValue_union0_error != null) {
329
+ obj_rateAdjustmentValue_union0 = obj_rateAdjustmentValue_union0_error.message;
330
+ }
331
+ let obj_rateAdjustmentValue_union1 = null;
332
+ const obj_rateAdjustmentValue_union1_error = (() => {
333
+ if (obj_rateAdjustmentValue !== null) {
334
+ return new TypeError('Expected "null" but received "' + typeof obj_rateAdjustmentValue + '" (at "' + path_rateAdjustmentValue + '")');
335
+ }
336
+ })();
337
+ if (obj_rateAdjustmentValue_union1_error != null) {
338
+ obj_rateAdjustmentValue_union1 = obj_rateAdjustmentValue_union1_error.message;
339
+ }
340
+ if (obj_rateAdjustmentValue_union0 && obj_rateAdjustmentValue_union1) {
341
+ let message = 'Object doesn\'t match union (at "' + path_rateAdjustmentValue + '")';
342
+ message += '\n' + obj_rateAdjustmentValue_union0.split('\n').map((line) => '\t' + line).join('\n');
343
+ message += '\n' + obj_rateAdjustmentValue_union1.split('\n').map((line) => '\t' + line).join('\n');
344
+ return new TypeError(message);
345
+ }
346
+ const obj_tierUnitOfMeasure = obj.tierUnitOfMeasure;
347
+ const path_tierUnitOfMeasure = path + '.tierUnitOfMeasure';
348
+ let obj_tierUnitOfMeasure_union0 = null;
349
+ const obj_tierUnitOfMeasure_union0_error = (() => {
350
+ if (typeof obj_tierUnitOfMeasure !== 'string') {
351
+ return new TypeError('Expected "string" but received "' + typeof obj_tierUnitOfMeasure + '" (at "' + path_tierUnitOfMeasure + '")');
352
+ }
353
+ })();
354
+ if (obj_tierUnitOfMeasure_union0_error != null) {
355
+ obj_tierUnitOfMeasure_union0 = obj_tierUnitOfMeasure_union0_error.message;
356
+ }
357
+ let obj_tierUnitOfMeasure_union1 = null;
358
+ const obj_tierUnitOfMeasure_union1_error = (() => {
359
+ if (obj_tierUnitOfMeasure !== null) {
360
+ return new TypeError('Expected "null" but received "' + typeof obj_tierUnitOfMeasure + '" (at "' + path_tierUnitOfMeasure + '")');
361
+ }
362
+ })();
363
+ if (obj_tierUnitOfMeasure_union1_error != null) {
364
+ obj_tierUnitOfMeasure_union1 = obj_tierUnitOfMeasure_union1_error.message;
365
+ }
366
+ if (obj_tierUnitOfMeasure_union0 && obj_tierUnitOfMeasure_union1) {
367
+ let message = 'Object doesn\'t match union (at "' + path_tierUnitOfMeasure + '")';
368
+ message += '\n' + obj_tierUnitOfMeasure_union0.split('\n').map((line) => '\t' + line).join('\n');
369
+ message += '\n' + obj_tierUnitOfMeasure_union1.split('\n').map((line) => '\t' + line).join('\n');
370
+ return new TypeError(message);
371
+ }
372
+ const obj_upperBound = obj.upperBound;
373
+ const path_upperBound = path + '.upperBound';
374
+ let obj_upperBound_union0 = null;
375
+ const obj_upperBound_union0_error = (() => {
376
+ if (typeof obj_upperBound !== 'number') {
377
+ return new TypeError('Expected "number" but received "' + typeof obj_upperBound + '" (at "' + path_upperBound + '")');
378
+ }
379
+ })();
380
+ if (obj_upperBound_union0_error != null) {
381
+ obj_upperBound_union0 = obj_upperBound_union0_error.message;
382
+ }
383
+ let obj_upperBound_union1 = null;
384
+ const obj_upperBound_union1_error = (() => {
385
+ if (obj_upperBound !== null) {
386
+ return new TypeError('Expected "null" but received "' + typeof obj_upperBound + '" (at "' + path_upperBound + '")');
387
+ }
388
+ })();
389
+ if (obj_upperBound_union1_error != null) {
390
+ obj_upperBound_union1 = obj_upperBound_union1_error.message;
391
+ }
392
+ if (obj_upperBound_union0 && obj_upperBound_union1) {
393
+ let message = 'Object doesn\'t match union (at "' + path_upperBound + '")';
394
+ message += '\n' + obj_upperBound_union0.split('\n').map((line) => '\t' + line).join('\n');
395
+ message += '\n' + obj_upperBound_union1.split('\n').map((line) => '\t' + line).join('\n');
396
+ return new TypeError(message);
397
+ }
398
+ })();
399
+ return v_error === undefined ? null : v_error;
400
+ }
401
+ const select$i = function RateAdjustmentsOutputRepresentationSelect() {
402
+ return {
403
+ kind: 'Fragment',
404
+ version: VERSION$e,
405
+ private: [],
406
+ selections: [
407
+ {
408
+ name: 'fields',
409
+ kind: 'Object',
410
+ // any
411
+ },
412
+ {
413
+ name: 'lowerBound',
414
+ kind: 'Scalar'
415
+ },
416
+ {
417
+ name: 'name',
418
+ kind: 'Scalar'
419
+ },
420
+ {
421
+ name: 'negotiatedRateAdjustmentId',
422
+ kind: 'Scalar'
423
+ },
424
+ {
425
+ name: 'rateAdjustmentId',
426
+ kind: 'Scalar'
427
+ },
428
+ {
429
+ name: 'rateAdjustmentType',
430
+ kind: 'Scalar'
431
+ },
432
+ {
433
+ name: 'rateAdjustmentValue',
434
+ kind: 'Scalar'
435
+ },
436
+ {
437
+ name: 'tierUnitOfMeasure',
438
+ kind: 'Scalar'
439
+ },
440
+ {
441
+ name: 'upperBound',
442
+ kind: 'Scalar'
443
+ }
444
+ ]
445
+ };
446
+ };
447
+ function equals$e(existing, incoming) {
448
+ const existing_rateAdjustmentId = existing.rateAdjustmentId;
449
+ const incoming_rateAdjustmentId = incoming.rateAdjustmentId;
450
+ if (!(existing_rateAdjustmentId === incoming_rateAdjustmentId)) {
451
+ return false;
452
+ }
453
+ const existing_fields = existing.fields;
454
+ const incoming_fields = incoming.fields;
455
+ // if at least one of these optionals is defined
456
+ if (existing_fields !== undefined || incoming_fields !== undefined) {
457
+ // if one of these is not defined we know the other is defined and therefore
458
+ // not equal
459
+ if (existing_fields === undefined || incoming_fields === undefined) {
460
+ return false;
461
+ }
462
+ const equals_fields_props = equalsObject(existing_fields, incoming_fields, (existing_fields_prop, incoming_fields_prop) => {
463
+ if (JSONStringify(incoming_fields_prop) !== JSONStringify(existing_fields_prop)) {
464
+ return false;
465
+ }
466
+ });
467
+ if (equals_fields_props === false) {
468
+ return false;
469
+ }
470
+ }
471
+ const existing_lowerBound = existing.lowerBound;
472
+ const incoming_lowerBound = incoming.lowerBound;
473
+ if (!(existing_lowerBound === incoming_lowerBound)) {
474
+ return false;
475
+ }
476
+ const existing_name = existing.name;
477
+ const incoming_name = incoming.name;
478
+ if (!(existing_name === incoming_name)) {
479
+ return false;
480
+ }
481
+ const existing_negotiatedRateAdjustmentId = existing.negotiatedRateAdjustmentId;
482
+ const incoming_negotiatedRateAdjustmentId = incoming.negotiatedRateAdjustmentId;
483
+ if (!(existing_negotiatedRateAdjustmentId === incoming_negotiatedRateAdjustmentId)) {
484
+ return false;
485
+ }
486
+ const existing_rateAdjustmentType = existing.rateAdjustmentType;
487
+ const incoming_rateAdjustmentType = incoming.rateAdjustmentType;
488
+ if (!(existing_rateAdjustmentType === incoming_rateAdjustmentType)) {
489
+ return false;
490
+ }
491
+ const existing_rateAdjustmentValue = existing.rateAdjustmentValue;
492
+ const incoming_rateAdjustmentValue = incoming.rateAdjustmentValue;
493
+ if (!(existing_rateAdjustmentValue === incoming_rateAdjustmentValue)) {
494
+ return false;
495
+ }
496
+ const existing_tierUnitOfMeasure = existing.tierUnitOfMeasure;
497
+ const incoming_tierUnitOfMeasure = incoming.tierUnitOfMeasure;
498
+ if (!(existing_tierUnitOfMeasure === incoming_tierUnitOfMeasure)) {
499
+ return false;
500
+ }
501
+ const existing_upperBound = existing.upperBound;
502
+ const incoming_upperBound = incoming.upperBound;
503
+ if (!(existing_upperBound === incoming_upperBound)) {
504
+ return false;
505
+ }
506
+ return true;
507
+ }
508
+
509
+ const VERSION$d = "750a8174fcbd532f0a64116220b53185";
510
+ function validate$d(obj, path = 'PolicyDetailOutputRepresentation') {
511
+ const v_error = (() => {
512
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
513
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
514
+ }
515
+ const obj_id = obj.id;
516
+ const path_id = path + '.id';
517
+ let obj_id_union0 = null;
518
+ const obj_id_union0_error = (() => {
519
+ if (typeof obj_id !== 'string') {
520
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
521
+ }
522
+ })();
523
+ if (obj_id_union0_error != null) {
524
+ obj_id_union0 = obj_id_union0_error.message;
525
+ }
526
+ let obj_id_union1 = null;
527
+ const obj_id_union1_error = (() => {
528
+ if (obj_id !== null) {
529
+ return new TypeError('Expected "null" but received "' + typeof obj_id + '" (at "' + path_id + '")');
530
+ }
531
+ })();
532
+ if (obj_id_union1_error != null) {
533
+ obj_id_union1 = obj_id_union1_error.message;
534
+ }
535
+ if (obj_id_union0 && obj_id_union1) {
536
+ let message = 'Object doesn\'t match union (at "' + path_id + '")';
537
+ message += '\n' + obj_id_union0.split('\n').map((line) => '\t' + line).join('\n');
538
+ message += '\n' + obj_id_union1.split('\n').map((line) => '\t' + line).join('\n');
539
+ return new TypeError(message);
540
+ }
541
+ const obj_negotiable = obj.negotiable;
542
+ const path_negotiable = path + '.negotiable';
543
+ let obj_negotiable_union0 = null;
544
+ const obj_negotiable_union0_error = (() => {
545
+ if (typeof obj_negotiable !== 'string') {
546
+ return new TypeError('Expected "string" but received "' + typeof obj_negotiable + '" (at "' + path_negotiable + '")');
547
+ }
548
+ })();
549
+ if (obj_negotiable_union0_error != null) {
550
+ obj_negotiable_union0 = obj_negotiable_union0_error.message;
551
+ }
552
+ let obj_negotiable_union1 = null;
553
+ const obj_negotiable_union1_error = (() => {
554
+ if (obj_negotiable !== null) {
555
+ return new TypeError('Expected "null" but received "' + typeof obj_negotiable + '" (at "' + path_negotiable + '")');
556
+ }
557
+ })();
558
+ if (obj_negotiable_union1_error != null) {
559
+ obj_negotiable_union1 = obj_negotiable_union1_error.message;
560
+ }
561
+ if (obj_negotiable_union0 && obj_negotiable_union1) {
562
+ let message = 'Object doesn\'t match union (at "' + path_negotiable + '")';
563
+ message += '\n' + obj_negotiable_union0.split('\n').map((line) => '\t' + line).join('\n');
564
+ message += '\n' + obj_negotiable_union1.split('\n').map((line) => '\t' + line).join('\n');
565
+ return new TypeError(message);
566
+ }
567
+ })();
568
+ return v_error === undefined ? null : v_error;
569
+ }
570
+ const select$h = function PolicyDetailOutputRepresentationSelect() {
571
+ return {
572
+ kind: 'Fragment',
573
+ version: VERSION$d,
574
+ private: [],
575
+ selections: [
576
+ {
577
+ name: 'id',
578
+ kind: 'Scalar'
579
+ },
580
+ {
581
+ name: 'negotiable',
582
+ kind: 'Scalar'
583
+ }
584
+ ]
585
+ };
586
+ };
587
+ function equals$d(existing, incoming) {
588
+ const existing_id = existing.id;
589
+ const incoming_id = incoming.id;
590
+ if (!(existing_id === incoming_id)) {
591
+ return false;
592
+ }
593
+ const existing_negotiable = existing.negotiable;
594
+ const incoming_negotiable = incoming.negotiable;
595
+ if (!(existing_negotiable === incoming_negotiable)) {
596
+ return false;
597
+ }
598
+ return true;
599
+ }
600
+
601
+ const VERSION$c = "8d4fc60883c9534fc4637046cb405afe";
602
+ function validate$c(obj, path = 'NegotiatedGrantDetailOutputRepresentation') {
603
+ const v_error = (() => {
604
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
605
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
606
+ }
607
+ const obj_grantType = obj.grantType;
608
+ const path_grantType = path + '.grantType';
609
+ let obj_grantType_union0 = null;
610
+ const obj_grantType_union0_error = (() => {
611
+ if (typeof obj_grantType !== 'string') {
612
+ return new TypeError('Expected "string" but received "' + typeof obj_grantType + '" (at "' + path_grantType + '")');
613
+ }
614
+ })();
615
+ if (obj_grantType_union0_error != null) {
616
+ obj_grantType_union0 = obj_grantType_union0_error.message;
617
+ }
618
+ let obj_grantType_union1 = null;
619
+ const obj_grantType_union1_error = (() => {
620
+ if (obj_grantType !== null) {
621
+ return new TypeError('Expected "null" but received "' + typeof obj_grantType + '" (at "' + path_grantType + '")');
622
+ }
623
+ })();
624
+ if (obj_grantType_union1_error != null) {
625
+ obj_grantType_union1 = obj_grantType_union1_error.message;
626
+ }
627
+ if (obj_grantType_union0 && obj_grantType_union1) {
628
+ let message = 'Object doesn\'t match union (at "' + path_grantType + '")';
629
+ message += '\n' + obj_grantType_union0.split('\n').map((line) => '\t' + line).join('\n');
630
+ message += '\n' + obj_grantType_union1.split('\n').map((line) => '\t' + line).join('\n');
631
+ return new TypeError(message);
632
+ }
633
+ if (obj.id !== undefined) {
634
+ const obj_id = obj.id;
635
+ const path_id = path + '.id';
636
+ let obj_id_union0 = null;
637
+ const obj_id_union0_error = (() => {
638
+ if (typeof obj_id !== 'string') {
639
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
640
+ }
641
+ })();
642
+ if (obj_id_union0_error != null) {
643
+ obj_id_union0 = obj_id_union0_error.message;
644
+ }
645
+ let obj_id_union1 = null;
646
+ const obj_id_union1_error = (() => {
647
+ if (obj_id !== null) {
648
+ return new TypeError('Expected "null" but received "' + typeof obj_id + '" (at "' + path_id + '")');
649
+ }
650
+ })();
651
+ if (obj_id_union1_error != null) {
652
+ obj_id_union1 = obj_id_union1_error.message;
653
+ }
654
+ if (obj_id_union0 && obj_id_union1) {
655
+ let message = 'Object doesn\'t match union (at "' + path_id + '")';
656
+ message += '\n' + obj_id_union0.split('\n').map((line) => '\t' + line).join('\n');
657
+ message += '\n' + obj_id_union1.split('\n').map((line) => '\t' + line).join('\n');
658
+ return new TypeError(message);
659
+ }
660
+ }
661
+ const obj_quantity = obj.quantity;
662
+ const path_quantity = path + '.quantity';
663
+ let obj_quantity_union0 = null;
664
+ const obj_quantity_union0_error = (() => {
665
+ if (typeof obj_quantity !== 'number') {
666
+ return new TypeError('Expected "number" but received "' + typeof obj_quantity + '" (at "' + path_quantity + '")');
667
+ }
668
+ })();
669
+ if (obj_quantity_union0_error != null) {
670
+ obj_quantity_union0 = obj_quantity_union0_error.message;
671
+ }
672
+ let obj_quantity_union1 = null;
673
+ const obj_quantity_union1_error = (() => {
674
+ if (obj_quantity !== null) {
675
+ return new TypeError('Expected "null" but received "' + typeof obj_quantity + '" (at "' + path_quantity + '")');
676
+ }
677
+ })();
678
+ if (obj_quantity_union1_error != null) {
679
+ obj_quantity_union1 = obj_quantity_union1_error.message;
680
+ }
681
+ if (obj_quantity_union0 && obj_quantity_union1) {
682
+ let message = 'Object doesn\'t match union (at "' + path_quantity + '")';
683
+ message += '\n' + obj_quantity_union0.split('\n').map((line) => '\t' + line).join('\n');
684
+ message += '\n' + obj_quantity_union1.split('\n').map((line) => '\t' + line).join('\n');
685
+ return new TypeError(message);
686
+ }
687
+ const obj_usageGrantNegotiable = obj.usageGrantNegotiable;
688
+ const path_usageGrantNegotiable = path + '.usageGrantNegotiable';
689
+ let obj_usageGrantNegotiable_union0 = null;
690
+ const obj_usageGrantNegotiable_union0_error = (() => {
691
+ if (typeof obj_usageGrantNegotiable !== 'string') {
692
+ return new TypeError('Expected "string" but received "' + typeof obj_usageGrantNegotiable + '" (at "' + path_usageGrantNegotiable + '")');
693
+ }
694
+ })();
695
+ if (obj_usageGrantNegotiable_union0_error != null) {
696
+ obj_usageGrantNegotiable_union0 = obj_usageGrantNegotiable_union0_error.message;
697
+ }
698
+ let obj_usageGrantNegotiable_union1 = null;
699
+ const obj_usageGrantNegotiable_union1_error = (() => {
700
+ if (obj_usageGrantNegotiable !== null) {
701
+ return new TypeError('Expected "null" but received "' + typeof obj_usageGrantNegotiable + '" (at "' + path_usageGrantNegotiable + '")');
702
+ }
703
+ })();
704
+ if (obj_usageGrantNegotiable_union1_error != null) {
705
+ obj_usageGrantNegotiable_union1 = obj_usageGrantNegotiable_union1_error.message;
706
+ }
707
+ if (obj_usageGrantNegotiable_union0 && obj_usageGrantNegotiable_union1) {
708
+ let message = 'Object doesn\'t match union (at "' + path_usageGrantNegotiable + '")';
709
+ message += '\n' + obj_usageGrantNegotiable_union0.split('\n').map((line) => '\t' + line).join('\n');
710
+ message += '\n' + obj_usageGrantNegotiable_union1.split('\n').map((line) => '\t' + line).join('\n');
711
+ return new TypeError(message);
712
+ }
713
+ const obj_usageRefreshPolicy = obj.usageRefreshPolicy;
714
+ const path_usageRefreshPolicy = path + '.usageRefreshPolicy';
715
+ let obj_usageRefreshPolicy_union0 = null;
716
+ const obj_usageRefreshPolicy_union0_error = (() => {
717
+ const referencepath_usageRefreshPolicyValidationError = validate$d(obj_usageRefreshPolicy, path_usageRefreshPolicy);
718
+ if (referencepath_usageRefreshPolicyValidationError !== null) {
719
+ let message = 'Object doesn\'t match PolicyDetailOutputRepresentation (at "' + path_usageRefreshPolicy + '")\n';
720
+ message += referencepath_usageRefreshPolicyValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
721
+ return new TypeError(message);
722
+ }
723
+ })();
724
+ if (obj_usageRefreshPolicy_union0_error != null) {
725
+ obj_usageRefreshPolicy_union0 = obj_usageRefreshPolicy_union0_error.message;
726
+ }
727
+ let obj_usageRefreshPolicy_union1 = null;
728
+ const obj_usageRefreshPolicy_union1_error = (() => {
729
+ if (obj_usageRefreshPolicy !== null) {
730
+ return new TypeError('Expected "null" but received "' + typeof obj_usageRefreshPolicy + '" (at "' + path_usageRefreshPolicy + '")');
731
+ }
732
+ })();
733
+ if (obj_usageRefreshPolicy_union1_error != null) {
734
+ obj_usageRefreshPolicy_union1 = obj_usageRefreshPolicy_union1_error.message;
735
+ }
736
+ if (obj_usageRefreshPolicy_union0 && obj_usageRefreshPolicy_union1) {
737
+ let message = 'Object doesn\'t match union (at "' + path_usageRefreshPolicy + '")';
738
+ message += '\n' + obj_usageRefreshPolicy_union0.split('\n').map((line) => '\t' + line).join('\n');
739
+ message += '\n' + obj_usageRefreshPolicy_union1.split('\n').map((line) => '\t' + line).join('\n');
740
+ return new TypeError(message);
741
+ }
742
+ const obj_usageRolloverPolicy = obj.usageRolloverPolicy;
743
+ const path_usageRolloverPolicy = path + '.usageRolloverPolicy';
744
+ let obj_usageRolloverPolicy_union0 = null;
745
+ const obj_usageRolloverPolicy_union0_error = (() => {
746
+ const referencepath_usageRolloverPolicyValidationError = validate$d(obj_usageRolloverPolicy, path_usageRolloverPolicy);
747
+ if (referencepath_usageRolloverPolicyValidationError !== null) {
748
+ let message = 'Object doesn\'t match PolicyDetailOutputRepresentation (at "' + path_usageRolloverPolicy + '")\n';
749
+ message += referencepath_usageRolloverPolicyValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
750
+ return new TypeError(message);
751
+ }
752
+ })();
753
+ if (obj_usageRolloverPolicy_union0_error != null) {
754
+ obj_usageRolloverPolicy_union0 = obj_usageRolloverPolicy_union0_error.message;
755
+ }
756
+ let obj_usageRolloverPolicy_union1 = null;
757
+ const obj_usageRolloverPolicy_union1_error = (() => {
758
+ if (obj_usageRolloverPolicy !== null) {
759
+ return new TypeError('Expected "null" but received "' + typeof obj_usageRolloverPolicy + '" (at "' + path_usageRolloverPolicy + '")');
760
+ }
761
+ })();
762
+ if (obj_usageRolloverPolicy_union1_error != null) {
763
+ obj_usageRolloverPolicy_union1 = obj_usageRolloverPolicy_union1_error.message;
764
+ }
765
+ if (obj_usageRolloverPolicy_union0 && obj_usageRolloverPolicy_union1) {
766
+ let message = 'Object doesn\'t match union (at "' + path_usageRolloverPolicy + '")';
767
+ message += '\n' + obj_usageRolloverPolicy_union0.split('\n').map((line) => '\t' + line).join('\n');
768
+ message += '\n' + obj_usageRolloverPolicy_union1.split('\n').map((line) => '\t' + line).join('\n');
769
+ return new TypeError(message);
770
+ }
771
+ const obj_validityPeriodTerm = obj.validityPeriodTerm;
772
+ const path_validityPeriodTerm = path + '.validityPeriodTerm';
773
+ let obj_validityPeriodTerm_union0 = null;
774
+ const obj_validityPeriodTerm_union0_error = (() => {
775
+ if (typeof obj_validityPeriodTerm !== 'number') {
776
+ return new TypeError('Expected "number" but received "' + typeof obj_validityPeriodTerm + '" (at "' + path_validityPeriodTerm + '")');
777
+ }
778
+ })();
779
+ if (obj_validityPeriodTerm_union0_error != null) {
780
+ obj_validityPeriodTerm_union0 = obj_validityPeriodTerm_union0_error.message;
781
+ }
782
+ let obj_validityPeriodTerm_union1 = null;
783
+ const obj_validityPeriodTerm_union1_error = (() => {
784
+ if (obj_validityPeriodTerm !== null) {
785
+ return new TypeError('Expected "null" but received "' + typeof obj_validityPeriodTerm + '" (at "' + path_validityPeriodTerm + '")');
786
+ }
787
+ })();
788
+ if (obj_validityPeriodTerm_union1_error != null) {
789
+ obj_validityPeriodTerm_union1 = obj_validityPeriodTerm_union1_error.message;
790
+ }
791
+ if (obj_validityPeriodTerm_union0 && obj_validityPeriodTerm_union1) {
792
+ let message = 'Object doesn\'t match union (at "' + path_validityPeriodTerm + '")';
793
+ message += '\n' + obj_validityPeriodTerm_union0.split('\n').map((line) => '\t' + line).join('\n');
794
+ message += '\n' + obj_validityPeriodTerm_union1.split('\n').map((line) => '\t' + line).join('\n');
795
+ return new TypeError(message);
796
+ }
797
+ const obj_validityPeriodUnit = obj.validityPeriodUnit;
798
+ const path_validityPeriodUnit = path + '.validityPeriodUnit';
799
+ let obj_validityPeriodUnit_union0 = null;
800
+ const obj_validityPeriodUnit_union0_error = (() => {
801
+ if (typeof obj_validityPeriodUnit !== 'string') {
802
+ return new TypeError('Expected "string" but received "' + typeof obj_validityPeriodUnit + '" (at "' + path_validityPeriodUnit + '")');
803
+ }
804
+ })();
805
+ if (obj_validityPeriodUnit_union0_error != null) {
806
+ obj_validityPeriodUnit_union0 = obj_validityPeriodUnit_union0_error.message;
807
+ }
808
+ let obj_validityPeriodUnit_union1 = null;
809
+ const obj_validityPeriodUnit_union1_error = (() => {
810
+ if (obj_validityPeriodUnit !== null) {
811
+ return new TypeError('Expected "null" but received "' + typeof obj_validityPeriodUnit + '" (at "' + path_validityPeriodUnit + '")');
812
+ }
813
+ })();
814
+ if (obj_validityPeriodUnit_union1_error != null) {
815
+ obj_validityPeriodUnit_union1 = obj_validityPeriodUnit_union1_error.message;
816
+ }
817
+ if (obj_validityPeriodUnit_union0 && obj_validityPeriodUnit_union1) {
818
+ let message = 'Object doesn\'t match union (at "' + path_validityPeriodUnit + '")';
819
+ message += '\n' + obj_validityPeriodUnit_union0.split('\n').map((line) => '\t' + line).join('\n');
820
+ message += '\n' + obj_validityPeriodUnit_union1.split('\n').map((line) => '\t' + line).join('\n');
821
+ return new TypeError(message);
822
+ }
823
+ })();
824
+ return v_error === undefined ? null : v_error;
825
+ }
826
+ const select$g = function NegotiatedGrantDetailOutputRepresentationSelect() {
827
+ const { selections: PolicyDetailOutputRepresentation__selections, opaque: PolicyDetailOutputRepresentation__opaque, } = select$h();
828
+ return {
829
+ kind: 'Fragment',
830
+ version: VERSION$c,
831
+ private: [],
832
+ selections: [
833
+ {
834
+ name: 'grantType',
835
+ kind: 'Scalar'
836
+ },
837
+ {
838
+ name: 'id',
839
+ kind: 'Scalar',
840
+ required: false
841
+ },
842
+ {
843
+ name: 'quantity',
844
+ kind: 'Scalar'
845
+ },
846
+ {
847
+ name: 'usageGrantNegotiable',
848
+ kind: 'Scalar'
849
+ },
850
+ {
851
+ name: 'usageRefreshPolicy',
852
+ kind: 'Object',
853
+ nullable: true,
854
+ selections: PolicyDetailOutputRepresentation__selections
855
+ },
856
+ {
857
+ name: 'usageRolloverPolicy',
858
+ kind: 'Object',
859
+ nullable: true,
860
+ selections: PolicyDetailOutputRepresentation__selections
861
+ },
862
+ {
863
+ name: 'validityPeriodTerm',
864
+ kind: 'Scalar'
865
+ },
866
+ {
867
+ name: 'validityPeriodUnit',
868
+ kind: 'Scalar'
869
+ }
870
+ ]
871
+ };
872
+ };
873
+ function equals$c(existing, incoming) {
874
+ const existing_grantType = existing.grantType;
875
+ const incoming_grantType = incoming.grantType;
876
+ if (!(existing_grantType === incoming_grantType)) {
877
+ return false;
878
+ }
879
+ const existing_id = existing.id;
880
+ const incoming_id = incoming.id;
881
+ // if at least one of these optionals is defined
882
+ if (existing_id !== undefined || incoming_id !== undefined) {
883
+ // if one of these is not defined we know the other is defined and therefore
884
+ // not equal
885
+ if (existing_id === undefined || incoming_id === undefined) {
886
+ return false;
887
+ }
888
+ if (!(existing_id === incoming_id)) {
889
+ return false;
890
+ }
891
+ }
892
+ const existing_quantity = existing.quantity;
893
+ const incoming_quantity = incoming.quantity;
894
+ if (!(existing_quantity === incoming_quantity)) {
895
+ return false;
896
+ }
897
+ const existing_usageGrantNegotiable = existing.usageGrantNegotiable;
898
+ const incoming_usageGrantNegotiable = incoming.usageGrantNegotiable;
899
+ if (!(existing_usageGrantNegotiable === incoming_usageGrantNegotiable)) {
900
+ return false;
901
+ }
902
+ const existing_usageRefreshPolicy = existing.usageRefreshPolicy;
903
+ const incoming_usageRefreshPolicy = incoming.usageRefreshPolicy;
904
+ if (!(existing_usageRefreshPolicy === incoming_usageRefreshPolicy
905
+ || (existing_usageRefreshPolicy != null &&
906
+ incoming_usageRefreshPolicy != null &&
907
+ equals$d(existing_usageRefreshPolicy, incoming_usageRefreshPolicy)))) {
908
+ return false;
909
+ }
910
+ const existing_usageRolloverPolicy = existing.usageRolloverPolicy;
911
+ const incoming_usageRolloverPolicy = incoming.usageRolloverPolicy;
912
+ if (!(existing_usageRolloverPolicy === incoming_usageRolloverPolicy
913
+ || (existing_usageRolloverPolicy != null &&
914
+ incoming_usageRolloverPolicy != null &&
915
+ equals$d(existing_usageRolloverPolicy, incoming_usageRolloverPolicy)))) {
916
+ return false;
917
+ }
918
+ const existing_validityPeriodTerm = existing.validityPeriodTerm;
919
+ const incoming_validityPeriodTerm = incoming.validityPeriodTerm;
920
+ if (!(existing_validityPeriodTerm === incoming_validityPeriodTerm)) {
921
+ return false;
922
+ }
923
+ const existing_validityPeriodUnit = existing.validityPeriodUnit;
924
+ const incoming_validityPeriodUnit = incoming.validityPeriodUnit;
925
+ if (!(existing_validityPeriodUnit === incoming_validityPeriodUnit)) {
926
+ return false;
927
+ }
928
+ return true;
929
+ }
930
+
931
+ const VERSION$b = "acaecc54e4457dd62382644206c35637";
932
+ function validate$b(obj, path = 'ResourcePolicyDetailOutputRepresentation') {
933
+ const v_error = (() => {
934
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
935
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
936
+ }
937
+ if (obj.id !== undefined) {
938
+ const obj_id = obj.id;
939
+ const path_id = path + '.id';
940
+ let obj_id_union0 = null;
941
+ const obj_id_union0_error = (() => {
942
+ if (typeof obj_id !== 'string') {
943
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
944
+ }
945
+ })();
946
+ if (obj_id_union0_error != null) {
947
+ obj_id_union0 = obj_id_union0_error.message;
948
+ }
949
+ let obj_id_union1 = null;
950
+ const obj_id_union1_error = (() => {
951
+ if (obj_id !== null) {
952
+ return new TypeError('Expected "null" but received "' + typeof obj_id + '" (at "' + path_id + '")');
953
+ }
954
+ })();
955
+ if (obj_id_union1_error != null) {
956
+ obj_id_union1 = obj_id_union1_error.message;
957
+ }
958
+ if (obj_id_union0 && obj_id_union1) {
959
+ let message = 'Object doesn\'t match union (at "' + path_id + '")';
960
+ message += '\n' + obj_id_union0.split('\n').map((line) => '\t' + line).join('\n');
961
+ message += '\n' + obj_id_union1.split('\n').map((line) => '\t' + line).join('\n');
962
+ return new TypeError(message);
963
+ }
964
+ }
965
+ const obj_ratingFrequencyPolicy = obj.ratingFrequencyPolicy;
966
+ const path_ratingFrequencyPolicy = path + '.ratingFrequencyPolicy';
967
+ let obj_ratingFrequencyPolicy_union0 = null;
968
+ const obj_ratingFrequencyPolicy_union0_error = (() => {
969
+ const referencepath_ratingFrequencyPolicyValidationError = validate$d(obj_ratingFrequencyPolicy, path_ratingFrequencyPolicy);
970
+ if (referencepath_ratingFrequencyPolicyValidationError !== null) {
971
+ let message = 'Object doesn\'t match PolicyDetailOutputRepresentation (at "' + path_ratingFrequencyPolicy + '")\n';
972
+ message += referencepath_ratingFrequencyPolicyValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
973
+ return new TypeError(message);
974
+ }
975
+ })();
976
+ if (obj_ratingFrequencyPolicy_union0_error != null) {
977
+ obj_ratingFrequencyPolicy_union0 = obj_ratingFrequencyPolicy_union0_error.message;
978
+ }
979
+ let obj_ratingFrequencyPolicy_union1 = null;
980
+ const obj_ratingFrequencyPolicy_union1_error = (() => {
981
+ if (obj_ratingFrequencyPolicy !== null) {
982
+ return new TypeError('Expected "null" but received "' + typeof obj_ratingFrequencyPolicy + '" (at "' + path_ratingFrequencyPolicy + '")');
983
+ }
984
+ })();
985
+ if (obj_ratingFrequencyPolicy_union1_error != null) {
986
+ obj_ratingFrequencyPolicy_union1 = obj_ratingFrequencyPolicy_union1_error.message;
987
+ }
988
+ if (obj_ratingFrequencyPolicy_union0 && obj_ratingFrequencyPolicy_union1) {
989
+ let message = 'Object doesn\'t match union (at "' + path_ratingFrequencyPolicy + '")';
990
+ message += '\n' + obj_ratingFrequencyPolicy_union0.split('\n').map((line) => '\t' + line).join('\n');
991
+ message += '\n' + obj_ratingFrequencyPolicy_union1.split('\n').map((line) => '\t' + line).join('\n');
992
+ return new TypeError(message);
993
+ }
994
+ const obj_usageAggregationPolicy = obj.usageAggregationPolicy;
995
+ const path_usageAggregationPolicy = path + '.usageAggregationPolicy';
996
+ let obj_usageAggregationPolicy_union0 = null;
997
+ const obj_usageAggregationPolicy_union0_error = (() => {
998
+ const referencepath_usageAggregationPolicyValidationError = validate$d(obj_usageAggregationPolicy, path_usageAggregationPolicy);
999
+ if (referencepath_usageAggregationPolicyValidationError !== null) {
1000
+ let message = 'Object doesn\'t match PolicyDetailOutputRepresentation (at "' + path_usageAggregationPolicy + '")\n';
1001
+ message += referencepath_usageAggregationPolicyValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1002
+ return new TypeError(message);
1003
+ }
1004
+ })();
1005
+ if (obj_usageAggregationPolicy_union0_error != null) {
1006
+ obj_usageAggregationPolicy_union0 = obj_usageAggregationPolicy_union0_error.message;
1007
+ }
1008
+ let obj_usageAggregationPolicy_union1 = null;
1009
+ const obj_usageAggregationPolicy_union1_error = (() => {
1010
+ if (obj_usageAggregationPolicy !== null) {
1011
+ return new TypeError('Expected "null" but received "' + typeof obj_usageAggregationPolicy + '" (at "' + path_usageAggregationPolicy + '")');
1012
+ }
1013
+ })();
1014
+ if (obj_usageAggregationPolicy_union1_error != null) {
1015
+ obj_usageAggregationPolicy_union1 = obj_usageAggregationPolicy_union1_error.message;
1016
+ }
1017
+ if (obj_usageAggregationPolicy_union0 && obj_usageAggregationPolicy_union1) {
1018
+ let message = 'Object doesn\'t match union (at "' + path_usageAggregationPolicy + '")';
1019
+ message += '\n' + obj_usageAggregationPolicy_union0.split('\n').map((line) => '\t' + line).join('\n');
1020
+ message += '\n' + obj_usageAggregationPolicy_union1.split('\n').map((line) => '\t' + line).join('\n');
1021
+ return new TypeError(message);
1022
+ }
1023
+ const obj_usageCommitmentPolicy = obj.usageCommitmentPolicy;
1024
+ const path_usageCommitmentPolicy = path + '.usageCommitmentPolicy';
1025
+ let obj_usageCommitmentPolicy_union0 = null;
1026
+ const obj_usageCommitmentPolicy_union0_error = (() => {
1027
+ const referencepath_usageCommitmentPolicyValidationError = validate$d(obj_usageCommitmentPolicy, path_usageCommitmentPolicy);
1028
+ if (referencepath_usageCommitmentPolicyValidationError !== null) {
1029
+ let message = 'Object doesn\'t match PolicyDetailOutputRepresentation (at "' + path_usageCommitmentPolicy + '")\n';
1030
+ message += referencepath_usageCommitmentPolicyValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1031
+ return new TypeError(message);
1032
+ }
1033
+ })();
1034
+ if (obj_usageCommitmentPolicy_union0_error != null) {
1035
+ obj_usageCommitmentPolicy_union0 = obj_usageCommitmentPolicy_union0_error.message;
1036
+ }
1037
+ let obj_usageCommitmentPolicy_union1 = null;
1038
+ const obj_usageCommitmentPolicy_union1_error = (() => {
1039
+ if (obj_usageCommitmentPolicy !== null) {
1040
+ return new TypeError('Expected "null" but received "' + typeof obj_usageCommitmentPolicy + '" (at "' + path_usageCommitmentPolicy + '")');
1041
+ }
1042
+ })();
1043
+ if (obj_usageCommitmentPolicy_union1_error != null) {
1044
+ obj_usageCommitmentPolicy_union1 = obj_usageCommitmentPolicy_union1_error.message;
1045
+ }
1046
+ if (obj_usageCommitmentPolicy_union0 && obj_usageCommitmentPolicy_union1) {
1047
+ let message = 'Object doesn\'t match union (at "' + path_usageCommitmentPolicy + '")';
1048
+ message += '\n' + obj_usageCommitmentPolicy_union0.split('\n').map((line) => '\t' + line).join('\n');
1049
+ message += '\n' + obj_usageCommitmentPolicy_union1.split('\n').map((line) => '\t' + line).join('\n');
1050
+ return new TypeError(message);
1051
+ }
1052
+ const obj_usageOveragePolicy = obj.usageOveragePolicy;
1053
+ const path_usageOveragePolicy = path + '.usageOveragePolicy';
1054
+ let obj_usageOveragePolicy_union0 = null;
1055
+ const obj_usageOveragePolicy_union0_error = (() => {
1056
+ const referencepath_usageOveragePolicyValidationError = validate$d(obj_usageOveragePolicy, path_usageOveragePolicy);
1057
+ if (referencepath_usageOveragePolicyValidationError !== null) {
1058
+ let message = 'Object doesn\'t match PolicyDetailOutputRepresentation (at "' + path_usageOveragePolicy + '")\n';
1059
+ message += referencepath_usageOveragePolicyValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1060
+ return new TypeError(message);
1061
+ }
1062
+ })();
1063
+ if (obj_usageOveragePolicy_union0_error != null) {
1064
+ obj_usageOveragePolicy_union0 = obj_usageOveragePolicy_union0_error.message;
1065
+ }
1066
+ let obj_usageOveragePolicy_union1 = null;
1067
+ const obj_usageOveragePolicy_union1_error = (() => {
1068
+ if (obj_usageOveragePolicy !== null) {
1069
+ return new TypeError('Expected "null" but received "' + typeof obj_usageOveragePolicy + '" (at "' + path_usageOveragePolicy + '")');
1070
+ }
1071
+ })();
1072
+ if (obj_usageOveragePolicy_union1_error != null) {
1073
+ obj_usageOveragePolicy_union1 = obj_usageOveragePolicy_union1_error.message;
1074
+ }
1075
+ if (obj_usageOveragePolicy_union0 && obj_usageOveragePolicy_union1) {
1076
+ let message = 'Object doesn\'t match union (at "' + path_usageOveragePolicy + '")';
1077
+ message += '\n' + obj_usageOveragePolicy_union0.split('\n').map((line) => '\t' + line).join('\n');
1078
+ message += '\n' + obj_usageOveragePolicy_union1.split('\n').map((line) => '\t' + line).join('\n');
1079
+ return new TypeError(message);
1080
+ }
1081
+ })();
1082
+ return v_error === undefined ? null : v_error;
1083
+ }
1084
+ const select$f = function ResourcePolicyDetailOutputRepresentationSelect() {
1085
+ const { selections: PolicyDetailOutputRepresentation__selections, opaque: PolicyDetailOutputRepresentation__opaque, } = select$h();
1086
+ return {
1087
+ kind: 'Fragment',
1088
+ version: VERSION$b,
1089
+ private: [],
1090
+ selections: [
1091
+ {
1092
+ name: 'id',
1093
+ kind: 'Scalar',
1094
+ required: false
1095
+ },
1096
+ {
1097
+ name: 'ratingFrequencyPolicy',
1098
+ kind: 'Object',
1099
+ nullable: true,
1100
+ selections: PolicyDetailOutputRepresentation__selections
1101
+ },
1102
+ {
1103
+ name: 'usageAggregationPolicy',
1104
+ kind: 'Object',
1105
+ nullable: true,
1106
+ selections: PolicyDetailOutputRepresentation__selections
1107
+ },
1108
+ {
1109
+ name: 'usageCommitmentPolicy',
1110
+ kind: 'Object',
1111
+ nullable: true,
1112
+ selections: PolicyDetailOutputRepresentation__selections
1113
+ },
1114
+ {
1115
+ name: 'usageOveragePolicy',
1116
+ kind: 'Object',
1117
+ nullable: true,
1118
+ selections: PolicyDetailOutputRepresentation__selections
1119
+ }
1120
+ ]
1121
+ };
1122
+ };
1123
+ function equals$b(existing, incoming) {
1124
+ const existing_id = existing.id;
1125
+ const incoming_id = incoming.id;
1126
+ // if at least one of these optionals is defined
1127
+ if (existing_id !== undefined || incoming_id !== undefined) {
1128
+ // if one of these is not defined we know the other is defined and therefore
1129
+ // not equal
1130
+ if (existing_id === undefined || incoming_id === undefined) {
1131
+ return false;
1132
+ }
1133
+ if (!(existing_id === incoming_id)) {
1134
+ return false;
1135
+ }
1136
+ }
1137
+ const existing_ratingFrequencyPolicy = existing.ratingFrequencyPolicy;
1138
+ const incoming_ratingFrequencyPolicy = incoming.ratingFrequencyPolicy;
1139
+ if (!(existing_ratingFrequencyPolicy === incoming_ratingFrequencyPolicy
1140
+ || (existing_ratingFrequencyPolicy != null &&
1141
+ incoming_ratingFrequencyPolicy != null &&
1142
+ equals$d(existing_ratingFrequencyPolicy, incoming_ratingFrequencyPolicy)))) {
1143
+ return false;
1144
+ }
1145
+ const existing_usageAggregationPolicy = existing.usageAggregationPolicy;
1146
+ const incoming_usageAggregationPolicy = incoming.usageAggregationPolicy;
1147
+ if (!(existing_usageAggregationPolicy === incoming_usageAggregationPolicy
1148
+ || (existing_usageAggregationPolicy != null &&
1149
+ incoming_usageAggregationPolicy != null &&
1150
+ equals$d(existing_usageAggregationPolicy, incoming_usageAggregationPolicy)))) {
1151
+ return false;
1152
+ }
1153
+ const existing_usageCommitmentPolicy = existing.usageCommitmentPolicy;
1154
+ const incoming_usageCommitmentPolicy = incoming.usageCommitmentPolicy;
1155
+ if (!(existing_usageCommitmentPolicy === incoming_usageCommitmentPolicy
1156
+ || (existing_usageCommitmentPolicy != null &&
1157
+ incoming_usageCommitmentPolicy != null &&
1158
+ equals$d(existing_usageCommitmentPolicy, incoming_usageCommitmentPolicy)))) {
1159
+ return false;
1160
+ }
1161
+ const existing_usageOveragePolicy = existing.usageOveragePolicy;
1162
+ const incoming_usageOveragePolicy = incoming.usageOveragePolicy;
1163
+ if (!(existing_usageOveragePolicy === incoming_usageOveragePolicy
1164
+ || (existing_usageOveragePolicy != null &&
1165
+ incoming_usageOveragePolicy != null &&
1166
+ equals$d(existing_usageOveragePolicy, incoming_usageOveragePolicy)))) {
1167
+ return false;
1168
+ }
1169
+ return true;
1170
+ }
1171
+
1172
+ const VERSION$a = "b89882d349b55468ea9c26a4b5cf2ea1";
1173
+ function validate$a(obj, path = 'UsageResourceGrantAndPolicyDetailOutputRepresentation') {
1174
+ const v_error = (() => {
1175
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1176
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1177
+ }
1178
+ if (obj.grantDetail !== undefined) {
1179
+ const obj_grantDetail = obj.grantDetail;
1180
+ const path_grantDetail = path + '.grantDetail';
1181
+ const referencepath_grantDetailValidationError = validate$c(obj_grantDetail, path_grantDetail);
1182
+ if (referencepath_grantDetailValidationError !== null) {
1183
+ let message = 'Object doesn\'t match NegotiatedGrantDetailOutputRepresentation (at "' + path_grantDetail + '")\n';
1184
+ message += referencepath_grantDetailValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1185
+ return new TypeError(message);
1186
+ }
1187
+ }
1188
+ if (obj.negotiatedGrantDetail !== undefined) {
1189
+ const obj_negotiatedGrantDetail = obj.negotiatedGrantDetail;
1190
+ const path_negotiatedGrantDetail = path + '.negotiatedGrantDetail';
1191
+ const referencepath_negotiatedGrantDetailValidationError = validate$c(obj_negotiatedGrantDetail, path_negotiatedGrantDetail);
1192
+ if (referencepath_negotiatedGrantDetailValidationError !== null) {
1193
+ let message = 'Object doesn\'t match NegotiatedGrantDetailOutputRepresentation (at "' + path_negotiatedGrantDetail + '")\n';
1194
+ message += referencepath_negotiatedGrantDetailValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1195
+ return new TypeError(message);
1196
+ }
1197
+ }
1198
+ if (obj.negotiatedResourcePolicyDetail !== undefined) {
1199
+ const obj_negotiatedResourcePolicyDetail = obj.negotiatedResourcePolicyDetail;
1200
+ const path_negotiatedResourcePolicyDetail = path + '.negotiatedResourcePolicyDetail';
1201
+ const referencepath_negotiatedResourcePolicyDetailValidationError = validate$b(obj_negotiatedResourcePolicyDetail, path_negotiatedResourcePolicyDetail);
1202
+ if (referencepath_negotiatedResourcePolicyDetailValidationError !== null) {
1203
+ let message = 'Object doesn\'t match ResourcePolicyDetailOutputRepresentation (at "' + path_negotiatedResourcePolicyDetail + '")\n';
1204
+ message += referencepath_negotiatedResourcePolicyDetailValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1205
+ return new TypeError(message);
1206
+ }
1207
+ }
1208
+ if (obj.resourcePolicyDetail !== undefined) {
1209
+ const obj_resourcePolicyDetail = obj.resourcePolicyDetail;
1210
+ const path_resourcePolicyDetail = path + '.resourcePolicyDetail';
1211
+ const referencepath_resourcePolicyDetailValidationError = validate$b(obj_resourcePolicyDetail, path_resourcePolicyDetail);
1212
+ if (referencepath_resourcePolicyDetailValidationError !== null) {
1213
+ let message = 'Object doesn\'t match ResourcePolicyDetailOutputRepresentation (at "' + path_resourcePolicyDetail + '")\n';
1214
+ message += referencepath_resourcePolicyDetailValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1215
+ return new TypeError(message);
1216
+ }
1217
+ }
1218
+ })();
1219
+ return v_error === undefined ? null : v_error;
1220
+ }
1221
+ const select$e = function UsageResourceGrantAndPolicyDetailOutputRepresentationSelect() {
1222
+ const { selections: NegotiatedGrantDetailOutputRepresentation__selections, opaque: NegotiatedGrantDetailOutputRepresentation__opaque, } = select$g();
1223
+ const { selections: ResourcePolicyDetailOutputRepresentation__selections, opaque: ResourcePolicyDetailOutputRepresentation__opaque, } = select$f();
1224
+ return {
1225
+ kind: 'Fragment',
1226
+ version: VERSION$a,
1227
+ private: [],
1228
+ selections: [
1229
+ {
1230
+ name: 'grantDetail',
1231
+ kind: 'Object',
1232
+ selections: NegotiatedGrantDetailOutputRepresentation__selections,
1233
+ required: false
1234
+ },
1235
+ {
1236
+ name: 'negotiatedGrantDetail',
1237
+ kind: 'Object',
1238
+ selections: NegotiatedGrantDetailOutputRepresentation__selections,
1239
+ required: false
1240
+ },
1241
+ {
1242
+ name: 'negotiatedResourcePolicyDetail',
1243
+ kind: 'Object',
1244
+ selections: ResourcePolicyDetailOutputRepresentation__selections,
1245
+ required: false
1246
+ },
1247
+ {
1248
+ name: 'resourcePolicyDetail',
1249
+ kind: 'Object',
1250
+ selections: ResourcePolicyDetailOutputRepresentation__selections,
1251
+ required: false
1252
+ }
1253
+ ]
1254
+ };
1255
+ };
1256
+ function equals$a(existing, incoming) {
1257
+ const existing_grantDetail = existing.grantDetail;
1258
+ const incoming_grantDetail = incoming.grantDetail;
1259
+ // if at least one of these optionals is defined
1260
+ if (existing_grantDetail !== undefined || incoming_grantDetail !== undefined) {
1261
+ // if one of these is not defined we know the other is defined and therefore
1262
+ // not equal
1263
+ if (existing_grantDetail === undefined || incoming_grantDetail === undefined) {
1264
+ return false;
1265
+ }
1266
+ if (!(equals$c(existing_grantDetail, incoming_grantDetail))) {
1267
+ return false;
1268
+ }
1269
+ }
1270
+ const existing_negotiatedGrantDetail = existing.negotiatedGrantDetail;
1271
+ const incoming_negotiatedGrantDetail = incoming.negotiatedGrantDetail;
1272
+ // if at least one of these optionals is defined
1273
+ if (existing_negotiatedGrantDetail !== undefined || incoming_negotiatedGrantDetail !== undefined) {
1274
+ // if one of these is not defined we know the other is defined and therefore
1275
+ // not equal
1276
+ if (existing_negotiatedGrantDetail === undefined || incoming_negotiatedGrantDetail === undefined) {
1277
+ return false;
1278
+ }
1279
+ if (!(equals$c(existing_negotiatedGrantDetail, incoming_negotiatedGrantDetail))) {
1280
+ return false;
1281
+ }
1282
+ }
1283
+ const existing_negotiatedResourcePolicyDetail = existing.negotiatedResourcePolicyDetail;
1284
+ const incoming_negotiatedResourcePolicyDetail = incoming.negotiatedResourcePolicyDetail;
1285
+ // if at least one of these optionals is defined
1286
+ if (existing_negotiatedResourcePolicyDetail !== undefined || incoming_negotiatedResourcePolicyDetail !== undefined) {
1287
+ // if one of these is not defined we know the other is defined and therefore
1288
+ // not equal
1289
+ if (existing_negotiatedResourcePolicyDetail === undefined || incoming_negotiatedResourcePolicyDetail === undefined) {
1290
+ return false;
1291
+ }
1292
+ if (!(equals$b(existing_negotiatedResourcePolicyDetail, incoming_negotiatedResourcePolicyDetail))) {
1293
+ return false;
1294
+ }
1295
+ }
1296
+ const existing_resourcePolicyDetail = existing.resourcePolicyDetail;
1297
+ const incoming_resourcePolicyDetail = incoming.resourcePolicyDetail;
1298
+ // if at least one of these optionals is defined
1299
+ if (existing_resourcePolicyDetail !== undefined || incoming_resourcePolicyDetail !== undefined) {
1300
+ // if one of these is not defined we know the other is defined and therefore
1301
+ // not equal
1302
+ if (existing_resourcePolicyDetail === undefined || incoming_resourcePolicyDetail === undefined) {
1303
+ return false;
1304
+ }
1305
+ if (!(equals$b(existing_resourcePolicyDetail, incoming_resourcePolicyDetail))) {
1306
+ return false;
1307
+ }
1308
+ }
1309
+ return true;
1310
+ }
1311
+
1312
+ const VERSION$9 = "a399d4f31b7dcae001794cce64c40be8";
1313
+ function validate$9(obj, path = 'RateCardEntryOutputRepresentation') {
1314
+ const v_error = (() => {
1315
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1316
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1317
+ }
1318
+ if (obj.bindingInstanceTargetType !== undefined) {
1319
+ const obj_bindingInstanceTargetType = obj.bindingInstanceTargetType;
1320
+ const path_bindingInstanceTargetType = path + '.bindingInstanceTargetType';
1321
+ let obj_bindingInstanceTargetType_union0 = null;
1322
+ const obj_bindingInstanceTargetType_union0_error = (() => {
1323
+ if (typeof obj_bindingInstanceTargetType !== 'string') {
1324
+ return new TypeError('Expected "string" but received "' + typeof obj_bindingInstanceTargetType + '" (at "' + path_bindingInstanceTargetType + '")');
1325
+ }
1326
+ })();
1327
+ if (obj_bindingInstanceTargetType_union0_error != null) {
1328
+ obj_bindingInstanceTargetType_union0 = obj_bindingInstanceTargetType_union0_error.message;
1329
+ }
1330
+ let obj_bindingInstanceTargetType_union1 = null;
1331
+ const obj_bindingInstanceTargetType_union1_error = (() => {
1332
+ if (obj_bindingInstanceTargetType !== null) {
1333
+ return new TypeError('Expected "null" but received "' + typeof obj_bindingInstanceTargetType + '" (at "' + path_bindingInstanceTargetType + '")');
1334
+ }
1335
+ })();
1336
+ if (obj_bindingInstanceTargetType_union1_error != null) {
1337
+ obj_bindingInstanceTargetType_union1 = obj_bindingInstanceTargetType_union1_error.message;
1338
+ }
1339
+ if (obj_bindingInstanceTargetType_union0 && obj_bindingInstanceTargetType_union1) {
1340
+ let message = 'Object doesn\'t match union (at "' + path_bindingInstanceTargetType + '")';
1341
+ message += '\n' + obj_bindingInstanceTargetType_union0.split('\n').map((line) => '\t' + line).join('\n');
1342
+ message += '\n' + obj_bindingInstanceTargetType_union1.split('\n').map((line) => '\t' + line).join('\n');
1343
+ return new TypeError(message);
1344
+ }
1345
+ }
1346
+ if (obj.bindingInstanceType !== undefined) {
1347
+ const obj_bindingInstanceType = obj.bindingInstanceType;
1348
+ const path_bindingInstanceType = path + '.bindingInstanceType';
1349
+ let obj_bindingInstanceType_union0 = null;
1350
+ const obj_bindingInstanceType_union0_error = (() => {
1351
+ if (typeof obj_bindingInstanceType !== 'string') {
1352
+ return new TypeError('Expected "string" but received "' + typeof obj_bindingInstanceType + '" (at "' + path_bindingInstanceType + '")');
1353
+ }
1354
+ })();
1355
+ if (obj_bindingInstanceType_union0_error != null) {
1356
+ obj_bindingInstanceType_union0 = obj_bindingInstanceType_union0_error.message;
1357
+ }
1358
+ let obj_bindingInstanceType_union1 = null;
1359
+ const obj_bindingInstanceType_union1_error = (() => {
1360
+ if (obj_bindingInstanceType !== null) {
1361
+ return new TypeError('Expected "null" but received "' + typeof obj_bindingInstanceType + '" (at "' + path_bindingInstanceType + '")');
1362
+ }
1363
+ })();
1364
+ if (obj_bindingInstanceType_union1_error != null) {
1365
+ obj_bindingInstanceType_union1 = obj_bindingInstanceType_union1_error.message;
1366
+ }
1367
+ if (obj_bindingInstanceType_union0 && obj_bindingInstanceType_union1) {
1368
+ let message = 'Object doesn\'t match union (at "' + path_bindingInstanceType + '")';
1369
+ message += '\n' + obj_bindingInstanceType_union0.split('\n').map((line) => '\t' + line).join('\n');
1370
+ message += '\n' + obj_bindingInstanceType_union1.split('\n').map((line) => '\t' + line).join('\n');
1371
+ return new TypeError(message);
1372
+ }
1373
+ }
1374
+ const obj_chargeForOverages = obj.chargeForOverages;
1375
+ const path_chargeForOverages = path + '.chargeForOverages';
1376
+ let obj_chargeForOverages_union0 = null;
1377
+ const obj_chargeForOverages_union0_error = (() => {
1378
+ if (typeof obj_chargeForOverages !== 'string') {
1379
+ return new TypeError('Expected "string" but received "' + typeof obj_chargeForOverages + '" (at "' + path_chargeForOverages + '")');
1380
+ }
1381
+ })();
1382
+ if (obj_chargeForOverages_union0_error != null) {
1383
+ obj_chargeForOverages_union0 = obj_chargeForOverages_union0_error.message;
1384
+ }
1385
+ let obj_chargeForOverages_union1 = null;
1386
+ const obj_chargeForOverages_union1_error = (() => {
1387
+ if (obj_chargeForOverages !== null) {
1388
+ return new TypeError('Expected "null" but received "' + typeof obj_chargeForOverages + '" (at "' + path_chargeForOverages + '")');
1389
+ }
1390
+ })();
1391
+ if (obj_chargeForOverages_union1_error != null) {
1392
+ obj_chargeForOverages_union1 = obj_chargeForOverages_union1_error.message;
1393
+ }
1394
+ if (obj_chargeForOverages_union0 && obj_chargeForOverages_union1) {
1395
+ let message = 'Object doesn\'t match union (at "' + path_chargeForOverages + '")';
1396
+ message += '\n' + obj_chargeForOverages_union0.split('\n').map((line) => '\t' + line).join('\n');
1397
+ message += '\n' + obj_chargeForOverages_union1.split('\n').map((line) => '\t' + line).join('\n');
1398
+ return new TypeError(message);
1399
+ }
1400
+ if (obj.fields !== undefined) {
1401
+ const obj_fields = obj.fields;
1402
+ const path_fields = path + '.fields';
1403
+ if (typeof obj_fields !== 'object' || ArrayIsArray(obj_fields) || obj_fields === null) {
1404
+ return new TypeError('Expected "object" but received "' + typeof obj_fields + '" (at "' + path_fields + '")');
1405
+ }
1406
+ const obj_fields_keys = ObjectKeys(obj_fields);
1407
+ for (let i = 0; i < obj_fields_keys.length; i++) {
1408
+ const key = obj_fields_keys[i];
1409
+ const obj_fields_prop = obj_fields[key];
1410
+ const path_fields_prop = path_fields + '["' + key + '"]';
1411
+ if (obj_fields_prop === undefined) {
1412
+ return new TypeError('Expected "defined" but received "' + typeof obj_fields_prop + '" (at "' + path_fields_prop + '")');
1413
+ }
1414
+ }
1415
+ }
1416
+ if (obj.isOptional !== undefined) {
1417
+ const obj_isOptional = obj.isOptional;
1418
+ const path_isOptional = path + '.isOptional';
1419
+ let obj_isOptional_union0 = null;
1420
+ const obj_isOptional_union0_error = (() => {
1421
+ if (typeof obj_isOptional !== 'boolean') {
1422
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isOptional + '" (at "' + path_isOptional + '")');
1423
+ }
1424
+ })();
1425
+ if (obj_isOptional_union0_error != null) {
1426
+ obj_isOptional_union0 = obj_isOptional_union0_error.message;
1427
+ }
1428
+ let obj_isOptional_union1 = null;
1429
+ const obj_isOptional_union1_error = (() => {
1430
+ if (obj_isOptional !== null) {
1431
+ return new TypeError('Expected "null" but received "' + typeof obj_isOptional + '" (at "' + path_isOptional + '")');
1432
+ }
1433
+ })();
1434
+ if (obj_isOptional_union1_error != null) {
1435
+ obj_isOptional_union1 = obj_isOptional_union1_error.message;
1436
+ }
1437
+ if (obj_isOptional_union0 && obj_isOptional_union1) {
1438
+ let message = 'Object doesn\'t match union (at "' + path_isOptional + '")';
1439
+ message += '\n' + obj_isOptional_union0.split('\n').map((line) => '\t' + line).join('\n');
1440
+ message += '\n' + obj_isOptional_union1.split('\n').map((line) => '\t' + line).join('\n');
1441
+ return new TypeError(message);
1442
+ }
1443
+ }
1444
+ const obj_name = obj.name;
1445
+ const path_name = path + '.name';
1446
+ let obj_name_union0 = null;
1447
+ const obj_name_union0_error = (() => {
1448
+ if (typeof obj_name !== 'string') {
1449
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
1450
+ }
1451
+ })();
1452
+ if (obj_name_union0_error != null) {
1453
+ obj_name_union0 = obj_name_union0_error.message;
1454
+ }
1455
+ let obj_name_union1 = null;
1456
+ const obj_name_union1_error = (() => {
1457
+ if (obj_name !== null) {
1458
+ return new TypeError('Expected "null" but received "' + typeof obj_name + '" (at "' + path_name + '")');
1459
+ }
1460
+ })();
1461
+ if (obj_name_union1_error != null) {
1462
+ obj_name_union1 = obj_name_union1_error.message;
1463
+ }
1464
+ if (obj_name_union0 && obj_name_union1) {
1465
+ let message = 'Object doesn\'t match union (at "' + path_name + '")';
1466
+ message += '\n' + obj_name_union0.split('\n').map((line) => '\t' + line).join('\n');
1467
+ message += '\n' + obj_name_union1.split('\n').map((line) => '\t' + line).join('\n');
1468
+ return new TypeError(message);
1469
+ }
1470
+ const obj_negotiable = obj.negotiable;
1471
+ const path_negotiable = path + '.negotiable';
1472
+ let obj_negotiable_union0 = null;
1473
+ const obj_negotiable_union0_error = (() => {
1474
+ if (typeof obj_negotiable !== 'string') {
1475
+ return new TypeError('Expected "string" but received "' + typeof obj_negotiable + '" (at "' + path_negotiable + '")');
1476
+ }
1477
+ })();
1478
+ if (obj_negotiable_union0_error != null) {
1479
+ obj_negotiable_union0 = obj_negotiable_union0_error.message;
1480
+ }
1481
+ let obj_negotiable_union1 = null;
1482
+ const obj_negotiable_union1_error = (() => {
1483
+ if (obj_negotiable !== null) {
1484
+ return new TypeError('Expected "null" but received "' + typeof obj_negotiable + '" (at "' + path_negotiable + '")');
1485
+ }
1486
+ })();
1487
+ if (obj_negotiable_union1_error != null) {
1488
+ obj_negotiable_union1 = obj_negotiable_union1_error.message;
1489
+ }
1490
+ if (obj_negotiable_union0 && obj_negotiable_union1) {
1491
+ let message = 'Object doesn\'t match union (at "' + path_negotiable + '")';
1492
+ message += '\n' + obj_negotiable_union0.split('\n').map((line) => '\t' + line).join('\n');
1493
+ message += '\n' + obj_negotiable_union1.split('\n').map((line) => '\t' + line).join('\n');
1494
+ return new TypeError(message);
1495
+ }
1496
+ const obj_negotiatedRate = obj.negotiatedRate;
1497
+ const path_negotiatedRate = path + '.negotiatedRate';
1498
+ let obj_negotiatedRate_union0 = null;
1499
+ const obj_negotiatedRate_union0_error = (() => {
1500
+ if (typeof obj_negotiatedRate !== 'number') {
1501
+ return new TypeError('Expected "number" but received "' + typeof obj_negotiatedRate + '" (at "' + path_negotiatedRate + '")');
1502
+ }
1503
+ })();
1504
+ if (obj_negotiatedRate_union0_error != null) {
1505
+ obj_negotiatedRate_union0 = obj_negotiatedRate_union0_error.message;
1506
+ }
1507
+ let obj_negotiatedRate_union1 = null;
1508
+ const obj_negotiatedRate_union1_error = (() => {
1509
+ if (obj_negotiatedRate !== null) {
1510
+ return new TypeError('Expected "null" but received "' + typeof obj_negotiatedRate + '" (at "' + path_negotiatedRate + '")');
1511
+ }
1512
+ })();
1513
+ if (obj_negotiatedRate_union1_error != null) {
1514
+ obj_negotiatedRate_union1 = obj_negotiatedRate_union1_error.message;
1515
+ }
1516
+ if (obj_negotiatedRate_union0 && obj_negotiatedRate_union1) {
1517
+ let message = 'Object doesn\'t match union (at "' + path_negotiatedRate + '")';
1518
+ message += '\n' + obj_negotiatedRate_union0.split('\n').map((line) => '\t' + line).join('\n');
1519
+ message += '\n' + obj_negotiatedRate_union1.split('\n').map((line) => '\t' + line).join('\n');
1520
+ return new TypeError(message);
1521
+ }
1522
+ const obj_negotiatedRateCardEntryId = obj.negotiatedRateCardEntryId;
1523
+ const path_negotiatedRateCardEntryId = path + '.negotiatedRateCardEntryId';
1524
+ let obj_negotiatedRateCardEntryId_union0 = null;
1525
+ const obj_negotiatedRateCardEntryId_union0_error = (() => {
1526
+ if (typeof obj_negotiatedRateCardEntryId !== 'string') {
1527
+ return new TypeError('Expected "string" but received "' + typeof obj_negotiatedRateCardEntryId + '" (at "' + path_negotiatedRateCardEntryId + '")');
1528
+ }
1529
+ })();
1530
+ if (obj_negotiatedRateCardEntryId_union0_error != null) {
1531
+ obj_negotiatedRateCardEntryId_union0 = obj_negotiatedRateCardEntryId_union0_error.message;
1532
+ }
1533
+ let obj_negotiatedRateCardEntryId_union1 = null;
1534
+ const obj_negotiatedRateCardEntryId_union1_error = (() => {
1535
+ if (obj_negotiatedRateCardEntryId !== null) {
1536
+ return new TypeError('Expected "null" but received "' + typeof obj_negotiatedRateCardEntryId + '" (at "' + path_negotiatedRateCardEntryId + '")');
1537
+ }
1538
+ })();
1539
+ if (obj_negotiatedRateCardEntryId_union1_error != null) {
1540
+ obj_negotiatedRateCardEntryId_union1 = obj_negotiatedRateCardEntryId_union1_error.message;
1541
+ }
1542
+ if (obj_negotiatedRateCardEntryId_union0 && obj_negotiatedRateCardEntryId_union1) {
1543
+ let message = 'Object doesn\'t match union (at "' + path_negotiatedRateCardEntryId + '")';
1544
+ message += '\n' + obj_negotiatedRateCardEntryId_union0.split('\n').map((line) => '\t' + line).join('\n');
1545
+ message += '\n' + obj_negotiatedRateCardEntryId_union1.split('\n').map((line) => '\t' + line).join('\n');
1546
+ return new TypeError(message);
1547
+ }
1548
+ const obj_quantity = obj.quantity;
1549
+ const path_quantity = path + '.quantity';
1550
+ let obj_quantity_union0 = null;
1551
+ const obj_quantity_union0_error = (() => {
1552
+ if (typeof obj_quantity !== 'number') {
1553
+ return new TypeError('Expected "number" but received "' + typeof obj_quantity + '" (at "' + path_quantity + '")');
1554
+ }
1555
+ })();
1556
+ if (obj_quantity_union0_error != null) {
1557
+ obj_quantity_union0 = obj_quantity_union0_error.message;
1558
+ }
1559
+ let obj_quantity_union1 = null;
1560
+ const obj_quantity_union1_error = (() => {
1561
+ if (obj_quantity !== null) {
1562
+ return new TypeError('Expected "null" but received "' + typeof obj_quantity + '" (at "' + path_quantity + '")');
1563
+ }
1564
+ })();
1565
+ if (obj_quantity_union1_error != null) {
1566
+ obj_quantity_union1 = obj_quantity_union1_error.message;
1567
+ }
1568
+ if (obj_quantity_union0 && obj_quantity_union1) {
1569
+ let message = 'Object doesn\'t match union (at "' + path_quantity + '")';
1570
+ message += '\n' + obj_quantity_union0.split('\n').map((line) => '\t' + line).join('\n');
1571
+ message += '\n' + obj_quantity_union1.split('\n').map((line) => '\t' + line).join('\n');
1572
+ return new TypeError(message);
1573
+ }
1574
+ const obj_rate = obj.rate;
1575
+ const path_rate = path + '.rate';
1576
+ let obj_rate_union0 = null;
1577
+ const obj_rate_union0_error = (() => {
1578
+ if (typeof obj_rate !== 'number') {
1579
+ return new TypeError('Expected "number" but received "' + typeof obj_rate + '" (at "' + path_rate + '")');
1580
+ }
1581
+ })();
1582
+ if (obj_rate_union0_error != null) {
1583
+ obj_rate_union0 = obj_rate_union0_error.message;
1584
+ }
1585
+ let obj_rate_union1 = null;
1586
+ const obj_rate_union1_error = (() => {
1587
+ if (obj_rate !== null) {
1588
+ return new TypeError('Expected "null" but received "' + typeof obj_rate + '" (at "' + path_rate + '")');
1589
+ }
1590
+ })();
1591
+ if (obj_rate_union1_error != null) {
1592
+ obj_rate_union1 = obj_rate_union1_error.message;
1593
+ }
1594
+ if (obj_rate_union0 && obj_rate_union1) {
1595
+ let message = 'Object doesn\'t match union (at "' + path_rate + '")';
1596
+ message += '\n' + obj_rate_union0.split('\n').map((line) => '\t' + line).join('\n');
1597
+ message += '\n' + obj_rate_union1.split('\n').map((line) => '\t' + line).join('\n');
1598
+ return new TypeError(message);
1599
+ }
1600
+ const obj_rateAdjustments = obj.rateAdjustments;
1601
+ const path_rateAdjustments = path + '.rateAdjustments';
1602
+ if (!ArrayIsArray(obj_rateAdjustments)) {
1603
+ return new TypeError('Expected "array" but received "' + typeof obj_rateAdjustments + '" (at "' + path_rateAdjustments + '")');
1604
+ }
1605
+ for (let i = 0; i < obj_rateAdjustments.length; i++) {
1606
+ const obj_rateAdjustments_item = obj_rateAdjustments[i];
1607
+ const path_rateAdjustments_item = path_rateAdjustments + '[' + i + ']';
1608
+ let obj_rateAdjustments_item_union0 = null;
1609
+ const obj_rateAdjustments_item_union0_error = (() => {
1610
+ const referencepath_rateAdjustments_itemValidationError = validate$e(obj_rateAdjustments_item, path_rateAdjustments_item);
1611
+ if (referencepath_rateAdjustments_itemValidationError !== null) {
1612
+ let message = 'Object doesn\'t match RateAdjustmentsOutputRepresentation (at "' + path_rateAdjustments_item + '")\n';
1613
+ message += referencepath_rateAdjustments_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1614
+ return new TypeError(message);
1615
+ }
1616
+ })();
1617
+ if (obj_rateAdjustments_item_union0_error != null) {
1618
+ obj_rateAdjustments_item_union0 = obj_rateAdjustments_item_union0_error.message;
1619
+ }
1620
+ let obj_rateAdjustments_item_union1 = null;
1621
+ const obj_rateAdjustments_item_union1_error = (() => {
1622
+ if (obj_rateAdjustments_item !== null) {
1623
+ return new TypeError('Expected "null" but received "' + typeof obj_rateAdjustments_item + '" (at "' + path_rateAdjustments_item + '")');
1624
+ }
1625
+ })();
1626
+ if (obj_rateAdjustments_item_union1_error != null) {
1627
+ obj_rateAdjustments_item_union1 = obj_rateAdjustments_item_union1_error.message;
1628
+ }
1629
+ if (obj_rateAdjustments_item_union0 && obj_rateAdjustments_item_union1) {
1630
+ let message = 'Object doesn\'t match union (at "' + path_rateAdjustments_item + '")';
1631
+ message += '\n' + obj_rateAdjustments_item_union0.split('\n').map((line) => '\t' + line).join('\n');
1632
+ message += '\n' + obj_rateAdjustments_item_union1.split('\n').map((line) => '\t' + line).join('\n');
1633
+ return new TypeError(message);
1634
+ }
1635
+ }
1636
+ const obj_rateCardEntryId = obj.rateCardEntryId;
1637
+ const path_rateCardEntryId = path + '.rateCardEntryId';
1638
+ if (typeof obj_rateCardEntryId !== 'string') {
1639
+ return new TypeError('Expected "string" but received "' + typeof obj_rateCardEntryId + '" (at "' + path_rateCardEntryId + '")');
1640
+ }
1641
+ const obj_rateUnitOfMeasureName = obj.rateUnitOfMeasureName;
1642
+ const path_rateUnitOfMeasureName = path + '.rateUnitOfMeasureName';
1643
+ let obj_rateUnitOfMeasureName_union0 = null;
1644
+ const obj_rateUnitOfMeasureName_union0_error = (() => {
1645
+ if (typeof obj_rateUnitOfMeasureName !== 'string') {
1646
+ return new TypeError('Expected "string" but received "' + typeof obj_rateUnitOfMeasureName + '" (at "' + path_rateUnitOfMeasureName + '")');
1647
+ }
1648
+ })();
1649
+ if (obj_rateUnitOfMeasureName_union0_error != null) {
1650
+ obj_rateUnitOfMeasureName_union0 = obj_rateUnitOfMeasureName_union0_error.message;
1651
+ }
1652
+ let obj_rateUnitOfMeasureName_union1 = null;
1653
+ const obj_rateUnitOfMeasureName_union1_error = (() => {
1654
+ if (obj_rateUnitOfMeasureName !== null) {
1655
+ return new TypeError('Expected "null" but received "' + typeof obj_rateUnitOfMeasureName + '" (at "' + path_rateUnitOfMeasureName + '")');
1656
+ }
1657
+ })();
1658
+ if (obj_rateUnitOfMeasureName_union1_error != null) {
1659
+ obj_rateUnitOfMeasureName_union1 = obj_rateUnitOfMeasureName_union1_error.message;
1660
+ }
1661
+ if (obj_rateUnitOfMeasureName_union0 && obj_rateUnitOfMeasureName_union1) {
1662
+ let message = 'Object doesn\'t match union (at "' + path_rateUnitOfMeasureName + '")';
1663
+ message += '\n' + obj_rateUnitOfMeasureName_union0.split('\n').map((line) => '\t' + line).join('\n');
1664
+ message += '\n' + obj_rateUnitOfMeasureName_union1.split('\n').map((line) => '\t' + line).join('\n');
1665
+ return new TypeError(message);
1666
+ }
1667
+ const obj_unitOfMeasure = obj.unitOfMeasure;
1668
+ const path_unitOfMeasure = path + '.unitOfMeasure';
1669
+ let obj_unitOfMeasure_union0 = null;
1670
+ const obj_unitOfMeasure_union0_error = (() => {
1671
+ if (typeof obj_unitOfMeasure !== 'string') {
1672
+ return new TypeError('Expected "string" but received "' + typeof obj_unitOfMeasure + '" (at "' + path_unitOfMeasure + '")');
1673
+ }
1674
+ })();
1675
+ if (obj_unitOfMeasure_union0_error != null) {
1676
+ obj_unitOfMeasure_union0 = obj_unitOfMeasure_union0_error.message;
1677
+ }
1678
+ let obj_unitOfMeasure_union1 = null;
1679
+ const obj_unitOfMeasure_union1_error = (() => {
1680
+ if (obj_unitOfMeasure !== null) {
1681
+ return new TypeError('Expected "null" but received "' + typeof obj_unitOfMeasure + '" (at "' + path_unitOfMeasure + '")');
1682
+ }
1683
+ })();
1684
+ if (obj_unitOfMeasure_union1_error != null) {
1685
+ obj_unitOfMeasure_union1 = obj_unitOfMeasure_union1_error.message;
1686
+ }
1687
+ if (obj_unitOfMeasure_union0 && obj_unitOfMeasure_union1) {
1688
+ let message = 'Object doesn\'t match union (at "' + path_unitOfMeasure + '")';
1689
+ message += '\n' + obj_unitOfMeasure_union0.split('\n').map((line) => '\t' + line).join('\n');
1690
+ message += '\n' + obj_unitOfMeasure_union1.split('\n').map((line) => '\t' + line).join('\n');
1691
+ return new TypeError(message);
1692
+ }
1693
+ const obj_unitOfMeasureCode = obj.unitOfMeasureCode;
1694
+ const path_unitOfMeasureCode = path + '.unitOfMeasureCode';
1695
+ let obj_unitOfMeasureCode_union0 = null;
1696
+ const obj_unitOfMeasureCode_union0_error = (() => {
1697
+ if (typeof obj_unitOfMeasureCode !== 'string') {
1698
+ return new TypeError('Expected "string" but received "' + typeof obj_unitOfMeasureCode + '" (at "' + path_unitOfMeasureCode + '")');
1699
+ }
1700
+ })();
1701
+ if (obj_unitOfMeasureCode_union0_error != null) {
1702
+ obj_unitOfMeasureCode_union0 = obj_unitOfMeasureCode_union0_error.message;
1703
+ }
1704
+ let obj_unitOfMeasureCode_union1 = null;
1705
+ const obj_unitOfMeasureCode_union1_error = (() => {
1706
+ if (obj_unitOfMeasureCode !== null) {
1707
+ return new TypeError('Expected "null" but received "' + typeof obj_unitOfMeasureCode + '" (at "' + path_unitOfMeasureCode + '")');
1708
+ }
1709
+ })();
1710
+ if (obj_unitOfMeasureCode_union1_error != null) {
1711
+ obj_unitOfMeasureCode_union1 = obj_unitOfMeasureCode_union1_error.message;
1712
+ }
1713
+ if (obj_unitOfMeasureCode_union0 && obj_unitOfMeasureCode_union1) {
1714
+ let message = 'Object doesn\'t match union (at "' + path_unitOfMeasureCode + '")';
1715
+ message += '\n' + obj_unitOfMeasureCode_union0.split('\n').map((line) => '\t' + line).join('\n');
1716
+ message += '\n' + obj_unitOfMeasureCode_union1.split('\n').map((line) => '\t' + line).join('\n');
1717
+ return new TypeError(message);
1718
+ }
1719
+ if (obj.usageResourceGrantAndPolicyDetail !== undefined) {
1720
+ const obj_usageResourceGrantAndPolicyDetail = obj.usageResourceGrantAndPolicyDetail;
1721
+ const path_usageResourceGrantAndPolicyDetail = path + '.usageResourceGrantAndPolicyDetail';
1722
+ const referencepath_usageResourceGrantAndPolicyDetailValidationError = validate$a(obj_usageResourceGrantAndPolicyDetail, path_usageResourceGrantAndPolicyDetail);
1723
+ if (referencepath_usageResourceGrantAndPolicyDetailValidationError !== null) {
1724
+ let message = 'Object doesn\'t match UsageResourceGrantAndPolicyDetailOutputRepresentation (at "' + path_usageResourceGrantAndPolicyDetail + '")\n';
1725
+ message += referencepath_usageResourceGrantAndPolicyDetailValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1726
+ return new TypeError(message);
1727
+ }
1728
+ }
1729
+ if (obj.usageResourceId !== undefined) {
1730
+ const obj_usageResourceId = obj.usageResourceId;
1731
+ const path_usageResourceId = path + '.usageResourceId';
1732
+ let obj_usageResourceId_union0 = null;
1733
+ const obj_usageResourceId_union0_error = (() => {
1734
+ if (typeof obj_usageResourceId !== 'string') {
1735
+ return new TypeError('Expected "string" but received "' + typeof obj_usageResourceId + '" (at "' + path_usageResourceId + '")');
1736
+ }
1737
+ })();
1738
+ if (obj_usageResourceId_union0_error != null) {
1739
+ obj_usageResourceId_union0 = obj_usageResourceId_union0_error.message;
1740
+ }
1741
+ let obj_usageResourceId_union1 = null;
1742
+ const obj_usageResourceId_union1_error = (() => {
1743
+ if (obj_usageResourceId !== null) {
1744
+ return new TypeError('Expected "null" but received "' + typeof obj_usageResourceId + '" (at "' + path_usageResourceId + '")');
1745
+ }
1746
+ })();
1747
+ if (obj_usageResourceId_union1_error != null) {
1748
+ obj_usageResourceId_union1 = obj_usageResourceId_union1_error.message;
1749
+ }
1750
+ if (obj_usageResourceId_union0 && obj_usageResourceId_union1) {
1751
+ let message = 'Object doesn\'t match union (at "' + path_usageResourceId + '")';
1752
+ message += '\n' + obj_usageResourceId_union0.split('\n').map((line) => '\t' + line).join('\n');
1753
+ message += '\n' + obj_usageResourceId_union1.split('\n').map((line) => '\t' + line).join('\n');
1754
+ return new TypeError(message);
1755
+ }
1756
+ }
1757
+ })();
1758
+ return v_error === undefined ? null : v_error;
1759
+ }
1760
+ const select$d = function RateCardEntryOutputRepresentationSelect() {
1761
+ const { selections: RateAdjustmentsOutputRepresentation__selections, opaque: RateAdjustmentsOutputRepresentation__opaque, } = select$i();
1762
+ const { selections: UsageResourceGrantAndPolicyDetailOutputRepresentation__selections, opaque: UsageResourceGrantAndPolicyDetailOutputRepresentation__opaque, } = select$e();
1763
+ return {
1764
+ kind: 'Fragment',
1765
+ version: VERSION$9,
1766
+ private: [],
1767
+ selections: [
1768
+ {
1769
+ name: 'bindingInstanceTargetType',
1770
+ kind: 'Scalar',
1771
+ required: false
1772
+ },
1773
+ {
1774
+ name: 'bindingInstanceType',
1775
+ kind: 'Scalar',
1776
+ required: false
1777
+ },
1778
+ {
1779
+ name: 'chargeForOverages',
1780
+ kind: 'Scalar'
1781
+ },
1782
+ {
1783
+ name: 'fields',
1784
+ kind: 'Object',
1785
+ // any
1786
+ },
1787
+ {
1788
+ name: 'isOptional',
1789
+ kind: 'Scalar',
1790
+ required: false
1791
+ },
1792
+ {
1793
+ name: 'name',
1794
+ kind: 'Scalar'
1795
+ },
1796
+ {
1797
+ name: 'negotiable',
1798
+ kind: 'Scalar'
1799
+ },
1800
+ {
1801
+ name: 'negotiatedRate',
1802
+ kind: 'Scalar'
1803
+ },
1804
+ {
1805
+ name: 'negotiatedRateCardEntryId',
1806
+ kind: 'Scalar'
1807
+ },
1808
+ {
1809
+ name: 'quantity',
1810
+ kind: 'Scalar'
1811
+ },
1812
+ {
1813
+ name: 'rate',
1814
+ kind: 'Scalar'
1815
+ },
1816
+ {
1817
+ name: 'rateAdjustments',
1818
+ kind: 'Object',
1819
+ nullable: true,
1820
+ plural: true,
1821
+ selections: RateAdjustmentsOutputRepresentation__selections
1822
+ },
1823
+ {
1824
+ name: 'rateCardEntryId',
1825
+ kind: 'Scalar'
1826
+ },
1827
+ {
1828
+ name: 'rateUnitOfMeasureName',
1829
+ kind: 'Scalar'
1830
+ },
1831
+ {
1832
+ name: 'unitOfMeasure',
1833
+ kind: 'Scalar'
1834
+ },
1835
+ {
1836
+ name: 'unitOfMeasureCode',
1837
+ kind: 'Scalar'
1838
+ },
1839
+ {
1840
+ name: 'usageResourceGrantAndPolicyDetail',
1841
+ kind: 'Object',
1842
+ selections: UsageResourceGrantAndPolicyDetailOutputRepresentation__selections,
1843
+ required: false
1844
+ },
1845
+ {
1846
+ name: 'usageResourceId',
1847
+ kind: 'Scalar',
1848
+ required: false
1849
+ }
1850
+ ]
1851
+ };
1852
+ };
1853
+ function equals$9(existing, incoming) {
1854
+ const existing_rateCardEntryId = existing.rateCardEntryId;
1855
+ const incoming_rateCardEntryId = incoming.rateCardEntryId;
1856
+ if (!(existing_rateCardEntryId === incoming_rateCardEntryId)) {
1857
+ return false;
1858
+ }
1859
+ const existing_bindingInstanceTargetType = existing.bindingInstanceTargetType;
1860
+ const incoming_bindingInstanceTargetType = incoming.bindingInstanceTargetType;
1861
+ // if at least one of these optionals is defined
1862
+ if (existing_bindingInstanceTargetType !== undefined || incoming_bindingInstanceTargetType !== undefined) {
1863
+ // if one of these is not defined we know the other is defined and therefore
1864
+ // not equal
1865
+ if (existing_bindingInstanceTargetType === undefined || incoming_bindingInstanceTargetType === undefined) {
1866
+ return false;
1867
+ }
1868
+ if (!(existing_bindingInstanceTargetType === incoming_bindingInstanceTargetType)) {
1869
+ return false;
1870
+ }
1871
+ }
1872
+ const existing_bindingInstanceType = existing.bindingInstanceType;
1873
+ const incoming_bindingInstanceType = incoming.bindingInstanceType;
1874
+ // if at least one of these optionals is defined
1875
+ if (existing_bindingInstanceType !== undefined || incoming_bindingInstanceType !== undefined) {
1876
+ // if one of these is not defined we know the other is defined and therefore
1877
+ // not equal
1878
+ if (existing_bindingInstanceType === undefined || incoming_bindingInstanceType === undefined) {
1879
+ return false;
1880
+ }
1881
+ if (!(existing_bindingInstanceType === incoming_bindingInstanceType)) {
1882
+ return false;
1883
+ }
1884
+ }
1885
+ const existing_chargeForOverages = existing.chargeForOverages;
1886
+ const incoming_chargeForOverages = incoming.chargeForOverages;
1887
+ if (!(existing_chargeForOverages === incoming_chargeForOverages)) {
1888
+ return false;
1889
+ }
1890
+ const existing_fields = existing.fields;
1891
+ const incoming_fields = incoming.fields;
1892
+ // if at least one of these optionals is defined
1893
+ if (existing_fields !== undefined || incoming_fields !== undefined) {
1894
+ // if one of these is not defined we know the other is defined and therefore
1895
+ // not equal
1896
+ if (existing_fields === undefined || incoming_fields === undefined) {
1897
+ return false;
1898
+ }
1899
+ const equals_fields_props = equalsObject(existing_fields, incoming_fields, (existing_fields_prop, incoming_fields_prop) => {
1900
+ if (JSONStringify(incoming_fields_prop) !== JSONStringify(existing_fields_prop)) {
1901
+ return false;
1902
+ }
1903
+ });
1904
+ if (equals_fields_props === false) {
1905
+ return false;
1906
+ }
1907
+ }
1908
+ const existing_isOptional = existing.isOptional;
1909
+ const incoming_isOptional = incoming.isOptional;
1910
+ // if at least one of these optionals is defined
1911
+ if (existing_isOptional !== undefined || incoming_isOptional !== undefined) {
1912
+ // if one of these is not defined we know the other is defined and therefore
1913
+ // not equal
1914
+ if (existing_isOptional === undefined || incoming_isOptional === undefined) {
1915
+ return false;
1916
+ }
1917
+ if (!(existing_isOptional === incoming_isOptional)) {
1918
+ return false;
1919
+ }
1920
+ }
1921
+ const existing_name = existing.name;
1922
+ const incoming_name = incoming.name;
1923
+ if (!(existing_name === incoming_name)) {
1924
+ return false;
1925
+ }
1926
+ const existing_negotiable = existing.negotiable;
1927
+ const incoming_negotiable = incoming.negotiable;
1928
+ if (!(existing_negotiable === incoming_negotiable)) {
1929
+ return false;
1930
+ }
1931
+ const existing_negotiatedRate = existing.negotiatedRate;
1932
+ const incoming_negotiatedRate = incoming.negotiatedRate;
1933
+ if (!(existing_negotiatedRate === incoming_negotiatedRate)) {
1934
+ return false;
1935
+ }
1936
+ const existing_negotiatedRateCardEntryId = existing.negotiatedRateCardEntryId;
1937
+ const incoming_negotiatedRateCardEntryId = incoming.negotiatedRateCardEntryId;
1938
+ if (!(existing_negotiatedRateCardEntryId === incoming_negotiatedRateCardEntryId)) {
1939
+ return false;
1940
+ }
1941
+ const existing_quantity = existing.quantity;
1942
+ const incoming_quantity = incoming.quantity;
1943
+ if (!(existing_quantity === incoming_quantity)) {
1944
+ return false;
1945
+ }
1946
+ const existing_rate = existing.rate;
1947
+ const incoming_rate = incoming.rate;
1948
+ if (!(existing_rate === incoming_rate)) {
1949
+ return false;
1950
+ }
1951
+ const existing_rateAdjustments = existing.rateAdjustments;
1952
+ const incoming_rateAdjustments = incoming.rateAdjustments;
1953
+ const equals_rateAdjustments_items = equalsArray(existing_rateAdjustments, incoming_rateAdjustments, (existing_rateAdjustments_item, incoming_rateAdjustments_item) => {
1954
+ if (!(existing_rateAdjustments_item === incoming_rateAdjustments_item
1955
+ || (existing_rateAdjustments_item != null &&
1956
+ incoming_rateAdjustments_item != null &&
1957
+ equals$e(existing_rateAdjustments_item, incoming_rateAdjustments_item)))) {
1958
+ return false;
1959
+ }
1960
+ });
1961
+ if (equals_rateAdjustments_items === false) {
1962
+ return false;
1963
+ }
1964
+ const existing_rateUnitOfMeasureName = existing.rateUnitOfMeasureName;
1965
+ const incoming_rateUnitOfMeasureName = incoming.rateUnitOfMeasureName;
1966
+ if (!(existing_rateUnitOfMeasureName === incoming_rateUnitOfMeasureName)) {
1967
+ return false;
1968
+ }
1969
+ const existing_unitOfMeasure = existing.unitOfMeasure;
1970
+ const incoming_unitOfMeasure = incoming.unitOfMeasure;
1971
+ if (!(existing_unitOfMeasure === incoming_unitOfMeasure)) {
1972
+ return false;
1973
+ }
1974
+ const existing_unitOfMeasureCode = existing.unitOfMeasureCode;
1975
+ const incoming_unitOfMeasureCode = incoming.unitOfMeasureCode;
1976
+ if (!(existing_unitOfMeasureCode === incoming_unitOfMeasureCode)) {
1977
+ return false;
1978
+ }
1979
+ const existing_usageResourceGrantAndPolicyDetail = existing.usageResourceGrantAndPolicyDetail;
1980
+ const incoming_usageResourceGrantAndPolicyDetail = incoming.usageResourceGrantAndPolicyDetail;
1981
+ // if at least one of these optionals is defined
1982
+ if (existing_usageResourceGrantAndPolicyDetail !== undefined || incoming_usageResourceGrantAndPolicyDetail !== undefined) {
1983
+ // if one of these is not defined we know the other is defined and therefore
1984
+ // not equal
1985
+ if (existing_usageResourceGrantAndPolicyDetail === undefined || incoming_usageResourceGrantAndPolicyDetail === undefined) {
1986
+ return false;
1987
+ }
1988
+ if (!(equals$a(existing_usageResourceGrantAndPolicyDetail, incoming_usageResourceGrantAndPolicyDetail))) {
1989
+ return false;
1990
+ }
1991
+ }
1992
+ const existing_usageResourceId = existing.usageResourceId;
1993
+ const incoming_usageResourceId = incoming.usageResourceId;
1994
+ // if at least one of these optionals is defined
1995
+ if (existing_usageResourceId !== undefined || incoming_usageResourceId !== undefined) {
1996
+ // if one of these is not defined we know the other is defined and therefore
1997
+ // not equal
1998
+ if (existing_usageResourceId === undefined || incoming_usageResourceId === undefined) {
1999
+ return false;
2000
+ }
2001
+ if (!(existing_usageResourceId === incoming_usageResourceId)) {
2002
+ return false;
2003
+ }
2004
+ }
2005
+ return true;
2006
+ }
2007
+
2008
+ const TTL$1 = 1000;
2009
+ const VERSION$8 = "338996bd44a293867ffaab2724d4c41f";
2010
+ function validate$8(obj, path = 'UsageDetailOutputRepresentation') {
2011
+ const v_error = (() => {
2012
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2013
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2014
+ }
2015
+ if (obj.errors !== undefined) {
2016
+ const obj_errors = obj.errors;
2017
+ const path_errors = path + '.errors';
2018
+ if (!ArrayIsArray(obj_errors)) {
2019
+ return new TypeError('Expected "array" but received "' + typeof obj_errors + '" (at "' + path_errors + '")');
2020
+ }
2021
+ for (let i = 0; i < obj_errors.length; i++) {
2022
+ const obj_errors_item = obj_errors[i];
2023
+ const path_errors_item = path_errors + '[' + i + ']';
2024
+ const referencepath_errors_itemValidationError = validate$f(obj_errors_item, path_errors_item);
2025
+ if (referencepath_errors_itemValidationError !== null) {
2026
+ let message = 'Object doesn\'t match UsageDetailErrorResponseRepresentation (at "' + path_errors_item + '")\n';
2027
+ message += referencepath_errors_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2028
+ return new TypeError(message);
2029
+ }
2030
+ }
2031
+ }
2032
+ if (obj.records !== undefined) {
2033
+ const obj_records = obj.records;
2034
+ const path_records = path + '.records';
2035
+ if (!ArrayIsArray(obj_records)) {
2036
+ return new TypeError('Expected "array" but received "' + typeof obj_records + '" (at "' + path_records + '")');
2037
+ }
2038
+ for (let i = 0; i < obj_records.length; i++) {
2039
+ const obj_records_item = obj_records[i];
2040
+ const path_records_item = path_records + '[' + i + ']';
2041
+ const referencepath_records_itemValidationError = validate$9(obj_records_item, path_records_item);
2042
+ if (referencepath_records_itemValidationError !== null) {
2043
+ let message = 'Object doesn\'t match RateCardEntryOutputRepresentation (at "' + path_records_item + '")\n';
2044
+ message += referencepath_records_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2045
+ return new TypeError(message);
2046
+ }
2047
+ }
2048
+ }
2049
+ })();
2050
+ return v_error === undefined ? null : v_error;
2051
+ }
2052
+ const RepresentationType$1 = 'UsageDetailOutputRepresentation';
2053
+ function normalize$1(input, existing, path, luvio, store, timestamp) {
2054
+ return input;
2055
+ }
2056
+ const select$c = function UsageDetailOutputRepresentationSelect() {
2057
+ const { selections: UsageDetailErrorResponseRepresentation__selections, opaque: UsageDetailErrorResponseRepresentation__opaque, } = select$j();
2058
+ const { selections: RateCardEntryOutputRepresentation__selections, opaque: RateCardEntryOutputRepresentation__opaque, } = select$d();
2059
+ return {
2060
+ kind: 'Fragment',
2061
+ version: VERSION$8,
2062
+ private: [],
2063
+ selections: [
2064
+ {
2065
+ name: 'errors',
2066
+ kind: 'Object',
2067
+ plural: true,
2068
+ selections: UsageDetailErrorResponseRepresentation__selections,
2069
+ required: false
2070
+ },
2071
+ {
2072
+ name: 'records',
2073
+ kind: 'Object',
2074
+ plural: true,
2075
+ selections: RateCardEntryOutputRepresentation__selections,
2076
+ required: false
2077
+ }
2078
+ ]
2079
+ };
2080
+ };
2081
+ function equals$8(existing, incoming) {
2082
+ const existing_errors = existing.errors;
2083
+ const incoming_errors = incoming.errors;
2084
+ // if at least one of these optionals is defined
2085
+ if (existing_errors !== undefined || incoming_errors !== undefined) {
2086
+ // if one of these is not defined we know the other is defined and therefore
2087
+ // not equal
2088
+ if (existing_errors === undefined || incoming_errors === undefined) {
2089
+ return false;
2090
+ }
2091
+ const equals_errors_items = equalsArray(existing_errors, incoming_errors, (existing_errors_item, incoming_errors_item) => {
2092
+ if (!(equals$f(existing_errors_item, incoming_errors_item))) {
2093
+ return false;
2094
+ }
2095
+ });
2096
+ if (equals_errors_items === false) {
2097
+ return false;
2098
+ }
2099
+ }
2100
+ const existing_records = existing.records;
2101
+ const incoming_records = incoming.records;
2102
+ // if at least one of these optionals is defined
2103
+ if (existing_records !== undefined || incoming_records !== undefined) {
2104
+ // if one of these is not defined we know the other is defined and therefore
2105
+ // not equal
2106
+ if (existing_records === undefined || incoming_records === undefined) {
2107
+ return false;
2108
+ }
2109
+ const equals_records_items = equalsArray(existing_records, incoming_records, (existing_records_item, incoming_records_item) => {
2110
+ if (!(equals$9(existing_records_item, incoming_records_item))) {
2111
+ return false;
2112
+ }
2113
+ });
2114
+ if (equals_records_items === false) {
2115
+ return false;
2116
+ }
2117
+ }
2118
+ return true;
2119
+ }
2120
+ const ingest$1 = function UsageDetailOutputRepresentationIngest(input, path, luvio, store, timestamp) {
2121
+ if (process.env.NODE_ENV !== 'production') {
2122
+ const validateError = validate$8(input);
2123
+ if (validateError !== null) {
2124
+ throw validateError;
2125
+ }
2126
+ }
2127
+ const key = path.fullPath;
2128
+ const ttlToUse = TTL$1;
2129
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "usage-detail", VERSION$8, RepresentationType$1, equals$8);
2130
+ return createLink(key);
2131
+ };
2132
+ function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
2133
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
2134
+ const rootKey = fullPathFactory();
2135
+ rootKeySet.set(rootKey, {
2136
+ namespace: keyPrefix,
2137
+ representationName: RepresentationType$1,
2138
+ mergeable: false
2139
+ });
2140
+ }
2141
+
2142
+ function select$b(luvio, params) {
2143
+ return select$c();
2144
+ }
2145
+ function keyBuilder$7(luvio, params) {
2146
+ return keyPrefix + '::UsageDetailOutputRepresentation:(' + 'effectiveDate:' + params.queryParams.effectiveDate + ',' + 'optionalFields:' + params.queryParams.optionalFields + ',' + 'assetId:' + params.urlParams.assetId + ')';
2147
+ }
2148
+ function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
2149
+ getTypeCacheKeys$1(storeKeyMap, luvio, response, () => keyBuilder$7(luvio, resourceParams));
2150
+ }
2151
+ function ingestSuccess$3(luvio, resourceParams, response, snapshotRefresh) {
2152
+ const { body } = response;
2153
+ const key = keyBuilder$7(luvio, resourceParams);
2154
+ luvio.storeIngest(key, ingest$1, body);
2155
+ const snapshot = luvio.storeLookup({
2156
+ recordId: key,
2157
+ node: select$b(),
2158
+ variables: {},
2159
+ }, snapshotRefresh);
2160
+ if (process.env.NODE_ENV !== 'production') {
2161
+ if (snapshot.state !== 'Fulfilled') {
2162
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
2163
+ }
2164
+ }
2165
+ deepFreeze(snapshot.data);
2166
+ return snapshot;
2167
+ }
2168
+ function ingestError$3(luvio, params, error, snapshotRefresh) {
2169
+ const key = keyBuilder$7(luvio, params);
2170
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
2171
+ const storeMetadataParams = {
2172
+ ttl: TTL$1,
2173
+ namespace: keyPrefix,
2174
+ version: VERSION$8,
2175
+ representationName: RepresentationType$1
2176
+ };
2177
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
2178
+ return errorSnapshot;
2179
+ }
2180
+ function createResourceRequest$3(config) {
2181
+ const headers = {};
2182
+ return {
2183
+ baseUri: '/services/data/v66.0',
2184
+ basePath: '/asset-management/assets/' + config.urlParams.assetId + '/usage-details',
2185
+ method: 'get',
2186
+ body: null,
2187
+ urlParams: config.urlParams,
2188
+ queryParams: config.queryParams,
2189
+ headers,
2190
+ priority: 'normal',
2191
+ };
2192
+ }
2193
+
2194
+ const adapterName$3 = 'getAssetUsageDetails';
2195
+ const getAssetUsageDetails_ConfigPropertyMetadata = [
2196
+ generateParamConfigMetadata('assetId', true, 0 /* UrlParameter */, 0 /* String */),
2197
+ generateParamConfigMetadata('effectiveDate', false, 1 /* QueryParameter */, 0 /* String */),
2198
+ generateParamConfigMetadata('optionalFields', false, 1 /* QueryParameter */, 0 /* String */, true),
2199
+ ];
2200
+ const getAssetUsageDetails_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, getAssetUsageDetails_ConfigPropertyMetadata);
2201
+ const createResourceParams$3 = /*#__PURE__*/ createResourceParams$4(getAssetUsageDetails_ConfigPropertyMetadata);
2202
+ function keyBuilder$6(luvio, config) {
2203
+ const resourceParams = createResourceParams$3(config);
2204
+ return keyBuilder$7(luvio, resourceParams);
2205
+ }
2206
+ function typeCheckConfig$3(untrustedConfig) {
2207
+ const config = {};
2208
+ typeCheckConfig$4(untrustedConfig, config, getAssetUsageDetails_ConfigPropertyMetadata);
2209
+ return config;
2210
+ }
2211
+ function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
2212
+ if (!untrustedIsObject(untrustedConfig)) {
2213
+ return null;
2214
+ }
2215
+ if (process.env.NODE_ENV !== 'production') {
2216
+ validateConfig(untrustedConfig, configPropertyNames);
2217
+ }
2218
+ const config = typeCheckConfig$3(untrustedConfig);
2219
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
2220
+ return null;
2221
+ }
2222
+ return config;
2223
+ }
2224
+ function adapterFragment$3(luvio, config) {
2225
+ createResourceParams$3(config);
2226
+ return select$b();
2227
+ }
2228
+ function onFetchResponseSuccess$3(luvio, config, resourceParams, response) {
2229
+ const snapshot = ingestSuccess$3(luvio, resourceParams, response, {
2230
+ config,
2231
+ resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
2232
+ });
2233
+ return luvio.storeBroadcast().then(() => snapshot);
2234
+ }
2235
+ function onFetchResponseError$3(luvio, config, resourceParams, response) {
2236
+ const snapshot = ingestError$3(luvio, resourceParams, response, {
2237
+ config,
2238
+ resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
2239
+ });
2240
+ return luvio.storeBroadcast().then(() => snapshot);
2241
+ }
2242
+ function buildNetworkSnapshot$3(luvio, config, options) {
2243
+ const resourceParams = createResourceParams$3(config);
2244
+ const request = createResourceRequest$3(resourceParams);
2245
+ return luvio.dispatchResourceRequest(request, options)
2246
+ .then((response) => {
2247
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$3(luvio, config, resourceParams, response), () => {
2248
+ const cache = new StoreKeyMap();
2249
+ getResponseCacheKeys$3(cache, luvio, resourceParams, response.body);
2250
+ return cache;
2251
+ });
2252
+ }, (response) => {
2253
+ return luvio.handleErrorResponse(() => onFetchResponseError$3(luvio, config, resourceParams, response));
2254
+ });
2255
+ }
2256
+ function buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext) {
2257
+ return buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext, buildNetworkSnapshot$3, undefined, false);
2258
+ }
2259
+ function buildCachedSnapshotCachePolicy$3(context, storeLookup) {
2260
+ const { luvio, config } = context;
2261
+ const selector = {
2262
+ recordId: keyBuilder$6(luvio, config),
2263
+ node: adapterFragment$3(luvio, config),
2264
+ variables: {},
2265
+ };
2266
+ const cacheSnapshot = storeLookup(selector, {
2267
+ config,
2268
+ resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
2269
+ });
2270
+ return cacheSnapshot;
2271
+ }
2272
+ const getAssetUsageDetailsAdapterFactory = (luvio) => function usageDetail__getAssetUsageDetails(untrustedConfig, requestContext) {
2273
+ const config = validateAdapterConfig$3(untrustedConfig, getAssetUsageDetails_ConfigPropertyNames);
2274
+ // Invalid or incomplete config
2275
+ if (config === null) {
2276
+ return null;
2277
+ }
2278
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
2279
+ buildCachedSnapshotCachePolicy$3, buildNetworkSnapshotCachePolicy$3);
2280
+ };
2281
+
2282
+ const VERSION$7 = "9071132028d85d83aeb0f3722cfb88cf";
2283
+ function validate$7(obj, path = 'BindingObjectRateAdjustmentsOutputRepresentation') {
2284
+ const v_error = (() => {
2285
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2286
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2287
+ }
2288
+ const obj_lowerBound = obj.lowerBound;
2289
+ const path_lowerBound = path + '.lowerBound';
2290
+ let obj_lowerBound_union0 = null;
2291
+ const obj_lowerBound_union0_error = (() => {
2292
+ if (typeof obj_lowerBound !== 'number') {
2293
+ return new TypeError('Expected "number" but received "' + typeof obj_lowerBound + '" (at "' + path_lowerBound + '")');
2294
+ }
2295
+ })();
2296
+ if (obj_lowerBound_union0_error != null) {
2297
+ obj_lowerBound_union0 = obj_lowerBound_union0_error.message;
2298
+ }
2299
+ let obj_lowerBound_union1 = null;
2300
+ const obj_lowerBound_union1_error = (() => {
2301
+ if (obj_lowerBound !== null) {
2302
+ return new TypeError('Expected "null" but received "' + typeof obj_lowerBound + '" (at "' + path_lowerBound + '")');
2303
+ }
2304
+ })();
2305
+ if (obj_lowerBound_union1_error != null) {
2306
+ obj_lowerBound_union1 = obj_lowerBound_union1_error.message;
2307
+ }
2308
+ if (obj_lowerBound_union0 && obj_lowerBound_union1) {
2309
+ let message = 'Object doesn\'t match union (at "' + path_lowerBound + '")';
2310
+ message += '\n' + obj_lowerBound_union0.split('\n').map((line) => '\t' + line).join('\n');
2311
+ message += '\n' + obj_lowerBound_union1.split('\n').map((line) => '\t' + line).join('\n');
2312
+ return new TypeError(message);
2313
+ }
2314
+ const obj_name = obj.name;
2315
+ const path_name = path + '.name';
2316
+ let obj_name_union0 = null;
2317
+ const obj_name_union0_error = (() => {
2318
+ if (typeof obj_name !== 'string') {
2319
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
2320
+ }
2321
+ })();
2322
+ if (obj_name_union0_error != null) {
2323
+ obj_name_union0 = obj_name_union0_error.message;
2324
+ }
2325
+ let obj_name_union1 = null;
2326
+ const obj_name_union1_error = (() => {
2327
+ if (obj_name !== null) {
2328
+ return new TypeError('Expected "null" but received "' + typeof obj_name + '" (at "' + path_name + '")');
2329
+ }
2330
+ })();
2331
+ if (obj_name_union1_error != null) {
2332
+ obj_name_union1 = obj_name_union1_error.message;
2333
+ }
2334
+ if (obj_name_union0 && obj_name_union1) {
2335
+ let message = 'Object doesn\'t match union (at "' + path_name + '")';
2336
+ message += '\n' + obj_name_union0.split('\n').map((line) => '\t' + line).join('\n');
2337
+ message += '\n' + obj_name_union1.split('\n').map((line) => '\t' + line).join('\n');
2338
+ return new TypeError(message);
2339
+ }
2340
+ const obj_rateAdjustmentId = obj.rateAdjustmentId;
2341
+ const path_rateAdjustmentId = path + '.rateAdjustmentId';
2342
+ let obj_rateAdjustmentId_union0 = null;
2343
+ const obj_rateAdjustmentId_union0_error = (() => {
2344
+ if (typeof obj_rateAdjustmentId !== 'string') {
2345
+ return new TypeError('Expected "string" but received "' + typeof obj_rateAdjustmentId + '" (at "' + path_rateAdjustmentId + '")');
2346
+ }
2347
+ })();
2348
+ if (obj_rateAdjustmentId_union0_error != null) {
2349
+ obj_rateAdjustmentId_union0 = obj_rateAdjustmentId_union0_error.message;
2350
+ }
2351
+ let obj_rateAdjustmentId_union1 = null;
2352
+ const obj_rateAdjustmentId_union1_error = (() => {
2353
+ if (obj_rateAdjustmentId !== null) {
2354
+ return new TypeError('Expected "null" but received "' + typeof obj_rateAdjustmentId + '" (at "' + path_rateAdjustmentId + '")');
2355
+ }
2356
+ })();
2357
+ if (obj_rateAdjustmentId_union1_error != null) {
2358
+ obj_rateAdjustmentId_union1 = obj_rateAdjustmentId_union1_error.message;
2359
+ }
2360
+ if (obj_rateAdjustmentId_union0 && obj_rateAdjustmentId_union1) {
2361
+ let message = 'Object doesn\'t match union (at "' + path_rateAdjustmentId + '")';
2362
+ message += '\n' + obj_rateAdjustmentId_union0.split('\n').map((line) => '\t' + line).join('\n');
2363
+ message += '\n' + obj_rateAdjustmentId_union1.split('\n').map((line) => '\t' + line).join('\n');
2364
+ return new TypeError(message);
2365
+ }
2366
+ const obj_rateAdjustmentType = obj.rateAdjustmentType;
2367
+ const path_rateAdjustmentType = path + '.rateAdjustmentType';
2368
+ let obj_rateAdjustmentType_union0 = null;
2369
+ const obj_rateAdjustmentType_union0_error = (() => {
2370
+ if (typeof obj_rateAdjustmentType !== 'string') {
2371
+ return new TypeError('Expected "string" but received "' + typeof obj_rateAdjustmentType + '" (at "' + path_rateAdjustmentType + '")');
2372
+ }
2373
+ })();
2374
+ if (obj_rateAdjustmentType_union0_error != null) {
2375
+ obj_rateAdjustmentType_union0 = obj_rateAdjustmentType_union0_error.message;
2376
+ }
2377
+ let obj_rateAdjustmentType_union1 = null;
2378
+ const obj_rateAdjustmentType_union1_error = (() => {
2379
+ if (obj_rateAdjustmentType !== null) {
2380
+ return new TypeError('Expected "null" but received "' + typeof obj_rateAdjustmentType + '" (at "' + path_rateAdjustmentType + '")');
2381
+ }
2382
+ })();
2383
+ if (obj_rateAdjustmentType_union1_error != null) {
2384
+ obj_rateAdjustmentType_union1 = obj_rateAdjustmentType_union1_error.message;
2385
+ }
2386
+ if (obj_rateAdjustmentType_union0 && obj_rateAdjustmentType_union1) {
2387
+ let message = 'Object doesn\'t match union (at "' + path_rateAdjustmentType + '")';
2388
+ message += '\n' + obj_rateAdjustmentType_union0.split('\n').map((line) => '\t' + line).join('\n');
2389
+ message += '\n' + obj_rateAdjustmentType_union1.split('\n').map((line) => '\t' + line).join('\n');
2390
+ return new TypeError(message);
2391
+ }
2392
+ const obj_rateAdjustmentValue = obj.rateAdjustmentValue;
2393
+ const path_rateAdjustmentValue = path + '.rateAdjustmentValue';
2394
+ let obj_rateAdjustmentValue_union0 = null;
2395
+ const obj_rateAdjustmentValue_union0_error = (() => {
2396
+ if (typeof obj_rateAdjustmentValue !== 'number') {
2397
+ return new TypeError('Expected "number" but received "' + typeof obj_rateAdjustmentValue + '" (at "' + path_rateAdjustmentValue + '")');
2398
+ }
2399
+ })();
2400
+ if (obj_rateAdjustmentValue_union0_error != null) {
2401
+ obj_rateAdjustmentValue_union0 = obj_rateAdjustmentValue_union0_error.message;
2402
+ }
2403
+ let obj_rateAdjustmentValue_union1 = null;
2404
+ const obj_rateAdjustmentValue_union1_error = (() => {
2405
+ if (obj_rateAdjustmentValue !== null) {
2406
+ return new TypeError('Expected "null" but received "' + typeof obj_rateAdjustmentValue + '" (at "' + path_rateAdjustmentValue + '")');
2407
+ }
2408
+ })();
2409
+ if (obj_rateAdjustmentValue_union1_error != null) {
2410
+ obj_rateAdjustmentValue_union1 = obj_rateAdjustmentValue_union1_error.message;
2411
+ }
2412
+ if (obj_rateAdjustmentValue_union0 && obj_rateAdjustmentValue_union1) {
2413
+ let message = 'Object doesn\'t match union (at "' + path_rateAdjustmentValue + '")';
2414
+ message += '\n' + obj_rateAdjustmentValue_union0.split('\n').map((line) => '\t' + line).join('\n');
2415
+ message += '\n' + obj_rateAdjustmentValue_union1.split('\n').map((line) => '\t' + line).join('\n');
2416
+ return new TypeError(message);
2417
+ }
2418
+ const obj_tierUnitOfMeasure = obj.tierUnitOfMeasure;
2419
+ const path_tierUnitOfMeasure = path + '.tierUnitOfMeasure';
2420
+ let obj_tierUnitOfMeasure_union0 = null;
2421
+ const obj_tierUnitOfMeasure_union0_error = (() => {
2422
+ if (typeof obj_tierUnitOfMeasure !== 'string') {
2423
+ return new TypeError('Expected "string" but received "' + typeof obj_tierUnitOfMeasure + '" (at "' + path_tierUnitOfMeasure + '")');
2424
+ }
2425
+ })();
2426
+ if (obj_tierUnitOfMeasure_union0_error != null) {
2427
+ obj_tierUnitOfMeasure_union0 = obj_tierUnitOfMeasure_union0_error.message;
2428
+ }
2429
+ let obj_tierUnitOfMeasure_union1 = null;
2430
+ const obj_tierUnitOfMeasure_union1_error = (() => {
2431
+ if (obj_tierUnitOfMeasure !== null) {
2432
+ return new TypeError('Expected "null" but received "' + typeof obj_tierUnitOfMeasure + '" (at "' + path_tierUnitOfMeasure + '")');
2433
+ }
2434
+ })();
2435
+ if (obj_tierUnitOfMeasure_union1_error != null) {
2436
+ obj_tierUnitOfMeasure_union1 = obj_tierUnitOfMeasure_union1_error.message;
2437
+ }
2438
+ if (obj_tierUnitOfMeasure_union0 && obj_tierUnitOfMeasure_union1) {
2439
+ let message = 'Object doesn\'t match union (at "' + path_tierUnitOfMeasure + '")';
2440
+ message += '\n' + obj_tierUnitOfMeasure_union0.split('\n').map((line) => '\t' + line).join('\n');
2441
+ message += '\n' + obj_tierUnitOfMeasure_union1.split('\n').map((line) => '\t' + line).join('\n');
2442
+ return new TypeError(message);
2443
+ }
2444
+ const obj_upperBound = obj.upperBound;
2445
+ const path_upperBound = path + '.upperBound';
2446
+ let obj_upperBound_union0 = null;
2447
+ const obj_upperBound_union0_error = (() => {
2448
+ if (typeof obj_upperBound !== 'number') {
2449
+ return new TypeError('Expected "number" but received "' + typeof obj_upperBound + '" (at "' + path_upperBound + '")');
2450
+ }
2451
+ })();
2452
+ if (obj_upperBound_union0_error != null) {
2453
+ obj_upperBound_union0 = obj_upperBound_union0_error.message;
2454
+ }
2455
+ let obj_upperBound_union1 = null;
2456
+ const obj_upperBound_union1_error = (() => {
2457
+ if (obj_upperBound !== null) {
2458
+ return new TypeError('Expected "null" but received "' + typeof obj_upperBound + '" (at "' + path_upperBound + '")');
2459
+ }
2460
+ })();
2461
+ if (obj_upperBound_union1_error != null) {
2462
+ obj_upperBound_union1 = obj_upperBound_union1_error.message;
2463
+ }
2464
+ if (obj_upperBound_union0 && obj_upperBound_union1) {
2465
+ let message = 'Object doesn\'t match union (at "' + path_upperBound + '")';
2466
+ message += '\n' + obj_upperBound_union0.split('\n').map((line) => '\t' + line).join('\n');
2467
+ message += '\n' + obj_upperBound_union1.split('\n').map((line) => '\t' + line).join('\n');
2468
+ return new TypeError(message);
2469
+ }
2470
+ })();
2471
+ return v_error === undefined ? null : v_error;
2472
+ }
2473
+ const select$a = function BindingObjectRateAdjustmentsOutputRepresentationSelect() {
2474
+ return {
2475
+ kind: 'Fragment',
2476
+ version: VERSION$7,
2477
+ private: [],
2478
+ selections: [
2479
+ {
2480
+ name: 'lowerBound',
2481
+ kind: 'Scalar'
2482
+ },
2483
+ {
2484
+ name: 'name',
2485
+ kind: 'Scalar'
2486
+ },
2487
+ {
2488
+ name: 'rateAdjustmentId',
2489
+ kind: 'Scalar'
2490
+ },
2491
+ {
2492
+ name: 'rateAdjustmentType',
2493
+ kind: 'Scalar'
2494
+ },
2495
+ {
2496
+ name: 'rateAdjustmentValue',
2497
+ kind: 'Scalar'
2498
+ },
2499
+ {
2500
+ name: 'tierUnitOfMeasure',
2501
+ kind: 'Scalar'
2502
+ },
2503
+ {
2504
+ name: 'upperBound',
2505
+ kind: 'Scalar'
2506
+ }
2507
+ ]
2508
+ };
2509
+ };
2510
+ function equals$7(existing, incoming) {
2511
+ const existing_lowerBound = existing.lowerBound;
2512
+ const incoming_lowerBound = incoming.lowerBound;
2513
+ if (!(existing_lowerBound === incoming_lowerBound)) {
2514
+ return false;
2515
+ }
2516
+ const existing_name = existing.name;
2517
+ const incoming_name = incoming.name;
2518
+ if (!(existing_name === incoming_name)) {
2519
+ return false;
2520
+ }
2521
+ const existing_rateAdjustmentId = existing.rateAdjustmentId;
2522
+ const incoming_rateAdjustmentId = incoming.rateAdjustmentId;
2523
+ if (!(existing_rateAdjustmentId === incoming_rateAdjustmentId)) {
2524
+ return false;
2525
+ }
2526
+ const existing_rateAdjustmentType = existing.rateAdjustmentType;
2527
+ const incoming_rateAdjustmentType = incoming.rateAdjustmentType;
2528
+ if (!(existing_rateAdjustmentType === incoming_rateAdjustmentType)) {
2529
+ return false;
2530
+ }
2531
+ const existing_rateAdjustmentValue = existing.rateAdjustmentValue;
2532
+ const incoming_rateAdjustmentValue = incoming.rateAdjustmentValue;
2533
+ if (!(existing_rateAdjustmentValue === incoming_rateAdjustmentValue)) {
2534
+ return false;
2535
+ }
2536
+ const existing_tierUnitOfMeasure = existing.tierUnitOfMeasure;
2537
+ const incoming_tierUnitOfMeasure = incoming.tierUnitOfMeasure;
2538
+ if (!(existing_tierUnitOfMeasure === incoming_tierUnitOfMeasure)) {
2539
+ return false;
2540
+ }
2541
+ const existing_upperBound = existing.upperBound;
2542
+ const incoming_upperBound = incoming.upperBound;
2543
+ if (!(existing_upperBound === incoming_upperBound)) {
2544
+ return false;
2545
+ }
2546
+ return true;
2547
+ }
2548
+
2549
+ const VERSION$6 = "c712ee5181793d7a6f21ef43f715b2b3";
2550
+ function validate$6(obj, path = 'BindingObjectRateOutputRepresentation') {
2551
+ const v_error = (() => {
2552
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2553
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2554
+ }
2555
+ const obj_id = obj.id;
2556
+ const path_id = path + '.id';
2557
+ let obj_id_union0 = null;
2558
+ const obj_id_union0_error = (() => {
2559
+ if (typeof obj_id !== 'string') {
2560
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
2561
+ }
2562
+ })();
2563
+ if (obj_id_union0_error != null) {
2564
+ obj_id_union0 = obj_id_union0_error.message;
2565
+ }
2566
+ let obj_id_union1 = null;
2567
+ const obj_id_union1_error = (() => {
2568
+ if (obj_id !== null) {
2569
+ return new TypeError('Expected "null" but received "' + typeof obj_id + '" (at "' + path_id + '")');
2570
+ }
2571
+ })();
2572
+ if (obj_id_union1_error != null) {
2573
+ obj_id_union1 = obj_id_union1_error.message;
2574
+ }
2575
+ if (obj_id_union0 && obj_id_union1) {
2576
+ let message = 'Object doesn\'t match union (at "' + path_id + '")';
2577
+ message += '\n' + obj_id_union0.split('\n').map((line) => '\t' + line).join('\n');
2578
+ message += '\n' + obj_id_union1.split('\n').map((line) => '\t' + line).join('\n');
2579
+ return new TypeError(message);
2580
+ }
2581
+ const obj_negotiatedRate = obj.negotiatedRate;
2582
+ const path_negotiatedRate = path + '.negotiatedRate';
2583
+ let obj_negotiatedRate_union0 = null;
2584
+ const obj_negotiatedRate_union0_error = (() => {
2585
+ if (typeof obj_negotiatedRate !== 'number') {
2586
+ return new TypeError('Expected "number" but received "' + typeof obj_negotiatedRate + '" (at "' + path_negotiatedRate + '")');
2587
+ }
2588
+ })();
2589
+ if (obj_negotiatedRate_union0_error != null) {
2590
+ obj_negotiatedRate_union0 = obj_negotiatedRate_union0_error.message;
2591
+ }
2592
+ let obj_negotiatedRate_union1 = null;
2593
+ const obj_negotiatedRate_union1_error = (() => {
2594
+ if (obj_negotiatedRate !== null) {
2595
+ return new TypeError('Expected "null" but received "' + typeof obj_negotiatedRate + '" (at "' + path_negotiatedRate + '")');
2596
+ }
2597
+ })();
2598
+ if (obj_negotiatedRate_union1_error != null) {
2599
+ obj_negotiatedRate_union1 = obj_negotiatedRate_union1_error.message;
2600
+ }
2601
+ if (obj_negotiatedRate_union0 && obj_negotiatedRate_union1) {
2602
+ let message = 'Object doesn\'t match union (at "' + path_negotiatedRate + '")';
2603
+ message += '\n' + obj_negotiatedRate_union0.split('\n').map((line) => '\t' + line).join('\n');
2604
+ message += '\n' + obj_negotiatedRate_union1.split('\n').map((line) => '\t' + line).join('\n');
2605
+ return new TypeError(message);
2606
+ }
2607
+ const obj_negotiatedRateAdjustments = obj.negotiatedRateAdjustments;
2608
+ const path_negotiatedRateAdjustments = path + '.negotiatedRateAdjustments';
2609
+ if (!ArrayIsArray(obj_negotiatedRateAdjustments)) {
2610
+ return new TypeError('Expected "array" but received "' + typeof obj_negotiatedRateAdjustments + '" (at "' + path_negotiatedRateAdjustments + '")');
2611
+ }
2612
+ for (let i = 0; i < obj_negotiatedRateAdjustments.length; i++) {
2613
+ const obj_negotiatedRateAdjustments_item = obj_negotiatedRateAdjustments[i];
2614
+ const path_negotiatedRateAdjustments_item = path_negotiatedRateAdjustments + '[' + i + ']';
2615
+ let obj_negotiatedRateAdjustments_item_union0 = null;
2616
+ const obj_negotiatedRateAdjustments_item_union0_error = (() => {
2617
+ const referencepath_negotiatedRateAdjustments_itemValidationError = validate$7(obj_negotiatedRateAdjustments_item, path_negotiatedRateAdjustments_item);
2618
+ if (referencepath_negotiatedRateAdjustments_itemValidationError !== null) {
2619
+ let message = 'Object doesn\'t match BindingObjectRateAdjustmentsOutputRepresentation (at "' + path_negotiatedRateAdjustments_item + '")\n';
2620
+ message += referencepath_negotiatedRateAdjustments_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2621
+ return new TypeError(message);
2622
+ }
2623
+ })();
2624
+ if (obj_negotiatedRateAdjustments_item_union0_error != null) {
2625
+ obj_negotiatedRateAdjustments_item_union0 = obj_negotiatedRateAdjustments_item_union0_error.message;
2626
+ }
2627
+ let obj_negotiatedRateAdjustments_item_union1 = null;
2628
+ const obj_negotiatedRateAdjustments_item_union1_error = (() => {
2629
+ if (obj_negotiatedRateAdjustments_item !== null) {
2630
+ return new TypeError('Expected "null" but received "' + typeof obj_negotiatedRateAdjustments_item + '" (at "' + path_negotiatedRateAdjustments_item + '")');
2631
+ }
2632
+ })();
2633
+ if (obj_negotiatedRateAdjustments_item_union1_error != null) {
2634
+ obj_negotiatedRateAdjustments_item_union1 = obj_negotiatedRateAdjustments_item_union1_error.message;
2635
+ }
2636
+ if (obj_negotiatedRateAdjustments_item_union0 && obj_negotiatedRateAdjustments_item_union1) {
2637
+ let message = 'Object doesn\'t match union (at "' + path_negotiatedRateAdjustments_item + '")';
2638
+ message += '\n' + obj_negotiatedRateAdjustments_item_union0.split('\n').map((line) => '\t' + line).join('\n');
2639
+ message += '\n' + obj_negotiatedRateAdjustments_item_union1.split('\n').map((line) => '\t' + line).join('\n');
2640
+ return new TypeError(message);
2641
+ }
2642
+ }
2643
+ const obj_rate = obj.rate;
2644
+ const path_rate = path + '.rate';
2645
+ let obj_rate_union0 = null;
2646
+ const obj_rate_union0_error = (() => {
2647
+ if (typeof obj_rate !== 'number') {
2648
+ return new TypeError('Expected "number" but received "' + typeof obj_rate + '" (at "' + path_rate + '")');
2649
+ }
2650
+ })();
2651
+ if (obj_rate_union0_error != null) {
2652
+ obj_rate_union0 = obj_rate_union0_error.message;
2653
+ }
2654
+ let obj_rate_union1 = null;
2655
+ const obj_rate_union1_error = (() => {
2656
+ if (obj_rate !== null) {
2657
+ return new TypeError('Expected "null" but received "' + typeof obj_rate + '" (at "' + path_rate + '")');
2658
+ }
2659
+ })();
2660
+ if (obj_rate_union1_error != null) {
2661
+ obj_rate_union1 = obj_rate_union1_error.message;
2662
+ }
2663
+ if (obj_rate_union0 && obj_rate_union1) {
2664
+ let message = 'Object doesn\'t match union (at "' + path_rate + '")';
2665
+ message += '\n' + obj_rate_union0.split('\n').map((line) => '\t' + line).join('\n');
2666
+ message += '\n' + obj_rate_union1.split('\n').map((line) => '\t' + line).join('\n');
2667
+ return new TypeError(message);
2668
+ }
2669
+ const obj_rateCardEntryId = obj.rateCardEntryId;
2670
+ const path_rateCardEntryId = path + '.rateCardEntryId';
2671
+ let obj_rateCardEntryId_union0 = null;
2672
+ const obj_rateCardEntryId_union0_error = (() => {
2673
+ if (typeof obj_rateCardEntryId !== 'string') {
2674
+ return new TypeError('Expected "string" but received "' + typeof obj_rateCardEntryId + '" (at "' + path_rateCardEntryId + '")');
2675
+ }
2676
+ })();
2677
+ if (obj_rateCardEntryId_union0_error != null) {
2678
+ obj_rateCardEntryId_union0 = obj_rateCardEntryId_union0_error.message;
2679
+ }
2680
+ let obj_rateCardEntryId_union1 = null;
2681
+ const obj_rateCardEntryId_union1_error = (() => {
2682
+ if (obj_rateCardEntryId !== null) {
2683
+ return new TypeError('Expected "null" but received "' + typeof obj_rateCardEntryId + '" (at "' + path_rateCardEntryId + '")');
2684
+ }
2685
+ })();
2686
+ if (obj_rateCardEntryId_union1_error != null) {
2687
+ obj_rateCardEntryId_union1 = obj_rateCardEntryId_union1_error.message;
2688
+ }
2689
+ if (obj_rateCardEntryId_union0 && obj_rateCardEntryId_union1) {
2690
+ let message = 'Object doesn\'t match union (at "' + path_rateCardEntryId + '")';
2691
+ message += '\n' + obj_rateCardEntryId_union0.split('\n').map((line) => '\t' + line).join('\n');
2692
+ message += '\n' + obj_rateCardEntryId_union1.split('\n').map((line) => '\t' + line).join('\n');
2693
+ return new TypeError(message);
2694
+ }
2695
+ const obj_rateUnitOfMeasureName = obj.rateUnitOfMeasureName;
2696
+ const path_rateUnitOfMeasureName = path + '.rateUnitOfMeasureName';
2697
+ let obj_rateUnitOfMeasureName_union0 = null;
2698
+ const obj_rateUnitOfMeasureName_union0_error = (() => {
2699
+ if (typeof obj_rateUnitOfMeasureName !== 'string') {
2700
+ return new TypeError('Expected "string" but received "' + typeof obj_rateUnitOfMeasureName + '" (at "' + path_rateUnitOfMeasureName + '")');
2701
+ }
2702
+ })();
2703
+ if (obj_rateUnitOfMeasureName_union0_error != null) {
2704
+ obj_rateUnitOfMeasureName_union0 = obj_rateUnitOfMeasureName_union0_error.message;
2705
+ }
2706
+ let obj_rateUnitOfMeasureName_union1 = null;
2707
+ const obj_rateUnitOfMeasureName_union1_error = (() => {
2708
+ if (obj_rateUnitOfMeasureName !== null) {
2709
+ return new TypeError('Expected "null" but received "' + typeof obj_rateUnitOfMeasureName + '" (at "' + path_rateUnitOfMeasureName + '")');
2710
+ }
2711
+ })();
2712
+ if (obj_rateUnitOfMeasureName_union1_error != null) {
2713
+ obj_rateUnitOfMeasureName_union1 = obj_rateUnitOfMeasureName_union1_error.message;
2714
+ }
2715
+ if (obj_rateUnitOfMeasureName_union0 && obj_rateUnitOfMeasureName_union1) {
2716
+ let message = 'Object doesn\'t match union (at "' + path_rateUnitOfMeasureName + '")';
2717
+ message += '\n' + obj_rateUnitOfMeasureName_union0.split('\n').map((line) => '\t' + line).join('\n');
2718
+ message += '\n' + obj_rateUnitOfMeasureName_union1.split('\n').map((line) => '\t' + line).join('\n');
2719
+ return new TypeError(message);
2720
+ }
2721
+ })();
2722
+ return v_error === undefined ? null : v_error;
2723
+ }
2724
+ const select$9 = function BindingObjectRateOutputRepresentationSelect() {
2725
+ const { selections: BindingObjectRateAdjustmentsOutputRepresentation__selections, opaque: BindingObjectRateAdjustmentsOutputRepresentation__opaque, } = select$a();
2726
+ return {
2727
+ kind: 'Fragment',
2728
+ version: VERSION$6,
2729
+ private: [],
2730
+ selections: [
2731
+ {
2732
+ name: 'id',
2733
+ kind: 'Scalar'
2734
+ },
2735
+ {
2736
+ name: 'negotiatedRate',
2737
+ kind: 'Scalar'
2738
+ },
2739
+ {
2740
+ name: 'negotiatedRateAdjustments',
2741
+ kind: 'Object',
2742
+ nullable: true,
2743
+ plural: true,
2744
+ selections: BindingObjectRateAdjustmentsOutputRepresentation__selections
2745
+ },
2746
+ {
2747
+ name: 'rate',
2748
+ kind: 'Scalar'
2749
+ },
2750
+ {
2751
+ name: 'rateCardEntryId',
2752
+ kind: 'Scalar'
2753
+ },
2754
+ {
2755
+ name: 'rateUnitOfMeasureName',
2756
+ kind: 'Scalar'
2757
+ }
2758
+ ]
2759
+ };
2760
+ };
2761
+ function equals$6(existing, incoming) {
2762
+ const existing_id = existing.id;
2763
+ const incoming_id = incoming.id;
2764
+ if (!(existing_id === incoming_id)) {
2765
+ return false;
2766
+ }
2767
+ const existing_negotiatedRate = existing.negotiatedRate;
2768
+ const incoming_negotiatedRate = incoming.negotiatedRate;
2769
+ if (!(existing_negotiatedRate === incoming_negotiatedRate)) {
2770
+ return false;
2771
+ }
2772
+ const existing_negotiatedRateAdjustments = existing.negotiatedRateAdjustments;
2773
+ const incoming_negotiatedRateAdjustments = incoming.negotiatedRateAdjustments;
2774
+ const equals_negotiatedRateAdjustments_items = equalsArray(existing_negotiatedRateAdjustments, incoming_negotiatedRateAdjustments, (existing_negotiatedRateAdjustments_item, incoming_negotiatedRateAdjustments_item) => {
2775
+ if (!(existing_negotiatedRateAdjustments_item === incoming_negotiatedRateAdjustments_item
2776
+ || (existing_negotiatedRateAdjustments_item != null &&
2777
+ incoming_negotiatedRateAdjustments_item != null &&
2778
+ equals$7(existing_negotiatedRateAdjustments_item, incoming_negotiatedRateAdjustments_item)))) {
2779
+ return false;
2780
+ }
2781
+ });
2782
+ if (equals_negotiatedRateAdjustments_items === false) {
2783
+ return false;
2784
+ }
2785
+ const existing_rate = existing.rate;
2786
+ const incoming_rate = incoming.rate;
2787
+ if (!(existing_rate === incoming_rate)) {
2788
+ return false;
2789
+ }
2790
+ const existing_rateCardEntryId = existing.rateCardEntryId;
2791
+ const incoming_rateCardEntryId = incoming.rateCardEntryId;
2792
+ if (!(existing_rateCardEntryId === incoming_rateCardEntryId)) {
2793
+ return false;
2794
+ }
2795
+ const existing_rateUnitOfMeasureName = existing.rateUnitOfMeasureName;
2796
+ const incoming_rateUnitOfMeasureName = incoming.rateUnitOfMeasureName;
2797
+ if (!(existing_rateUnitOfMeasureName === incoming_rateUnitOfMeasureName)) {
2798
+ return false;
2799
+ }
2800
+ return true;
2801
+ }
2802
+
2803
+ const VERSION$5 = "33e33f0cd2919c7a3113b7c4b63348fb";
2804
+ function validate$5(obj, path = 'LookupDetailOutputRepresentation') {
2805
+ const v_error = (() => {
2806
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2807
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2808
+ }
2809
+ const obj_id = obj.id;
2810
+ const path_id = path + '.id';
2811
+ let obj_id_union0 = null;
2812
+ const obj_id_union0_error = (() => {
2813
+ if (typeof obj_id !== 'string') {
2814
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
2815
+ }
2816
+ })();
2817
+ if (obj_id_union0_error != null) {
2818
+ obj_id_union0 = obj_id_union0_error.message;
2819
+ }
2820
+ let obj_id_union1 = null;
2821
+ const obj_id_union1_error = (() => {
2822
+ if (obj_id !== null) {
2823
+ return new TypeError('Expected "null" but received "' + typeof obj_id + '" (at "' + path_id + '")');
2824
+ }
2825
+ })();
2826
+ if (obj_id_union1_error != null) {
2827
+ obj_id_union1 = obj_id_union1_error.message;
2828
+ }
2829
+ if (obj_id_union0 && obj_id_union1) {
2830
+ let message = 'Object doesn\'t match union (at "' + path_id + '")';
2831
+ message += '\n' + obj_id_union0.split('\n').map((line) => '\t' + line).join('\n');
2832
+ message += '\n' + obj_id_union1.split('\n').map((line) => '\t' + line).join('\n');
2833
+ return new TypeError(message);
2834
+ }
2835
+ })();
2836
+ return v_error === undefined ? null : v_error;
2837
+ }
2838
+ const select$8 = function LookupDetailOutputRepresentationSelect() {
2839
+ return {
2840
+ kind: 'Fragment',
2841
+ version: VERSION$5,
2842
+ private: [],
2843
+ selections: [
2844
+ {
2845
+ name: 'id',
2846
+ kind: 'Scalar'
2847
+ }
2848
+ ]
2849
+ };
2850
+ };
2851
+ function equals$5(existing, incoming) {
2852
+ const existing_id = existing.id;
2853
+ const incoming_id = incoming.id;
2854
+ if (!(existing_id === incoming_id)) {
2855
+ return false;
2856
+ }
2857
+ return true;
2858
+ }
2859
+
2860
+ const VERSION$4 = "22170829b3cf236b15897c1874cea75d";
2861
+ function validate$4(obj, path = 'BindingObjectGrantDetailOutputRepresentation') {
2862
+ const v_error = (() => {
2863
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2864
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2865
+ }
2866
+ const obj_effectiveEndDate = obj.effectiveEndDate;
2867
+ const path_effectiveEndDate = path + '.effectiveEndDate';
2868
+ let obj_effectiveEndDate_union0 = null;
2869
+ const obj_effectiveEndDate_union0_error = (() => {
2870
+ if (typeof obj_effectiveEndDate !== 'string') {
2871
+ return new TypeError('Expected "string" but received "' + typeof obj_effectiveEndDate + '" (at "' + path_effectiveEndDate + '")');
2872
+ }
2873
+ })();
2874
+ if (obj_effectiveEndDate_union0_error != null) {
2875
+ obj_effectiveEndDate_union0 = obj_effectiveEndDate_union0_error.message;
2876
+ }
2877
+ let obj_effectiveEndDate_union1 = null;
2878
+ const obj_effectiveEndDate_union1_error = (() => {
2879
+ if (obj_effectiveEndDate !== null) {
2880
+ return new TypeError('Expected "null" but received "' + typeof obj_effectiveEndDate + '" (at "' + path_effectiveEndDate + '")');
2881
+ }
2882
+ })();
2883
+ if (obj_effectiveEndDate_union1_error != null) {
2884
+ obj_effectiveEndDate_union1 = obj_effectiveEndDate_union1_error.message;
2885
+ }
2886
+ if (obj_effectiveEndDate_union0 && obj_effectiveEndDate_union1) {
2887
+ let message = 'Object doesn\'t match union (at "' + path_effectiveEndDate + '")';
2888
+ message += '\n' + obj_effectiveEndDate_union0.split('\n').map((line) => '\t' + line).join('\n');
2889
+ message += '\n' + obj_effectiveEndDate_union1.split('\n').map((line) => '\t' + line).join('\n');
2890
+ return new TypeError(message);
2891
+ }
2892
+ const obj_effectiveStartDate = obj.effectiveStartDate;
2893
+ const path_effectiveStartDate = path + '.effectiveStartDate';
2894
+ let obj_effectiveStartDate_union0 = null;
2895
+ const obj_effectiveStartDate_union0_error = (() => {
2896
+ if (typeof obj_effectiveStartDate !== 'string') {
2897
+ return new TypeError('Expected "string" but received "' + typeof obj_effectiveStartDate + '" (at "' + path_effectiveStartDate + '")');
2898
+ }
2899
+ })();
2900
+ if (obj_effectiveStartDate_union0_error != null) {
2901
+ obj_effectiveStartDate_union0 = obj_effectiveStartDate_union0_error.message;
2902
+ }
2903
+ let obj_effectiveStartDate_union1 = null;
2904
+ const obj_effectiveStartDate_union1_error = (() => {
2905
+ if (obj_effectiveStartDate !== null) {
2906
+ return new TypeError('Expected "null" but received "' + typeof obj_effectiveStartDate + '" (at "' + path_effectiveStartDate + '")');
2907
+ }
2908
+ })();
2909
+ if (obj_effectiveStartDate_union1_error != null) {
2910
+ obj_effectiveStartDate_union1 = obj_effectiveStartDate_union1_error.message;
2911
+ }
2912
+ if (obj_effectiveStartDate_union0 && obj_effectiveStartDate_union1) {
2913
+ let message = 'Object doesn\'t match union (at "' + path_effectiveStartDate + '")';
2914
+ message += '\n' + obj_effectiveStartDate_union0.split('\n').map((line) => '\t' + line).join('\n');
2915
+ message += '\n' + obj_effectiveStartDate_union1.split('\n').map((line) => '\t' + line).join('\n');
2916
+ return new TypeError(message);
2917
+ }
2918
+ const obj_grantType = obj.grantType;
2919
+ const path_grantType = path + '.grantType';
2920
+ let obj_grantType_union0 = null;
2921
+ const obj_grantType_union0_error = (() => {
2922
+ if (typeof obj_grantType !== 'string') {
2923
+ return new TypeError('Expected "string" but received "' + typeof obj_grantType + '" (at "' + path_grantType + '")');
2924
+ }
2925
+ })();
2926
+ if (obj_grantType_union0_error != null) {
2927
+ obj_grantType_union0 = obj_grantType_union0_error.message;
2928
+ }
2929
+ let obj_grantType_union1 = null;
2930
+ const obj_grantType_union1_error = (() => {
2931
+ if (obj_grantType !== null) {
2932
+ return new TypeError('Expected "null" but received "' + typeof obj_grantType + '" (at "' + path_grantType + '")');
2933
+ }
2934
+ })();
2935
+ if (obj_grantType_union1_error != null) {
2936
+ obj_grantType_union1 = obj_grantType_union1_error.message;
2937
+ }
2938
+ if (obj_grantType_union0 && obj_grantType_union1) {
2939
+ let message = 'Object doesn\'t match union (at "' + path_grantType + '")';
2940
+ message += '\n' + obj_grantType_union0.split('\n').map((line) => '\t' + line).join('\n');
2941
+ message += '\n' + obj_grantType_union1.split('\n').map((line) => '\t' + line).join('\n');
2942
+ return new TypeError(message);
2943
+ }
2944
+ const obj_id = obj.id;
2945
+ const path_id = path + '.id';
2946
+ let obj_id_union0 = null;
2947
+ const obj_id_union0_error = (() => {
2948
+ if (typeof obj_id !== 'string') {
2949
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
2950
+ }
2951
+ })();
2952
+ if (obj_id_union0_error != null) {
2953
+ obj_id_union0 = obj_id_union0_error.message;
2954
+ }
2955
+ let obj_id_union1 = null;
2956
+ const obj_id_union1_error = (() => {
2957
+ if (obj_id !== null) {
2958
+ return new TypeError('Expected "null" but received "' + typeof obj_id + '" (at "' + path_id + '")');
2959
+ }
2960
+ })();
2961
+ if (obj_id_union1_error != null) {
2962
+ obj_id_union1 = obj_id_union1_error.message;
2963
+ }
2964
+ if (obj_id_union0 && obj_id_union1) {
2965
+ let message = 'Object doesn\'t match union (at "' + path_id + '")';
2966
+ message += '\n' + obj_id_union0.split('\n').map((line) => '\t' + line).join('\n');
2967
+ message += '\n' + obj_id_union1.split('\n').map((line) => '\t' + line).join('\n');
2968
+ return new TypeError(message);
2969
+ }
2970
+ const obj_product = obj.product;
2971
+ const path_product = path + '.product';
2972
+ let obj_product_union0 = null;
2973
+ const obj_product_union0_error = (() => {
2974
+ const referencepath_productValidationError = validate$5(obj_product, path_product);
2975
+ if (referencepath_productValidationError !== null) {
2976
+ let message = 'Object doesn\'t match LookupDetailOutputRepresentation (at "' + path_product + '")\n';
2977
+ message += referencepath_productValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2978
+ return new TypeError(message);
2979
+ }
2980
+ })();
2981
+ if (obj_product_union0_error != null) {
2982
+ obj_product_union0 = obj_product_union0_error.message;
2983
+ }
2984
+ let obj_product_union1 = null;
2985
+ const obj_product_union1_error = (() => {
2986
+ if (obj_product !== null) {
2987
+ return new TypeError('Expected "null" but received "' + typeof obj_product + '" (at "' + path_product + '")');
2988
+ }
2989
+ })();
2990
+ if (obj_product_union1_error != null) {
2991
+ obj_product_union1 = obj_product_union1_error.message;
2992
+ }
2993
+ if (obj_product_union0 && obj_product_union1) {
2994
+ let message = 'Object doesn\'t match union (at "' + path_product + '")';
2995
+ message += '\n' + obj_product_union0.split('\n').map((line) => '\t' + line).join('\n');
2996
+ message += '\n' + obj_product_union1.split('\n').map((line) => '\t' + line).join('\n');
2997
+ return new TypeError(message);
2998
+ }
2999
+ const obj_quantity = obj.quantity;
3000
+ const path_quantity = path + '.quantity';
3001
+ let obj_quantity_union0 = null;
3002
+ const obj_quantity_union0_error = (() => {
3003
+ if (typeof obj_quantity !== 'number') {
3004
+ return new TypeError('Expected "number" but received "' + typeof obj_quantity + '" (at "' + path_quantity + '")');
3005
+ }
3006
+ })();
3007
+ if (obj_quantity_union0_error != null) {
3008
+ obj_quantity_union0 = obj_quantity_union0_error.message;
3009
+ }
3010
+ let obj_quantity_union1 = null;
3011
+ const obj_quantity_union1_error = (() => {
3012
+ if (obj_quantity !== null) {
3013
+ return new TypeError('Expected "null" but received "' + typeof obj_quantity + '" (at "' + path_quantity + '")');
3014
+ }
3015
+ })();
3016
+ if (obj_quantity_union1_error != null) {
3017
+ obj_quantity_union1 = obj_quantity_union1_error.message;
3018
+ }
3019
+ if (obj_quantity_union0 && obj_quantity_union1) {
3020
+ let message = 'Object doesn\'t match union (at "' + path_quantity + '")';
3021
+ message += '\n' + obj_quantity_union0.split('\n').map((line) => '\t' + line).join('\n');
3022
+ message += '\n' + obj_quantity_union1.split('\n').map((line) => '\t' + line).join('\n');
3023
+ return new TypeError(message);
3024
+ }
3025
+ const obj_record = obj.record;
3026
+ const path_record = path + '.record';
3027
+ let obj_record_union0 = null;
3028
+ const obj_record_union0_error = (() => {
3029
+ const referencepath_recordValidationError = validate$5(obj_record, path_record);
3030
+ if (referencepath_recordValidationError !== null) {
3031
+ let message = 'Object doesn\'t match LookupDetailOutputRepresentation (at "' + path_record + '")\n';
3032
+ message += referencepath_recordValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
3033
+ return new TypeError(message);
3034
+ }
3035
+ })();
3036
+ if (obj_record_union0_error != null) {
3037
+ obj_record_union0 = obj_record_union0_error.message;
3038
+ }
3039
+ let obj_record_union1 = null;
3040
+ const obj_record_union1_error = (() => {
3041
+ if (obj_record !== null) {
3042
+ return new TypeError('Expected "null" but received "' + typeof obj_record + '" (at "' + path_record + '")');
3043
+ }
3044
+ })();
3045
+ if (obj_record_union1_error != null) {
3046
+ obj_record_union1 = obj_record_union1_error.message;
3047
+ }
3048
+ if (obj_record_union0 && obj_record_union1) {
3049
+ let message = 'Object doesn\'t match union (at "' + path_record + '")';
3050
+ message += '\n' + obj_record_union0.split('\n').map((line) => '\t' + line).join('\n');
3051
+ message += '\n' + obj_record_union1.split('\n').map((line) => '\t' + line).join('\n');
3052
+ return new TypeError(message);
3053
+ }
3054
+ const obj_unitOfMeasure = obj.unitOfMeasure;
3055
+ const path_unitOfMeasure = path + '.unitOfMeasure';
3056
+ let obj_unitOfMeasure_union0 = null;
3057
+ const obj_unitOfMeasure_union0_error = (() => {
3058
+ const referencepath_unitOfMeasureValidationError = validate$5(obj_unitOfMeasure, path_unitOfMeasure);
3059
+ if (referencepath_unitOfMeasureValidationError !== null) {
3060
+ let message = 'Object doesn\'t match LookupDetailOutputRepresentation (at "' + path_unitOfMeasure + '")\n';
3061
+ message += referencepath_unitOfMeasureValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
3062
+ return new TypeError(message);
3063
+ }
3064
+ })();
3065
+ if (obj_unitOfMeasure_union0_error != null) {
3066
+ obj_unitOfMeasure_union0 = obj_unitOfMeasure_union0_error.message;
3067
+ }
3068
+ let obj_unitOfMeasure_union1 = null;
3069
+ const obj_unitOfMeasure_union1_error = (() => {
3070
+ if (obj_unitOfMeasure !== null) {
3071
+ return new TypeError('Expected "null" but received "' + typeof obj_unitOfMeasure + '" (at "' + path_unitOfMeasure + '")');
3072
+ }
3073
+ })();
3074
+ if (obj_unitOfMeasure_union1_error != null) {
3075
+ obj_unitOfMeasure_union1 = obj_unitOfMeasure_union1_error.message;
3076
+ }
3077
+ if (obj_unitOfMeasure_union0 && obj_unitOfMeasure_union1) {
3078
+ let message = 'Object doesn\'t match union (at "' + path_unitOfMeasure + '")';
3079
+ message += '\n' + obj_unitOfMeasure_union0.split('\n').map((line) => '\t' + line).join('\n');
3080
+ message += '\n' + obj_unitOfMeasure_union1.split('\n').map((line) => '\t' + line).join('\n');
3081
+ return new TypeError(message);
3082
+ }
3083
+ const obj_usageRefreshPolicy = obj.usageRefreshPolicy;
3084
+ const path_usageRefreshPolicy = path + '.usageRefreshPolicy';
3085
+ let obj_usageRefreshPolicy_union0 = null;
3086
+ const obj_usageRefreshPolicy_union0_error = (() => {
3087
+ const referencepath_usageRefreshPolicyValidationError = validate$d(obj_usageRefreshPolicy, path_usageRefreshPolicy);
3088
+ if (referencepath_usageRefreshPolicyValidationError !== null) {
3089
+ let message = 'Object doesn\'t match PolicyDetailOutputRepresentation (at "' + path_usageRefreshPolicy + '")\n';
3090
+ message += referencepath_usageRefreshPolicyValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
3091
+ return new TypeError(message);
3092
+ }
3093
+ })();
3094
+ if (obj_usageRefreshPolicy_union0_error != null) {
3095
+ obj_usageRefreshPolicy_union0 = obj_usageRefreshPolicy_union0_error.message;
3096
+ }
3097
+ let obj_usageRefreshPolicy_union1 = null;
3098
+ const obj_usageRefreshPolicy_union1_error = (() => {
3099
+ if (obj_usageRefreshPolicy !== null) {
3100
+ return new TypeError('Expected "null" but received "' + typeof obj_usageRefreshPolicy + '" (at "' + path_usageRefreshPolicy + '")');
3101
+ }
3102
+ })();
3103
+ if (obj_usageRefreshPolicy_union1_error != null) {
3104
+ obj_usageRefreshPolicy_union1 = obj_usageRefreshPolicy_union1_error.message;
3105
+ }
3106
+ if (obj_usageRefreshPolicy_union0 && obj_usageRefreshPolicy_union1) {
3107
+ let message = 'Object doesn\'t match union (at "' + path_usageRefreshPolicy + '")';
3108
+ message += '\n' + obj_usageRefreshPolicy_union0.split('\n').map((line) => '\t' + line).join('\n');
3109
+ message += '\n' + obj_usageRefreshPolicy_union1.split('\n').map((line) => '\t' + line).join('\n');
3110
+ return new TypeError(message);
3111
+ }
3112
+ const obj_usageRolloverPolicy = obj.usageRolloverPolicy;
3113
+ const path_usageRolloverPolicy = path + '.usageRolloverPolicy';
3114
+ let obj_usageRolloverPolicy_union0 = null;
3115
+ const obj_usageRolloverPolicy_union0_error = (() => {
3116
+ const referencepath_usageRolloverPolicyValidationError = validate$d(obj_usageRolloverPolicy, path_usageRolloverPolicy);
3117
+ if (referencepath_usageRolloverPolicyValidationError !== null) {
3118
+ let message = 'Object doesn\'t match PolicyDetailOutputRepresentation (at "' + path_usageRolloverPolicy + '")\n';
3119
+ message += referencepath_usageRolloverPolicyValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
3120
+ return new TypeError(message);
3121
+ }
3122
+ })();
3123
+ if (obj_usageRolloverPolicy_union0_error != null) {
3124
+ obj_usageRolloverPolicy_union0 = obj_usageRolloverPolicy_union0_error.message;
3125
+ }
3126
+ let obj_usageRolloverPolicy_union1 = null;
3127
+ const obj_usageRolloverPolicy_union1_error = (() => {
3128
+ if (obj_usageRolloverPolicy !== null) {
3129
+ return new TypeError('Expected "null" but received "' + typeof obj_usageRolloverPolicy + '" (at "' + path_usageRolloverPolicy + '")');
3130
+ }
3131
+ })();
3132
+ if (obj_usageRolloverPolicy_union1_error != null) {
3133
+ obj_usageRolloverPolicy_union1 = obj_usageRolloverPolicy_union1_error.message;
3134
+ }
3135
+ if (obj_usageRolloverPolicy_union0 && obj_usageRolloverPolicy_union1) {
3136
+ let message = 'Object doesn\'t match union (at "' + path_usageRolloverPolicy + '")';
3137
+ message += '\n' + obj_usageRolloverPolicy_union0.split('\n').map((line) => '\t' + line).join('\n');
3138
+ message += '\n' + obj_usageRolloverPolicy_union1.split('\n').map((line) => '\t' + line).join('\n');
3139
+ return new TypeError(message);
3140
+ }
3141
+ const obj_validityPeriodTerm = obj.validityPeriodTerm;
3142
+ const path_validityPeriodTerm = path + '.validityPeriodTerm';
3143
+ let obj_validityPeriodTerm_union0 = null;
3144
+ const obj_validityPeriodTerm_union0_error = (() => {
3145
+ if (typeof obj_validityPeriodTerm !== 'number') {
3146
+ return new TypeError('Expected "number" but received "' + typeof obj_validityPeriodTerm + '" (at "' + path_validityPeriodTerm + '")');
3147
+ }
3148
+ })();
3149
+ if (obj_validityPeriodTerm_union0_error != null) {
3150
+ obj_validityPeriodTerm_union0 = obj_validityPeriodTerm_union0_error.message;
3151
+ }
3152
+ let obj_validityPeriodTerm_union1 = null;
3153
+ const obj_validityPeriodTerm_union1_error = (() => {
3154
+ if (obj_validityPeriodTerm !== null) {
3155
+ return new TypeError('Expected "null" but received "' + typeof obj_validityPeriodTerm + '" (at "' + path_validityPeriodTerm + '")');
3156
+ }
3157
+ })();
3158
+ if (obj_validityPeriodTerm_union1_error != null) {
3159
+ obj_validityPeriodTerm_union1 = obj_validityPeriodTerm_union1_error.message;
3160
+ }
3161
+ if (obj_validityPeriodTerm_union0 && obj_validityPeriodTerm_union1) {
3162
+ let message = 'Object doesn\'t match union (at "' + path_validityPeriodTerm + '")';
3163
+ message += '\n' + obj_validityPeriodTerm_union0.split('\n').map((line) => '\t' + line).join('\n');
3164
+ message += '\n' + obj_validityPeriodTerm_union1.split('\n').map((line) => '\t' + line).join('\n');
3165
+ return new TypeError(message);
3166
+ }
3167
+ const obj_validityPeriodUnit = obj.validityPeriodUnit;
3168
+ const path_validityPeriodUnit = path + '.validityPeriodUnit';
3169
+ let obj_validityPeriodUnit_union0 = null;
3170
+ const obj_validityPeriodUnit_union0_error = (() => {
3171
+ if (typeof obj_validityPeriodUnit !== 'string') {
3172
+ return new TypeError('Expected "string" but received "' + typeof obj_validityPeriodUnit + '" (at "' + path_validityPeriodUnit + '")');
3173
+ }
3174
+ })();
3175
+ if (obj_validityPeriodUnit_union0_error != null) {
3176
+ obj_validityPeriodUnit_union0 = obj_validityPeriodUnit_union0_error.message;
3177
+ }
3178
+ let obj_validityPeriodUnit_union1 = null;
3179
+ const obj_validityPeriodUnit_union1_error = (() => {
3180
+ if (obj_validityPeriodUnit !== null) {
3181
+ return new TypeError('Expected "null" but received "' + typeof obj_validityPeriodUnit + '" (at "' + path_validityPeriodUnit + '")');
3182
+ }
3183
+ })();
3184
+ if (obj_validityPeriodUnit_union1_error != null) {
3185
+ obj_validityPeriodUnit_union1 = obj_validityPeriodUnit_union1_error.message;
3186
+ }
3187
+ if (obj_validityPeriodUnit_union0 && obj_validityPeriodUnit_union1) {
3188
+ let message = 'Object doesn\'t match union (at "' + path_validityPeriodUnit + '")';
3189
+ message += '\n' + obj_validityPeriodUnit_union0.split('\n').map((line) => '\t' + line).join('\n');
3190
+ message += '\n' + obj_validityPeriodUnit_union1.split('\n').map((line) => '\t' + line).join('\n');
3191
+ return new TypeError(message);
3192
+ }
3193
+ })();
3194
+ return v_error === undefined ? null : v_error;
3195
+ }
3196
+ const select$7 = function BindingObjectGrantDetailOutputRepresentationSelect() {
3197
+ const { selections: LookupDetailOutputRepresentation__selections, opaque: LookupDetailOutputRepresentation__opaque, } = select$8();
3198
+ const { selections: PolicyDetailOutputRepresentation__selections, opaque: PolicyDetailOutputRepresentation__opaque, } = select$h();
3199
+ return {
3200
+ kind: 'Fragment',
3201
+ version: VERSION$4,
3202
+ private: [],
3203
+ selections: [
3204
+ {
3205
+ name: 'effectiveEndDate',
3206
+ kind: 'Scalar'
3207
+ },
3208
+ {
3209
+ name: 'effectiveStartDate',
3210
+ kind: 'Scalar'
3211
+ },
3212
+ {
3213
+ name: 'grantType',
3214
+ kind: 'Scalar'
3215
+ },
3216
+ {
3217
+ name: 'id',
3218
+ kind: 'Scalar'
3219
+ },
3220
+ {
3221
+ name: 'product',
3222
+ kind: 'Object',
3223
+ nullable: true,
3224
+ selections: LookupDetailOutputRepresentation__selections
3225
+ },
3226
+ {
3227
+ name: 'quantity',
3228
+ kind: 'Scalar'
3229
+ },
3230
+ {
3231
+ name: 'record',
3232
+ kind: 'Object',
3233
+ nullable: true,
3234
+ selections: LookupDetailOutputRepresentation__selections
3235
+ },
3236
+ {
3237
+ name: 'unitOfMeasure',
3238
+ kind: 'Object',
3239
+ nullable: true,
3240
+ selections: LookupDetailOutputRepresentation__selections
3241
+ },
3242
+ {
3243
+ name: 'usageRefreshPolicy',
3244
+ kind: 'Object',
3245
+ nullable: true,
3246
+ selections: PolicyDetailOutputRepresentation__selections
3247
+ },
3248
+ {
3249
+ name: 'usageRolloverPolicy',
3250
+ kind: 'Object',
3251
+ nullable: true,
3252
+ selections: PolicyDetailOutputRepresentation__selections
3253
+ },
3254
+ {
3255
+ name: 'validityPeriodTerm',
3256
+ kind: 'Scalar'
3257
+ },
3258
+ {
3259
+ name: 'validityPeriodUnit',
3260
+ kind: 'Scalar'
3261
+ }
3262
+ ]
3263
+ };
3264
+ };
3265
+ function equals$4(existing, incoming) {
3266
+ const existing_effectiveEndDate = existing.effectiveEndDate;
3267
+ const incoming_effectiveEndDate = incoming.effectiveEndDate;
3268
+ if (!(existing_effectiveEndDate === incoming_effectiveEndDate)) {
3269
+ return false;
3270
+ }
3271
+ const existing_effectiveStartDate = existing.effectiveStartDate;
3272
+ const incoming_effectiveStartDate = incoming.effectiveStartDate;
3273
+ if (!(existing_effectiveStartDate === incoming_effectiveStartDate)) {
3274
+ return false;
3275
+ }
3276
+ const existing_grantType = existing.grantType;
3277
+ const incoming_grantType = incoming.grantType;
3278
+ if (!(existing_grantType === incoming_grantType)) {
3279
+ return false;
3280
+ }
3281
+ const existing_id = existing.id;
3282
+ const incoming_id = incoming.id;
3283
+ if (!(existing_id === incoming_id)) {
3284
+ return false;
3285
+ }
3286
+ const existing_product = existing.product;
3287
+ const incoming_product = incoming.product;
3288
+ if (!(existing_product === incoming_product
3289
+ || (existing_product != null &&
3290
+ incoming_product != null &&
3291
+ equals$5(existing_product, incoming_product)))) {
3292
+ return false;
3293
+ }
3294
+ const existing_quantity = existing.quantity;
3295
+ const incoming_quantity = incoming.quantity;
3296
+ if (!(existing_quantity === incoming_quantity)) {
3297
+ return false;
3298
+ }
3299
+ const existing_record = existing.record;
3300
+ const incoming_record = incoming.record;
3301
+ if (!(existing_record === incoming_record
3302
+ || (existing_record != null &&
3303
+ incoming_record != null &&
3304
+ equals$5(existing_record, incoming_record)))) {
3305
+ return false;
3306
+ }
3307
+ const existing_unitOfMeasure = existing.unitOfMeasure;
3308
+ const incoming_unitOfMeasure = incoming.unitOfMeasure;
3309
+ if (!(existing_unitOfMeasure === incoming_unitOfMeasure
3310
+ || (existing_unitOfMeasure != null &&
3311
+ incoming_unitOfMeasure != null &&
3312
+ equals$5(existing_unitOfMeasure, incoming_unitOfMeasure)))) {
3313
+ return false;
3314
+ }
3315
+ const existing_usageRefreshPolicy = existing.usageRefreshPolicy;
3316
+ const incoming_usageRefreshPolicy = incoming.usageRefreshPolicy;
3317
+ if (!(existing_usageRefreshPolicy === incoming_usageRefreshPolicy
3318
+ || (existing_usageRefreshPolicy != null &&
3319
+ incoming_usageRefreshPolicy != null &&
3320
+ equals$d(existing_usageRefreshPolicy, incoming_usageRefreshPolicy)))) {
3321
+ return false;
3322
+ }
3323
+ const existing_usageRolloverPolicy = existing.usageRolloverPolicy;
3324
+ const incoming_usageRolloverPolicy = incoming.usageRolloverPolicy;
3325
+ if (!(existing_usageRolloverPolicy === incoming_usageRolloverPolicy
3326
+ || (existing_usageRolloverPolicy != null &&
3327
+ incoming_usageRolloverPolicy != null &&
3328
+ equals$d(existing_usageRolloverPolicy, incoming_usageRolloverPolicy)))) {
3329
+ return false;
3330
+ }
3331
+ const existing_validityPeriodTerm = existing.validityPeriodTerm;
3332
+ const incoming_validityPeriodTerm = incoming.validityPeriodTerm;
3333
+ if (!(existing_validityPeriodTerm === incoming_validityPeriodTerm)) {
3334
+ return false;
3335
+ }
3336
+ const existing_validityPeriodUnit = existing.validityPeriodUnit;
3337
+ const incoming_validityPeriodUnit = incoming.validityPeriodUnit;
3338
+ if (!(existing_validityPeriodUnit === incoming_validityPeriodUnit)) {
3339
+ return false;
3340
+ }
3341
+ return true;
3342
+ }
3343
+
3344
+ const VERSION$3 = "4ac471e759f07d5b598ca0dec1fedd12";
3345
+ function validate$3(obj, path = 'BindingObjectResourcePolicyDetailOutputRepresentation') {
3346
+ const v_error = (() => {
3347
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
3348
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
3349
+ }
3350
+ const obj_drawdownOrder = obj.drawdownOrder;
3351
+ const path_drawdownOrder = path + '.drawdownOrder';
3352
+ let obj_drawdownOrder_union0 = null;
3353
+ const obj_drawdownOrder_union0_error = (() => {
3354
+ if (typeof obj_drawdownOrder !== 'string') {
3355
+ return new TypeError('Expected "string" but received "' + typeof obj_drawdownOrder + '" (at "' + path_drawdownOrder + '")');
3356
+ }
3357
+ })();
3358
+ if (obj_drawdownOrder_union0_error != null) {
3359
+ obj_drawdownOrder_union0 = obj_drawdownOrder_union0_error.message;
3360
+ }
3361
+ let obj_drawdownOrder_union1 = null;
3362
+ const obj_drawdownOrder_union1_error = (() => {
3363
+ if (obj_drawdownOrder !== null) {
3364
+ return new TypeError('Expected "null" but received "' + typeof obj_drawdownOrder + '" (at "' + path_drawdownOrder + '")');
3365
+ }
3366
+ })();
3367
+ if (obj_drawdownOrder_union1_error != null) {
3368
+ obj_drawdownOrder_union1 = obj_drawdownOrder_union1_error.message;
3369
+ }
3370
+ if (obj_drawdownOrder_union0 && obj_drawdownOrder_union1) {
3371
+ let message = 'Object doesn\'t match union (at "' + path_drawdownOrder + '")';
3372
+ message += '\n' + obj_drawdownOrder_union0.split('\n').map((line) => '\t' + line).join('\n');
3373
+ message += '\n' + obj_drawdownOrder_union1.split('\n').map((line) => '\t' + line).join('\n');
3374
+ return new TypeError(message);
3375
+ }
3376
+ const obj_id = obj.id;
3377
+ const path_id = path + '.id';
3378
+ let obj_id_union0 = null;
3379
+ const obj_id_union0_error = (() => {
3380
+ if (typeof obj_id !== 'string') {
3381
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
3382
+ }
3383
+ })();
3384
+ if (obj_id_union0_error != null) {
3385
+ obj_id_union0 = obj_id_union0_error.message;
3386
+ }
3387
+ let obj_id_union1 = null;
3388
+ const obj_id_union1_error = (() => {
3389
+ if (obj_id !== null) {
3390
+ return new TypeError('Expected "null" but received "' + typeof obj_id + '" (at "' + path_id + '")');
3391
+ }
3392
+ })();
3393
+ if (obj_id_union1_error != null) {
3394
+ obj_id_union1 = obj_id_union1_error.message;
3395
+ }
3396
+ if (obj_id_union0 && obj_id_union1) {
3397
+ let message = 'Object doesn\'t match union (at "' + path_id + '")';
3398
+ message += '\n' + obj_id_union0.split('\n').map((line) => '\t' + line).join('\n');
3399
+ message += '\n' + obj_id_union1.split('\n').map((line) => '\t' + line).join('\n');
3400
+ return new TypeError(message);
3401
+ }
3402
+ const obj_ratingFrequencyPolicy = obj.ratingFrequencyPolicy;
3403
+ const path_ratingFrequencyPolicy = path + '.ratingFrequencyPolicy';
3404
+ let obj_ratingFrequencyPolicy_union0 = null;
3405
+ const obj_ratingFrequencyPolicy_union0_error = (() => {
3406
+ const referencepath_ratingFrequencyPolicyValidationError = validate$d(obj_ratingFrequencyPolicy, path_ratingFrequencyPolicy);
3407
+ if (referencepath_ratingFrequencyPolicyValidationError !== null) {
3408
+ let message = 'Object doesn\'t match PolicyDetailOutputRepresentation (at "' + path_ratingFrequencyPolicy + '")\n';
3409
+ message += referencepath_ratingFrequencyPolicyValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
3410
+ return new TypeError(message);
3411
+ }
3412
+ })();
3413
+ if (obj_ratingFrequencyPolicy_union0_error != null) {
3414
+ obj_ratingFrequencyPolicy_union0 = obj_ratingFrequencyPolicy_union0_error.message;
3415
+ }
3416
+ let obj_ratingFrequencyPolicy_union1 = null;
3417
+ const obj_ratingFrequencyPolicy_union1_error = (() => {
3418
+ if (obj_ratingFrequencyPolicy !== null) {
3419
+ return new TypeError('Expected "null" but received "' + typeof obj_ratingFrequencyPolicy + '" (at "' + path_ratingFrequencyPolicy + '")');
3420
+ }
3421
+ })();
3422
+ if (obj_ratingFrequencyPolicy_union1_error != null) {
3423
+ obj_ratingFrequencyPolicy_union1 = obj_ratingFrequencyPolicy_union1_error.message;
3424
+ }
3425
+ if (obj_ratingFrequencyPolicy_union0 && obj_ratingFrequencyPolicy_union1) {
3426
+ let message = 'Object doesn\'t match union (at "' + path_ratingFrequencyPolicy + '")';
3427
+ message += '\n' + obj_ratingFrequencyPolicy_union0.split('\n').map((line) => '\t' + line).join('\n');
3428
+ message += '\n' + obj_ratingFrequencyPolicy_union1.split('\n').map((line) => '\t' + line).join('\n');
3429
+ return new TypeError(message);
3430
+ }
3431
+ const obj_usageAggregationPolicy = obj.usageAggregationPolicy;
3432
+ const path_usageAggregationPolicy = path + '.usageAggregationPolicy';
3433
+ let obj_usageAggregationPolicy_union0 = null;
3434
+ const obj_usageAggregationPolicy_union0_error = (() => {
3435
+ const referencepath_usageAggregationPolicyValidationError = validate$d(obj_usageAggregationPolicy, path_usageAggregationPolicy);
3436
+ if (referencepath_usageAggregationPolicyValidationError !== null) {
3437
+ let message = 'Object doesn\'t match PolicyDetailOutputRepresentation (at "' + path_usageAggregationPolicy + '")\n';
3438
+ message += referencepath_usageAggregationPolicyValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
3439
+ return new TypeError(message);
3440
+ }
3441
+ })();
3442
+ if (obj_usageAggregationPolicy_union0_error != null) {
3443
+ obj_usageAggregationPolicy_union0 = obj_usageAggregationPolicy_union0_error.message;
3444
+ }
3445
+ let obj_usageAggregationPolicy_union1 = null;
3446
+ const obj_usageAggregationPolicy_union1_error = (() => {
3447
+ if (obj_usageAggregationPolicy !== null) {
3448
+ return new TypeError('Expected "null" but received "' + typeof obj_usageAggregationPolicy + '" (at "' + path_usageAggregationPolicy + '")');
3449
+ }
3450
+ })();
3451
+ if (obj_usageAggregationPolicy_union1_error != null) {
3452
+ obj_usageAggregationPolicy_union1 = obj_usageAggregationPolicy_union1_error.message;
3453
+ }
3454
+ if (obj_usageAggregationPolicy_union0 && obj_usageAggregationPolicy_union1) {
3455
+ let message = 'Object doesn\'t match union (at "' + path_usageAggregationPolicy + '")';
3456
+ message += '\n' + obj_usageAggregationPolicy_union0.split('\n').map((line) => '\t' + line).join('\n');
3457
+ message += '\n' + obj_usageAggregationPolicy_union1.split('\n').map((line) => '\t' + line).join('\n');
3458
+ return new TypeError(message);
3459
+ }
3460
+ const obj_usageCommitmentPolicy = obj.usageCommitmentPolicy;
3461
+ const path_usageCommitmentPolicy = path + '.usageCommitmentPolicy';
3462
+ let obj_usageCommitmentPolicy_union0 = null;
3463
+ const obj_usageCommitmentPolicy_union0_error = (() => {
3464
+ const referencepath_usageCommitmentPolicyValidationError = validate$d(obj_usageCommitmentPolicy, path_usageCommitmentPolicy);
3465
+ if (referencepath_usageCommitmentPolicyValidationError !== null) {
3466
+ let message = 'Object doesn\'t match PolicyDetailOutputRepresentation (at "' + path_usageCommitmentPolicy + '")\n';
3467
+ message += referencepath_usageCommitmentPolicyValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
3468
+ return new TypeError(message);
3469
+ }
3470
+ })();
3471
+ if (obj_usageCommitmentPolicy_union0_error != null) {
3472
+ obj_usageCommitmentPolicy_union0 = obj_usageCommitmentPolicy_union0_error.message;
3473
+ }
3474
+ let obj_usageCommitmentPolicy_union1 = null;
3475
+ const obj_usageCommitmentPolicy_union1_error = (() => {
3476
+ if (obj_usageCommitmentPolicy !== null) {
3477
+ return new TypeError('Expected "null" but received "' + typeof obj_usageCommitmentPolicy + '" (at "' + path_usageCommitmentPolicy + '")');
3478
+ }
3479
+ })();
3480
+ if (obj_usageCommitmentPolicy_union1_error != null) {
3481
+ obj_usageCommitmentPolicy_union1 = obj_usageCommitmentPolicy_union1_error.message;
3482
+ }
3483
+ if (obj_usageCommitmentPolicy_union0 && obj_usageCommitmentPolicy_union1) {
3484
+ let message = 'Object doesn\'t match union (at "' + path_usageCommitmentPolicy + '")';
3485
+ message += '\n' + obj_usageCommitmentPolicy_union0.split('\n').map((line) => '\t' + line).join('\n');
3486
+ message += '\n' + obj_usageCommitmentPolicy_union1.split('\n').map((line) => '\t' + line).join('\n');
3487
+ return new TypeError(message);
3488
+ }
3489
+ const obj_usageOveragePolicy = obj.usageOveragePolicy;
3490
+ const path_usageOveragePolicy = path + '.usageOveragePolicy';
3491
+ let obj_usageOveragePolicy_union0 = null;
3492
+ const obj_usageOveragePolicy_union0_error = (() => {
3493
+ const referencepath_usageOveragePolicyValidationError = validate$d(obj_usageOveragePolicy, path_usageOveragePolicy);
3494
+ if (referencepath_usageOveragePolicyValidationError !== null) {
3495
+ let message = 'Object doesn\'t match PolicyDetailOutputRepresentation (at "' + path_usageOveragePolicy + '")\n';
3496
+ message += referencepath_usageOveragePolicyValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
3497
+ return new TypeError(message);
3498
+ }
3499
+ })();
3500
+ if (obj_usageOveragePolicy_union0_error != null) {
3501
+ obj_usageOveragePolicy_union0 = obj_usageOveragePolicy_union0_error.message;
3502
+ }
3503
+ let obj_usageOveragePolicy_union1 = null;
3504
+ const obj_usageOveragePolicy_union1_error = (() => {
3505
+ if (obj_usageOveragePolicy !== null) {
3506
+ return new TypeError('Expected "null" but received "' + typeof obj_usageOveragePolicy + '" (at "' + path_usageOveragePolicy + '")');
3507
+ }
3508
+ })();
3509
+ if (obj_usageOveragePolicy_union1_error != null) {
3510
+ obj_usageOveragePolicy_union1 = obj_usageOveragePolicy_union1_error.message;
3511
+ }
3512
+ if (obj_usageOveragePolicy_union0 && obj_usageOveragePolicy_union1) {
3513
+ let message = 'Object doesn\'t match union (at "' + path_usageOveragePolicy + '")';
3514
+ message += '\n' + obj_usageOveragePolicy_union0.split('\n').map((line) => '\t' + line).join('\n');
3515
+ message += '\n' + obj_usageOveragePolicy_union1.split('\n').map((line) => '\t' + line).join('\n');
3516
+ return new TypeError(message);
3517
+ }
3518
+ })();
3519
+ return v_error === undefined ? null : v_error;
3520
+ }
3521
+ const select$6 = function BindingObjectResourcePolicyDetailOutputRepresentationSelect() {
3522
+ const { selections: PolicyDetailOutputRepresentation__selections, opaque: PolicyDetailOutputRepresentation__opaque, } = select$h();
3523
+ return {
3524
+ kind: 'Fragment',
3525
+ version: VERSION$3,
3526
+ private: [],
3527
+ selections: [
3528
+ {
3529
+ name: 'drawdownOrder',
3530
+ kind: 'Scalar'
3531
+ },
3532
+ {
3533
+ name: 'id',
3534
+ kind: 'Scalar'
3535
+ },
3536
+ {
3537
+ name: 'ratingFrequencyPolicy',
3538
+ kind: 'Object',
3539
+ nullable: true,
3540
+ selections: PolicyDetailOutputRepresentation__selections
3541
+ },
3542
+ {
3543
+ name: 'usageAggregationPolicy',
3544
+ kind: 'Object',
3545
+ nullable: true,
3546
+ selections: PolicyDetailOutputRepresentation__selections
3547
+ },
3548
+ {
3549
+ name: 'usageCommitmentPolicy',
3550
+ kind: 'Object',
3551
+ nullable: true,
3552
+ selections: PolicyDetailOutputRepresentation__selections
3553
+ },
3554
+ {
3555
+ name: 'usageOveragePolicy',
3556
+ kind: 'Object',
3557
+ nullable: true,
3558
+ selections: PolicyDetailOutputRepresentation__selections
3559
+ }
3560
+ ]
3561
+ };
3562
+ };
3563
+ function equals$3(existing, incoming) {
3564
+ const existing_drawdownOrder = existing.drawdownOrder;
3565
+ const incoming_drawdownOrder = incoming.drawdownOrder;
3566
+ if (!(existing_drawdownOrder === incoming_drawdownOrder)) {
3567
+ return false;
3568
+ }
3569
+ const existing_id = existing.id;
3570
+ const incoming_id = incoming.id;
3571
+ if (!(existing_id === incoming_id)) {
3572
+ return false;
3573
+ }
3574
+ const existing_ratingFrequencyPolicy = existing.ratingFrequencyPolicy;
3575
+ const incoming_ratingFrequencyPolicy = incoming.ratingFrequencyPolicy;
3576
+ if (!(existing_ratingFrequencyPolicy === incoming_ratingFrequencyPolicy
3577
+ || (existing_ratingFrequencyPolicy != null &&
3578
+ incoming_ratingFrequencyPolicy != null &&
3579
+ equals$d(existing_ratingFrequencyPolicy, incoming_ratingFrequencyPolicy)))) {
3580
+ return false;
3581
+ }
3582
+ const existing_usageAggregationPolicy = existing.usageAggregationPolicy;
3583
+ const incoming_usageAggregationPolicy = incoming.usageAggregationPolicy;
3584
+ if (!(existing_usageAggregationPolicy === incoming_usageAggregationPolicy
3585
+ || (existing_usageAggregationPolicy != null &&
3586
+ incoming_usageAggregationPolicy != null &&
3587
+ equals$d(existing_usageAggregationPolicy, incoming_usageAggregationPolicy)))) {
3588
+ return false;
3589
+ }
3590
+ const existing_usageCommitmentPolicy = existing.usageCommitmentPolicy;
3591
+ const incoming_usageCommitmentPolicy = incoming.usageCommitmentPolicy;
3592
+ if (!(existing_usageCommitmentPolicy === incoming_usageCommitmentPolicy
3593
+ || (existing_usageCommitmentPolicy != null &&
3594
+ incoming_usageCommitmentPolicy != null &&
3595
+ equals$d(existing_usageCommitmentPolicy, incoming_usageCommitmentPolicy)))) {
3596
+ return false;
3597
+ }
3598
+ const existing_usageOveragePolicy = existing.usageOveragePolicy;
3599
+ const incoming_usageOveragePolicy = incoming.usageOveragePolicy;
3600
+ if (!(existing_usageOveragePolicy === incoming_usageOveragePolicy
3601
+ || (existing_usageOveragePolicy != null &&
3602
+ incoming_usageOveragePolicy != null &&
3603
+ equals$d(existing_usageOveragePolicy, incoming_usageOveragePolicy)))) {
3604
+ return false;
3605
+ }
3606
+ return true;
3607
+ }
3608
+
3609
+ const VERSION$2 = "ec9b1f7cc93c689c690b479b3ef6f931";
3610
+ function validate$2(obj, path = 'BindingObjectResourceGrantAndPolicyDetailOutputRepresentation') {
3611
+ const v_error = (() => {
3612
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
3613
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
3614
+ }
3615
+ if (obj.bindingObjectGrantDetail !== undefined) {
3616
+ const obj_bindingObjectGrantDetail = obj.bindingObjectGrantDetail;
3617
+ const path_bindingObjectGrantDetail = path + '.bindingObjectGrantDetail';
3618
+ if (!ArrayIsArray(obj_bindingObjectGrantDetail)) {
3619
+ return new TypeError('Expected "array" but received "' + typeof obj_bindingObjectGrantDetail + '" (at "' + path_bindingObjectGrantDetail + '")');
3620
+ }
3621
+ for (let i = 0; i < obj_bindingObjectGrantDetail.length; i++) {
3622
+ const obj_bindingObjectGrantDetail_item = obj_bindingObjectGrantDetail[i];
3623
+ const path_bindingObjectGrantDetail_item = path_bindingObjectGrantDetail + '[' + i + ']';
3624
+ const referencepath_bindingObjectGrantDetail_itemValidationError = validate$4(obj_bindingObjectGrantDetail_item, path_bindingObjectGrantDetail_item);
3625
+ if (referencepath_bindingObjectGrantDetail_itemValidationError !== null) {
3626
+ let message = 'Object doesn\'t match BindingObjectGrantDetailOutputRepresentation (at "' + path_bindingObjectGrantDetail_item + '")\n';
3627
+ message += referencepath_bindingObjectGrantDetail_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
3628
+ return new TypeError(message);
3629
+ }
3630
+ }
3631
+ }
3632
+ if (obj.bindingObjectResourcePolicyDetail !== undefined) {
3633
+ const obj_bindingObjectResourcePolicyDetail = obj.bindingObjectResourcePolicyDetail;
3634
+ const path_bindingObjectResourcePolicyDetail = path + '.bindingObjectResourcePolicyDetail';
3635
+ const referencepath_bindingObjectResourcePolicyDetailValidationError = validate$3(obj_bindingObjectResourcePolicyDetail, path_bindingObjectResourcePolicyDetail);
3636
+ if (referencepath_bindingObjectResourcePolicyDetailValidationError !== null) {
3637
+ let message = 'Object doesn\'t match BindingObjectResourcePolicyDetailOutputRepresentation (at "' + path_bindingObjectResourcePolicyDetail + '")\n';
3638
+ message += referencepath_bindingObjectResourcePolicyDetailValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
3639
+ return new TypeError(message);
3640
+ }
3641
+ }
3642
+ })();
3643
+ return v_error === undefined ? null : v_error;
3644
+ }
3645
+ const select$5 = function BindingObjectResourceGrantAndPolicyDetailOutputRepresentationSelect() {
3646
+ const { selections: BindingObjectGrantDetailOutputRepresentation__selections, opaque: BindingObjectGrantDetailOutputRepresentation__opaque, } = select$7();
3647
+ const { selections: BindingObjectResourcePolicyDetailOutputRepresentation__selections, opaque: BindingObjectResourcePolicyDetailOutputRepresentation__opaque, } = select$6();
3648
+ return {
3649
+ kind: 'Fragment',
3650
+ version: VERSION$2,
3651
+ private: [],
3652
+ selections: [
3653
+ {
3654
+ name: 'bindingObjectGrantDetail',
3655
+ kind: 'Object',
3656
+ plural: true,
3657
+ selections: BindingObjectGrantDetailOutputRepresentation__selections,
3658
+ required: false
3659
+ },
3660
+ {
3661
+ name: 'bindingObjectResourcePolicyDetail',
3662
+ kind: 'Object',
3663
+ selections: BindingObjectResourcePolicyDetailOutputRepresentation__selections,
3664
+ required: false
3665
+ }
3666
+ ]
3667
+ };
3668
+ };
3669
+ function equals$2(existing, incoming) {
3670
+ const existing_bindingObjectGrantDetail = existing.bindingObjectGrantDetail;
3671
+ const incoming_bindingObjectGrantDetail = incoming.bindingObjectGrantDetail;
3672
+ // if at least one of these optionals is defined
3673
+ if (existing_bindingObjectGrantDetail !== undefined || incoming_bindingObjectGrantDetail !== undefined) {
3674
+ // if one of these is not defined we know the other is defined and therefore
3675
+ // not equal
3676
+ if (existing_bindingObjectGrantDetail === undefined || incoming_bindingObjectGrantDetail === undefined) {
3677
+ return false;
3678
+ }
3679
+ const equals_bindingObjectGrantDetail_items = equalsArray(existing_bindingObjectGrantDetail, incoming_bindingObjectGrantDetail, (existing_bindingObjectGrantDetail_item, incoming_bindingObjectGrantDetail_item) => {
3680
+ if (!(equals$4(existing_bindingObjectGrantDetail_item, incoming_bindingObjectGrantDetail_item))) {
3681
+ return false;
3682
+ }
3683
+ });
3684
+ if (equals_bindingObjectGrantDetail_items === false) {
3685
+ return false;
3686
+ }
3687
+ }
3688
+ const existing_bindingObjectResourcePolicyDetail = existing.bindingObjectResourcePolicyDetail;
3689
+ const incoming_bindingObjectResourcePolicyDetail = incoming.bindingObjectResourcePolicyDetail;
3690
+ // if at least one of these optionals is defined
3691
+ if (existing_bindingObjectResourcePolicyDetail !== undefined || incoming_bindingObjectResourcePolicyDetail !== undefined) {
3692
+ // if one of these is not defined we know the other is defined and therefore
3693
+ // not equal
3694
+ if (existing_bindingObjectResourcePolicyDetail === undefined || incoming_bindingObjectResourcePolicyDetail === undefined) {
3695
+ return false;
3696
+ }
3697
+ if (!(equals$3(existing_bindingObjectResourcePolicyDetail, incoming_bindingObjectResourcePolicyDetail))) {
3698
+ return false;
3699
+ }
3700
+ }
3701
+ return true;
3702
+ }
3703
+
3704
+ const VERSION$1 = "9ac3605c04ffb39f20c8db01c7a72e5d";
3705
+ function validate$1(obj, path = 'BindingObjectDetailOutputRepresentation') {
3706
+ const v_error = (() => {
3707
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
3708
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
3709
+ }
3710
+ if (obj.bindingObjectRate !== undefined) {
3711
+ const obj_bindingObjectRate = obj.bindingObjectRate;
3712
+ const path_bindingObjectRate = path + '.bindingObjectRate';
3713
+ const referencepath_bindingObjectRateValidationError = validate$6(obj_bindingObjectRate, path_bindingObjectRate);
3714
+ if (referencepath_bindingObjectRateValidationError !== null) {
3715
+ let message = 'Object doesn\'t match BindingObjectRateOutputRepresentation (at "' + path_bindingObjectRate + '")\n';
3716
+ message += referencepath_bindingObjectRateValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
3717
+ return new TypeError(message);
3718
+ }
3719
+ }
3720
+ if (obj.bindingObjectResourceGrantAndPolicyDetail !== undefined) {
3721
+ const obj_bindingObjectResourceGrantAndPolicyDetail = obj.bindingObjectResourceGrantAndPolicyDetail;
3722
+ const path_bindingObjectResourceGrantAndPolicyDetail = path + '.bindingObjectResourceGrantAndPolicyDetail';
3723
+ const referencepath_bindingObjectResourceGrantAndPolicyDetailValidationError = validate$2(obj_bindingObjectResourceGrantAndPolicyDetail, path_bindingObjectResourceGrantAndPolicyDetail);
3724
+ if (referencepath_bindingObjectResourceGrantAndPolicyDetailValidationError !== null) {
3725
+ let message = 'Object doesn\'t match BindingObjectResourceGrantAndPolicyDetailOutputRepresentation (at "' + path_bindingObjectResourceGrantAndPolicyDetail + '")\n';
3726
+ message += referencepath_bindingObjectResourceGrantAndPolicyDetailValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
3727
+ return new TypeError(message);
3728
+ }
3729
+ }
3730
+ if (obj.usageResource !== undefined) {
3731
+ const obj_usageResource = obj.usageResource;
3732
+ const path_usageResource = path + '.usageResource';
3733
+ const referencepath_usageResourceValidationError = validate$5(obj_usageResource, path_usageResource);
3734
+ if (referencepath_usageResourceValidationError !== null) {
3735
+ let message = 'Object doesn\'t match LookupDetailOutputRepresentation (at "' + path_usageResource + '")\n';
3736
+ message += referencepath_usageResourceValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
3737
+ return new TypeError(message);
3738
+ }
3739
+ }
3740
+ })();
3741
+ return v_error === undefined ? null : v_error;
3742
+ }
3743
+ const select$4 = function BindingObjectDetailOutputRepresentationSelect() {
3744
+ const { selections: BindingObjectRateOutputRepresentation__selections, opaque: BindingObjectRateOutputRepresentation__opaque, } = select$9();
3745
+ const { selections: BindingObjectResourceGrantAndPolicyDetailOutputRepresentation__selections, opaque: BindingObjectResourceGrantAndPolicyDetailOutputRepresentation__opaque, } = select$5();
3746
+ const { selections: LookupDetailOutputRepresentation__selections, opaque: LookupDetailOutputRepresentation__opaque, } = select$8();
3747
+ return {
3748
+ kind: 'Fragment',
3749
+ version: VERSION$1,
3750
+ private: [],
3751
+ selections: [
3752
+ {
3753
+ name: 'bindingObjectRate',
3754
+ kind: 'Object',
3755
+ selections: BindingObjectRateOutputRepresentation__selections,
3756
+ required: false
3757
+ },
3758
+ {
3759
+ name: 'bindingObjectResourceGrantAndPolicyDetail',
3760
+ kind: 'Object',
3761
+ selections: BindingObjectResourceGrantAndPolicyDetailOutputRepresentation__selections,
3762
+ required: false
3763
+ },
3764
+ {
3765
+ name: 'usageResource',
3766
+ kind: 'Object',
3767
+ selections: LookupDetailOutputRepresentation__selections,
3768
+ required: false
3769
+ }
3770
+ ]
3771
+ };
3772
+ };
3773
+ function equals$1(existing, incoming) {
3774
+ const existing_bindingObjectRate = existing.bindingObjectRate;
3775
+ const incoming_bindingObjectRate = incoming.bindingObjectRate;
3776
+ // if at least one of these optionals is defined
3777
+ if (existing_bindingObjectRate !== undefined || incoming_bindingObjectRate !== undefined) {
3778
+ // if one of these is not defined we know the other is defined and therefore
3779
+ // not equal
3780
+ if (existing_bindingObjectRate === undefined || incoming_bindingObjectRate === undefined) {
3781
+ return false;
3782
+ }
3783
+ if (!(equals$6(existing_bindingObjectRate, incoming_bindingObjectRate))) {
3784
+ return false;
3785
+ }
3786
+ }
3787
+ const existing_bindingObjectResourceGrantAndPolicyDetail = existing.bindingObjectResourceGrantAndPolicyDetail;
3788
+ const incoming_bindingObjectResourceGrantAndPolicyDetail = incoming.bindingObjectResourceGrantAndPolicyDetail;
3789
+ // if at least one of these optionals is defined
3790
+ if (existing_bindingObjectResourceGrantAndPolicyDetail !== undefined || incoming_bindingObjectResourceGrantAndPolicyDetail !== undefined) {
3791
+ // if one of these is not defined we know the other is defined and therefore
3792
+ // not equal
3793
+ if (existing_bindingObjectResourceGrantAndPolicyDetail === undefined || incoming_bindingObjectResourceGrantAndPolicyDetail === undefined) {
3794
+ return false;
3795
+ }
3796
+ if (!(equals$2(existing_bindingObjectResourceGrantAndPolicyDetail, incoming_bindingObjectResourceGrantAndPolicyDetail))) {
3797
+ return false;
3798
+ }
3799
+ }
3800
+ const existing_usageResource = existing.usageResource;
3801
+ const incoming_usageResource = incoming.usageResource;
3802
+ // if at least one of these optionals is defined
3803
+ if (existing_usageResource !== undefined || incoming_usageResource !== undefined) {
3804
+ // if one of these is not defined we know the other is defined and therefore
3805
+ // not equal
3806
+ if (existing_usageResource === undefined || incoming_usageResource === undefined) {
3807
+ return false;
3808
+ }
3809
+ if (!(equals$5(existing_usageResource, incoming_usageResource))) {
3810
+ return false;
3811
+ }
3812
+ }
3813
+ return true;
3814
+ }
3815
+
3816
+ const TTL = 1000;
3817
+ const VERSION = "9069d220a2be54179acb1ff90002cc10";
3818
+ function validate(obj, path = 'UsageDetailBindingObjectOutputRepresentation') {
3819
+ const v_error = (() => {
3820
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
3821
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
3822
+ }
3823
+ if (obj.errors !== undefined) {
3824
+ const obj_errors = obj.errors;
3825
+ const path_errors = path + '.errors';
3826
+ if (!ArrayIsArray(obj_errors)) {
3827
+ return new TypeError('Expected "array" but received "' + typeof obj_errors + '" (at "' + path_errors + '")');
3828
+ }
3829
+ for (let i = 0; i < obj_errors.length; i++) {
3830
+ const obj_errors_item = obj_errors[i];
3831
+ const path_errors_item = path_errors + '[' + i + ']';
3832
+ const referencepath_errors_itemValidationError = validate$f(obj_errors_item, path_errors_item);
3833
+ if (referencepath_errors_itemValidationError !== null) {
3834
+ let message = 'Object doesn\'t match UsageDetailErrorResponseRepresentation (at "' + path_errors_item + '")\n';
3835
+ message += referencepath_errors_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
3836
+ return new TypeError(message);
3837
+ }
3838
+ }
3839
+ }
3840
+ if (obj.records !== undefined) {
3841
+ const obj_records = obj.records;
3842
+ const path_records = path + '.records';
3843
+ if (!ArrayIsArray(obj_records)) {
3844
+ return new TypeError('Expected "array" but received "' + typeof obj_records + '" (at "' + path_records + '")');
3845
+ }
3846
+ for (let i = 0; i < obj_records.length; i++) {
3847
+ const obj_records_item = obj_records[i];
3848
+ const path_records_item = path_records + '[' + i + ']';
3849
+ const referencepath_records_itemValidationError = validate$1(obj_records_item, path_records_item);
3850
+ if (referencepath_records_itemValidationError !== null) {
3851
+ let message = 'Object doesn\'t match BindingObjectDetailOutputRepresentation (at "' + path_records_item + '")\n';
3852
+ message += referencepath_records_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
3853
+ return new TypeError(message);
3854
+ }
3855
+ }
3856
+ }
3857
+ })();
3858
+ return v_error === undefined ? null : v_error;
3859
+ }
3860
+ const RepresentationType = 'UsageDetailBindingObjectOutputRepresentation';
3861
+ function normalize(input, existing, path, luvio, store, timestamp) {
3862
+ return input;
3863
+ }
3864
+ const select$3 = function UsageDetailBindingObjectOutputRepresentationSelect() {
3865
+ const { selections: UsageDetailErrorResponseRepresentation__selections, opaque: UsageDetailErrorResponseRepresentation__opaque, } = select$j();
3866
+ const { selections: BindingObjectDetailOutputRepresentation__selections, opaque: BindingObjectDetailOutputRepresentation__opaque, } = select$4();
3867
+ return {
3868
+ kind: 'Fragment',
3869
+ version: VERSION,
3870
+ private: [],
3871
+ selections: [
3872
+ {
3873
+ name: 'errors',
3874
+ kind: 'Object',
3875
+ plural: true,
3876
+ selections: UsageDetailErrorResponseRepresentation__selections,
3877
+ required: false
3878
+ },
3879
+ {
3880
+ name: 'records',
3881
+ kind: 'Object',
3882
+ plural: true,
3883
+ selections: BindingObjectDetailOutputRepresentation__selections,
3884
+ required: false
3885
+ }
3886
+ ]
3887
+ };
3888
+ };
3889
+ function equals(existing, incoming) {
3890
+ const existing_errors = existing.errors;
3891
+ const incoming_errors = incoming.errors;
3892
+ // if at least one of these optionals is defined
3893
+ if (existing_errors !== undefined || incoming_errors !== undefined) {
3894
+ // if one of these is not defined we know the other is defined and therefore
3895
+ // not equal
3896
+ if (existing_errors === undefined || incoming_errors === undefined) {
3897
+ return false;
3898
+ }
3899
+ const equals_errors_items = equalsArray(existing_errors, incoming_errors, (existing_errors_item, incoming_errors_item) => {
3900
+ if (!(equals$f(existing_errors_item, incoming_errors_item))) {
3901
+ return false;
3902
+ }
3903
+ });
3904
+ if (equals_errors_items === false) {
3905
+ return false;
3906
+ }
3907
+ }
3908
+ const existing_records = existing.records;
3909
+ const incoming_records = incoming.records;
3910
+ // if at least one of these optionals is defined
3911
+ if (existing_records !== undefined || incoming_records !== undefined) {
3912
+ // if one of these is not defined we know the other is defined and therefore
3913
+ // not equal
3914
+ if (existing_records === undefined || incoming_records === undefined) {
3915
+ return false;
3916
+ }
3917
+ const equals_records_items = equalsArray(existing_records, incoming_records, (existing_records_item, incoming_records_item) => {
3918
+ if (!(equals$1(existing_records_item, incoming_records_item))) {
3919
+ return false;
3920
+ }
3921
+ });
3922
+ if (equals_records_items === false) {
3923
+ return false;
3924
+ }
3925
+ }
3926
+ return true;
3927
+ }
3928
+ const ingest = function UsageDetailBindingObjectOutputRepresentationIngest(input, path, luvio, store, timestamp) {
3929
+ if (process.env.NODE_ENV !== 'production') {
3930
+ const validateError = validate(input);
3931
+ if (validateError !== null) {
3932
+ throw validateError;
3933
+ }
3934
+ }
3935
+ const key = path.fullPath;
3936
+ const ttlToUse = TTL;
3937
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "usage-detail", VERSION, RepresentationType, equals);
3938
+ return createLink(key);
3939
+ };
3940
+ function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
3941
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
3942
+ const rootKey = fullPathFactory();
3943
+ rootKeySet.set(rootKey, {
3944
+ namespace: keyPrefix,
3945
+ representationName: RepresentationType,
3946
+ mergeable: false
3947
+ });
3948
+ }
3949
+
3950
+ function select$2(luvio, params) {
3951
+ return select$3();
3952
+ }
3953
+ function keyBuilder$5(luvio, params) {
3954
+ return keyPrefix + '::UsageDetailBindingObjectOutputRepresentation:(' + 'effectiveDate:' + params.queryParams.effectiveDate + ',' + 'bindingObjectId:' + params.urlParams.bindingObjectId + ')';
3955
+ }
3956
+ function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
3957
+ getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$5(luvio, resourceParams));
3958
+ }
3959
+ function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
3960
+ const { body } = response;
3961
+ const key = keyBuilder$5(luvio, resourceParams);
3962
+ luvio.storeIngest(key, ingest, body);
3963
+ const snapshot = luvio.storeLookup({
3964
+ recordId: key,
3965
+ node: select$2(),
3966
+ variables: {},
3967
+ }, snapshotRefresh);
3968
+ if (process.env.NODE_ENV !== 'production') {
3969
+ if (snapshot.state !== 'Fulfilled') {
3970
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
3971
+ }
3972
+ }
3973
+ deepFreeze(snapshot.data);
3974
+ return snapshot;
3975
+ }
3976
+ function ingestError$2(luvio, params, error, snapshotRefresh) {
3977
+ const key = keyBuilder$5(luvio, params);
3978
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
3979
+ const storeMetadataParams = {
3980
+ ttl: TTL,
3981
+ namespace: keyPrefix,
3982
+ version: VERSION,
3983
+ representationName: RepresentationType
3984
+ };
3985
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
3986
+ return errorSnapshot;
3987
+ }
3988
+ function createResourceRequest$2(config) {
3989
+ const headers = {};
3990
+ return {
3991
+ baseUri: '/services/data/v66.0',
3992
+ basePath: '/revenue/usage-management/binding-objects/' + config.urlParams.bindingObjectId + '/actions/usage-details',
3993
+ method: 'get',
3994
+ body: null,
3995
+ urlParams: config.urlParams,
3996
+ queryParams: config.queryParams,
3997
+ headers,
3998
+ priority: 'normal',
3999
+ };
4000
+ }
4001
+
4002
+ const adapterName$2 = 'getBindingObjectUsageDetails';
4003
+ const getBindingObjectUsageDetails_ConfigPropertyMetadata = [
4004
+ generateParamConfigMetadata('bindingObjectId', true, 0 /* UrlParameter */, 0 /* String */),
4005
+ generateParamConfigMetadata('effectiveDate', false, 1 /* QueryParameter */, 0 /* String */),
4006
+ ];
4007
+ const getBindingObjectUsageDetails_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, getBindingObjectUsageDetails_ConfigPropertyMetadata);
4008
+ const createResourceParams$2 = /*#__PURE__*/ createResourceParams$4(getBindingObjectUsageDetails_ConfigPropertyMetadata);
4009
+ function keyBuilder$4(luvio, config) {
4010
+ const resourceParams = createResourceParams$2(config);
4011
+ return keyBuilder$5(luvio, resourceParams);
4012
+ }
4013
+ function typeCheckConfig$2(untrustedConfig) {
4014
+ const config = {};
4015
+ typeCheckConfig$4(untrustedConfig, config, getBindingObjectUsageDetails_ConfigPropertyMetadata);
4016
+ return config;
4017
+ }
4018
+ function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
4019
+ if (!untrustedIsObject(untrustedConfig)) {
4020
+ return null;
4021
+ }
4022
+ if (process.env.NODE_ENV !== 'production') {
4023
+ validateConfig(untrustedConfig, configPropertyNames);
4024
+ }
4025
+ const config = typeCheckConfig$2(untrustedConfig);
4026
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
4027
+ return null;
4028
+ }
4029
+ return config;
4030
+ }
4031
+ function adapterFragment$2(luvio, config) {
4032
+ createResourceParams$2(config);
4033
+ return select$2();
4034
+ }
4035
+ function onFetchResponseSuccess$2(luvio, config, resourceParams, response) {
4036
+ const snapshot = ingestSuccess$2(luvio, resourceParams, response, {
4037
+ config,
4038
+ resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
4039
+ });
4040
+ return luvio.storeBroadcast().then(() => snapshot);
4041
+ }
4042
+ function onFetchResponseError$2(luvio, config, resourceParams, response) {
4043
+ const snapshot = ingestError$2(luvio, resourceParams, response, {
4044
+ config,
4045
+ resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
4046
+ });
4047
+ return luvio.storeBroadcast().then(() => snapshot);
4048
+ }
4049
+ function buildNetworkSnapshot$2(luvio, config, options) {
4050
+ const resourceParams = createResourceParams$2(config);
4051
+ const request = createResourceRequest$2(resourceParams);
4052
+ return luvio.dispatchResourceRequest(request, options)
4053
+ .then((response) => {
4054
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$2(luvio, config, resourceParams, response), () => {
4055
+ const cache = new StoreKeyMap();
4056
+ getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
4057
+ return cache;
4058
+ });
4059
+ }, (response) => {
4060
+ return luvio.handleErrorResponse(() => onFetchResponseError$2(luvio, config, resourceParams, response));
4061
+ });
4062
+ }
4063
+ function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext) {
4064
+ return buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext, buildNetworkSnapshot$2, undefined, false);
4065
+ }
4066
+ function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
4067
+ const { luvio, config } = context;
4068
+ const selector = {
4069
+ recordId: keyBuilder$4(luvio, config),
4070
+ node: adapterFragment$2(luvio, config),
4071
+ variables: {},
4072
+ };
4073
+ const cacheSnapshot = storeLookup(selector, {
4074
+ config,
4075
+ resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
4076
+ });
4077
+ return cacheSnapshot;
4078
+ }
4079
+ const getBindingObjectUsageDetailsAdapterFactory = (luvio) => function usageDetail__getBindingObjectUsageDetails(untrustedConfig, requestContext) {
4080
+ const config = validateAdapterConfig$2(untrustedConfig, getBindingObjectUsageDetails_ConfigPropertyNames);
4081
+ // Invalid or incomplete config
4082
+ if (config === null) {
4083
+ return null;
4084
+ }
4085
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
4086
+ buildCachedSnapshotCachePolicy$2, buildNetworkSnapshotCachePolicy$2);
4087
+ };
4088
+
4089
+ function select$1(luvio, params) {
4090
+ return select$c();
4091
+ }
4092
+ function keyBuilder$3(luvio, params) {
4093
+ return keyPrefix + '::UsageDetailOutputRepresentation:(' + 'effectiveDate:' + params.queryParams.effectiveDate + ',' + 'optionalFields:' + params.queryParams.optionalFields + ',' + 'orderItemId:' + params.urlParams.orderItemId + ')';
4094
+ }
4095
+ function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
4096
+ getTypeCacheKeys$1(storeKeyMap, luvio, response, () => keyBuilder$3(luvio, resourceParams));
4097
+ }
4098
+ function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
4099
+ const { body } = response;
4100
+ const key = keyBuilder$3(luvio, resourceParams);
4101
+ luvio.storeIngest(key, ingest$1, body);
4102
+ const snapshot = luvio.storeLookup({
4103
+ recordId: key,
4104
+ node: select$1(),
4105
+ variables: {},
4106
+ }, snapshotRefresh);
4107
+ if (process.env.NODE_ENV !== 'production') {
4108
+ if (snapshot.state !== 'Fulfilled') {
4109
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
4110
+ }
4111
+ }
4112
+ deepFreeze(snapshot.data);
4113
+ return snapshot;
4114
+ }
4115
+ function ingestError$1(luvio, params, error, snapshotRefresh) {
4116
+ const key = keyBuilder$3(luvio, params);
4117
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
4118
+ const storeMetadataParams = {
4119
+ ttl: TTL$1,
4120
+ namespace: keyPrefix,
4121
+ version: VERSION$8,
4122
+ representationName: RepresentationType$1
4123
+ };
4124
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
4125
+ return errorSnapshot;
4126
+ }
4127
+ function createResourceRequest$1(config) {
4128
+ const headers = {};
4129
+ return {
4130
+ baseUri: '/services/data/v66.0',
4131
+ basePath: '/commerce/sales-orders/line-items/' + config.urlParams.orderItemId + '/usage-details',
4132
+ method: 'get',
4133
+ body: null,
4134
+ urlParams: config.urlParams,
4135
+ queryParams: config.queryParams,
4136
+ headers,
4137
+ priority: 'normal',
4138
+ };
4139
+ }
4140
+
4141
+ const adapterName$1 = 'getOrderUsageDetails';
4142
+ const getOrderUsageDetails_ConfigPropertyMetadata = [
4143
+ generateParamConfigMetadata('orderItemId', true, 0 /* UrlParameter */, 0 /* String */),
4144
+ generateParamConfigMetadata('effectiveDate', false, 1 /* QueryParameter */, 0 /* String */),
4145
+ generateParamConfigMetadata('optionalFields', false, 1 /* QueryParameter */, 0 /* String */, true),
4146
+ ];
4147
+ const getOrderUsageDetails_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, getOrderUsageDetails_ConfigPropertyMetadata);
4148
+ const createResourceParams$1 = /*#__PURE__*/ createResourceParams$4(getOrderUsageDetails_ConfigPropertyMetadata);
4149
+ function keyBuilder$2(luvio, config) {
4150
+ const resourceParams = createResourceParams$1(config);
4151
+ return keyBuilder$3(luvio, resourceParams);
4152
+ }
4153
+ function typeCheckConfig$1(untrustedConfig) {
4154
+ const config = {};
4155
+ typeCheckConfig$4(untrustedConfig, config, getOrderUsageDetails_ConfigPropertyMetadata);
4156
+ return config;
4157
+ }
4158
+ function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
4159
+ if (!untrustedIsObject(untrustedConfig)) {
4160
+ return null;
4161
+ }
4162
+ if (process.env.NODE_ENV !== 'production') {
4163
+ validateConfig(untrustedConfig, configPropertyNames);
4164
+ }
4165
+ const config = typeCheckConfig$1(untrustedConfig);
4166
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
4167
+ return null;
4168
+ }
4169
+ return config;
4170
+ }
4171
+ function adapterFragment$1(luvio, config) {
4172
+ createResourceParams$1(config);
4173
+ return select$1();
4174
+ }
4175
+ function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
4176
+ const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
4177
+ config,
4178
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
4179
+ });
4180
+ return luvio.storeBroadcast().then(() => snapshot);
4181
+ }
4182
+ function onFetchResponseError$1(luvio, config, resourceParams, response) {
4183
+ const snapshot = ingestError$1(luvio, resourceParams, response, {
4184
+ config,
4185
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
4186
+ });
4187
+ return luvio.storeBroadcast().then(() => snapshot);
4188
+ }
4189
+ function buildNetworkSnapshot$1(luvio, config, options) {
4190
+ const resourceParams = createResourceParams$1(config);
4191
+ const request = createResourceRequest$1(resourceParams);
4192
+ return luvio.dispatchResourceRequest(request, options)
4193
+ .then((response) => {
4194
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => {
4195
+ const cache = new StoreKeyMap();
4196
+ getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
4197
+ return cache;
4198
+ });
4199
+ }, (response) => {
4200
+ return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
4201
+ });
4202
+ }
4203
+ function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
4204
+ return buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext, buildNetworkSnapshot$1, undefined, false);
4205
+ }
4206
+ function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
4207
+ const { luvio, config } = context;
4208
+ const selector = {
4209
+ recordId: keyBuilder$2(luvio, config),
4210
+ node: adapterFragment$1(luvio, config),
4211
+ variables: {},
4212
+ };
4213
+ const cacheSnapshot = storeLookup(selector, {
4214
+ config,
4215
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
4216
+ });
4217
+ return cacheSnapshot;
4218
+ }
4219
+ const getOrderUsageDetailsAdapterFactory = (luvio) => function usageDetail__getOrderUsageDetails(untrustedConfig, requestContext) {
4220
+ const config = validateAdapterConfig$1(untrustedConfig, getOrderUsageDetails_ConfigPropertyNames);
4221
+ // Invalid or incomplete config
4222
+ if (config === null) {
4223
+ return null;
4224
+ }
4225
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
4226
+ buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
4227
+ };
4228
+
4229
+ function select(luvio, params) {
4230
+ return select$c();
4231
+ }
4232
+ function keyBuilder$1(luvio, params) {
4233
+ return keyPrefix + '::UsageDetailOutputRepresentation:(' + 'effectiveDate:' + params.queryParams.effectiveDate + ',' + 'optionalFields:' + params.queryParams.optionalFields + ',' + 'quoteLineItemId:' + params.urlParams.quoteLineItemId + ')';
4234
+ }
4235
+ function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
4236
+ getTypeCacheKeys$1(storeKeyMap, luvio, response, () => keyBuilder$1(luvio, resourceParams));
4237
+ }
4238
+ function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
4239
+ const { body } = response;
4240
+ const key = keyBuilder$1(luvio, resourceParams);
4241
+ luvio.storeIngest(key, ingest$1, body);
4242
+ const snapshot = luvio.storeLookup({
4243
+ recordId: key,
4244
+ node: select(),
4245
+ variables: {},
4246
+ }, snapshotRefresh);
4247
+ if (process.env.NODE_ENV !== 'production') {
4248
+ if (snapshot.state !== 'Fulfilled') {
4249
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
4250
+ }
4251
+ }
4252
+ deepFreeze(snapshot.data);
4253
+ return snapshot;
4254
+ }
4255
+ function ingestError(luvio, params, error, snapshotRefresh) {
4256
+ const key = keyBuilder$1(luvio, params);
4257
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
4258
+ const storeMetadataParams = {
4259
+ ttl: TTL$1,
4260
+ namespace: keyPrefix,
4261
+ version: VERSION$8,
4262
+ representationName: RepresentationType$1
4263
+ };
4264
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
4265
+ return errorSnapshot;
4266
+ }
4267
+ function createResourceRequest(config) {
4268
+ const headers = {};
4269
+ return {
4270
+ baseUri: '/services/data/v66.0',
4271
+ basePath: '/commerce/quotes/line-items/' + config.urlParams.quoteLineItemId + '/usage-details',
4272
+ method: 'get',
4273
+ body: null,
4274
+ urlParams: config.urlParams,
4275
+ queryParams: config.queryParams,
4276
+ headers,
4277
+ priority: 'normal',
4278
+ };
4279
+ }
4280
+
4281
+ const adapterName = 'getQuoteUsageDetails';
4282
+ const getQuoteUsageDetails_ConfigPropertyMetadata = [
4283
+ generateParamConfigMetadata('quoteLineItemId', true, 0 /* UrlParameter */, 0 /* String */),
4284
+ generateParamConfigMetadata('effectiveDate', false, 1 /* QueryParameter */, 0 /* String */),
4285
+ generateParamConfigMetadata('optionalFields', false, 1 /* QueryParameter */, 0 /* String */, true),
4286
+ ];
4287
+ const getQuoteUsageDetails_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getQuoteUsageDetails_ConfigPropertyMetadata);
4288
+ const createResourceParams = /*#__PURE__*/ createResourceParams$4(getQuoteUsageDetails_ConfigPropertyMetadata);
4289
+ function keyBuilder(luvio, config) {
4290
+ const resourceParams = createResourceParams(config);
4291
+ return keyBuilder$1(luvio, resourceParams);
4292
+ }
4293
+ function typeCheckConfig(untrustedConfig) {
4294
+ const config = {};
4295
+ typeCheckConfig$4(untrustedConfig, config, getQuoteUsageDetails_ConfigPropertyMetadata);
4296
+ return config;
4297
+ }
4298
+ function validateAdapterConfig(untrustedConfig, configPropertyNames) {
4299
+ if (!untrustedIsObject(untrustedConfig)) {
4300
+ return null;
4301
+ }
4302
+ if (process.env.NODE_ENV !== 'production') {
4303
+ validateConfig(untrustedConfig, configPropertyNames);
4304
+ }
4305
+ const config = typeCheckConfig(untrustedConfig);
4306
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
4307
+ return null;
4308
+ }
4309
+ return config;
4310
+ }
4311
+ function adapterFragment(luvio, config) {
4312
+ createResourceParams(config);
4313
+ return select();
4314
+ }
4315
+ function onFetchResponseSuccess(luvio, config, resourceParams, response) {
4316
+ const snapshot = ingestSuccess(luvio, resourceParams, response, {
4317
+ config,
4318
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
4319
+ });
4320
+ return luvio.storeBroadcast().then(() => snapshot);
4321
+ }
4322
+ function onFetchResponseError(luvio, config, resourceParams, response) {
4323
+ const snapshot = ingestError(luvio, resourceParams, response, {
4324
+ config,
4325
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
4326
+ });
4327
+ return luvio.storeBroadcast().then(() => snapshot);
4328
+ }
4329
+ function buildNetworkSnapshot(luvio, config, options) {
4330
+ const resourceParams = createResourceParams(config);
4331
+ const request = createResourceRequest(resourceParams);
4332
+ return luvio.dispatchResourceRequest(request, options)
4333
+ .then((response) => {
4334
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
4335
+ const cache = new StoreKeyMap();
4336
+ getResponseCacheKeys(cache, luvio, resourceParams, response.body);
4337
+ return cache;
4338
+ });
4339
+ }, (response) => {
4340
+ return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
4341
+ });
4342
+ }
4343
+ function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
4344
+ return buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
4345
+ }
4346
+ function buildCachedSnapshotCachePolicy(context, storeLookup) {
4347
+ const { luvio, config } = context;
4348
+ const selector = {
4349
+ recordId: keyBuilder(luvio, config),
4350
+ node: adapterFragment(luvio, config),
4351
+ variables: {},
4352
+ };
4353
+ const cacheSnapshot = storeLookup(selector, {
4354
+ config,
4355
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
4356
+ });
4357
+ return cacheSnapshot;
4358
+ }
4359
+ const getQuoteUsageDetailsAdapterFactory = (luvio) => function usageDetail__getQuoteUsageDetails(untrustedConfig, requestContext) {
4360
+ const config = validateAdapterConfig(untrustedConfig, getQuoteUsageDetails_ConfigPropertyNames);
4361
+ // Invalid or incomplete config
4362
+ if (config === null) {
4363
+ return null;
4364
+ }
4365
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
4366
+ buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
4367
+ };
4368
+
4369
+ let getAssetUsageDetails;
4370
+ let getBindingObjectUsageDetails;
4371
+ let getOrderUsageDetails;
4372
+ let getQuoteUsageDetails;
4373
+ // Imperative GET Adapters
4374
+ let getAssetUsageDetails_imperative;
4375
+ let getBindingObjectUsageDetails_imperative;
4376
+ let getOrderUsageDetails_imperative;
4377
+ let getQuoteUsageDetails_imperative;
4378
+ // Adapter Metadata
4379
+ const getAssetUsageDetailsMetadata = {
4380
+ apiFamily: 'usagedetail',
4381
+ name: 'getAssetUsageDetails',
4382
+ ttl: 1000,
4383
+ };
4384
+ const getBindingObjectUsageDetailsMetadata = {
4385
+ apiFamily: 'usagedetail',
4386
+ name: 'getBindingObjectUsageDetails',
4387
+ ttl: 1000,
4388
+ };
4389
+ const getOrderUsageDetailsMetadata = {
4390
+ apiFamily: 'usagedetail',
4391
+ name: 'getOrderUsageDetails',
4392
+ ttl: 1000,
4393
+ };
4394
+ const getQuoteUsageDetailsMetadata = {
4395
+ apiFamily: 'usagedetail',
4396
+ name: 'getQuoteUsageDetails',
4397
+ ttl: 1000,
4398
+ };
4399
+ // Notify Update Available
4400
+ function bindExportsTo(luvio) {
4401
+ // LDS Adapters
4402
+ const getAssetUsageDetails_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getAssetUsageDetails', getAssetUsageDetailsAdapterFactory), getAssetUsageDetailsMetadata);
4403
+ const getBindingObjectUsageDetails_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getBindingObjectUsageDetails', getBindingObjectUsageDetailsAdapterFactory), getBindingObjectUsageDetailsMetadata);
4404
+ const getOrderUsageDetails_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getOrderUsageDetails', getOrderUsageDetailsAdapterFactory), getOrderUsageDetailsMetadata);
4405
+ const getQuoteUsageDetails_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getQuoteUsageDetails', getQuoteUsageDetailsAdapterFactory), getQuoteUsageDetailsMetadata);
4406
+ return {
4407
+ getAssetUsageDetails: createWireAdapterConstructor(luvio, getAssetUsageDetails_ldsAdapter, getAssetUsageDetailsMetadata),
4408
+ getBindingObjectUsageDetails: createWireAdapterConstructor(luvio, getBindingObjectUsageDetails_ldsAdapter, getBindingObjectUsageDetailsMetadata),
4409
+ getOrderUsageDetails: createWireAdapterConstructor(luvio, getOrderUsageDetails_ldsAdapter, getOrderUsageDetailsMetadata),
4410
+ getQuoteUsageDetails: createWireAdapterConstructor(luvio, getQuoteUsageDetails_ldsAdapter, getQuoteUsageDetailsMetadata),
4411
+ // Imperative GET Adapters
4412
+ getAssetUsageDetails_imperative: createImperativeAdapter(luvio, getAssetUsageDetails_ldsAdapter, getAssetUsageDetailsMetadata),
4413
+ getBindingObjectUsageDetails_imperative: createImperativeAdapter(luvio, getBindingObjectUsageDetails_ldsAdapter, getBindingObjectUsageDetailsMetadata),
4414
+ getOrderUsageDetails_imperative: createImperativeAdapter(luvio, getOrderUsageDetails_ldsAdapter, getOrderUsageDetailsMetadata),
4415
+ getQuoteUsageDetails_imperative: createImperativeAdapter(luvio, getQuoteUsageDetails_ldsAdapter, getQuoteUsageDetailsMetadata),
4416
+ // Notify Update Availables
4417
+ };
4418
+ }
4419
+ withDefaultLuvio((luvio) => {
4420
+ ({
4421
+ getAssetUsageDetails,
4422
+ getBindingObjectUsageDetails,
4423
+ getOrderUsageDetails,
4424
+ getQuoteUsageDetails,
4425
+ getAssetUsageDetails_imperative,
4426
+ getBindingObjectUsageDetails_imperative,
4427
+ getOrderUsageDetails_imperative,
4428
+ getQuoteUsageDetails_imperative,
4429
+ } = bindExportsTo(luvio));
4430
+ });
4431
+
4432
+ export { getAssetUsageDetails, getAssetUsageDetails_imperative, getBindingObjectUsageDetails, getBindingObjectUsageDetails_imperative, getOrderUsageDetails, getOrderUsageDetails_imperative, getQuoteUsageDetails, getQuoteUsageDetails_imperative };
4433
+ // version: 0.1.0-dev1-c978a7b010