-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
40 changed files
with
1,272 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.. _application: | ||
|
||
Application | ||
=========== | ||
|
||
.. module:: pyatlan.model.assets | ||
:no-index: | ||
|
||
.. autoclass:: Application | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.. _applicationcontainer: | ||
|
||
ApplicationContainer | ||
==================== | ||
|
||
.. module:: pyatlan.model.assets | ||
:no-index: | ||
|
||
.. autoclass:: ApplicationContainer | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
pyatlan/generator/templates/methods/asset/application_container.jinja2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
|
||
@classmethod | ||
@init_guid | ||
def creator( | ||
cls, | ||
*, | ||
name: str, | ||
connection_qualified_name: str, | ||
) -> ApplicationContainer: | ||
validate_required_fields( | ||
["name", "connection_qualified_name"], [name, connection_qualified_name] | ||
) | ||
attributes = ApplicationContainer.Attributes.creator( | ||
name=name, | ||
connection_qualified_name=connection_qualified_name, | ||
) | ||
return cls(attributes=attributes) |
20 changes: 20 additions & 0 deletions
20
pyatlan/generator/templates/methods/attribute/application_container.jinja2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
|
||
@classmethod | ||
@init_guid | ||
def creator( | ||
cls, | ||
*, | ||
name: str, | ||
connection_qualified_name: str, | ||
) -> ApplicationContainer.Attributes: | ||
validate_required_fields( | ||
["name", "connection_qualified_name"], [name, connection_qualified_name] | ||
) | ||
return ApplicationContainer.Attributes( | ||
name=name, | ||
qualified_name=f"{connection_qualified_name}/{name}", | ||
connection_qualified_name=connection_qualified_name, | ||
connector_name=AtlanConnectorType.get_connector_name( | ||
connection_qualified_name | ||
), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# Copyright 2022 Atlan Pte. Ltd. | ||
|
||
|
||
from __future__ import annotations | ||
|
||
from typing import ClassVar, List, Optional | ||
|
||
from pydantic.v1 import Field, validator | ||
|
||
from pyatlan.model.fields.atlan_fields import KeywordField | ||
|
||
from .catalog import Catalog | ||
|
||
|
||
class Application(Catalog): | ||
"""Description""" | ||
|
||
type_name: str = Field(default="Application", allow_mutation=False) | ||
|
||
@validator("type_name") | ||
def validate_type_name(cls, v): | ||
if v != "Application": | ||
raise ValueError("must be Application") | ||
return v | ||
|
||
def __setattr__(self, name, value): | ||
if name in Application._convenience_properties: | ||
return object.__setattr__(self, name, value) | ||
super().__setattr__(name, value) | ||
|
||
APPLICATION_ID: ClassVar[KeywordField] = KeywordField( | ||
"applicationId", "applicationId" | ||
) | ||
""" | ||
Unique identifier for the Application asset from the source system. | ||
""" | ||
|
||
_convenience_properties: ClassVar[List[str]] = [ | ||
"application_id", | ||
] | ||
|
||
@property | ||
def application_id(self) -> Optional[str]: | ||
return None if self.attributes is None else self.attributes.application_id | ||
|
||
@application_id.setter | ||
def application_id(self, application_id: Optional[str]): | ||
if self.attributes is None: | ||
self.attributes = self.Attributes() | ||
self.attributes.application_id = application_id | ||
|
||
class Attributes(Catalog.Attributes): | ||
application_id: Optional[str] = Field(default=None, description="") | ||
|
||
attributes: Application.Attributes = Field( | ||
default_factory=lambda: Application.Attributes(), | ||
description=( | ||
"Map of attributes in the instance and their values. " | ||
"The specific keys of this map will vary by type, " | ||
"so are described in the sub-types of this schema." | ||
), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# Copyright 2022 Atlan Pte. Ltd. | ||
|
||
|
||
from __future__ import annotations | ||
|
||
from typing import ClassVar, List, Optional | ||
|
||
from pydantic.v1 import Field, validator | ||
|
||
from pyatlan.model.enums import AtlanConnectorType | ||
from pyatlan.model.fields.atlan_fields import RelationField | ||
from pyatlan.utils import init_guid, validate_required_fields | ||
|
||
from .application import Application | ||
|
||
|
||
class ApplicationContainer(Application): | ||
"""Description""" | ||
|
||
@classmethod | ||
@init_guid | ||
def creator( | ||
cls, | ||
*, | ||
name: str, | ||
connection_qualified_name: str, | ||
) -> ApplicationContainer: | ||
validate_required_fields( | ||
["name", "connection_qualified_name"], [name, connection_qualified_name] | ||
) | ||
attributes = ApplicationContainer.Attributes.creator( | ||
name=name, | ||
connection_qualified_name=connection_qualified_name, | ||
) | ||
return cls(attributes=attributes) | ||
|
||
type_name: str = Field(default="ApplicationContainer", allow_mutation=False) | ||
|
||
@validator("type_name") | ||
def validate_type_name(cls, v): | ||
if v != "ApplicationContainer": | ||
raise ValueError("must be ApplicationContainer") | ||
return v | ||
|
||
def __setattr__(self, name, value): | ||
if name in ApplicationContainer._convenience_properties: | ||
return object.__setattr__(self, name, value) | ||
super().__setattr__(name, value) | ||
|
||
APPLICATION_OWNED_ASSETS: ClassVar[RelationField] = RelationField( | ||
"applicationOwnedAssets" | ||
) | ||
""" | ||
TBC | ||
""" | ||
|
||
_convenience_properties: ClassVar[List[str]] = [ | ||
"application_owned_assets", | ||
] | ||
|
||
@property | ||
def application_owned_assets(self) -> Optional[List[Catalog]]: | ||
return ( | ||
None | ||
if self.attributes is None | ||
else self.attributes.application_owned_assets | ||
) | ||
|
||
@application_owned_assets.setter | ||
def application_owned_assets( | ||
self, application_owned_assets: Optional[List[Catalog]] | ||
): | ||
if self.attributes is None: | ||
self.attributes = self.Attributes() | ||
self.attributes.application_owned_assets = application_owned_assets | ||
|
||
class Attributes(Application.Attributes): | ||
application_owned_assets: Optional[List[Catalog]] = Field( | ||
default=None, description="" | ||
) # relationship | ||
|
||
@classmethod | ||
@init_guid | ||
def creator( | ||
cls, | ||
*, | ||
name: str, | ||
connection_qualified_name: str, | ||
) -> ApplicationContainer.Attributes: | ||
validate_required_fields( | ||
["name", "connection_qualified_name"], [name, connection_qualified_name] | ||
) | ||
return ApplicationContainer.Attributes( | ||
name=name, | ||
qualified_name=f"{connection_qualified_name}/{name}", | ||
connection_qualified_name=connection_qualified_name, | ||
connector_name=AtlanConnectorType.get_connector_name( | ||
connection_qualified_name | ||
), | ||
) | ||
|
||
attributes: ApplicationContainer.Attributes = Field( | ||
default_factory=lambda: ApplicationContainer.Attributes(), | ||
description=( | ||
"Map of attributes in the instance and their values. " | ||
"The specific keys of this map will vary by type, " | ||
"so are described in the sub-types of this schema." | ||
), | ||
) | ||
|
||
|
||
from .catalog import Catalog # noqa |
Oops, something went wrong.