Skip to content

Commit 3592cd1

Browse files
lualua
lua
authored and
lua
committed
generates the new sdk
1 parent 3790bd7 commit 3592cd1

File tree

1 file changed

+31
-48
lines changed

1 file changed

+31
-48
lines changed

plenigo-client/plenigo/models/subscription_item.py

+31-48
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@ class SubscriptionItem:
1919
Attributes:
2020
subscription_item_id (int): unique id of the subscription item in the context of a company
2121
product_id (str): id of the product bought
22+
access_right_unique_id (str): unique id of the access right this subscription item grants access to
2223
title (str): product title presented to the customer
23-
price (float): price of the subscription
24+
tax_type (TaxType): unique identification of the tax type the product represents
2425
quantity (int): quantity of purchased entities
26+
status (SubscriptionItemStatus): current status of the subscription item
2527
created_date (Union[None, Unset, datetime.datetime]): time the object was created with time notation as defined
2628
by <a href="https://tools.ietf.org/html/rfc3339#section-5.6" target="_blank">RFC 3339, section 5.6</a>, for
2729
example, 17:32:28
@@ -36,32 +38,31 @@ class SubscriptionItem:
3638
provided here - can be identically to the productId
3739
plenigo_step_id (Union[Unset, str]): if the product is based on a plenigo offer the plenigo step id is provided
3840
here
39-
access_right_unique_id (Union[Unset, str]): unique id of the access right this subscription item grants access
40-
to
4141
internal_title (Union[Unset, str]): if the product is based on a plenigo offer the product title for internal
4242
usage is provided here
43-
tax_type (Union[Unset, TaxType]): unique identification of the tax type the product represents
4443
package_title (Union[Unset, str]): if subscription item is correlated to another subscription item in a way that
4544
both items are presented as one (bundle) this field contains the correlation title
4645
package_id (Union[Unset, str]): if subscription item is correlated to another subscription item in a way that
4746
both items are presented as one (bundle) this field contains the correlation id - the id is only unique within a
4847
subscription
4948
package_cancellation_locked (Union[Unset, bool]): flag indicating if package elements can only be cancelled
5049
together
50+
price (Union[Unset, float]): price of the subscription
5151
price_issue_id (Union[Unset, int]): id of the price issue the subscription item's price is based on
5252
discount_percentage (Union[Unset, int]): discount offered to the subscription
5353
credit_count (Union[Unset, int]): available credit count to use
5454
credit_wallet_unique_id (Union[Unset, str]): the credit wallet unique id
55-
status (Union[Unset, SubscriptionItemStatus]): current status of the subscription item
5655
cost_center (Union[Unset, str]): cost center associated with this subscription item
5756
purchase_number (Union[Unset, str]): purchase number associated with this subscription item
5857
"""
5958

6059
subscription_item_id: int
6160
product_id: str
61+
access_right_unique_id: str
6262
title: str
63-
price: float
63+
tax_type: TaxType
6464
quantity: int
65+
status: SubscriptionItemStatus
6566
created_date: Union[None, Unset, datetime.datetime] = UNSET
6667
changed_date: Union[None, Unset, datetime.datetime] = UNSET
6768
created_by: Union[Unset, str] = UNSET
@@ -70,17 +71,15 @@ class SubscriptionItem:
7071
changed_by_type: Union[Unset, UserType] = UNSET
7172
plenigo_product_id: Union[Unset, str] = UNSET
7273
plenigo_step_id: Union[Unset, str] = UNSET
73-
access_right_unique_id: Union[Unset, str] = UNSET
7474
internal_title: Union[Unset, str] = UNSET
75-
tax_type: Union[Unset, TaxType] = UNSET
7675
package_title: Union[Unset, str] = UNSET
7776
package_id: Union[Unset, str] = UNSET
7877
package_cancellation_locked: Union[Unset, bool] = UNSET
78+
price: Union[Unset, float] = UNSET
7979
price_issue_id: Union[Unset, int] = UNSET
8080
discount_percentage: Union[Unset, int] = UNSET
8181
credit_count: Union[Unset, int] = UNSET
8282
credit_wallet_unique_id: Union[Unset, str] = UNSET
83-
status: Union[Unset, SubscriptionItemStatus] = UNSET
8483
cost_center: Union[Unset, str] = UNSET
8584
purchase_number: Union[Unset, str] = UNSET
8685
additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
@@ -90,12 +89,16 @@ def to_dict(self) -> Dict[str, Any]:
9089

9190
product_id = self.product_id
9291

92+
access_right_unique_id = self.access_right_unique_id
93+
9394
title = self.title
9495

95-
price = self.price
96+
tax_type = self.tax_type.value
9697

9798
quantity = self.quantity
9899

100+
status = self.status.value
101+
99102
created_date: Union[None, Unset, str]
100103
if isinstance(self.created_date, Unset) or self.created_date is None:
101104
created_date = UNSET
@@ -128,20 +131,16 @@ def to_dict(self) -> Dict[str, Any]:
128131

129132
plenigo_step_id = self.plenigo_step_id
130133

131-
access_right_unique_id = self.access_right_unique_id
132-
133134
internal_title = self.internal_title
134135

135-
tax_type: Union[Unset, str] = UNSET
136-
if not isinstance(self.tax_type, Unset):
137-
tax_type = self.tax_type.value
138-
139136
package_title = self.package_title
140137

141138
package_id = self.package_id
142139

143140
package_cancellation_locked = self.package_cancellation_locked
144141

142+
price = self.price
143+
145144
price_issue_id = self.price_issue_id
146145

147146
discount_percentage = self.discount_percentage
@@ -150,10 +149,6 @@ def to_dict(self) -> Dict[str, Any]:
150149

151150
credit_wallet_unique_id = self.credit_wallet_unique_id
152151

153-
status: Union[Unset, str] = UNSET
154-
if not isinstance(self.status, Unset):
155-
status = self.status.value
156-
157152
cost_center = self.cost_center
158153

159154
purchase_number = self.purchase_number
@@ -164,9 +159,11 @@ def to_dict(self) -> Dict[str, Any]:
164159
{
165160
"subscriptionItemId": subscription_item_id,
166161
"productId": product_id,
162+
"accessRightUniqueId": access_right_unique_id,
167163
"title": title,
168-
"price": price,
164+
"taxType": tax_type,
169165
"quantity": quantity,
166+
"status": status,
170167
}
171168
)
172169
if created_date is not UNSET:
@@ -185,18 +182,16 @@ def to_dict(self) -> Dict[str, Any]:
185182
field_dict["plenigoProductId"] = plenigo_product_id
186183
if plenigo_step_id is not UNSET:
187184
field_dict["plenigoStepId"] = plenigo_step_id
188-
if access_right_unique_id is not UNSET:
189-
field_dict["accessRightUniqueId"] = access_right_unique_id
190185
if internal_title is not UNSET:
191186
field_dict["internalTitle"] = internal_title
192-
if tax_type is not UNSET:
193-
field_dict["taxType"] = tax_type
194187
if package_title is not UNSET:
195188
field_dict["packageTitle"] = package_title
196189
if package_id is not UNSET:
197190
field_dict["packageId"] = package_id
198191
if package_cancellation_locked is not UNSET:
199192
field_dict["packageCancellationLocked"] = package_cancellation_locked
193+
if price is not UNSET:
194+
field_dict["price"] = price
200195
if price_issue_id is not UNSET:
201196
field_dict["priceIssueId"] = price_issue_id
202197
if discount_percentage is not UNSET:
@@ -205,8 +200,6 @@ def to_dict(self) -> Dict[str, Any]:
205200
field_dict["creditCount"] = credit_count
206201
if credit_wallet_unique_id is not UNSET:
207202
field_dict["creditWalletUniqueId"] = credit_wallet_unique_id
208-
if status is not UNSET:
209-
field_dict["status"] = status
210203
if cost_center is not UNSET:
211204
field_dict["costCenter"] = cost_center
212205
if purchase_number is not UNSET:
@@ -221,12 +214,16 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
221214

222215
product_id = d.pop("productId")
223216

217+
access_right_unique_id = d.pop("accessRightUniqueId")
218+
224219
title = d.pop("title")
225220

226-
price = d.pop("price")
221+
tax_type = TaxType(d.pop("taxType"))
227222

228223
quantity = d.pop("quantity")
229224

225+
status = SubscriptionItemStatus(d.pop("status"))
226+
230227
def _parse_created_date(data: object) -> Union[None, Unset, datetime.datetime]:
231228
if data is None:
232229
return data
@@ -297,23 +294,16 @@ def _parse_changed_date(data: object) -> Union[None, Unset, datetime.datetime]:
297294

298295
plenigo_step_id = d.pop("plenigoStepId", UNSET)
299296

300-
access_right_unique_id = d.pop("accessRightUniqueId", UNSET)
301-
302297
internal_title = d.pop("internalTitle", UNSET)
303298

304-
_tax_type = d.pop("taxType", UNSET)
305-
tax_type: Union[Unset, TaxType]
306-
if isinstance(_tax_type, Unset) or not _tax_type:
307-
tax_type = UNSET
308-
else:
309-
tax_type = TaxType(_tax_type)
310-
311299
package_title = d.pop("packageTitle", UNSET)
312300

313301
package_id = d.pop("packageId", UNSET)
314302

315303
package_cancellation_locked = d.pop("packageCancellationLocked", UNSET)
316304

305+
price = d.pop("price", UNSET)
306+
317307
price_issue_id = d.pop("priceIssueId", UNSET)
318308

319309
discount_percentage = d.pop("discountPercentage", UNSET)
@@ -322,23 +312,18 @@ def _parse_changed_date(data: object) -> Union[None, Unset, datetime.datetime]:
322312

323313
credit_wallet_unique_id = d.pop("creditWalletUniqueId", UNSET)
324314

325-
_status = d.pop("status", UNSET)
326-
status: Union[Unset, SubscriptionItemStatus]
327-
if isinstance(_status, Unset) or not _status:
328-
status = UNSET
329-
else:
330-
status = SubscriptionItemStatus(_status)
331-
332315
cost_center = d.pop("costCenter", UNSET)
333316

334317
purchase_number = d.pop("purchaseNumber", UNSET)
335318

336319
subscription_item = cls(
337320
subscription_item_id=subscription_item_id,
338321
product_id=product_id,
322+
access_right_unique_id=access_right_unique_id,
339323
title=title,
340-
price=price,
324+
tax_type=tax_type,
341325
quantity=quantity,
326+
status=status,
342327
created_date=created_date,
343328
changed_date=changed_date,
344329
created_by=created_by,
@@ -347,17 +332,15 @@ def _parse_changed_date(data: object) -> Union[None, Unset, datetime.datetime]:
347332
changed_by_type=changed_by_type,
348333
plenigo_product_id=plenigo_product_id,
349334
plenigo_step_id=plenigo_step_id,
350-
access_right_unique_id=access_right_unique_id,
351335
internal_title=internal_title,
352-
tax_type=tax_type,
353336
package_title=package_title,
354337
package_id=package_id,
355338
package_cancellation_locked=package_cancellation_locked,
339+
price=price,
356340
price_issue_id=price_issue_id,
357341
discount_percentage=discount_percentage,
358342
credit_count=credit_count,
359343
credit_wallet_unique_id=credit_wallet_unique_id,
360-
status=status,
361344
cost_center=cost_center,
362345
purchase_number=purchase_number,
363346
)

0 commit comments

Comments
 (0)