stackit-dremio 0.1.0__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.
- stackit/dremio/__init__.py +86 -0
- stackit/dremio/api/__init__.py +4 -0
- stackit/dremio/api/default_api.py +2642 -0
- stackit/dremio/api_client.py +649 -0
- stackit/dremio/api_response.py +22 -0
- stackit/dremio/configuration.py +163 -0
- stackit/dremio/exceptions.py +217 -0
- stackit/dremio/models/__init__.py +33 -0
- stackit/dremio/models/auth_parameters.py +83 -0
- stackit/dremio/models/authentication.py +106 -0
- stackit/dremio/models/azuread.py +101 -0
- stackit/dremio/models/create_dremio_instance_payload.py +113 -0
- stackit/dremio/models/create_dremio_user_payload.py +109 -0
- stackit/dremio/models/dremio_response.py +167 -0
- stackit/dremio/models/dremio_user_response.py +155 -0
- stackit/dremio/models/endpoints.py +88 -0
- stackit/dremio/models/error.py +83 -0
- stackit/dremio/models/list_dremio_users_response.py +103 -0
- stackit/dremio/models/list_dremios_response.py +103 -0
- stackit/dremio/models/oauth.py +141 -0
- stackit/dremio/models/oauth_jwt_claims.py +82 -0
- stackit/dremio/models/update_dremio_instance_payload.py +118 -0
- stackit/dremio/py.typed +0 -0
- stackit/dremio/rest.py +163 -0
- stackit_dremio-0.1.0.dist-info/METADATA +48 -0
- stackit_dremio-0.1.0.dist-info/RECORD +29 -0
- stackit_dremio-0.1.0.dist-info/WHEEL +4 -0
- stackit_dremio-0.1.0.dist-info/licenses/LICENSE.md +201 -0
- stackit_dremio-0.1.0.dist-info/licenses/NOTICE.txt +2 -0
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
STACKIT Dremio API
|
|
5
|
+
|
|
6
|
+
This API provides endpoints for managing Dremio instances and users.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1beta.0.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
from __future__ import annotations
|
|
15
|
+
|
|
16
|
+
import json
|
|
17
|
+
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
19
|
+
from typing import Any, ClassVar, Dict, List, Optional, Set
|
|
20
|
+
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, field_validator
|
|
22
|
+
from pydantic_core import to_jsonable_python
|
|
23
|
+
from typing_extensions import Annotated, Self
|
|
24
|
+
|
|
25
|
+
from stackit.dremio.models.authentication import Authentication
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class CreateDremioInstancePayload(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
CreateDremioInstancePayload
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
|
|
33
|
+
authentication: Optional[Authentication] = None
|
|
34
|
+
description: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = Field(
|
|
35
|
+
default=None,
|
|
36
|
+
description="The description is a longer text chosen by the user to provide more context for the resource.",
|
|
37
|
+
)
|
|
38
|
+
display_name: Annotated[str, Field(min_length=1, strict=True, max_length=32)] = Field(
|
|
39
|
+
description="The display name is a short name chosen by the user to identify the resource.", alias="displayName"
|
|
40
|
+
)
|
|
41
|
+
__properties: ClassVar[List[str]] = ["authentication", "description", "displayName"]
|
|
42
|
+
|
|
43
|
+
@field_validator("display_name")
|
|
44
|
+
def display_name_validate_regular_expression(cls, value):
|
|
45
|
+
"""Validates the regular expression"""
|
|
46
|
+
if not isinstance(value, str):
|
|
47
|
+
value = str(value)
|
|
48
|
+
|
|
49
|
+
if not re.match(r"^[a-zA-Z0-9 ]*$", value):
|
|
50
|
+
raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9 ]*$/")
|
|
51
|
+
return value
|
|
52
|
+
|
|
53
|
+
model_config = ConfigDict(
|
|
54
|
+
validate_by_name=True,
|
|
55
|
+
validate_by_alias=True,
|
|
56
|
+
validate_assignment=True,
|
|
57
|
+
protected_namespaces=(),
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
def to_str(self) -> str:
|
|
61
|
+
"""Returns the string representation of the model using alias"""
|
|
62
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
63
|
+
|
|
64
|
+
def to_json(self) -> str:
|
|
65
|
+
"""Returns the JSON representation of the model using alias"""
|
|
66
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
67
|
+
|
|
68
|
+
@classmethod
|
|
69
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
70
|
+
"""Create an instance of CreateDremioInstancePayload from a JSON string"""
|
|
71
|
+
return cls.from_dict(json.loads(json_str))
|
|
72
|
+
|
|
73
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
74
|
+
"""Return the dictionary representation of the model using alias.
|
|
75
|
+
|
|
76
|
+
This has the following differences from calling pydantic's
|
|
77
|
+
`self.model_dump(by_alias=True)`:
|
|
78
|
+
|
|
79
|
+
* `None` is only added to the output dict for nullable fields that
|
|
80
|
+
were set at model initialization. Other fields with value `None`
|
|
81
|
+
are ignored.
|
|
82
|
+
"""
|
|
83
|
+
excluded_fields: Set[str] = set([])
|
|
84
|
+
|
|
85
|
+
_dict = self.model_dump(
|
|
86
|
+
by_alias=True,
|
|
87
|
+
exclude=excluded_fields,
|
|
88
|
+
exclude_none=True,
|
|
89
|
+
)
|
|
90
|
+
# override the default output from pydantic by calling `to_dict()` of authentication
|
|
91
|
+
if self.authentication:
|
|
92
|
+
_dict["authentication"] = self.authentication.to_dict()
|
|
93
|
+
return _dict
|
|
94
|
+
|
|
95
|
+
@classmethod
|
|
96
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
97
|
+
"""Create an instance of CreateDremioInstancePayload from a dict"""
|
|
98
|
+
if obj is None:
|
|
99
|
+
return None
|
|
100
|
+
|
|
101
|
+
if not isinstance(obj, dict):
|
|
102
|
+
return cls.model_validate(obj)
|
|
103
|
+
|
|
104
|
+
_obj = cls.model_validate(
|
|
105
|
+
{
|
|
106
|
+
"authentication": (
|
|
107
|
+
Authentication.from_dict(obj["authentication"]) if obj.get("authentication") is not None else None
|
|
108
|
+
),
|
|
109
|
+
"description": obj.get("description"),
|
|
110
|
+
"displayName": obj.get("displayName"),
|
|
111
|
+
}
|
|
112
|
+
)
|
|
113
|
+
return _obj
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
STACKIT Dremio API
|
|
5
|
+
|
|
6
|
+
This API provides endpoints for managing Dremio instances and users.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1beta.0.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
from __future__ import annotations
|
|
15
|
+
|
|
16
|
+
import json
|
|
17
|
+
import pprint
|
|
18
|
+
from typing import Any, ClassVar, Dict, List, Optional, Set
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
21
|
+
from pydantic_core import to_jsonable_python
|
|
22
|
+
from typing_extensions import Annotated, Self
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class CreateDremioUserPayload(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
CreateDremioUserPayload
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
|
|
30
|
+
description: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = Field(
|
|
31
|
+
default=None,
|
|
32
|
+
description="The description is a longer text chosen by the user to provide more context for the resource.",
|
|
33
|
+
)
|
|
34
|
+
email: Annotated[str, Field(min_length=1, strict=True, max_length=256)] = Field(
|
|
35
|
+
description="This is the admin user's email address."
|
|
36
|
+
)
|
|
37
|
+
first_name: Annotated[str, Field(min_length=1, strict=True, max_length=256)] = Field(
|
|
38
|
+
description="This is the admin user's first name.", alias="firstName"
|
|
39
|
+
)
|
|
40
|
+
last_name: Annotated[str, Field(min_length=1, strict=True, max_length=256)] = Field(
|
|
41
|
+
description="This is the admin user's last name.", alias="lastName"
|
|
42
|
+
)
|
|
43
|
+
name: Annotated[str, Field(min_length=1, strict=True, max_length=128)] = Field(
|
|
44
|
+
description="This is the username used to login the admin user."
|
|
45
|
+
)
|
|
46
|
+
password: Annotated[str, Field(min_length=15, strict=True, max_length=128)] = Field(
|
|
47
|
+
description="A password chosen by the user."
|
|
48
|
+
)
|
|
49
|
+
__properties: ClassVar[List[str]] = ["description", "email", "firstName", "lastName", "name", "password"]
|
|
50
|
+
|
|
51
|
+
model_config = ConfigDict(
|
|
52
|
+
validate_by_name=True,
|
|
53
|
+
validate_by_alias=True,
|
|
54
|
+
validate_assignment=True,
|
|
55
|
+
protected_namespaces=(),
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
def to_str(self) -> str:
|
|
59
|
+
"""Returns the string representation of the model using alias"""
|
|
60
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
61
|
+
|
|
62
|
+
def to_json(self) -> str:
|
|
63
|
+
"""Returns the JSON representation of the model using alias"""
|
|
64
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
65
|
+
|
|
66
|
+
@classmethod
|
|
67
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
68
|
+
"""Create an instance of CreateDremioUserPayload from a JSON string"""
|
|
69
|
+
return cls.from_dict(json.loads(json_str))
|
|
70
|
+
|
|
71
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
72
|
+
"""Return the dictionary representation of the model using alias.
|
|
73
|
+
|
|
74
|
+
This has the following differences from calling pydantic's
|
|
75
|
+
`self.model_dump(by_alias=True)`:
|
|
76
|
+
|
|
77
|
+
* `None` is only added to the output dict for nullable fields that
|
|
78
|
+
were set at model initialization. Other fields with value `None`
|
|
79
|
+
are ignored.
|
|
80
|
+
"""
|
|
81
|
+
excluded_fields: Set[str] = set([])
|
|
82
|
+
|
|
83
|
+
_dict = self.model_dump(
|
|
84
|
+
by_alias=True,
|
|
85
|
+
exclude=excluded_fields,
|
|
86
|
+
exclude_none=True,
|
|
87
|
+
)
|
|
88
|
+
return _dict
|
|
89
|
+
|
|
90
|
+
@classmethod
|
|
91
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
92
|
+
"""Create an instance of CreateDremioUserPayload from a dict"""
|
|
93
|
+
if obj is None:
|
|
94
|
+
return None
|
|
95
|
+
|
|
96
|
+
if not isinstance(obj, dict):
|
|
97
|
+
return cls.model_validate(obj)
|
|
98
|
+
|
|
99
|
+
_obj = cls.model_validate(
|
|
100
|
+
{
|
|
101
|
+
"description": obj.get("description"),
|
|
102
|
+
"email": obj.get("email"),
|
|
103
|
+
"firstName": obj.get("firstName"),
|
|
104
|
+
"lastName": obj.get("lastName"),
|
|
105
|
+
"name": obj.get("name"),
|
|
106
|
+
"password": obj.get("password"),
|
|
107
|
+
}
|
|
108
|
+
)
|
|
109
|
+
return _obj
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
STACKIT Dremio API
|
|
5
|
+
|
|
6
|
+
This API provides endpoints for managing Dremio instances and users.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1beta.0.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
from __future__ import annotations
|
|
15
|
+
|
|
16
|
+
import json
|
|
17
|
+
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
19
|
+
from datetime import datetime
|
|
20
|
+
from typing import Any, ClassVar, Dict, List, Optional, Set
|
|
21
|
+
from uuid import UUID
|
|
22
|
+
|
|
23
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
|
24
|
+
from pydantic_core import to_jsonable_python
|
|
25
|
+
from typing_extensions import Annotated, Self
|
|
26
|
+
|
|
27
|
+
from stackit.dremio.models.authentication import Authentication
|
|
28
|
+
from stackit.dremio.models.endpoints import Endpoints
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class DremioResponse(BaseModel):
|
|
32
|
+
"""
|
|
33
|
+
DremioResponse
|
|
34
|
+
""" # noqa: E501
|
|
35
|
+
|
|
36
|
+
authentication: Authentication
|
|
37
|
+
create_time: datetime = Field(description="The point in time the resource was created.")
|
|
38
|
+
description: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = Field(
|
|
39
|
+
default=None,
|
|
40
|
+
description="The description is a longer text chosen by the user to provide more context for the resource.",
|
|
41
|
+
)
|
|
42
|
+
display_name: Annotated[str, Field(min_length=1, strict=True, max_length=32)] = Field(
|
|
43
|
+
description="The display name is a short name chosen by the user to identify the resource.", alias="displayName"
|
|
44
|
+
)
|
|
45
|
+
endpoints: Endpoints
|
|
46
|
+
error_message: Optional[StrictStr] = Field(
|
|
47
|
+
default=None,
|
|
48
|
+
description="A message describing an actionable error the user can resolve. This field is empty if no such error exists.",
|
|
49
|
+
alias="errorMessage",
|
|
50
|
+
)
|
|
51
|
+
id: UUID = Field(description="A auto generated unique id which identifies the resource.")
|
|
52
|
+
state: StrictStr = Field(description="The current state of the resource.")
|
|
53
|
+
__properties: ClassVar[List[str]] = [
|
|
54
|
+
"authentication",
|
|
55
|
+
"create_time",
|
|
56
|
+
"description",
|
|
57
|
+
"displayName",
|
|
58
|
+
"endpoints",
|
|
59
|
+
"errorMessage",
|
|
60
|
+
"id",
|
|
61
|
+
"state",
|
|
62
|
+
]
|
|
63
|
+
|
|
64
|
+
@field_validator("create_time", mode="before")
|
|
65
|
+
def create_time_change_year_zero_to_one(cls, value):
|
|
66
|
+
"""Workaround which prevents year 0 issue"""
|
|
67
|
+
if isinstance(value, str):
|
|
68
|
+
# Check for year "0000" at the beginning of the string
|
|
69
|
+
# This assumes common date formats like YYYY-MM-DDTHH:MM:SS+00:00 or YYYY-MM-DDTHH:MM:SSZ
|
|
70
|
+
if value.startswith("0000-01-01T") and re.match(
|
|
71
|
+
r"^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\+\d{2}:\d{2}|Z)$", value
|
|
72
|
+
):
|
|
73
|
+
# Workaround: Replace "0000" with "0001"
|
|
74
|
+
return "0001" + value[4:] # Take "0001" and append the rest of the string
|
|
75
|
+
return value
|
|
76
|
+
|
|
77
|
+
@field_validator("display_name")
|
|
78
|
+
def display_name_validate_regular_expression(cls, value):
|
|
79
|
+
"""Validates the regular expression"""
|
|
80
|
+
if not isinstance(value, str):
|
|
81
|
+
value = str(value)
|
|
82
|
+
|
|
83
|
+
if not re.match(r"^[a-zA-Z0-9 ]*$", value):
|
|
84
|
+
raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9 ]*$/")
|
|
85
|
+
return value
|
|
86
|
+
|
|
87
|
+
@field_validator("state")
|
|
88
|
+
def state_validate_enum(cls, value):
|
|
89
|
+
"""Validates the enum"""
|
|
90
|
+
if value not in set(["reconciling", "active", "deleting", "error"]):
|
|
91
|
+
raise ValueError("must be one of enum values ('reconciling', 'active', 'deleting', 'error')")
|
|
92
|
+
return value
|
|
93
|
+
|
|
94
|
+
model_config = ConfigDict(
|
|
95
|
+
validate_by_name=True,
|
|
96
|
+
validate_by_alias=True,
|
|
97
|
+
validate_assignment=True,
|
|
98
|
+
protected_namespaces=(),
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
def to_str(self) -> str:
|
|
102
|
+
"""Returns the string representation of the model using alias"""
|
|
103
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
104
|
+
|
|
105
|
+
def to_json(self) -> str:
|
|
106
|
+
"""Returns the JSON representation of the model using alias"""
|
|
107
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
108
|
+
|
|
109
|
+
@classmethod
|
|
110
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
111
|
+
"""Create an instance of DremioResponse from a JSON string"""
|
|
112
|
+
return cls.from_dict(json.loads(json_str))
|
|
113
|
+
|
|
114
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
115
|
+
"""Return the dictionary representation of the model using alias.
|
|
116
|
+
|
|
117
|
+
This has the following differences from calling pydantic's
|
|
118
|
+
`self.model_dump(by_alias=True)`:
|
|
119
|
+
|
|
120
|
+
* `None` is only added to the output dict for nullable fields that
|
|
121
|
+
were set at model initialization. Other fields with value `None`
|
|
122
|
+
are ignored.
|
|
123
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
124
|
+
"""
|
|
125
|
+
excluded_fields: Set[str] = set(
|
|
126
|
+
[
|
|
127
|
+
"error_message",
|
|
128
|
+
]
|
|
129
|
+
)
|
|
130
|
+
|
|
131
|
+
_dict = self.model_dump(
|
|
132
|
+
by_alias=True,
|
|
133
|
+
exclude=excluded_fields,
|
|
134
|
+
exclude_none=True,
|
|
135
|
+
)
|
|
136
|
+
# override the default output from pydantic by calling `to_dict()` of authentication
|
|
137
|
+
if self.authentication:
|
|
138
|
+
_dict["authentication"] = self.authentication.to_dict()
|
|
139
|
+
# override the default output from pydantic by calling `to_dict()` of endpoints
|
|
140
|
+
if self.endpoints:
|
|
141
|
+
_dict["endpoints"] = self.endpoints.to_dict()
|
|
142
|
+
return _dict
|
|
143
|
+
|
|
144
|
+
@classmethod
|
|
145
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
146
|
+
"""Create an instance of DremioResponse from a dict"""
|
|
147
|
+
if obj is None:
|
|
148
|
+
return None
|
|
149
|
+
|
|
150
|
+
if not isinstance(obj, dict):
|
|
151
|
+
return cls.model_validate(obj)
|
|
152
|
+
|
|
153
|
+
_obj = cls.model_validate(
|
|
154
|
+
{
|
|
155
|
+
"authentication": (
|
|
156
|
+
Authentication.from_dict(obj["authentication"]) if obj.get("authentication") is not None else None
|
|
157
|
+
),
|
|
158
|
+
"create_time": obj.get("create_time"),
|
|
159
|
+
"description": obj.get("description"),
|
|
160
|
+
"displayName": obj.get("displayName"),
|
|
161
|
+
"endpoints": Endpoints.from_dict(obj["endpoints"]) if obj.get("endpoints") is not None else None,
|
|
162
|
+
"errorMessage": obj.get("errorMessage"),
|
|
163
|
+
"id": obj.get("id"),
|
|
164
|
+
"state": obj.get("state"),
|
|
165
|
+
}
|
|
166
|
+
)
|
|
167
|
+
return _obj
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
STACKIT Dremio API
|
|
5
|
+
|
|
6
|
+
This API provides endpoints for managing Dremio instances and users.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1beta.0.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
from __future__ import annotations
|
|
15
|
+
|
|
16
|
+
import json
|
|
17
|
+
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
19
|
+
from datetime import datetime
|
|
20
|
+
from typing import Any, ClassVar, Dict, List, Optional, Set
|
|
21
|
+
from uuid import UUID
|
|
22
|
+
|
|
23
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
|
24
|
+
from pydantic_core import to_jsonable_python
|
|
25
|
+
from typing_extensions import Annotated, Self
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class DremioUserResponse(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
DremioUserResponse
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
|
|
33
|
+
create_time: Optional[datetime] = Field(default=None, description="The point in time the resource was created.")
|
|
34
|
+
description: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = Field(
|
|
35
|
+
default=None,
|
|
36
|
+
description="The description is a longer text chosen by the user to provide more context for the resource.",
|
|
37
|
+
)
|
|
38
|
+
email: Annotated[str, Field(min_length=5, strict=True, max_length=256)] = Field(
|
|
39
|
+
description="This is the admin user's email address."
|
|
40
|
+
)
|
|
41
|
+
error_message: Optional[StrictStr] = Field(
|
|
42
|
+
default=None,
|
|
43
|
+
description="A message describing an actionable error the user can resolve. This field is empty if no such error exists.",
|
|
44
|
+
alias="errorMessage",
|
|
45
|
+
)
|
|
46
|
+
first_name: Annotated[str, Field(min_length=1, strict=True, max_length=256)] = Field(
|
|
47
|
+
description="This is the admin user's first name.", alias="firstName"
|
|
48
|
+
)
|
|
49
|
+
id: UUID = Field(description="A auto generated unique id which identifies the resource.")
|
|
50
|
+
last_name: Annotated[str, Field(min_length=1, strict=True, max_length=256)] = Field(
|
|
51
|
+
description="This is the admin user's last name.", alias="lastName"
|
|
52
|
+
)
|
|
53
|
+
name: Annotated[str, Field(min_length=1, strict=True, max_length=128)] = Field(
|
|
54
|
+
description="This is the username used to login the admin user."
|
|
55
|
+
)
|
|
56
|
+
state: StrictStr = Field(description="The current state of the resource.")
|
|
57
|
+
__properties: ClassVar[List[str]] = [
|
|
58
|
+
"create_time",
|
|
59
|
+
"description",
|
|
60
|
+
"email",
|
|
61
|
+
"errorMessage",
|
|
62
|
+
"firstName",
|
|
63
|
+
"id",
|
|
64
|
+
"lastName",
|
|
65
|
+
"name",
|
|
66
|
+
"state",
|
|
67
|
+
]
|
|
68
|
+
|
|
69
|
+
@field_validator("create_time", mode="before")
|
|
70
|
+
def create_time_change_year_zero_to_one(cls, value):
|
|
71
|
+
"""Workaround which prevents year 0 issue"""
|
|
72
|
+
if isinstance(value, str):
|
|
73
|
+
# Check for year "0000" at the beginning of the string
|
|
74
|
+
# This assumes common date formats like YYYY-MM-DDTHH:MM:SS+00:00 or YYYY-MM-DDTHH:MM:SSZ
|
|
75
|
+
if value.startswith("0000-01-01T") and re.match(
|
|
76
|
+
r"^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\+\d{2}:\d{2}|Z)$", value
|
|
77
|
+
):
|
|
78
|
+
# Workaround: Replace "0000" with "0001"
|
|
79
|
+
return "0001" + value[4:] # Take "0001" and append the rest of the string
|
|
80
|
+
return value
|
|
81
|
+
|
|
82
|
+
@field_validator("state")
|
|
83
|
+
def state_validate_enum(cls, value):
|
|
84
|
+
"""Validates the enum"""
|
|
85
|
+
if value not in set(["reconciling", "active", "deleting", "error"]):
|
|
86
|
+
raise ValueError("must be one of enum values ('reconciling', 'active', 'deleting', 'error')")
|
|
87
|
+
return value
|
|
88
|
+
|
|
89
|
+
model_config = ConfigDict(
|
|
90
|
+
validate_by_name=True,
|
|
91
|
+
validate_by_alias=True,
|
|
92
|
+
validate_assignment=True,
|
|
93
|
+
protected_namespaces=(),
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
def to_str(self) -> str:
|
|
97
|
+
"""Returns the string representation of the model using alias"""
|
|
98
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
99
|
+
|
|
100
|
+
def to_json(self) -> str:
|
|
101
|
+
"""Returns the JSON representation of the model using alias"""
|
|
102
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
103
|
+
|
|
104
|
+
@classmethod
|
|
105
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
106
|
+
"""Create an instance of DremioUserResponse from a JSON string"""
|
|
107
|
+
return cls.from_dict(json.loads(json_str))
|
|
108
|
+
|
|
109
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
110
|
+
"""Return the dictionary representation of the model using alias.
|
|
111
|
+
|
|
112
|
+
This has the following differences from calling pydantic's
|
|
113
|
+
`self.model_dump(by_alias=True)`:
|
|
114
|
+
|
|
115
|
+
* `None` is only added to the output dict for nullable fields that
|
|
116
|
+
were set at model initialization. Other fields with value `None`
|
|
117
|
+
are ignored.
|
|
118
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
119
|
+
"""
|
|
120
|
+
excluded_fields: Set[str] = set(
|
|
121
|
+
[
|
|
122
|
+
"error_message",
|
|
123
|
+
]
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
_dict = self.model_dump(
|
|
127
|
+
by_alias=True,
|
|
128
|
+
exclude=excluded_fields,
|
|
129
|
+
exclude_none=True,
|
|
130
|
+
)
|
|
131
|
+
return _dict
|
|
132
|
+
|
|
133
|
+
@classmethod
|
|
134
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
135
|
+
"""Create an instance of DremioUserResponse from a dict"""
|
|
136
|
+
if obj is None:
|
|
137
|
+
return None
|
|
138
|
+
|
|
139
|
+
if not isinstance(obj, dict):
|
|
140
|
+
return cls.model_validate(obj)
|
|
141
|
+
|
|
142
|
+
_obj = cls.model_validate(
|
|
143
|
+
{
|
|
144
|
+
"create_time": obj.get("create_time"),
|
|
145
|
+
"description": obj.get("description"),
|
|
146
|
+
"email": obj.get("email"),
|
|
147
|
+
"errorMessage": obj.get("errorMessage"),
|
|
148
|
+
"firstName": obj.get("firstName"),
|
|
149
|
+
"id": obj.get("id"),
|
|
150
|
+
"lastName": obj.get("lastName"),
|
|
151
|
+
"name": obj.get("name"),
|
|
152
|
+
"state": obj.get("state"),
|
|
153
|
+
}
|
|
154
|
+
)
|
|
155
|
+
return _obj
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
STACKIT Dremio API
|
|
5
|
+
|
|
6
|
+
This API provides endpoints for managing Dremio instances and users.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1beta.0.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
from __future__ import annotations
|
|
15
|
+
|
|
16
|
+
import json
|
|
17
|
+
import pprint
|
|
18
|
+
from typing import Any, ClassVar, Dict, List, Optional, Set
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
21
|
+
from pydantic_core import to_jsonable_python
|
|
22
|
+
from typing_extensions import Self
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class Endpoints(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
A collection of endpoints offered by the Dremio instance.
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
|
|
30
|
+
arrow_flight: StrictStr = Field(
|
|
31
|
+
description="The URL for the Arrow Flight endpoint of the Dremio instance.", alias="arrowFlight"
|
|
32
|
+
)
|
|
33
|
+
catalog: StrictStr = Field(description="The URL for the Catalog endpoint of the Dremio instance.")
|
|
34
|
+
ui: StrictStr = Field(description="The URL for the UI of the Dremio instance.")
|
|
35
|
+
__properties: ClassVar[List[str]] = ["arrowFlight", "catalog", "ui"]
|
|
36
|
+
|
|
37
|
+
model_config = ConfigDict(
|
|
38
|
+
validate_by_name=True,
|
|
39
|
+
validate_by_alias=True,
|
|
40
|
+
validate_assignment=True,
|
|
41
|
+
protected_namespaces=(),
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
def to_str(self) -> str:
|
|
45
|
+
"""Returns the string representation of the model using alias"""
|
|
46
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
47
|
+
|
|
48
|
+
def to_json(self) -> str:
|
|
49
|
+
"""Returns the JSON representation of the model using alias"""
|
|
50
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
51
|
+
|
|
52
|
+
@classmethod
|
|
53
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
54
|
+
"""Create an instance of Endpoints from a JSON string"""
|
|
55
|
+
return cls.from_dict(json.loads(json_str))
|
|
56
|
+
|
|
57
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
58
|
+
"""Return the dictionary representation of the model using alias.
|
|
59
|
+
|
|
60
|
+
This has the following differences from calling pydantic's
|
|
61
|
+
`self.model_dump(by_alias=True)`:
|
|
62
|
+
|
|
63
|
+
* `None` is only added to the output dict for nullable fields that
|
|
64
|
+
were set at model initialization. Other fields with value `None`
|
|
65
|
+
are ignored.
|
|
66
|
+
"""
|
|
67
|
+
excluded_fields: Set[str] = set([])
|
|
68
|
+
|
|
69
|
+
_dict = self.model_dump(
|
|
70
|
+
by_alias=True,
|
|
71
|
+
exclude=excluded_fields,
|
|
72
|
+
exclude_none=True,
|
|
73
|
+
)
|
|
74
|
+
return _dict
|
|
75
|
+
|
|
76
|
+
@classmethod
|
|
77
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
78
|
+
"""Create an instance of Endpoints from a dict"""
|
|
79
|
+
if obj is None:
|
|
80
|
+
return None
|
|
81
|
+
|
|
82
|
+
if not isinstance(obj, dict):
|
|
83
|
+
return cls.model_validate(obj)
|
|
84
|
+
|
|
85
|
+
_obj = cls.model_validate(
|
|
86
|
+
{"arrowFlight": obj.get("arrowFlight"), "catalog": obj.get("catalog"), "ui": obj.get("ui")}
|
|
87
|
+
)
|
|
88
|
+
return _obj
|