unitycatalog-client 0.2.1__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.
- unitycatalog/client/__init__.py +102 -0
- unitycatalog/client/api/__init__.py +13 -0
- unitycatalog/client/api/catalogs_api.py +1404 -0
- unitycatalog/client/api/functions_api.py +1135 -0
- unitycatalog/client/api/grants_api.py +630 -0
- unitycatalog/client/api/model_versions_api.py +1748 -0
- unitycatalog/client/api/registered_models_api.py +1438 -0
- unitycatalog/client/api/schemas_api.py +1421 -0
- unitycatalog/client/api/tables_api.py +1135 -0
- unitycatalog/client/api/temporary_credentials_api.py +1109 -0
- unitycatalog/client/api/volumes_api.py +1421 -0
- unitycatalog/client/api_client.py +773 -0
- unitycatalog/client/api_response.py +21 -0
- unitycatalog/client/configuration.py +432 -0
- unitycatalog/client/exceptions.py +199 -0
- unitycatalog/client/models/__init__.py +77 -0
- unitycatalog/client/models/aws_credentials.py +91 -0
- unitycatalog/client/models/azure_user_delegation_sas.py +87 -0
- unitycatalog/client/models/catalog_info.py +103 -0
- unitycatalog/client/models/column_info.py +108 -0
- unitycatalog/client/models/column_type_name.py +56 -0
- unitycatalog/client/models/create_catalog.py +91 -0
- unitycatalog/client/models/create_function.py +163 -0
- unitycatalog/client/models/create_function_request.py +91 -0
- unitycatalog/client/models/create_model_version.py +97 -0
- unitycatalog/client/models/create_registered_model.py +93 -0
- unitycatalog/client/models/create_schema.py +93 -0
- unitycatalog/client/models/create_table.py +113 -0
- unitycatalog/client/models/create_volume_request_content.py +99 -0
- unitycatalog/client/models/data_source_format.py +42 -0
- unitycatalog/client/models/dependency.py +97 -0
- unitycatalog/client/models/dependency_list.py +95 -0
- unitycatalog/client/models/finalize_model_version.py +89 -0
- unitycatalog/client/models/function_dependency.py +87 -0
- unitycatalog/client/models/function_info.py +189 -0
- unitycatalog/client/models/function_parameter_info.py +112 -0
- unitycatalog/client/models/function_parameter_infos.py +95 -0
- unitycatalog/client/models/function_parameter_mode.py +36 -0
- unitycatalog/client/models/function_parameter_type.py +37 -0
- unitycatalog/client/models/gcp_oauth_token.py +87 -0
- unitycatalog/client/models/generate_temporary_model_version_credential.py +96 -0
- unitycatalog/client/models/generate_temporary_path_credential.py +90 -0
- unitycatalog/client/models/generate_temporary_table_credential.py +90 -0
- unitycatalog/client/models/generate_temporary_volume_credential.py +90 -0
- unitycatalog/client/models/list_catalogs_response.py +97 -0
- unitycatalog/client/models/list_functions_response.py +97 -0
- unitycatalog/client/models/list_model_versions_response.py +97 -0
- unitycatalog/client/models/list_registered_models_response.py +97 -0
- unitycatalog/client/models/list_schemas_response.py +97 -0
- unitycatalog/client/models/list_tables_response.py +97 -0
- unitycatalog/client/models/list_volumes_response_content.py +97 -0
- unitycatalog/client/models/model_version_info.py +114 -0
- unitycatalog/client/models/model_version_operation.py +38 -0
- unitycatalog/client/models/model_version_status.py +39 -0
- unitycatalog/client/models/path_operation.py +39 -0
- unitycatalog/client/models/permissions_change.py +92 -0
- unitycatalog/client/models/permissions_list.py +95 -0
- unitycatalog/client/models/principal_type.py +37 -0
- unitycatalog/client/models/privilege.py +47 -0
- unitycatalog/client/models/privilege_assignment.py +90 -0
- unitycatalog/client/models/registered_model_info.py +109 -0
- unitycatalog/client/models/schema_info.py +107 -0
- unitycatalog/client/models/securable_type.py +42 -0
- unitycatalog/client/models/table_dependency.py +87 -0
- unitycatalog/client/models/table_info.py +125 -0
- unitycatalog/client/models/table_operation.py +38 -0
- unitycatalog/client/models/table_type.py +37 -0
- unitycatalog/client/models/temporary_credentials.py +105 -0
- unitycatalog/client/models/update_catalog.py +91 -0
- unitycatalog/client/models/update_model_version.py +87 -0
- unitycatalog/client/models/update_permissions.py +95 -0
- unitycatalog/client/models/update_registered_model.py +89 -0
- unitycatalog/client/models/update_schema.py +91 -0
- unitycatalog/client/models/update_volume_request_content.py +90 -0
- unitycatalog/client/models/volume_info.py +113 -0
- unitycatalog/client/models/volume_operation.py +38 -0
- unitycatalog/client/models/volume_type.py +37 -0
- unitycatalog/client/py.typed +0 -0
- unitycatalog/client/rest.py +215 -0
- unitycatalog_client-0.2.1.dist-info/METADATA +199 -0
- unitycatalog_client-0.2.1.dist-info/RECORD +82 -0
- unitycatalog_client-0.2.1.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
# flake8: noqa
|
|
4
|
+
"""
|
|
5
|
+
Unity Catalog API
|
|
6
|
+
|
|
7
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
8
|
+
|
|
9
|
+
The version of the OpenAPI document: 0.1
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
# import models into model package
|
|
17
|
+
from unitycatalog.client.models.aws_credentials import AwsCredentials
|
|
18
|
+
from unitycatalog.client.models.azure_user_delegation_sas import AzureUserDelegationSAS
|
|
19
|
+
from unitycatalog.client.models.catalog_info import CatalogInfo
|
|
20
|
+
from unitycatalog.client.models.column_info import ColumnInfo
|
|
21
|
+
from unitycatalog.client.models.column_type_name import ColumnTypeName
|
|
22
|
+
from unitycatalog.client.models.create_catalog import CreateCatalog
|
|
23
|
+
from unitycatalog.client.models.create_function import CreateFunction
|
|
24
|
+
from unitycatalog.client.models.create_function_request import CreateFunctionRequest
|
|
25
|
+
from unitycatalog.client.models.create_model_version import CreateModelVersion
|
|
26
|
+
from unitycatalog.client.models.create_registered_model import CreateRegisteredModel
|
|
27
|
+
from unitycatalog.client.models.create_schema import CreateSchema
|
|
28
|
+
from unitycatalog.client.models.create_table import CreateTable
|
|
29
|
+
from unitycatalog.client.models.create_volume_request_content import CreateVolumeRequestContent
|
|
30
|
+
from unitycatalog.client.models.data_source_format import DataSourceFormat
|
|
31
|
+
from unitycatalog.client.models.dependency import Dependency
|
|
32
|
+
from unitycatalog.client.models.dependency_list import DependencyList
|
|
33
|
+
from unitycatalog.client.models.finalize_model_version import FinalizeModelVersion
|
|
34
|
+
from unitycatalog.client.models.function_dependency import FunctionDependency
|
|
35
|
+
from unitycatalog.client.models.function_info import FunctionInfo
|
|
36
|
+
from unitycatalog.client.models.function_parameter_info import FunctionParameterInfo
|
|
37
|
+
from unitycatalog.client.models.function_parameter_infos import FunctionParameterInfos
|
|
38
|
+
from unitycatalog.client.models.function_parameter_mode import FunctionParameterMode
|
|
39
|
+
from unitycatalog.client.models.function_parameter_type import FunctionParameterType
|
|
40
|
+
from unitycatalog.client.models.gcp_oauth_token import GcpOauthToken
|
|
41
|
+
from unitycatalog.client.models.generate_temporary_model_version_credential import GenerateTemporaryModelVersionCredential
|
|
42
|
+
from unitycatalog.client.models.generate_temporary_path_credential import GenerateTemporaryPathCredential
|
|
43
|
+
from unitycatalog.client.models.generate_temporary_table_credential import GenerateTemporaryTableCredential
|
|
44
|
+
from unitycatalog.client.models.generate_temporary_volume_credential import GenerateTemporaryVolumeCredential
|
|
45
|
+
from unitycatalog.client.models.list_catalogs_response import ListCatalogsResponse
|
|
46
|
+
from unitycatalog.client.models.list_functions_response import ListFunctionsResponse
|
|
47
|
+
from unitycatalog.client.models.list_model_versions_response import ListModelVersionsResponse
|
|
48
|
+
from unitycatalog.client.models.list_registered_models_response import ListRegisteredModelsResponse
|
|
49
|
+
from unitycatalog.client.models.list_schemas_response import ListSchemasResponse
|
|
50
|
+
from unitycatalog.client.models.list_tables_response import ListTablesResponse
|
|
51
|
+
from unitycatalog.client.models.list_volumes_response_content import ListVolumesResponseContent
|
|
52
|
+
from unitycatalog.client.models.model_version_info import ModelVersionInfo
|
|
53
|
+
from unitycatalog.client.models.model_version_operation import ModelVersionOperation
|
|
54
|
+
from unitycatalog.client.models.model_version_status import ModelVersionStatus
|
|
55
|
+
from unitycatalog.client.models.path_operation import PathOperation
|
|
56
|
+
from unitycatalog.client.models.permissions_change import PermissionsChange
|
|
57
|
+
from unitycatalog.client.models.permissions_list import PermissionsList
|
|
58
|
+
from unitycatalog.client.models.principal_type import PrincipalType
|
|
59
|
+
from unitycatalog.client.models.privilege import Privilege
|
|
60
|
+
from unitycatalog.client.models.privilege_assignment import PrivilegeAssignment
|
|
61
|
+
from unitycatalog.client.models.registered_model_info import RegisteredModelInfo
|
|
62
|
+
from unitycatalog.client.models.schema_info import SchemaInfo
|
|
63
|
+
from unitycatalog.client.models.securable_type import SecurableType
|
|
64
|
+
from unitycatalog.client.models.table_dependency import TableDependency
|
|
65
|
+
from unitycatalog.client.models.table_info import TableInfo
|
|
66
|
+
from unitycatalog.client.models.table_operation import TableOperation
|
|
67
|
+
from unitycatalog.client.models.table_type import TableType
|
|
68
|
+
from unitycatalog.client.models.temporary_credentials import TemporaryCredentials
|
|
69
|
+
from unitycatalog.client.models.update_catalog import UpdateCatalog
|
|
70
|
+
from unitycatalog.client.models.update_model_version import UpdateModelVersion
|
|
71
|
+
from unitycatalog.client.models.update_permissions import UpdatePermissions
|
|
72
|
+
from unitycatalog.client.models.update_registered_model import UpdateRegisteredModel
|
|
73
|
+
from unitycatalog.client.models.update_schema import UpdateSchema
|
|
74
|
+
from unitycatalog.client.models.update_volume_request_content import UpdateVolumeRequestContent
|
|
75
|
+
from unitycatalog.client.models.volume_info import VolumeInfo
|
|
76
|
+
from unitycatalog.client.models.volume_operation import VolumeOperation
|
|
77
|
+
from unitycatalog.client.models.volume_type import VolumeType
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Unity Catalog API
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.1
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class AwsCredentials(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
AwsCredentials
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
access_key_id: Optional[StrictStr] = Field(default=None, description="The access key ID that identifies the temporary credentials.")
|
|
30
|
+
secret_access_key: Optional[StrictStr] = Field(default=None, description="The secret access key that can be used to sign AWS API requests.")
|
|
31
|
+
session_token: Optional[StrictStr] = Field(default=None, description="The token that users must pass to AWS API to use the temporary credentials.")
|
|
32
|
+
__properties: ClassVar[List[str]] = ["access_key_id", "secret_access_key", "session_token"]
|
|
33
|
+
|
|
34
|
+
model_config = ConfigDict(
|
|
35
|
+
populate_by_name=True,
|
|
36
|
+
validate_assignment=True,
|
|
37
|
+
protected_namespaces=(),
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def to_str(self) -> str:
|
|
42
|
+
"""Returns the string representation of the model using alias"""
|
|
43
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
44
|
+
|
|
45
|
+
def to_json(self) -> str:
|
|
46
|
+
"""Returns the JSON representation of the model using alias"""
|
|
47
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
48
|
+
return json.dumps(self.to_dict())
|
|
49
|
+
|
|
50
|
+
@classmethod
|
|
51
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
52
|
+
"""Create an instance of AwsCredentials from a JSON string"""
|
|
53
|
+
return cls.from_dict(json.loads(json_str))
|
|
54
|
+
|
|
55
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
56
|
+
"""Return the dictionary representation of the model using alias.
|
|
57
|
+
|
|
58
|
+
This has the following differences from calling pydantic's
|
|
59
|
+
`self.model_dump(by_alias=True)`:
|
|
60
|
+
|
|
61
|
+
* `None` is only added to the output dict for nullable fields that
|
|
62
|
+
were set at model initialization. Other fields with value `None`
|
|
63
|
+
are ignored.
|
|
64
|
+
"""
|
|
65
|
+
excluded_fields: Set[str] = set([
|
|
66
|
+
])
|
|
67
|
+
|
|
68
|
+
_dict = self.model_dump(
|
|
69
|
+
by_alias=True,
|
|
70
|
+
exclude=excluded_fields,
|
|
71
|
+
exclude_none=True,
|
|
72
|
+
)
|
|
73
|
+
return _dict
|
|
74
|
+
|
|
75
|
+
@classmethod
|
|
76
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
77
|
+
"""Create an instance of AwsCredentials from a dict"""
|
|
78
|
+
if obj is None:
|
|
79
|
+
return None
|
|
80
|
+
|
|
81
|
+
if not isinstance(obj, dict):
|
|
82
|
+
return cls.model_validate(obj)
|
|
83
|
+
|
|
84
|
+
_obj = cls.model_validate({
|
|
85
|
+
"access_key_id": obj.get("access_key_id"),
|
|
86
|
+
"secret_access_key": obj.get("secret_access_key"),
|
|
87
|
+
"session_token": obj.get("session_token")
|
|
88
|
+
})
|
|
89
|
+
return _obj
|
|
90
|
+
|
|
91
|
+
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Unity Catalog API
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.1
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class AzureUserDelegationSAS(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
AzureUserDelegationSAS
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
sas_token: Optional[StrictStr] = Field(default=None, description="Azure SAS Token")
|
|
30
|
+
__properties: ClassVar[List[str]] = ["sas_token"]
|
|
31
|
+
|
|
32
|
+
model_config = ConfigDict(
|
|
33
|
+
populate_by_name=True,
|
|
34
|
+
validate_assignment=True,
|
|
35
|
+
protected_namespaces=(),
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def to_str(self) -> str:
|
|
40
|
+
"""Returns the string representation of the model using alias"""
|
|
41
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
42
|
+
|
|
43
|
+
def to_json(self) -> str:
|
|
44
|
+
"""Returns the JSON representation of the model using alias"""
|
|
45
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
46
|
+
return json.dumps(self.to_dict())
|
|
47
|
+
|
|
48
|
+
@classmethod
|
|
49
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
50
|
+
"""Create an instance of AzureUserDelegationSAS from a JSON string"""
|
|
51
|
+
return cls.from_dict(json.loads(json_str))
|
|
52
|
+
|
|
53
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
54
|
+
"""Return the dictionary representation of the model using alias.
|
|
55
|
+
|
|
56
|
+
This has the following differences from calling pydantic's
|
|
57
|
+
`self.model_dump(by_alias=True)`:
|
|
58
|
+
|
|
59
|
+
* `None` is only added to the output dict for nullable fields that
|
|
60
|
+
were set at model initialization. Other fields with value `None`
|
|
61
|
+
are ignored.
|
|
62
|
+
"""
|
|
63
|
+
excluded_fields: Set[str] = set([
|
|
64
|
+
])
|
|
65
|
+
|
|
66
|
+
_dict = self.model_dump(
|
|
67
|
+
by_alias=True,
|
|
68
|
+
exclude=excluded_fields,
|
|
69
|
+
exclude_none=True,
|
|
70
|
+
)
|
|
71
|
+
return _dict
|
|
72
|
+
|
|
73
|
+
@classmethod
|
|
74
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
75
|
+
"""Create an instance of AzureUserDelegationSAS from a dict"""
|
|
76
|
+
if obj is None:
|
|
77
|
+
return None
|
|
78
|
+
|
|
79
|
+
if not isinstance(obj, dict):
|
|
80
|
+
return cls.model_validate(obj)
|
|
81
|
+
|
|
82
|
+
_obj = cls.model_validate({
|
|
83
|
+
"sas_token": obj.get("sas_token")
|
|
84
|
+
})
|
|
85
|
+
return _obj
|
|
86
|
+
|
|
87
|
+
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Unity Catalog API
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.1
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class CatalogInfo(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
CatalogInfo
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
name: Optional[StrictStr] = Field(default=None, description="Name of catalog.")
|
|
30
|
+
comment: Optional[StrictStr] = Field(default=None, description="User-provided free-form text description.")
|
|
31
|
+
properties: Optional[Dict[str, StrictStr]] = Field(default=None, description="A map of key-value properties attached to the securable.")
|
|
32
|
+
owner: Optional[StrictStr] = Field(default=None, description="Username of current owner of catalog.")
|
|
33
|
+
created_at: Optional[StrictInt] = Field(default=None, description="Time at which this catalog was created, in epoch milliseconds.")
|
|
34
|
+
created_by: Optional[StrictStr] = Field(default=None, description="Username of catalog creator.")
|
|
35
|
+
updated_at: Optional[StrictInt] = Field(default=None, description="Time at which this catalog was last modified, in epoch milliseconds.")
|
|
36
|
+
updated_by: Optional[StrictStr] = Field(default=None, description="Username of user who last modified catalog.")
|
|
37
|
+
id: Optional[StrictStr] = Field(default=None, description="Unique identifier for the catalog.")
|
|
38
|
+
__properties: ClassVar[List[str]] = ["name", "comment", "properties", "owner", "created_at", "created_by", "updated_at", "updated_by", "id"]
|
|
39
|
+
|
|
40
|
+
model_config = ConfigDict(
|
|
41
|
+
populate_by_name=True,
|
|
42
|
+
validate_assignment=True,
|
|
43
|
+
protected_namespaces=(),
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def to_str(self) -> str:
|
|
48
|
+
"""Returns the string representation of the model using alias"""
|
|
49
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
50
|
+
|
|
51
|
+
def to_json(self) -> str:
|
|
52
|
+
"""Returns the JSON representation of the model using alias"""
|
|
53
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
54
|
+
return json.dumps(self.to_dict())
|
|
55
|
+
|
|
56
|
+
@classmethod
|
|
57
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
58
|
+
"""Create an instance of CatalogInfo from a JSON string"""
|
|
59
|
+
return cls.from_dict(json.loads(json_str))
|
|
60
|
+
|
|
61
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
62
|
+
"""Return the dictionary representation of the model using alias.
|
|
63
|
+
|
|
64
|
+
This has the following differences from calling pydantic's
|
|
65
|
+
`self.model_dump(by_alias=True)`:
|
|
66
|
+
|
|
67
|
+
* `None` is only added to the output dict for nullable fields that
|
|
68
|
+
were set at model initialization. Other fields with value `None`
|
|
69
|
+
are ignored.
|
|
70
|
+
"""
|
|
71
|
+
excluded_fields: Set[str] = set([
|
|
72
|
+
])
|
|
73
|
+
|
|
74
|
+
_dict = self.model_dump(
|
|
75
|
+
by_alias=True,
|
|
76
|
+
exclude=excluded_fields,
|
|
77
|
+
exclude_none=True,
|
|
78
|
+
)
|
|
79
|
+
return _dict
|
|
80
|
+
|
|
81
|
+
@classmethod
|
|
82
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
83
|
+
"""Create an instance of CatalogInfo from a dict"""
|
|
84
|
+
if obj is None:
|
|
85
|
+
return None
|
|
86
|
+
|
|
87
|
+
if not isinstance(obj, dict):
|
|
88
|
+
return cls.model_validate(obj)
|
|
89
|
+
|
|
90
|
+
_obj = cls.model_validate({
|
|
91
|
+
"name": obj.get("name"),
|
|
92
|
+
"comment": obj.get("comment"),
|
|
93
|
+
"properties": obj.get("properties"),
|
|
94
|
+
"owner": obj.get("owner"),
|
|
95
|
+
"created_at": obj.get("created_at"),
|
|
96
|
+
"created_by": obj.get("created_by"),
|
|
97
|
+
"updated_at": obj.get("updated_at"),
|
|
98
|
+
"updated_by": obj.get("updated_by"),
|
|
99
|
+
"id": obj.get("id")
|
|
100
|
+
})
|
|
101
|
+
return _obj
|
|
102
|
+
|
|
103
|
+
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Unity Catalog API
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.1
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from unitycatalog.client.models.column_type_name import ColumnTypeName
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class ColumnInfo(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
ColumnInfo
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
name: Optional[StrictStr] = Field(default=None, description="Name of Column.")
|
|
31
|
+
type_text: Optional[StrictStr] = Field(default=None, description="Full data type specification as SQL/catalogString text.")
|
|
32
|
+
type_json: Optional[StrictStr] = Field(default=None, description="Full data type specification, JSON-serialized.")
|
|
33
|
+
type_name: Optional[ColumnTypeName] = None
|
|
34
|
+
type_precision: Optional[StrictInt] = Field(default=None, description="Digits of precision; required for DecimalTypes.")
|
|
35
|
+
type_scale: Optional[StrictInt] = Field(default=None, description="Digits to right of decimal; Required for DecimalTypes.")
|
|
36
|
+
type_interval_type: Optional[StrictStr] = Field(default=None, description="Format of IntervalType.")
|
|
37
|
+
position: Optional[StrictInt] = Field(default=None, description="Ordinal position of column (starting at position 0).")
|
|
38
|
+
comment: Optional[StrictStr] = Field(default=None, description="User-provided free-form text description.")
|
|
39
|
+
nullable: Optional[StrictBool] = Field(default=True, description="Whether field may be Null.")
|
|
40
|
+
partition_index: Optional[StrictInt] = Field(default=None, description="Partition index for column.")
|
|
41
|
+
__properties: ClassVar[List[str]] = ["name", "type_text", "type_json", "type_name", "type_precision", "type_scale", "type_interval_type", "position", "comment", "nullable", "partition_index"]
|
|
42
|
+
|
|
43
|
+
model_config = ConfigDict(
|
|
44
|
+
populate_by_name=True,
|
|
45
|
+
validate_assignment=True,
|
|
46
|
+
protected_namespaces=(),
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def to_str(self) -> str:
|
|
51
|
+
"""Returns the string representation of the model using alias"""
|
|
52
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
53
|
+
|
|
54
|
+
def to_json(self) -> str:
|
|
55
|
+
"""Returns the JSON representation of the model using alias"""
|
|
56
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
57
|
+
return json.dumps(self.to_dict())
|
|
58
|
+
|
|
59
|
+
@classmethod
|
|
60
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
61
|
+
"""Create an instance of ColumnInfo from a JSON string"""
|
|
62
|
+
return cls.from_dict(json.loads(json_str))
|
|
63
|
+
|
|
64
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
65
|
+
"""Return the dictionary representation of the model using alias.
|
|
66
|
+
|
|
67
|
+
This has the following differences from calling pydantic's
|
|
68
|
+
`self.model_dump(by_alias=True)`:
|
|
69
|
+
|
|
70
|
+
* `None` is only added to the output dict for nullable fields that
|
|
71
|
+
were set at model initialization. Other fields with value `None`
|
|
72
|
+
are ignored.
|
|
73
|
+
"""
|
|
74
|
+
excluded_fields: Set[str] = set([
|
|
75
|
+
])
|
|
76
|
+
|
|
77
|
+
_dict = self.model_dump(
|
|
78
|
+
by_alias=True,
|
|
79
|
+
exclude=excluded_fields,
|
|
80
|
+
exclude_none=True,
|
|
81
|
+
)
|
|
82
|
+
return _dict
|
|
83
|
+
|
|
84
|
+
@classmethod
|
|
85
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
86
|
+
"""Create an instance of ColumnInfo from a dict"""
|
|
87
|
+
if obj is None:
|
|
88
|
+
return None
|
|
89
|
+
|
|
90
|
+
if not isinstance(obj, dict):
|
|
91
|
+
return cls.model_validate(obj)
|
|
92
|
+
|
|
93
|
+
_obj = cls.model_validate({
|
|
94
|
+
"name": obj.get("name"),
|
|
95
|
+
"type_text": obj.get("type_text"),
|
|
96
|
+
"type_json": obj.get("type_json"),
|
|
97
|
+
"type_name": obj.get("type_name"),
|
|
98
|
+
"type_precision": obj.get("type_precision"),
|
|
99
|
+
"type_scale": obj.get("type_scale"),
|
|
100
|
+
"type_interval_type": obj.get("type_interval_type"),
|
|
101
|
+
"position": obj.get("position"),
|
|
102
|
+
"comment": obj.get("comment"),
|
|
103
|
+
"nullable": obj.get("nullable") if obj.get("nullable") is not None else True,
|
|
104
|
+
"partition_index": obj.get("partition_index")
|
|
105
|
+
})
|
|
106
|
+
return _obj
|
|
107
|
+
|
|
108
|
+
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Unity Catalog API
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.1
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import json
|
|
17
|
+
from enum import Enum
|
|
18
|
+
from typing_extensions import Self
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class ColumnTypeName(str, Enum):
|
|
22
|
+
"""
|
|
23
|
+
Name of type (INT, STRUCT, MAP, etc.).
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
"""
|
|
27
|
+
allowed enum values
|
|
28
|
+
"""
|
|
29
|
+
BOOLEAN = 'BOOLEAN'
|
|
30
|
+
BYTE = 'BYTE'
|
|
31
|
+
SHORT = 'SHORT'
|
|
32
|
+
INT = 'INT'
|
|
33
|
+
LONG = 'LONG'
|
|
34
|
+
FLOAT = 'FLOAT'
|
|
35
|
+
DOUBLE = 'DOUBLE'
|
|
36
|
+
DATE = 'DATE'
|
|
37
|
+
TIMESTAMP = 'TIMESTAMP'
|
|
38
|
+
TIMESTAMP_NTZ = 'TIMESTAMP_NTZ'
|
|
39
|
+
STRING = 'STRING'
|
|
40
|
+
BINARY = 'BINARY'
|
|
41
|
+
DECIMAL = 'DECIMAL'
|
|
42
|
+
INTERVAL = 'INTERVAL'
|
|
43
|
+
ARRAY = 'ARRAY'
|
|
44
|
+
STRUCT = 'STRUCT'
|
|
45
|
+
MAP = 'MAP'
|
|
46
|
+
CHAR = 'CHAR'
|
|
47
|
+
NULL = 'NULL'
|
|
48
|
+
USER_DEFINED_TYPE = 'USER_DEFINED_TYPE'
|
|
49
|
+
TABLE_TYPE = 'TABLE_TYPE'
|
|
50
|
+
|
|
51
|
+
@classmethod
|
|
52
|
+
def from_json(cls, json_str: str) -> Self:
|
|
53
|
+
"""Create an instance of ColumnTypeName from a JSON string"""
|
|
54
|
+
return cls(json.loads(json_str))
|
|
55
|
+
|
|
56
|
+
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Unity Catalog API
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.1
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class CreateCatalog(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
CreateCatalog
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
name: StrictStr = Field(description="Name of catalog.")
|
|
30
|
+
comment: Optional[StrictStr] = Field(default=None, description="User-provided free-form text description.")
|
|
31
|
+
properties: Optional[Dict[str, StrictStr]] = Field(default=None, description="A map of key-value properties attached to the securable.")
|
|
32
|
+
__properties: ClassVar[List[str]] = ["name", "comment", "properties"]
|
|
33
|
+
|
|
34
|
+
model_config = ConfigDict(
|
|
35
|
+
populate_by_name=True,
|
|
36
|
+
validate_assignment=True,
|
|
37
|
+
protected_namespaces=(),
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def to_str(self) -> str:
|
|
42
|
+
"""Returns the string representation of the model using alias"""
|
|
43
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
44
|
+
|
|
45
|
+
def to_json(self) -> str:
|
|
46
|
+
"""Returns the JSON representation of the model using alias"""
|
|
47
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
48
|
+
return json.dumps(self.to_dict())
|
|
49
|
+
|
|
50
|
+
@classmethod
|
|
51
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
52
|
+
"""Create an instance of CreateCatalog from a JSON string"""
|
|
53
|
+
return cls.from_dict(json.loads(json_str))
|
|
54
|
+
|
|
55
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
56
|
+
"""Return the dictionary representation of the model using alias.
|
|
57
|
+
|
|
58
|
+
This has the following differences from calling pydantic's
|
|
59
|
+
`self.model_dump(by_alias=True)`:
|
|
60
|
+
|
|
61
|
+
* `None` is only added to the output dict for nullable fields that
|
|
62
|
+
were set at model initialization. Other fields with value `None`
|
|
63
|
+
are ignored.
|
|
64
|
+
"""
|
|
65
|
+
excluded_fields: Set[str] = set([
|
|
66
|
+
])
|
|
67
|
+
|
|
68
|
+
_dict = self.model_dump(
|
|
69
|
+
by_alias=True,
|
|
70
|
+
exclude=excluded_fields,
|
|
71
|
+
exclude_none=True,
|
|
72
|
+
)
|
|
73
|
+
return _dict
|
|
74
|
+
|
|
75
|
+
@classmethod
|
|
76
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
77
|
+
"""Create an instance of CreateCatalog from a dict"""
|
|
78
|
+
if obj is None:
|
|
79
|
+
return None
|
|
80
|
+
|
|
81
|
+
if not isinstance(obj, dict):
|
|
82
|
+
return cls.model_validate(obj)
|
|
83
|
+
|
|
84
|
+
_obj = cls.model_validate({
|
|
85
|
+
"name": obj.get("name"),
|
|
86
|
+
"comment": obj.get("comment"),
|
|
87
|
+
"properties": obj.get("properties")
|
|
88
|
+
})
|
|
89
|
+
return _obj
|
|
90
|
+
|
|
91
|
+
|