ibm-platform-services 0.55.3__py3-none-any.whl

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 (29) hide show
  1. ibm_platform_services/__init__.py +43 -0
  2. ibm_platform_services/case_management_v1.py +2414 -0
  3. ibm_platform_services/catalog_management_v1.py +10127 -0
  4. ibm_platform_services/common.py +56 -0
  5. ibm_platform_services/context_based_restrictions_v1.py +3633 -0
  6. ibm_platform_services/enterprise_billing_units_v1.py +1324 -0
  7. ibm_platform_services/enterprise_management_v1.py +2497 -0
  8. ibm_platform_services/enterprise_usage_reports_v1.py +978 -0
  9. ibm_platform_services/global_catalog_v1.py +5129 -0
  10. ibm_platform_services/global_search_v2.py +497 -0
  11. ibm_platform_services/global_tagging_v1.py +1601 -0
  12. ibm_platform_services/iam_access_groups_v2.py +7684 -0
  13. ibm_platform_services/iam_identity_v1.py +11525 -0
  14. ibm_platform_services/iam_policy_management_v1.py +9016 -0
  15. ibm_platform_services/ibm_cloud_shell_v1.py +480 -0
  16. ibm_platform_services/open_service_broker_v1.py +1774 -0
  17. ibm_platform_services/partner_billing_units_v1.py +1381 -0
  18. ibm_platform_services/partner_usage_reports_v1.py +1091 -0
  19. ibm_platform_services/resource_controller_v2.py +4868 -0
  20. ibm_platform_services/resource_manager_v2.py +986 -0
  21. ibm_platform_services/usage_metering_v4.py +470 -0
  22. ibm_platform_services/usage_reports_v4.py +5165 -0
  23. ibm_platform_services/user_management_v1.py +1639 -0
  24. ibm_platform_services/version.py +5 -0
  25. ibm_platform_services-0.55.3.dist-info/LICENSE +201 -0
  26. ibm_platform_services-0.55.3.dist-info/METADATA +165 -0
  27. ibm_platform_services-0.55.3.dist-info/RECORD +29 -0
  28. ibm_platform_services-0.55.3.dist-info/WHEEL +5 -0
  29. ibm_platform_services-0.55.3.dist-info/top_level.txt +1 -0
