| 1 |
|
| 2 |
|
| 3 |
import datetime as dt |
| 4 |
import typing |
| 5 |
|
| 6 |
import pydantic |
| 7 |
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel |
| 8 |
from .integration_feature_type_enum import IntegrationFeatureTypeEnum |
| 9 |
from .integration_release import IntegrationRelease |
| 10 |
|
| 11 |
|
| 12 |
class Integration(UniversalBaseModel): |
| 13 |
""" |
| 14 |
Integration defines a self contained functioning unit which partners |
| 15 |
publish. A partner may create one or many of these integrations. |
| 16 |
""" |
| 17 |
|
| 18 |
id: typing.Optional[str] = pydantic.Field(default=None) |
| 19 |
""" |
| 20 |
id is a system generated GUID. This same ID is designed to be federated in |
| 21 |
all the applicable localities. |
| 22 |
""" |
| 23 |
|
| 24 |
catalog_id: typing.Optional[str] = pydantic.Field(default=None) |
| 25 |
""" |
| 26 |
catalog_id refers to the ID in the marketplace catalog |
| 27 |
""" |
| 28 |
|
| 29 |
url_slug: typing.Optional[str] = pydantic.Field(default=None) |
| 30 |
""" |
| 31 |
url_slug refers to the url_slug in the marketplace catalog |
| 32 |
""" |
| 33 |
|
| 34 |
partner_id: typing.Optional[str] = pydantic.Field(default=None) |
| 35 |
""" |
| 36 |
partner_id is the foreign key reference to the partner account this |
| 37 |
integration belongs to. |
| 38 |
""" |
| 39 |
|
| 40 |
name: typing.Optional[str] = pydantic.Field(default=None) |
| 41 |
""" |
| 42 |
name is the integration name, which will be used for display purposes in |
| 43 |
the marketplace. |
| 44 |
|
| 45 |
To start we're going to make sure the display name is at least 3 |
| 46 |
characters. Can adjust this easily later. |
| 47 |
""" |
| 48 |
|
| 49 |
description: typing.Optional[str] = pydantic.Field(default=None) |
| 50 |
""" |
| 51 |
description adds more text for the integration name -- also relevant for |
| 52 |
the marketplace listing. |
| 53 |
""" |
| 54 |
|
| 55 |
short_description: typing.Optional[str] = pydantic.Field(default=None) |
| 56 |
""" |
| 57 |
short_description is the brief description of the integration, which is used for display purposes in cards |
| 58 |
""" |
| 59 |
|
| 60 |
logo: typing.Optional[str] = None |
| 61 |
feature_type: typing.Optional[IntegrationFeatureTypeEnum] = None |
| 62 |
terms_of_use_url: typing.Optional[str] = None |
| 63 |
privacy_policy_url: typing.Optional[str] = None |
| 64 |
public_support_link: typing.Optional[str] = None |
| 65 |
current_release: typing.Optional[IntegrationRelease] = None |
| 66 |
created_at: typing.Optional[dt.datetime] = None |
| 67 |
updated_at: typing.Optional[dt.datetime] = None |
| 68 |
|
| 69 |
if IS_PYDANTIC_V2: |
| 70 |
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) |
| 71 |
else: |
| 72 |
|
| 73 |
class Config: |
| 74 |
frozen = True |
| 75 |
smart_union = True |
| 76 |
extra = pydantic.Extra.allow |