66import datetime
77from typing import List , Optional , Union
88
9+ import connect .models
910from .base import BaseModel
10- from connect .models .schemas import ProductConfigurationSchema , DownloadLinkSchema , DocumentSchema ,\
11- CustomerUiSettingsSchema , ProductSchema , RenewalSchema , ItemSchema
11+ from connect .models .schemas import ProductConfigurationSchema , DownloadLinkSchema , DocumentSchema , \
12+ CustomerUiSettingsSchema , ProductSchema , RenewalSchema , ItemSchema , ProductFamilySchema , \
13+ ProductCategorySchema , ProductStatsInfoSchema , ProductStatsSchema
1214
1315
1416class ProductConfiguration (BaseModel ):
@@ -34,6 +36,9 @@ class DownloadLink(BaseModel):
3436 url = None # type: str
3537 """ (str) Link URL. """
3638
39+ visible_for = None # title: str
40+ """ (str) Link visibility. One of: admin, user. """
41+
3742
3843class Document (BaseModel ):
3944 """ Document for a product. """
@@ -46,9 +51,6 @@ class Document(BaseModel):
4651 url = None # title: str
4752 """ (str) Document URL. """
4853
49- visible_for = None # title: str
50- """ (str) Document visibility. One of: admin, user. """
51-
5254
5355class CustomerUiSettings (BaseModel ):
5456 """ Customer Ui Settings for a product. """
@@ -68,6 +70,58 @@ class CustomerUiSettings(BaseModel):
6870 """ (List[:py:class:`.Document`]) Documents. """
6971
7072
73+ class ProductFamily (BaseModel ):
74+ """ Represents a family of products """
75+
76+ _schema = ProductFamilySchema ()
77+
78+ name = None # type: str
79+ """ (str) Family name. """
80+
81+
82+ class ProductCategory (BaseModel ):
83+ """ Represents a product category. """
84+
85+ _schema = ProductCategorySchema ()
86+
87+ name = None # type: str
88+ """ (str) Category name. """
89+
90+ parent = None # type: Optional[ProductCategory]
91+ """ (:py:class:`.ProductCategory` | None) Reference to parent category. """
92+
93+ children = None # type: Optional[List[ProductCategory]]
94+ """ (List[:py:class:`.ProductCategory`] | None) List of children categories. """
95+
96+ family = None # type: Optional[ProductFamily]
97+ """ (:py:class:`.ProductFamily` | None) Product family. """
98+
99+
100+ class ProductStatsInfo (BaseModel ):
101+ _schema = ProductStatsInfoSchema ()
102+
103+ distribution = None # type: int
104+ """ (int) Number of distributions related to the product. """
105+
106+ sourcing = None # type: int
107+ """ (int) Number of sourcings related to the product. """
108+
109+
110+ class ProductStats (BaseModel ):
111+ """ Statistics of product use. """
112+
113+ _schema = ProductStatsSchema ()
114+
115+ listing = None # type: int
116+ """ (int) Number of listings (direct use of product by provider). """
117+
118+ agreements = None # type: ProductStatsInfo
119+ """ (:py:class:`.ProductStatsInfo`) Agreements related to the product. """
120+
121+ contracts = None # type: ProductStatsInfo
122+ """ (:py:class:`.ProductStatsInfo`) Contracts related to the product """
123+
124+
71125class Product (BaseModel ):
72126 """ Represents basic marketing information about salable items, parameters, configurations,
73127 latest published version and connections.
@@ -94,12 +148,29 @@ class Product(BaseModel):
94148 version = None # type: int
95149 """ (int) Version of product. """
96150
151+ published_at = None # type: Optional[datetime.datetime]
152+ """ (datetime.datetime) Date of publishing. """
153+
97154 configurations = None # type: ProductConfiguration
98155 """ (:py:class:`.ProductConfiguration`) Product configuration. """
99156
100157 customer_ui_settings = None # type: CustomerUiSettings
101158 """ (:py:class:`.CustomerUiSettings`) Customer Ui Settings. """
102159
160+ category = None # type: Optional[ProductCategory]
161+ """ (:py:class:`.ProductCategory` | None) Reference to ProductCategory Object. """
162+
163+ owner = None # type: Optional[connect.models.Company]
164+ """ (:py:class:`.Company` | None) """
165+
166+ latest = None # type: Optional[bool]
167+ """ (bool|None) true if version is latest or for master versions without versions,
168+ false otherwise.
169+ """
170+
171+ stats = None # type: Optional[ProductStats]
172+ """ (:py:class:``.ProductStats) Statistics of product use, depends on account of callee. """
173+
103174
104175class Renewal (BaseModel ):
105176 """ Item renewal data. """
@@ -138,10 +209,27 @@ class Item(BaseModel):
138209 (empty for all other types).
139210 """
140211
212+ params = None # type: List[connect.models.Param]
213+ """ (List[:py:class:`.Param` | None] List of Item and Item x Marketplace Configuration Phase
214+ Parameter Context-Bound Object
215+ """
216+
217+ # Undocumented fields (they appear in PHP SDK)
218+
219+ display_name = None # type: str
220+ """ (str) Display name. """
221+
141222 global_id = None # type: str
142223 """ (str) Global id. """
143224
144- # Undocumented fields (they appear in PHP SDK)
225+ item_type = None # type: str
226+ """ (str) Item type. """
145227
146228 period = None # type: str
147229 """ (str) Period. """
230+
231+ type = None # type: str
232+ """ (str) Type. """
233+
234+ name = None # type: str
235+ """ (str) Name. """
0 commit comments