kodexa 7.4.412519097586__py3-none-any.whl → 7.4.412519531447__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.
@@ -1,13 +1,16 @@
1
- from typing import Optional, List
1
+ from decimal import Decimal
2
+ from typing import Optional, List, Set
2
3
 
3
4
  from pydantic import BaseModel, ConfigDict, Field
5
+
4
6
  from kodexa.model.base import StandardDateTime
5
7
  from kodexa.platform.client import EntityEndpoint, PageEndpoint, EntitiesEndpoint
6
8
  from .product_group import ProductGroup
7
9
 
8
- class Product(BaseModel):
9
- """
10
10
 
11
+ class ProjectTemplateMetadata(BaseModel):
12
+ """
13
+ A project template metadata entity
11
14
  """
12
15
  model_config = ConfigDict(
13
16
  populate_by_name=True,
@@ -15,10 +18,40 @@ class Product(BaseModel):
15
18
  arbitrary_types_allowed=True,
16
19
  protected_namespaces=("model_config",),
17
20
  )
21
+
22
+ id: str
23
+
24
+
25
+ class ProductProjectTemplate(BaseModel):
18
26
  """
19
- A product
27
+ A product project template entity representing the relationship between products and project templates
20
28
  """
29
+ model_config = ConfigDict(
30
+ populate_by_name=True,
31
+ use_enum_values=True,
32
+ arbitrary_types_allowed=True,
33
+ protected_namespaces=("model_config",),
34
+ )
21
35
 
36
+ id: Optional[str] = None
37
+ uuid: Optional[str] = None
38
+ change_sequence: Optional[int] = Field(None, alias="changeSequence")
39
+ created_on: Optional[StandardDateTime] = Field(None, alias="createdOn")
40
+ updated_on: Optional[StandardDateTime] = Field(None, alias="updatedOn")
41
+ display_order: Optional[int] = Field(None, alias="displayOrder")
42
+ project_template_metadata: Optional[ProjectTemplateMetadata] = Field(None, alias="projectTemplateMetadata")
43
+
44
+
45
+ class Product(BaseModel):
46
+ """
47
+ A product entity representing a product in the Kodexa platform
48
+ """
49
+ model_config = ConfigDict(
50
+ populate_by_name=True,
51
+ use_enum_values=True,
52
+ arbitrary_types_allowed=True,
53
+ protected_namespaces=("model_config",),
54
+ )
22
55
 
23
56
  id: Optional[str] = None
24
57
  uuid: Optional[str] = None
@@ -29,6 +62,25 @@ class Product(BaseModel):
29
62
  description: Optional[str] = None
30
63
  overview_markdown: Optional[str] = Field(None, alias="overviewMarkdown")
31
64
  product_group: ProductGroup = Field(..., alias="productGroup")
65
+ parent: Optional['Product'] = None
66
+ image_url: Optional[str] = Field(None, alias="imageUrl")
67
+ price_id: Optional[str] = Field(None, alias="priceId")
68
+ price: Optional[Decimal] = None
69
+ number_of_credits: Optional[int] = Field(None, alias="numberOfCredits")
70
+ price_suffix: Optional[str] = Field(None, alias="priceSuffix")
71
+ has_quantity: bool = Field(False, alias="hasQuantity")
72
+ active: bool = True
73
+ order: Optional[int] = None
74
+ promoted: Optional[bool] = None
75
+ product_project_templates: Optional[Set[ProductProjectTemplate]] = Field(None, alias="productProjectTemplates")
76
+ search_text: Optional[str] = None
77
+
78
+ def update_search_text(self):
79
+ """Updates the search text for the product"""
80
+ if self.product_group:
81
+ self.search_text = f"{self.name.lower()} {self.product_group.name.lower()}"
82
+ else:
83
+ self.search_text = self.name.lower()
32
84
 
33
85
 
34
86
  class ProductEndpoint(Product, EntityEndpoint):
@@ -54,7 +106,7 @@ class ProductEndpoint(Product, EntityEndpoint):
54
106
 
55
107
  class PageProduct(BaseModel):
56
108
  """
57
-
109
+ Represents a paginated list of products
58
110
  """
59
111
  model_config = ConfigDict(
60
112
  populate_by_name=True,
@@ -67,7 +119,6 @@ class PageProduct(BaseModel):
67
119
  size: Optional[int] = None
68
120
  content: Optional[List[Product]] = None
69
121
  number: Optional[int] = None
70
-
71
122
  number_of_elements: Optional[int] = Field(None, alias="numberOfElements")
72
123
  first: Optional[bool] = None
73
124
  last: Optional[bool] = None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: kodexa
3
- Version: 7.4.412519097586
3
+ Version: 7.4.412519531447
4
4
  Summary: Python SDK for the Kodexa Platform
5
5
  Author: Austin Redenbaugh
6
6
  Author-email: austin@kodexa.com
@@ -9,7 +9,7 @@ kodexa/model/__init__.py,sha256=rtLXYJBxB-rnukhslN9rlqoB3--1H3253HyHGbD_Gc8,796
9
9
  kodexa/model/base.py,sha256=CaZK8nMhT1LdCpt4aLhebJGcorjq9qRID1FjnXnP14M,521
10
10
  kodexa/model/entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
11
  kodexa/model/entities/check_response.py,sha256=eqBHxO6G2OAziL3p9bHGI-oiPkAG82H6Choc8wyvtM4,3949
12
- kodexa/model/entities/product.py,sha256=TaxpsW6tK_35POerBBiaYZRx2a6Aath_vvImXRXNN60,3632
12
+ kodexa/model/entities/product.py,sha256=LVOICrF8qCqeURt1y4nnghE-T5ZtEnHMAMILjL1AMfw,5771
13
13
  kodexa/model/entities/product_group.py,sha256=540fRGyUf34h1BzAN1DiWu6rGgvaj3xDFhZ2k-RvSFY,3617
14
14
  kodexa/model/entities/product_subscription.py,sha256=UcmWR-qgLfdV7VCtJNwzgkanoS8nBSL6ngVuxQUK1M8,3810
15
15
  kodexa/model/model.py,sha256=qh1YUew3UgtjU0t4fAwSXYYuzQjXTOZWZkafyFp_w8M,118801
@@ -44,7 +44,7 @@ kodexa/testing/test_utils.py,sha256=v44p__gE7ia67W7WeHN2HBFCWSCUrCZt7G4xBNCmwf8,
44
44
  kodexa/training/__init__.py,sha256=xs2L62YpRkIRfslQwtQZ5Yxjhm7sLzX2TrVX6EuBnZQ,52
45
45
  kodexa/training/train_utils.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
46
46
  kodexa/utils/__init__.py,sha256=Pnim1o9_db5YEnNvDTxpM7HG-qTlL6n8JwFwOafU9wo,5928
47
- kodexa-7.4.412519097586.dist-info/LICENSE,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
48
- kodexa-7.4.412519097586.dist-info/METADATA,sha256=4a8DDqZBIDVFj_ybiZQ2j96MqBFRa4wzsipJHnxV644,3528
49
- kodexa-7.4.412519097586.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
50
- kodexa-7.4.412519097586.dist-info/RECORD,,
47
+ kodexa-7.4.412519531447.dist-info/LICENSE,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
48
+ kodexa-7.4.412519531447.dist-info/METADATA,sha256=lT3vLHjjNyHYQP3USBb6uUgW4VdBVE-wsChzaNYPhNM,3528
49
+ kodexa-7.4.412519531447.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
50
+ kodexa-7.4.412519531447.dist-info/RECORD,,