@@ -0,0 +1,1381 @@
1
+ # coding: utf-8
2
+
3
+ # (C) Copyright IBM Corp. 2024.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # IBM OpenAPI SDK Code Generator Version: 3.85.0-75c38f8f-20240206-210220
18
+
19
+ """
20
+ Billing units for IBM Cloud partners
21
+
22
+ API Version: 1.0.0
23
+ """
24
+
25
+ from datetime import datetime
26
+ from enum import Enum
27
+ from typing import Dict, List, Optional
28
+ import json
29
+
30
+ from ibm_cloud_sdk_core import BaseService, DetailedResponse
31
+ from ibm_cloud_sdk_core.authenticators.authenticator import Authenticator
32
+ from ibm_cloud_sdk_core.get_authenticator import get_authenticator_from_environment
33
+ from ibm_cloud_sdk_core.utils import datetime_to_string, string_to_datetime
34
+
35
+ from .common import get_sdk_headers
36
+
37
+ ##############################################################################
38
+ # Service
39
+ ##############################################################################
40
+
41
+
42
+ class PartnerBillingUnitsV1(BaseService):
43
+ """The Partner Billing Units V1 service."""
44
+
45
+ DEFAULT_SERVICE_URL = 'https://partner.cloud.ibm.com'
46
+ DEFAULT_SERVICE_NAME = 'partner_billing_units'
47
+
48
+ @classmethod
49
+ def new_instance(
50
+ cls,
51
+ service_name: str = DEFAULT_SERVICE_NAME,
52
+ ) -> 'PartnerBillingUnitsV1':
53
+ """
54
+ Return a new client for the Partner Billing Units service using the
55
+ specified parameters and external configuration.
56
+ """
57
+ authenticator = get_authenticator_from_environment(service_name)
58
+ service = cls(authenticator)
59
+ service.configure_service(service_name)
60
+ return service
61
+
62
+ def __init__(
63
+ self,
64
+ authenticator: Authenticator = None,
65
+ ) -> None:
66
+ """
67
+ Construct a new client for the Partner Billing Units service.
68
+
69
+ :param Authenticator authenticator: The authenticator specifies the authentication mechanism.
70
+ Get up to date information from https://github.com/IBM/python-sdk-core/blob/main/README.md
71
+ about initializing the authenticator of your choice.
72
+ """
73
+ BaseService.__init__(self, service_url=self.DEFAULT_SERVICE_URL, authenticator=authenticator)
74
+
75
+ #########################
76
+ # Billing Options
77
+ #########################
78
+
79
+ def get_billing_options(
80
+ self,
81
+ partner_id: str,
82
+ *,
83
+ customer_id: Optional[str] = None,
84
+ reseller_id: Optional[str] = None,
85
+ date: Optional[str] = None,
86
+ limit: Optional[int] = None,
87
+ **kwargs,
88
+ ) -> DetailedResponse:
89
+ """
90
+ Get customers billing options.
91
+
92
+ Returns the billing options for the requested customer for a given month.
93
+
94
+ :param str partner_id: Enterprise ID of the distributor or reseller for
95
+ which the report is requested.
96
+ :param str customer_id: (optional) Enterprise ID of the customer for which
97
+ the report is requested.
98
+ :param str reseller_id: (optional) Enterprise ID of the reseller for which
99
+ the report is requested.
100
+ :param str date: (optional) The billing month for which the usage report is
101
+ requested. Format is yyyy-mm. Defaults to current month.
102
+ :param int limit: (optional) Number of usage records returned. The default
103
+ value is 30. Maximum value is 200.
104
+ :param dict headers: A `dict` containing the request headers
105
+ :return: A `DetailedResponse` containing the result, headers and HTTP status code.
106
+ :rtype: DetailedResponse with `dict` result representing a `BillingOptionsSummary` object
107
+ """
108
+
109
+ if not partner_id:
110
+ raise ValueError('partner_id must be provided')
111
+ headers = {}
112
+ sdk_headers = get_sdk_headers(
113
+ service_name=self.DEFAULT_SERVICE_NAME,
114
+ service_version='V1',
115
+ operation_id='get_billing_options',
116
+ )
117
+ headers.update(sdk_headers)
118
+
119
+ params = {
120
+ 'partner_id': partner_id,
121
+ 'customer_id': customer_id,
122
+ 'reseller_id': reseller_id,
123
+ 'date': date,
124
+ '_limit': limit,
125
+ }
126
+
127
+ if 'headers' in kwargs:
128
+ headers.update(kwargs.get('headers'))
129
+ del kwargs['headers']
130
+ headers['Accept'] = 'application/json'
131
+
132
+ url = '/v1/billing-options'
133
+ request = self.prepare_request(
134
+ method='GET',
135
+ url=url,
136
+ headers=headers,
137
+ params=params,
138
+ )
139
+
140
+ response = self.send(request, **kwargs)
141
+ return response
142
+
143
+ #########################
144
+ # Credit Pools
145
+ #########################
146
+
147
+ def get_credit_pools_report(
148
+ self,
149
+ partner_id: str,
150
+ *,
151
+ customer_id: Optional[str] = None,
152
+ reseller_id: Optional[str] = None,
153
+ date: Optional[str] = None,
154
+ limit: Optional[int] = None,
155
+ **kwargs,
156
+ ) -> DetailedResponse:
157
+ """
158
+ Get subscription burn-down report.
159
+
160
+ Returns the subscription or commitment burn-down reports for the end customers for
161
+ a given month.
162
+
163
+ :param str partner_id: Enterprise ID of the distributor or reseller for
164
+ which the report is requested.
165
+ :param str customer_id: (optional) Enterprise ID of the customer for which
166
+ the report is requested.
167
+ :param str reseller_id: (optional) Enterprise ID of the reseller for which
168
+ the report is requested.
169
+ :param str date: (optional) The billing month for which the usage report is
170
+ requested. Format is yyyy-mm. Defaults to current month.
171
+ :param int limit: (optional) Number of usage records returned. The default
172
+ value is 30. Maximum value is 200.
173
+ :param dict headers: A `dict` containing the request headers
174
+ :return: A `DetailedResponse` containing the result, headers and HTTP status code.
175
+ :rtype: DetailedResponse with `dict` result representing a `CreditPoolsReportSummary` object
176
+ """
177
+
178
+ if not partner_id:
179
+ raise ValueError('partner_id must be provided')
180
+ headers = {}
181
+ sdk_headers = get_sdk_headers(
182
+ service_name=self.DEFAULT_SERVICE_NAME,
183
+ service_version='V1',
184
+ operation_id='get_credit_pools_report',
185
+ )
186
+ headers.update(sdk_headers)
187
+
188
+ params = {
189
+ 'partner_id': partner_id,
190
+ 'customer_id': customer_id,
191
+ 'reseller_id': reseller_id,
192
+ 'date': date,
193
+ '_limit': limit,
194
+ }
195
+
196
+ if 'headers' in kwargs:
197
+ headers.update(kwargs.get('headers'))
198
+ del kwargs['headers']
199
+ headers['Accept'] = 'application/json'
200
+
201
+ url = '/v1/credit-pools'
202
+ request = self.prepare_request(
203
+ method='GET',
204
+ url=url,
205
+ headers=headers,
206
+ params=params,
207
+ )
208
+
209
+ response = self.send(request, **kwargs)
210
+ return response
211
+
212
+
213
+ ##############################################################################
214
+ # Models
215
+ ##############################################################################
216
+
217
+
218
+ class BillingOptionsSummaryFirst:
219
+ """
220
+ The link to the first page of the search query.
221
+
222
+ :param str href: (optional) A link to a page of query results.
223
+ """
224
+
225
+ def __init__(
226
+ self,
227
+ *,
228
+ href: Optional[str] = None,
229
+ ) -> None:
230
+ """
231
+ Initialize a BillingOptionsSummaryFirst object.
232
+
233
+ :param str href: (optional) A link to a page of query results.
234
+ """
235
+ self.href = href
236
+
237
+ @classmethod
238
+ def from_dict(cls, _dict: Dict) -> 'BillingOptionsSummaryFirst':
239
+ """Initialize a BillingOptionsSummaryFirst object from a json dictionary."""
240
+ args = {}
241
+ if (href := _dict.get('href')) is not None:
242
+ args['href'] = href
243
+ return cls(**args)
244
+
245
+ @classmethod
246
+ def _from_dict(cls, _dict):
247
+ """Initialize a BillingOptionsSummaryFirst object from a json dictionary."""
248
+ return cls.from_dict(_dict)
249
+
250
+ def to_dict(self) -> Dict:
251
+ """Return a json dictionary representing this model."""
252
+ _dict = {}
253
+ if hasattr(self, 'href') and self.href is not None:
254
+ _dict['href'] = self.href
255
+ return _dict
256
+
257
+ def _to_dict(self):
258
+ """Return a json dictionary representing this model."""
259
+ return self.to_dict()
260
+
261
+ def __str__(self) -> str:
262
+ """Return a `str` version of this BillingOptionsSummaryFirst object."""
263
+ return json.dumps(self.to_dict(), indent=2)
264
+
265
+ def __eq__(self, other: 'BillingOptionsSummaryFirst') -> bool:
266
+ """Return `true` when self and other are equal, false otherwise."""
267
+ if not isinstance(other, self.__class__):
268
+ return False
269
+ return self.__dict__ == other.__dict__
270
+
271
+ def __ne__(self, other: 'BillingOptionsSummaryFirst') -> bool:
272
+ """Return `true` when self and other are not equal, false otherwise."""
273
+ return not self == other
274
+
275
+
276
+ class BillingOptionsSummaryNext:
277
+ """
278
+ The link to the next page of the search query.
279
+
280
+ :param str href: (optional) A link to a page of query results.
281
+ :param str offset: (optional) The value of the `_start` query parameter to fetch
282
+ the next page.
283
+ """
284
+
285
+ def __init__(
286
+ self,
287
+ *,
288
+ href: Optional[str] = None,
289
+ offset: Optional[str] = None,
290
+ ) -> None:
291
+ """
292
+ Initialize a BillingOptionsSummaryNext object.
293
+
294
+ :param str href: (optional) A link to a page of query results.
295
+ :param str offset: (optional) The value of the `_start` query parameter to
296
+ fetch the next page.
297
+ """
298
+ self.href = href
299
+ self.offset = offset
300
+
301
+ @classmethod
302
+ def from_dict(cls, _dict: Dict) -> 'BillingOptionsSummaryNext':
303
+ """Initialize a BillingOptionsSummaryNext object from a json dictionary."""
304
+ args = {}
305
+ if (href := _dict.get('href')) is not None:
306
+ args['href'] = href
307
+ if (offset := _dict.get('offset')) is not None:
308
+ args['offset'] = offset
309
+ return cls(**args)
310
+
311
+ @classmethod
312
+ def _from_dict(cls, _dict):
313
+ """Initialize a BillingOptionsSummaryNext object from a json dictionary."""
314
+ return cls.from_dict(_dict)
315
+
316
+ def to_dict(self) -> Dict:
317
+ """Return a json dictionary representing this model."""
318
+ _dict = {}
319
+ if hasattr(self, 'href') and self.href is not None:
320
+ _dict['href'] = self.href
321
+ if hasattr(self, 'offset') and self.offset is not None:
322
+ _dict['offset'] = self.offset
323
+ return _dict
324
+
325
+ def _to_dict(self):
326
+ """Return a json dictionary representing this model."""
327
+ return self.to_dict()
328
+
329
+ def __str__(self) -> str:
330
+ """Return a `str` version of this BillingOptionsSummaryNext object."""
331
+ return json.dumps(self.to_dict(), indent=2)
332
+
333
+ def __eq__(self, other: 'BillingOptionsSummaryNext') -> bool:
334
+ """Return `true` when self and other are equal, false otherwise."""
335
+ if not isinstance(other, self.__class__):
336
+ return False
337
+ return self.__dict__ == other.__dict__
338
+
339
+ def __ne__(self, other: 'BillingOptionsSummaryNext') -> bool:
340
+ """Return `true` when self and other are not equal, false otherwise."""
341
+ return not self == other
342
+
343
+
344
+ class BillingOption:
345
+ """
346
+ Billing options report for the end customers.
347
+
348
+ :param str id: (optional) The ID of the billing option.
349
+ :param str billing_unit_id: (optional) The ID of the billing unit that's
350
+ associated with the billing option.
351
+ :param str customer_id: (optional) Account ID of the customer.
352
+ :param str customer_type: (optional) The customer type. The valid values are
353
+ `ENTERPRISE`, `ACCOUNT`, and `ACCOUNT_GROUP`.
354
+ :param str customer_name: (optional) A user-defined name for the customer.
355
+ :param str reseller_id: (optional) ID of the reseller in the heirarchy of the
356
+ requested customer.
357
+ :param str reseller_name: (optional) Name of the reseller in the heirarchy of
358
+ the requested customer.
359
+ :param str month: (optional) The billing month for which the burn-down report is
360
+ requested. Format is yyyy-mm. Defaults to current month.
361
+ :param List[dict] errors: (optional) Errors in the billing.
362
+ :param str type: (optional) The type of billing option. The valid values are
363
+ `SUBSCRIPTION` and `OFFER`.
364
+ :param datetime start_date: (optional) The start date of billing option.
365
+ :param datetime end_date: (optional) The end date of billing option.
366
+ :param str state: (optional) The state of the billing option. The valid values
367
+ include `ACTIVE, `SUSPENDED`, and `CANCELED`.
368
+ :param str category: (optional) The category of the billing option. The valid
369
+ values are `PLATFORM`, `SERVICE`, and `SUPPORT`.
370
+ :param dict payment_instrument: (optional) The payment method for support.
371
+ :param str part_number: (optional) Part number of the offering.
372
+ :param str catalog_id: (optional) ID of the catalog containing this offering.
373
+ :param str order_id: (optional) ID of the order containing this offering.
374
+ :param str po_number: (optional) PO Number of the offering.
375
+ :param str subscription_model: (optional) Subscription model.
376
+ :param int duration_in_months: (optional) The duration of the billing options in
377
+ months.
378
+ :param float monthly_amount: (optional) Amount billed monthly for this offering.
379
+ :param dict billing_system: (optional) The support billing system.
380
+ :param str country_code: (optional) The country code for the billing unit.
381
+ :param str currency_code: (optional) The currency code of the billing unit.
382
+ """
383
+
384
+ def __init__(
385
+ self,
386
+ *,
387
+ id: Optional[str] = None,
388
+ billing_unit_id: Optional[str] = None,
389
+ customer_id: Optional[str] = None,
390
+ customer_type: Optional[str] = None,
391
+ customer_name: Optional[str] = None,
392
+ reseller_id: Optional[str] = None,
393
+ reseller_name: Optional[str] = None,
394
+ month: Optional[str] = None,
395
+ errors: Optional[List[dict]] = None,
396
+ type: Optional[str] = None,
397
+ start_date: Optional[datetime] = None,
398
+ end_date: Optional[datetime] = None,
399
+ state: Optional[str] = None,
400
+ category: Optional[str] = None,
401
+ payment_instrument: Optional[dict] = None,
402
+ part_number: Optional[str] = None,
403
+ catalog_id: Optional[str] = None,
404
+ order_id: Optional[str] = None,
405
+ po_number: Optional[str] = None,
406
+ subscription_model: Optional[str] = None,
407
+ duration_in_months: Optional[int] = None,
408
+ monthly_amount: Optional[float] = None,
409
+ billing_system: Optional[dict] = None,
410
+ country_code: Optional[str] = None,
411
+ currency_code: Optional[str] = None,
412
+ ) -> None:
413
+ """
414
+ Initialize a BillingOption object.
415
+
416
+ :param str id: (optional) The ID of the billing option.
417
+ :param str billing_unit_id: (optional) The ID of the billing unit that's
418
+ associated with the billing option.
419
+ :param str customer_id: (optional) Account ID of the customer.
420
+ :param str customer_type: (optional) The customer type. The valid values
421
+ are `ENTERPRISE`, `ACCOUNT`, and `ACCOUNT_GROUP`.
422
+ :param str customer_name: (optional) A user-defined name for the customer.
423
+ :param str reseller_id: (optional) ID of the reseller in the heirarchy of
424
+ the requested customer.
425
+ :param str reseller_name: (optional) Name of the reseller in the heirarchy
426
+ of the requested customer.
427
+ :param str month: (optional) The billing month for which the burn-down
428
+ report is requested. Format is yyyy-mm. Defaults to current month.
429
+ :param List[dict] errors: (optional) Errors in the billing.
430
+ :param str type: (optional) The type of billing option. The valid values
431
+ are `SUBSCRIPTION` and `OFFER`.
432
+ :param datetime start_date: (optional) The start date of billing option.
433
+ :param datetime end_date: (optional) The end date of billing option.
434
+ :param str state: (optional) The state of the billing option. The valid
435
+ values include `ACTIVE, `SUSPENDED`, and `CANCELED`.
436
+ :param str category: (optional) The category of the billing option. The
437
+ valid values are `PLATFORM`, `SERVICE`, and `SUPPORT`.
438
+ :param dict payment_instrument: (optional) The payment method for support.
439
+ :param str part_number: (optional) Part number of the offering.
440
+ :param str catalog_id: (optional) ID of the catalog containing this
441
+ offering.
442
+ :param str order_id: (optional) ID of the order containing this offering.
443
+ :param str po_number: (optional) PO Number of the offering.
444
+ :param str subscription_model: (optional) Subscription model.
445
+ :param int duration_in_months: (optional) The duration of the billing
446
+ options in months.
447
+ :param float monthly_amount: (optional) Amount billed monthly for this
448
+ offering.
449
+ :param dict billing_system: (optional) The support billing system.
450
+ :param str country_code: (optional) The country code for the billing unit.
451
+ :param str currency_code: (optional) The currency code of the billing unit.
452
+ """
453
+ self.id = id
454
+ self.billing_unit_id = billing_unit_id
455
+ self.customer_id = customer_id
456
+ self.customer_type = customer_type
457
+ self.customer_name = customer_name
458
+ self.reseller_id = reseller_id
459
+ self.reseller_name = reseller_name
460
+ self.month = month
461
+ self.errors = errors
462
+ self.type = type
463
+ self.start_date = start_date
464
+ self.end_date = end_date
465
+ self.state = state
466
+ self.category = category
467
+ self.payment_instrument = payment_instrument
468
+ self.part_number = part_number
469
+ self.catalog_id = catalog_id
470
+ self.order_id = order_id
471
+ self.po_number = po_number
472
+ self.subscription_model = subscription_model
473
+ self.duration_in_months = duration_in_months
474
+ self.monthly_amount = monthly_amount
475
+ self.billing_system = billing_system
476
+ self.country_code = country_code
477
+ self.currency_code = currency_code
478
+
479
+ @classmethod
480
+ def from_dict(cls, _dict: Dict) -> 'BillingOption':
481
+ """Initialize a BillingOption object from a json dictionary."""
482
+ args = {}
483
+ if (id := _dict.get('id')) is not None:
484
+ args['id'] = id
485
+ if (billing_unit_id := _dict.get('billing_unit_id')) is not None:
486
+ args['billing_unit_id'] = billing_unit_id
487
+ if (customer_id := _dict.get('customer_id')) is not None:
488
+ args['customer_id'] = customer_id
489
+ if (customer_type := _dict.get('customer_type')) is not None:
490
+ args['customer_type'] = customer_type
491
+ if (customer_name := _dict.get('customer_name')) is not None:
492
+ args['customer_name'] = customer_name
493
+ if (reseller_id := _dict.get('reseller_id')) is not None:
494
+ args['reseller_id'] = reseller_id
495
+ if (reseller_name := _dict.get('reseller_name')) is not None:
496
+ args['reseller_name'] = reseller_name
497
+ if (month := _dict.get('month')) is not None:
498
+ args['month'] = month
499
+ if (errors := _dict.get('errors')) is not None:
500
+ args['errors'] = errors
501
+ if (type := _dict.get('type')) is not None:
502
+ args['type'] = type
503
+ if (start_date := _dict.get('start_date')) is not None:
504
+ args['start_date'] = string_to_datetime(start_date)
505
+ if (end_date := _dict.get('end_date')) is not None:
506
+ args['end_date'] = string_to_datetime(end_date)
507
+ if (state := _dict.get('state')) is not None:
508
+ args['state'] = state
509
+ if (category := _dict.get('category')) is not None:
510
+ args['category'] = category
511
+ if (payment_instrument := _dict.get('payment_instrument')) is not None:
512
+ args['payment_instrument'] = payment_instrument
513
+ if (part_number := _dict.get('part_number')) is not None:
514
+ args['part_number'] = part_number
515
+ if (catalog_id := _dict.get('catalog_id')) is not None:
516
+ args['catalog_id'] = catalog_id
517
+ if (order_id := _dict.get('order_id')) is not None:
518
+ args['order_id'] = order_id
519
+ if (po_number := _dict.get('po_number')) is not None:
520
+ args['po_number'] = po_number
521
+ if (subscription_model := _dict.get('subscription_model')) is not None:
522
+ args['subscription_model'] = subscription_model
523
+ if (duration_in_months := _dict.get('duration_in_months')) is not None:
524
+ args['duration_in_months'] = duration_in_months
525
+ if (monthly_amount := _dict.get('monthly_amount')) is not None:
526
+ args['monthly_amount'] = monthly_amount
527
+ if (billing_system := _dict.get('billing_system')) is not None:
528
+ args['billing_system'] = billing_system
529
+ if (country_code := _dict.get('country_code')) is not None:
530
+ args['country_code'] = country_code
531
+ if (currency_code := _dict.get('currency_code')) is not None:
532
+ args['currency_code'] = currency_code
533
+ return cls(**args)
534
+
535
+ @classmethod
536
+ def _from_dict(cls, _dict):
537
+ """Initialize a BillingOption object from a json dictionary."""
538
+ return cls.from_dict(_dict)
539
+
540
+ def to_dict(self) -> Dict:
541
+ """Return a json dictionary representing this model."""
542
+ _dict = {}
543
+ if hasattr(self, 'id') and self.id is not None:
544
+ _dict['id'] = self.id
545
+ if hasattr(self, 'billing_unit_id') and self.billing_unit_id is not None:
546
+ _dict['billing_unit_id'] = self.billing_unit_id
547
+ if hasattr(self, 'customer_id') and self.customer_id is not None:
548
+ _dict['customer_id'] = self.customer_id
549
+ if hasattr(self, 'customer_type') and self.customer_type is not None:
550
+ _dict['customer_type'] = self.customer_type
551
+ if hasattr(self, 'customer_name') and self.customer_name is not None:
552
+ _dict['customer_name'] = self.customer_name
553
+ if hasattr(self, 'reseller_id') and self.reseller_id is not None:
554
+ _dict['reseller_id'] = self.reseller_id
555
+ if hasattr(self, 'reseller_name') and self.reseller_name is not None:
556
+ _dict['reseller_name'] = self.reseller_name
557
+ if hasattr(self, 'month') and self.month is not None:
558
+ _dict['month'] = self.month
559
+ if hasattr(self, 'errors') and self.errors is not None:
560
+ _dict['errors'] = self.errors
561
+ if hasattr(self, 'type') and self.type is not None:
562
+ _dict['type'] = self.type
563
+ if hasattr(self, 'start_date') and self.start_date is not None:
564
+ _dict['start_date'] = datetime_to_string(self.start_date)
565
+ if hasattr(self, 'end_date') and self.end_date is not None:
566
+ _dict['end_date'] = datetime_to_string(self.end_date)
567
+ if hasattr(self, 'state') and self.state is not None:
568
+ _dict['state'] = self.state
569
+ if hasattr(self, 'category') and self.category is not None:
570
+ _dict['category'] = self.category
571
+ if hasattr(self, 'payment_instrument') and self.payment_instrument is not None:
572
+ _dict['payment_instrument'] = self.payment_instrument
573
+ if hasattr(self, 'part_number') and self.part_number is not None:
574
+ _dict['part_number'] = self.part_number
575
+ if hasattr(self, 'catalog_id') and self.catalog_id is not None:
576
+ _dict['catalog_id'] = self.catalog_id
577
+ if hasattr(self, 'order_id') and self.order_id is not None:
578
+ _dict['order_id'] = self.order_id
579
+ if hasattr(self, 'po_number') and self.po_number is not None:
580
+ _dict['po_number'] = self.po_number
581
+ if hasattr(self, 'subscription_model') and self.subscription_model is not None:
582
+ _dict['subscription_model'] = self.subscription_model
583
+ if hasattr(self, 'duration_in_months') and self.duration_in_months is not None:
584
+ _dict['duration_in_months'] = self.duration_in_months
585
+ if hasattr(self, 'monthly_amount') and self.monthly_amount is not None:
586
+ _dict['monthly_amount'] = self.monthly_amount
587
+ if hasattr(self, 'billing_system') and self.billing_system is not None:
588
+ _dict['billing_system'] = self.billing_system
589
+ if hasattr(self, 'country_code') and self.country_code is not None:
590
+ _dict['country_code'] = self.country_code
591
+ if hasattr(self, 'currency_code') and self.currency_code is not None:
592
+ _dict['currency_code'] = self.currency_code
593
+ return _dict
594
+
595
+ def _to_dict(self):
596
+ """Return a json dictionary representing this model."""
597
+ return self.to_dict()
598
+
599
+ def __str__(self) -> str:
600
+ """Return a `str` version of this BillingOption object."""
601
+ return json.dumps(self.to_dict(), indent=2)
602
+
603
+ def __eq__(self, other: 'BillingOption') -> bool:
604
+ """Return `true` when self and other are equal, false otherwise."""
605
+ if not isinstance(other, self.__class__):
606
+ return False
607
+ return self.__dict__ == other.__dict__
608
+
609
+ def __ne__(self, other: 'BillingOption') -> bool:
610
+ """Return `true` when self and other are not equal, false otherwise."""
611
+ return not self == other
612
+
613
+ class CustomerTypeEnum(str, Enum):
614
+ """
615
+ The customer type. The valid values are `ENTERPRISE`, `ACCOUNT`, and
616
+ `ACCOUNT_GROUP`.
617
+ """
618
+
619
+ ENTERPRISE = 'ENTERPRISE'
620
+ ACCOUNT = 'ACCOUNT'
621
+ ACCOUNT_GROUP = 'ACCOUNT_GROUP'
622
+
623
+ class TypeEnum(str, Enum):
624
+ """
625
+ The type of billing option. The valid values are `SUBSCRIPTION` and `OFFER`.
626
+ """
627
+
628
+ SUBSCRIPTION = 'SUBSCRIPTION'
629
+ OFFER = 'OFFER'
630
+
631
+ class StateEnum(str, Enum):
632
+ """
633
+ The state of the billing option. The valid values include `ACTIVE, `SUSPENDED`,
634
+ and `CANCELED`.
635
+ """
636
+
637
+ ACTIVE = 'ACTIVE'
638
+ SUSPENDED = 'SUSPENDED'
639
+ CANCELED = 'CANCELED'
640
+
641
+ class CategoryEnum(str, Enum):
642
+ """
643
+ The category of the billing option. The valid values are `PLATFORM`, `SERVICE`,
644
+ and `SUPPORT`.
645
+ """
646
+
647
+ PLATFORM = 'PLATFORM'
648
+ SERVICE = 'SERVICE'
649
+ SUPPORT = 'SUPPORT'
650
+
651
+
652
+ class BillingOptionsSummary:
653
+ """
654
+ The billing options report for the customer.
655
+
656
+ :param int limit: (optional) The max number of reports in the response.
657
+ :param BillingOptionsSummaryFirst first: (optional) The link to the first page
658
+ of the search query.
659
+ :param BillingOptionsSummaryNext next: (optional) The link to the next page of
660
+ the search query.
661
+ :param List[BillingOption] resources: (optional) Aggregated usage report of all
662
+ requested partners.
663
+ """
664
+
665
+ def __init__(
666
+ self,
667
+ *,
668
+ limit: Optional[int] = None,
669
+ first: Optional['BillingOptionsSummaryFirst'] = None,
670
+ next: Optional['BillingOptionsSummaryNext'] = None,
671
+ resources: Optional[List['BillingOption']] = None,
672
+ ) -> None:
673
+ """
674
+ Initialize a BillingOptionsSummary object.
675
+
676
+ :param int limit: (optional) The max number of reports in the response.
677
+ :param BillingOptionsSummaryFirst first: (optional) The link to the first
678
+ page of the search query.
679
+ :param BillingOptionsSummaryNext next: (optional) The link to the next page
680
+ of the search query.
681
+ :param List[BillingOption] resources: (optional) Aggregated usage report of
682
+ all requested partners.
683
+ """
684
+ self.limit = limit
685
+ self.first = first
686
+ self.next = next
687
+ self.resources = resources
688
+
689
+ @classmethod
690
+ def from_dict(cls, _dict: Dict) -> 'BillingOptionsSummary':
691
+ """Initialize a BillingOptionsSummary object from a json dictionary."""
692
+ args = {}
693
+ if (limit := _dict.get('limit')) is not None:
694
+ args['limit'] = limit
695
+ if (first := _dict.get('first')) is not None:
696
+ args['first'] = BillingOptionsSummaryFirst.from_dict(first)
697
+ if (next := _dict.get('next')) is not None:
698
+ args['next'] = BillingOptionsSummaryNext.from_dict(next)
699
+ if (resources := _dict.get('resources')) is not None:
700
+ args['resources'] = [BillingOption.from_dict(v) for v in resources]
701
+ return cls(**args)
702
+
703
+ @classmethod
704
+ def _from_dict(cls, _dict):
705
+ """Initialize a BillingOptionsSummary object from a json dictionary."""
706
+ return cls.from_dict(_dict)
707
+
708
+ def to_dict(self) -> Dict:
709
+ """Return a json dictionary representing this model."""
710
+ _dict = {}
711
+ if hasattr(self, 'limit') and self.limit is not None:
712
+ _dict['limit'] = self.limit
713
+ if hasattr(self, 'first') and self.first is not None:
714
+ if isinstance(self.first, dict):
715
+ _dict['first'] = self.first
716
+ else:
717
+ _dict['first'] = self.first.to_dict()
718
+ if hasattr(self, 'next') and self.next is not None:
719
+ if isinstance(self.next, dict):
720
+ _dict['next'] = self.next
721
+ else:
722
+ _dict['next'] = self.next.to_dict()
723
+ if hasattr(self, 'resources') and self.resources is not None:
724
+ resources_list = []
725
+ for v in self.resources:
726
+ if isinstance(v, dict):
727
+ resources_list.append(v)
728
+ else:
729
+ resources_list.append(v.to_dict())
730
+ _dict['resources'] = resources_list
731
+ return _dict
732
+
733
+ def _to_dict(self):
734
+ """Return a json dictionary representing this model."""
735
+ return self.to_dict()
736
+
737
+ def __str__(self) -> str:
738
+ """Return a `str` version of this BillingOptionsSummary object."""
739
+ return json.dumps(self.to_dict(), indent=2)
740
+
741
+ def __eq__(self, other: 'BillingOptionsSummary') -> bool:
742
+ """Return `true` when self and other are equal, false otherwise."""
743
+ if not isinstance(other, self.__class__):
744
+ return False
745
+ return self.__dict__ == other.__dict__
746
+
747
+ def __ne__(self, other: 'BillingOptionsSummary') -> bool:
748
+ """Return `true` when self and other are not equal, false otherwise."""
749
+ return not self == other
750
+
751
+
752
+ class CreditPoolsReportSummaryFirst:
753
+ """
754
+ The link to the first page of the search query.
755
+
756
+ :param str href: (optional) A link to a page of query results.
757
+ """
758
+
759
+ def __init__(
760
+ self,
761
+ *,
762
+ href: Optional[str] = None,
763
+ ) -> None:
764
+ """
765
+ Initialize a CreditPoolsReportSummaryFirst object.
766
+
767
+ :param str href: (optional) A link to a page of query results.
768
+ """
769
+ self.href = href
770
+
771
+ @classmethod
772
+ def from_dict(cls, _dict: Dict) -> 'CreditPoolsReportSummaryFirst':
773
+ """Initialize a CreditPoolsReportSummaryFirst object from a json dictionary."""
774
+ args = {}
775
+ if (href := _dict.get('href')) is not None:
776
+ args['href'] = href
777
+ return cls(**args)
778
+
779
+ @classmethod
780
+ def _from_dict(cls, _dict):
781
+ """Initialize a CreditPoolsReportSummaryFirst object from a json dictionary."""
782
+ return cls.from_dict(_dict)
783
+
784
+ def to_dict(self) -> Dict:
785
+ """Return a json dictionary representing this model."""
786
+ _dict = {}
787
+ if hasattr(self, 'href') and self.href is not None:
788
+ _dict['href'] = self.href
789
+ return _dict
790
+
791
+ def _to_dict(self):
792
+ """Return a json dictionary representing this model."""
793
+ return self.to_dict()
794
+
795
+ def __str__(self) -> str:
796
+ """Return a `str` version of this CreditPoolsReportSummaryFirst object."""
797
+ return json.dumps(self.to_dict(), indent=2)
798
+
799
+ def __eq__(self, other: 'CreditPoolsReportSummaryFirst') -> bool:
800
+ """Return `true` when self and other are equal, false otherwise."""
801
+ if not isinstance(other, self.__class__):
802
+ return False
803
+ return self.__dict__ == other.__dict__
804
+
805
+ def __ne__(self, other: 'CreditPoolsReportSummaryFirst') -> bool:
806
+ """Return `true` when self and other are not equal, false otherwise."""
807
+ return not self == other
808
+
809
+
810
+ class CreditPoolsReportSummaryNext:
811
+ """
812
+ The link to the next page of the search query.
813
+
814
+ :param str href: (optional) A link to a page of query results.
815
+ :param str offset: (optional) The value of the `_start` query parameter to fetch
816
+ the next page.
817
+ """
818
+
819
+ def __init__(
820
+ self,
821
+ *,
822
+ href: Optional[str] = None,
823
+ offset: Optional[str] = None,
824
+ ) -> None:
825
+ """
826
+ Initialize a CreditPoolsReportSummaryNext object.
827
+
828
+ :param str href: (optional) A link to a page of query results.
829
+ :param str offset: (optional) The value of the `_start` query parameter to
830
+ fetch the next page.
831
+ """
832
+ self.href = href
833
+ self.offset = offset
834
+
835
+ @classmethod
836
+ def from_dict(cls, _dict: Dict) -> 'CreditPoolsReportSummaryNext':
837
+ """Initialize a CreditPoolsReportSummaryNext object from a json dictionary."""
838
+ args = {}
839
+ if (href := _dict.get('href')) is not None:
840
+ args['href'] = href
841
+ if (offset := _dict.get('offset')) is not None:
842
+ args['offset'] = offset
843
+ return cls(**args)
844
+
845
+ @classmethod
846
+ def _from_dict(cls, _dict):
847
+ """Initialize a CreditPoolsReportSummaryNext object from a json dictionary."""
848
+ return cls.from_dict(_dict)
849
+
850
+ def to_dict(self) -> Dict:
851
+ """Return a json dictionary representing this model."""
852
+ _dict = {}
853
+ if hasattr(self, 'href') and self.href is not None:
854
+ _dict['href'] = self.href
855
+ if hasattr(self, 'offset') and self.offset is not None:
856
+ _dict['offset'] = self.offset
857
+ return _dict
858
+
859
+ def _to_dict(self):
860
+ """Return a json dictionary representing this model."""
861
+ return self.to_dict()
862
+
863
+ def __str__(self) -> str:
864
+ """Return a `str` version of this CreditPoolsReportSummaryNext object."""
865
+ return json.dumps(self.to_dict(), indent=2)
866
+
867
+ def __eq__(self, other: 'CreditPoolsReportSummaryNext') -> bool:
868
+ """Return `true` when self and other are equal, false otherwise."""
869
+ if not isinstance(other, self.__class__):
870
+ return False
871
+ return self.__dict__ == other.__dict__
872
+
873
+ def __ne__(self, other: 'CreditPoolsReportSummaryNext') -> bool:
874
+ """Return `true` when self and other are not equal, false otherwise."""
875
+ return not self == other
876
+
877
+
878
+ class CreditPoolsReport:
879
+ """
880
+ Aggregated subscription burn-down report for the end customers.
881
+
882
+ :param str type: (optional) The category of the billing option. The valid values
883
+ are `PLATFORM`, `SERVICE` and `SUPPORT`.
884
+ :param str billing_unit_id: (optional) The ID of the billing unit that's
885
+ associated with the billing option.
886
+ :param str customer_id: (optional) Account ID of the customer.
887
+ :param str customer_type: (optional) The customer type. The valid values are
888
+ `ENTERPRISE`, `ACCOUNT`, and `ACCOUNT_GROUP`.
889
+ :param str customer_name: (optional) A user-defined name for the customer.
890
+ :param str reseller_id: (optional) ID of the reseller in the heirarchy of the
891
+ requested customer.
892
+ :param str reseller_name: (optional) Name of the reseller in the heirarchy of
893
+ the requested customer.
894
+ :param str month: (optional) The billing month for which the burn-down report is
895
+ requested. Format is yyyy-mm. Defaults to current month.
896
+ :param str currency_code: (optional) The currency code of the billing unit.
897
+ :param List[TermCredits] term_credits: (optional) A list of active subscription
898
+ terms available within a credit.
899
+ :param Overage overage: (optional) Overage that was generated on the credit
900
+ pool.
901
+ """
902
+
903
+ def __init__(
904
+ self,
905
+ *,
906
+ type: Optional[str] = None,
907
+ billing_unit_id: Optional[str] = None,
908
+ customer_id: Optional[str] = None,
909
+ customer_type: Optional[str] = None,
910
+ customer_name: Optional[str] = None,
911
+ reseller_id: Optional[str] = None,
912
+ reseller_name: Optional[str] = None,
913
+ month: Optional[str] = None,
914
+ currency_code: Optional[str] = None,
915
+ term_credits: Optional[List['TermCredits']] = None,
916
+ overage: Optional['Overage'] = None,
917
+ ) -> None:
918
+ """
919
+ Initialize a CreditPoolsReport object.
920
+
921
+ :param str type: (optional) The category of the billing option. The valid
922
+ values are `PLATFORM`, `SERVICE` and `SUPPORT`.
923
+ :param str billing_unit_id: (optional) The ID of the billing unit that's
924
+ associated with the billing option.
925
+ :param str customer_id: (optional) Account ID of the customer.
926
+ :param str customer_type: (optional) The customer type. The valid values
927
+ are `ENTERPRISE`, `ACCOUNT`, and `ACCOUNT_GROUP`.
928
+ :param str customer_name: (optional) A user-defined name for the customer.
929
+ :param str reseller_id: (optional) ID of the reseller in the heirarchy of
930
+ the requested customer.
931
+ :param str reseller_name: (optional) Name of the reseller in the heirarchy
932
+ of the requested customer.
933
+ :param str month: (optional) The billing month for which the burn-down
934
+ report is requested. Format is yyyy-mm. Defaults to current month.
935
+ :param str currency_code: (optional) The currency code of the billing unit.
936
+ :param List[TermCredits] term_credits: (optional) A list of active
937
+ subscription terms available within a credit.
938
+ :param Overage overage: (optional) Overage that was generated on the credit
939
+ pool.
940
+ """
941
+ self.type = type
942
+ self.billing_unit_id = billing_unit_id
943
+ self.customer_id = customer_id
944
+ self.customer_type = customer_type
945
+ self.customer_name = customer_name
946
+ self.reseller_id = reseller_id
947
+ self.reseller_name = reseller_name
948
+ self.month = month
949
+ self.currency_code = currency_code
950
+ self.term_credits = term_credits
951
+ self.overage = overage
952
+
953
+ @classmethod
954
+ def from_dict(cls, _dict: Dict) -> 'CreditPoolsReport':
955
+ """Initialize a CreditPoolsReport object from a json dictionary."""
956
+ args = {}
957
+ if (type := _dict.get('type')) is not None:
958
+ args['type'] = type
959
+ if (billing_unit_id := _dict.get('billing_unit_id')) is not None:
960
+ args['billing_unit_id'] = billing_unit_id
961
+ if (customer_id := _dict.get('customer_id')) is not None:
962
+ args['customer_id'] = customer_id
963
+ if (customer_type := _dict.get('customer_type')) is not None:
964
+ args['customer_type'] = customer_type
965
+ if (customer_name := _dict.get('customer_name')) is not None:
966
+ args['customer_name'] = customer_name
967
+ if (reseller_id := _dict.get('reseller_id')) is not None:
968
+ args['reseller_id'] = reseller_id
969
+ if (reseller_name := _dict.get('reseller_name')) is not None:
970
+ args['reseller_name'] = reseller_name
971
+ if (month := _dict.get('month')) is not None:
972
+ args['month'] = month
973
+ if (currency_code := _dict.get('currency_code')) is not None:
974
+ args['currency_code'] = currency_code
975
+ if (term_credits := _dict.get('term_credits')) is not None:
976
+ args['term_credits'] = [TermCredits.from_dict(v) for v in term_credits]
977
+ if (overage := _dict.get('overage')) is not None:
978
+ args['overage'] = Overage.from_dict(overage)
979
+ return cls(**args)
980
+
981
+ @classmethod
982
+ def _from_dict(cls, _dict):
983
+ """Initialize a CreditPoolsReport object from a json dictionary."""
984
+ return cls.from_dict(_dict)
985
+
986
+ def to_dict(self) -> Dict:
987
+ """Return a json dictionary representing this model."""
988
+ _dict = {}
989
+ if hasattr(self, 'type') and self.type is not None:
990
+ _dict['type'] = self.type
991
+ if hasattr(self, 'billing_unit_id') and self.billing_unit_id is not None:
992
+ _dict['billing_unit_id'] = self.billing_unit_id
993
+ if hasattr(self, 'customer_id') and self.customer_id is not None:
994
+ _dict['customer_id'] = self.customer_id
995
+ if hasattr(self, 'customer_type') and self.customer_type is not None:
996
+ _dict['customer_type'] = self.customer_type
997
+ if hasattr(self, 'customer_name') and self.customer_name is not None:
998
+ _dict['customer_name'] = self.customer_name
999
+ if hasattr(self, 'reseller_id') and self.reseller_id is not None:
1000
+ _dict['reseller_id'] = self.reseller_id
1001
+ if hasattr(self, 'reseller_name') and self.reseller_name is not None:
1002
+ _dict['reseller_name'] = self.reseller_name
1003
+ if hasattr(self, 'month') and self.month is not None:
1004
+ _dict['month'] = self.month
1005
+ if hasattr(self, 'currency_code') and self.currency_code is not None:
1006
+ _dict['currency_code'] = self.currency_code
1007
+ if hasattr(self, 'term_credits') and self.term_credits is not None:
1008
+ term_credits_list = []
1009
+ for v in self.term_credits:
1010
+ if isinstance(v, dict):
1011
+ term_credits_list.append(v)
1012
+ else:
1013
+ term_credits_list.append(v.to_dict())
1014
+ _dict['term_credits'] = term_credits_list
1015
+ if hasattr(self, 'overage') and self.overage is not None:
1016
+ if isinstance(self.overage, dict):
1017
+ _dict['overage'] = self.overage
1018
+ else:
1019
+ _dict['overage'] = self.overage.to_dict()
1020
+ return _dict
1021
+
1022
+ def _to_dict(self):
1023
+ """Return a json dictionary representing this model."""
1024
+ return self.to_dict()
1025
+
1026
+ def __str__(self) -> str:
1027
+ """Return a `str` version of this CreditPoolsReport object."""
1028
+ return json.dumps(self.to_dict(), indent=2)
1029
+
1030
+ def __eq__(self, other: 'CreditPoolsReport') -> bool:
1031
+ """Return `true` when self and other are equal, false otherwise."""
1032
+ if not isinstance(other, self.__class__):
1033
+ return False
1034
+ return self.__dict__ == other.__dict__
1035
+
1036
+ def __ne__(self, other: 'CreditPoolsReport') -> bool:
1037
+ """Return `true` when self and other are not equal, false otherwise."""
1038
+ return not self == other
1039
+
1040
+ class TypeEnum(str, Enum):
1041
+ """
1042
+ The category of the billing option. The valid values are `PLATFORM`, `SERVICE` and
1043
+ `SUPPORT`.
1044
+ """
1045
+
1046
+ PLATFORM = 'PLATFORM'
1047
+ SERVICE = 'SERVICE'
1048
+ SUPPORT = 'SUPPORT'
1049
+
1050
+ class CustomerTypeEnum(str, Enum):
1051
+ """
1052
+ The customer type. The valid values are `ENTERPRISE`, `ACCOUNT`, and
1053
+ `ACCOUNT_GROUP`.
1054
+ """
1055
+
1056
+ ENTERPRISE = 'ENTERPRISE'
1057
+ ACCOUNT = 'ACCOUNT'
1058
+ ACCOUNT_GROUP = 'ACCOUNT_GROUP'
1059
+
1060
+
1061
+ class CreditPoolsReportSummary:
1062
+ """
1063
+ The aggregated credit pools report.
1064
+
1065
+ :param int limit: (optional) The max number of reports in the response.
1066
+ :param CreditPoolsReportSummaryFirst first: (optional) The link to the first
1067
+ page of the search query.
1068
+ :param CreditPoolsReportSummaryNext next: (optional) The link to the next page
1069
+ of the search query.
1070
+ :param List[CreditPoolsReport] resources: (optional) Aggregated usage report of
1071
+ all requested partners.
1072
+ """
1073
+
1074
+ def __init__(
1075
+ self,
1076
+ *,
1077
+ limit: Optional[int] = None,
1078
+ first: Optional['CreditPoolsReportSummaryFirst'] = None,
1079
+ next: Optional['CreditPoolsReportSummaryNext'] = None,
1080
+ resources: Optional[List['CreditPoolsReport']] = None,
1081
+ ) -> None:
1082
+ """
1083
+ Initialize a CreditPoolsReportSummary object.
1084
+
1085
+ :param int limit: (optional) The max number of reports in the response.
1086
+ :param CreditPoolsReportSummaryFirst first: (optional) The link to the
1087
+ first page of the search query.
1088
+ :param CreditPoolsReportSummaryNext next: (optional) The link to the next
1089
+ page of the search query.
1090
+ :param List[CreditPoolsReport] resources: (optional) Aggregated usage
1091
+ report of all requested partners.
1092
+ """
1093
+ self.limit = limit
1094
+ self.first = first
1095
+ self.next = next
1096
+ self.resources = resources
1097
+
1098
+ @classmethod
1099
+ def from_dict(cls, _dict: Dict) -> 'CreditPoolsReportSummary':
1100
+ """Initialize a CreditPoolsReportSummary object from a json dictionary."""
1101
+ args = {}
1102
+ if (limit := _dict.get('limit')) is not None:
1103
+ args['limit'] = limit
1104
+ if (first := _dict.get('first')) is not None:
1105
+ args['first'] = CreditPoolsReportSummaryFirst.from_dict(first)
1106
+ if (next := _dict.get('next')) is not None:
1107
+ args['next'] = CreditPoolsReportSummaryNext.from_dict(next)
1108
+ if (resources := _dict.get('resources')) is not None:
1109
+ args['resources'] = [CreditPoolsReport.from_dict(v) for v in resources]
1110
+ return cls(**args)
1111
+
1112
+ @classmethod
1113
+ def _from_dict(cls, _dict):
1114
+ """Initialize a CreditPoolsReportSummary object from a json dictionary."""
1115
+ return cls.from_dict(_dict)
1116
+
1117
+ def to_dict(self) -> Dict:
1118
+ """Return a json dictionary representing this model."""
1119
+ _dict = {}
1120
+ if hasattr(self, 'limit') and self.limit is not None:
1121
+ _dict['limit'] = self.limit
1122
+ if hasattr(self, 'first') and self.first is not None:
1123
+ if isinstance(self.first, dict):
1124
+ _dict['first'] = self.first
1125
+ else:
1126
+ _dict['first'] = self.first.to_dict()
1127
+ if hasattr(self, 'next') and self.next is not None:
1128
+ if isinstance(self.next, dict):
1129
+ _dict['next'] = self.next
1130
+ else:
1131
+ _dict['next'] = self.next.to_dict()
1132
+ if hasattr(self, 'resources') and self.resources is not None:
1133
+ resources_list = []
1134
+ for v in self.resources:
1135
+ if isinstance(v, dict):
1136
+ resources_list.append(v)
1137
+ else:
1138
+ resources_list.append(v.to_dict())
1139
+ _dict['resources'] = resources_list
1140
+ return _dict
1141
+
1142
+ def _to_dict(self):
1143
+ """Return a json dictionary representing this model."""
1144
+ return self.to_dict()
1145
+
1146
+ def __str__(self) -> str:
1147
+ """Return a `str` version of this CreditPoolsReportSummary object."""
1148
+ return json.dumps(self.to_dict(), indent=2)
1149
+
1150
+ def __eq__(self, other: 'CreditPoolsReportSummary') -> bool:
1151
+ """Return `true` when self and other are equal, false otherwise."""
1152
+ if not isinstance(other, self.__class__):
1153
+ return False
1154
+ return self.__dict__ == other.__dict__
1155
+
1156
+ def __ne__(self, other: 'CreditPoolsReportSummary') -> bool:
1157
+ """Return `true` when self and other are not equal, false otherwise."""
1158
+ return not self == other
1159
+
1160
+
1161
+ class Overage:
1162
+ """
1163
+ Overage that was generated on the credit pool.
1164
+
1165
+ :param float cost: (optional) The number of credits used as overage.
1166
+ :param List[dict] resources: (optional) A list of resources that generated
1167
+ overage.
1168
+ """
1169
+
1170
+ def __init__(
1171
+ self,
1172
+ *,
1173
+ cost: Optional[float] = None,
1174
+ resources: Optional[List[dict]] = None,
1175
+ ) -> None:
1176
+ """
1177
+ Initialize a Overage object.
1178
+
1179
+ :param float cost: (optional) The number of credits used as overage.
1180
+ :param List[dict] resources: (optional) A list of resources that generated
1181
+ overage.
1182
+ """
1183
+ self.cost = cost
1184
+ self.resources = resources
1185
+
1186
+ @classmethod
1187
+ def from_dict(cls, _dict: Dict) -> 'Overage':
1188
+ """Initialize a Overage object from a json dictionary."""
1189
+ args = {}
1190
+ if (cost := _dict.get('cost')) is not None:
1191
+ args['cost'] = cost
1192
+ if (resources := _dict.get('resources')) is not None:
1193
+ args['resources'] = resources
1194
+ return cls(**args)
1195
+
1196
+ @classmethod
1197
+ def _from_dict(cls, _dict):
1198
+ """Initialize a Overage object from a json dictionary."""
1199
+ return cls.from_dict(_dict)
1200
+
1201
+ def to_dict(self) -> Dict:
1202
+ """Return a json dictionary representing this model."""
1203
+ _dict = {}
1204
+ if hasattr(self, 'cost') and self.cost is not None:
1205
+ _dict['cost'] = self.cost
1206
+ if hasattr(self, 'resources') and self.resources is not None:
1207
+ _dict['resources'] = self.resources
1208
+ return _dict
1209
+
1210
+ def _to_dict(self):
1211
+ """Return a json dictionary representing this model."""
1212
+ return self.to_dict()
1213
+
1214
+ def __str__(self) -> str:
1215
+ """Return a `str` version of this Overage object."""
1216
+ return json.dumps(self.to_dict(), indent=2)
1217
+
1218
+ def __eq__(self, other: 'Overage') -> bool:
1219
+ """Return `true` when self and other are equal, false otherwise."""
1220
+ if not isinstance(other, self.__class__):
1221
+ return False
1222
+ return self.__dict__ == other.__dict__
1223
+
1224
+ def __ne__(self, other: 'Overage') -> bool:
1225
+ """Return `true` when self and other are not equal, false otherwise."""
1226
+ return not self == other
1227
+
1228
+
1229
+ class TermCredits:
1230
+ """
1231
+ The subscription term that is active in the requested month.
1232
+
1233
+ :param str billing_option_id: (optional) The ID of the billing option from which
1234
+ the subscription term is derived.
1235
+ :param str billing_option_model: (optional) Billing option model.
1236
+ :param str category: (optional) The category of the billing option. The valid
1237
+ values are `PLATFORM`, `SERVICE`, and `SUPPORT`.
1238
+ :param datetime start_date: (optional) The start date of the term in ISO format.
1239
+ :param datetime end_date: (optional) The end date of the term in ISO format.
1240
+ :param float total_credits: (optional) The total credit available in this term.
1241
+ :param float starting_balance: (optional) The balance of available credit at the
1242
+ start of the current month.
1243
+ :param float used_credits: (optional) The amount of credit used during the
1244
+ current month.
1245
+ :param float current_balance: (optional) The balance of remaining credit in the
1246
+ subscription term.
1247
+ :param List[dict] resources: (optional) A list of resources that used credit
1248
+ during the month.
1249
+ """
1250
+
1251
+ def __init__(
1252
+ self,
1253
+ *,
1254
+ billing_option_id: Optional[str] = None,
1255
+ billing_option_model: Optional[str] = None,
1256
+ category: Optional[str] = None,
1257
+ start_date: Optional[datetime] = None,
1258
+ end_date: Optional[datetime] = None,
1259
+ total_credits: Optional[float] = None,
1260
+ starting_balance: Optional[float] = None,
1261
+ used_credits: Optional[float] = None,
1262
+ current_balance: Optional[float] = None,
1263
+ resources: Optional[List[dict]] = None,
1264
+ ) -> None:
1265
+ """
1266
+ Initialize a TermCredits object.
1267
+
1268
+ :param str billing_option_id: (optional) The ID of the billing option from
1269
+ which the subscription term is derived.
1270
+ :param str billing_option_model: (optional) Billing option model.
1271
+ :param str category: (optional) The category of the billing option. The
1272
+ valid values are `PLATFORM`, `SERVICE`, and `SUPPORT`.
1273
+ :param datetime start_date: (optional) The start date of the term in ISO
1274
+ format.
1275
+ :param datetime end_date: (optional) The end date of the term in ISO
1276
+ format.
1277
+ :param float total_credits: (optional) The total credit available in this
1278
+ term.
1279
+ :param float starting_balance: (optional) The balance of available credit
1280
+ at the start of the current month.
1281
+ :param float used_credits: (optional) The amount of credit used during the
1282
+ current month.
1283
+ :param float current_balance: (optional) The balance of remaining credit in
1284
+ the subscription term.
1285
+ :param List[dict] resources: (optional) A list of resources that used
1286
+ credit during the month.
1287
+ """
1288
+ self.billing_option_id = billing_option_id
1289
+ self.billing_option_model = billing_option_model
1290
+ self.category = category
1291
+ self.start_date = start_date
1292
+ self.end_date = end_date
1293
+ self.total_credits = total_credits
1294
+ self.starting_balance = starting_balance
1295
+ self.used_credits = used_credits
1296
+ self.current_balance = current_balance
1297
+ self.resources = resources
1298
+
1299
+ @classmethod
1300
+ def from_dict(cls, _dict: Dict) -> 'TermCredits':
1301
+ """Initialize a TermCredits object from a json dictionary."""
1302
+ args = {}
1303
+ if (billing_option_id := _dict.get('billing_option_id')) is not None:
1304
+ args['billing_option_id'] = billing_option_id
1305
+ if (billing_option_model := _dict.get('billing_option_model')) is not None:
1306
+ args['billing_option_model'] = billing_option_model
1307
+ if (category := _dict.get('category')) is not None:
1308
+ args['category'] = category
1309
+ if (start_date := _dict.get('start_date')) is not None:
1310
+ args['start_date'] = string_to_datetime(start_date)
1311
+ if (end_date := _dict.get('end_date')) is not None:
1312
+ args['end_date'] = string_to_datetime(end_date)
1313
+ if (total_credits := _dict.get('total_credits')) is not None:
1314
+ args['total_credits'] = total_credits
1315
+ if (starting_balance := _dict.get('starting_balance')) is not None:
1316
+ args['starting_balance'] = starting_balance
1317
+ if (used_credits := _dict.get('used_credits')) is not None:
1318
+ args['used_credits'] = used_credits
1319
+ if (current_balance := _dict.get('current_balance')) is not None:
1320
+ args['current_balance'] = current_balance
1321
+ if (resources := _dict.get('resources')) is not None:
1322
+ args['resources'] = resources
1323
+ return cls(**args)
1324
+
1325
+ @classmethod
1326
+ def _from_dict(cls, _dict):
1327
+ """Initialize a TermCredits object from a json dictionary."""
1328
+ return cls.from_dict(_dict)
1329
+
1330
+ def to_dict(self) -> Dict:
1331
+ """Return a json dictionary representing this model."""
1332
+ _dict = {}
1333
+ if hasattr(self, 'billing_option_id') and self.billing_option_id is not None:
1334
+ _dict['billing_option_id'] = self.billing_option_id
1335
+ if hasattr(self, 'billing_option_model') and self.billing_option_model is not None:
1336
+ _dict['billing_option_model'] = self.billing_option_model
1337
+ if hasattr(self, 'category') and self.category is not None:
1338
+ _dict['category'] = self.category
1339
+ if hasattr(self, 'start_date') and self.start_date is not None:
1340
+ _dict['start_date'] = datetime_to_string(self.start_date)
1341
+ if hasattr(self, 'end_date') and self.end_date is not None:
1342
+ _dict['end_date'] = datetime_to_string(self.end_date)
1343
+ if hasattr(self, 'total_credits') and self.total_credits is not None:
1344
+ _dict['total_credits'] = self.total_credits
1345
+ if hasattr(self, 'starting_balance') and self.starting_balance is not None:
1346
+ _dict['starting_balance'] = self.starting_balance
1347
+ if hasattr(self, 'used_credits') and self.used_credits is not None:
1348
+ _dict['used_credits'] = self.used_credits
1349
+ if hasattr(self, 'current_balance') and self.current_balance is not None:
1350
+ _dict['current_balance'] = self.current_balance
1351
+ if hasattr(self, 'resources') and self.resources is not None:
1352
+ _dict['resources'] = self.resources
1353
+ return _dict
1354
+
1355
+ def _to_dict(self):
1356
+ """Return a json dictionary representing this model."""
1357
+ return self.to_dict()
1358
+
1359
+ def __str__(self) -> str:
1360
+ """Return a `str` version of this TermCredits object."""
1361
+ return json.dumps(self.to_dict(), indent=2)
1362
+
1363
+ def __eq__(self, other: 'TermCredits') -> bool:
1364
+ """Return `true` when self and other are equal, false otherwise."""
1365
+ if not isinstance(other, self.__class__):
1366
+ return False
1367
+ return self.__dict__ == other.__dict__
1368
+
1369
+ def __ne__(self, other: 'TermCredits') -> bool:
1370
+ """Return `true` when self and other are not equal, false otherwise."""
1371
+ return not self == other
1372
+
1373
+ class CategoryEnum(str, Enum):
1374
+ """
1375
+ The category of the billing option. The valid values are `PLATFORM`, `SERVICE`,
1376
+ and `SUPPORT`.
1377
+ """
1378
+
1379
+ PLATFORM = 'PLATFORM'
1380
+ SERVICE = 'SERVICE'
1381
+ SUPPORT = 'SUPPORT'