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