stackit-intake 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.
Files changed (36) hide show
  1. stackit/intake/__init__.py +115 -0
  2. stackit/intake/api/__init__.py +4 -0
  3. stackit/intake/api/default_api.py +4461 -0
  4. stackit/intake/api_client.py +639 -0
  5. stackit/intake/api_response.py +23 -0
  6. stackit/intake/configuration.py +164 -0
  7. stackit/intake/exceptions.py +217 -0
  8. stackit/intake/models/__init__.py +37 -0
  9. stackit/intake/models/catalog_auth.py +93 -0
  10. stackit/intake/models/catalog_auth_patch.py +93 -0
  11. stackit/intake/models/catalog_auth_type.py +36 -0
  12. stackit/intake/models/client_config.py +82 -0
  13. stackit/intake/models/create_intake_payload.py +112 -0
  14. stackit/intake/models/create_intake_runner_payload.py +115 -0
  15. stackit/intake/models/create_intake_user_payload.py +107 -0
  16. stackit/intake/models/dremio_auth.py +88 -0
  17. stackit/intake/models/dremio_auth_patch.py +88 -0
  18. stackit/intake/models/intake_catalog.py +118 -0
  19. stackit/intake/models/intake_catalog_patch.py +110 -0
  20. stackit/intake/models/intake_response.py +158 -0
  21. stackit/intake/models/intake_runner_response.py +135 -0
  22. stackit/intake/models/intake_user_response.py +139 -0
  23. stackit/intake/models/list_intake_runners_response.py +102 -0
  24. stackit/intake/models/list_intake_users_response.py +102 -0
  25. stackit/intake/models/list_intakes_response.py +102 -0
  26. stackit/intake/models/update_intake_payload.py +115 -0
  27. stackit/intake/models/update_intake_runner_payload.py +118 -0
  28. stackit/intake/models/update_intake_user_payload.py +112 -0
  29. stackit/intake/models/user_type.py +36 -0
  30. stackit/intake/py.typed +0 -0
  31. stackit/intake/rest.py +148 -0
  32. stackit_intake-0.1.0.dist-info/LICENSE.md +201 -0
  33. stackit_intake-0.1.0.dist-info/METADATA +46 -0
  34. stackit_intake-0.1.0.dist-info/NOTICE.txt +2 -0
  35. stackit_intake-0.1.0.dist-info/RECORD +36 -0
  36. stackit_intake-0.1.0.dist-info/WHEEL +4 -0
@@ -0,0 +1,118 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT Intake API
5
+
6
+ This API provides endpoints for managing Intakes.
7
+
8
+ The version of the OpenAPI document: 1beta.2.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 typing_extensions import Annotated, Self
22
+
23
+ from stackit.intake.models.catalog_auth import CatalogAuth
24
+
25
+
26
+ class IntakeCatalog(BaseModel):
27
+ """
28
+ The Iceberg catalog configuration
29
+ """ # noqa: E501
30
+
31
+ auth: Optional[CatalogAuth] = None
32
+ namespace: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = Field(
33
+ default="intake",
34
+ description="The namespace to which data shall be written. It will be automatically created, if it does not exist.",
35
+ )
36
+ partition_by: Optional[List[Annotated[str, Field(strict=True, max_length=1024)]]] = Field(
37
+ default=None, alias="partitionBy"
38
+ )
39
+ table_name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=32)]] = Field(
40
+ default=None,
41
+ description="The table name is a short name chosen by the user to identify the table in Iceberg.",
42
+ alias="tableName",
43
+ )
44
+ uri: Annotated[str, Field(strict=True, max_length=1024)] = Field(
45
+ description="The URI to the Iceberg catalog endpoint"
46
+ )
47
+ warehouse: Annotated[str, Field(strict=True, max_length=1024)] = Field(
48
+ description="The Iceberg warehouse to connect to, required when the catalog has no default warehouse configured."
49
+ )
50
+ __properties: ClassVar[List[str]] = ["auth", "namespace", "partitionBy", "tableName", "uri", "warehouse"]
51
+
52
+ model_config = ConfigDict(
53
+ populate_by_name=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
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
65
+ return json.dumps(self.to_dict())
66
+
67
+ @classmethod
68
+ def from_json(cls, json_str: str) -> Optional[Self]:
69
+ """Create an instance of IntakeCatalog from a JSON string"""
70
+ return cls.from_dict(json.loads(json_str))
71
+
72
+ def to_dict(self) -> Dict[str, Any]:
73
+ """Return the dictionary representation of the model using alias.
74
+
75
+ This has the following differences from calling pydantic's
76
+ `self.model_dump(by_alias=True)`:
77
+
78
+ * `None` is only added to the output dict for nullable fields that
79
+ were set at model initialization. Other fields with value `None`
80
+ are ignored.
81
+ """
82
+ excluded_fields: Set[str] = set([])
83
+
84
+ _dict = self.model_dump(
85
+ by_alias=True,
86
+ exclude=excluded_fields,
87
+ exclude_none=True,
88
+ )
89
+ # override the default output from pydantic by calling `to_dict()` of auth
90
+ if self.auth:
91
+ _dict["auth"] = self.auth.to_dict()
92
+ # set to None if partition_by (nullable) is None
93
+ # and model_fields_set contains the field
94
+ if self.partition_by is None and "partition_by" in self.model_fields_set:
95
+ _dict["partitionBy"] = None
96
+
97
+ return _dict
98
+
99
+ @classmethod
100
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
101
+ """Create an instance of IntakeCatalog from a dict"""
102
+ if obj is None:
103
+ return None
104
+
105
+ if not isinstance(obj, dict):
106
+ return cls.model_validate(obj)
107
+
108
+ _obj = cls.model_validate(
109
+ {
110
+ "auth": CatalogAuth.from_dict(obj["auth"]) if obj.get("auth") is not None else None,
111
+ "namespace": obj.get("namespace") if obj.get("namespace") is not None else "intake",
112
+ "partitionBy": obj.get("partitionBy"),
113
+ "tableName": obj.get("tableName"),
114
+ "uri": obj.get("uri"),
115
+ "warehouse": obj.get("warehouse"),
116
+ }
117
+ )
118
+ return _obj
@@ -0,0 +1,110 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT Intake API
5
+
6
+ This API provides endpoints for managing Intakes.
7
+
8
+ The version of the OpenAPI document: 1beta.2.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 typing_extensions import Annotated, Self
22
+
23
+ from stackit.intake.models.catalog_auth_patch import CatalogAuthPatch
24
+
25
+
26
+ class IntakeCatalogPatch(BaseModel):
27
+ """
28
+ The Iceberg catalog configuration
29
+ """ # noqa: E501
30
+
31
+ auth: Optional[CatalogAuthPatch] = None
32
+ namespace: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = Field(
33
+ default="intake",
34
+ description="The namespace to which data shall be written. It will be automatically created, if it does not exist.",
35
+ )
36
+ table_name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=32)]] = Field(
37
+ default=None,
38
+ description="The table name is a short name chosen by the user to identify the table in Iceberg.",
39
+ alias="tableName",
40
+ )
41
+ uri: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = Field(
42
+ default=None, description="The URI to the Iceberg catalog endpoint"
43
+ )
44
+ warehouse: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = Field(
45
+ default=None,
46
+ description="The Iceberg warehouse to connect to, required when the catalog has no default warehouse configured.",
47
+ )
48
+ __properties: ClassVar[List[str]] = ["auth", "namespace", "tableName", "uri", "warehouse"]
49
+
50
+ model_config = ConfigDict(
51
+ populate_by_name=True,
52
+ validate_assignment=True,
53
+ protected_namespaces=(),
54
+ )
55
+
56
+ def to_str(self) -> str:
57
+ """Returns the string representation of the model using alias"""
58
+ return pprint.pformat(self.model_dump(by_alias=True))
59
+
60
+ def to_json(self) -> str:
61
+ """Returns the JSON representation of the model using alias"""
62
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
63
+ return json.dumps(self.to_dict())
64
+
65
+ @classmethod
66
+ def from_json(cls, json_str: str) -> Optional[Self]:
67
+ """Create an instance of IntakeCatalogPatch from a JSON string"""
68
+ return cls.from_dict(json.loads(json_str))
69
+
70
+ def to_dict(self) -> Dict[str, Any]:
71
+ """Return the dictionary representation of the model using alias.
72
+
73
+ This has the following differences from calling pydantic's
74
+ `self.model_dump(by_alias=True)`:
75
+
76
+ * `None` is only added to the output dict for nullable fields that
77
+ were set at model initialization. Other fields with value `None`
78
+ are ignored.
79
+ """
80
+ excluded_fields: Set[str] = set([])
81
+
82
+ _dict = self.model_dump(
83
+ by_alias=True,
84
+ exclude=excluded_fields,
85
+ exclude_none=True,
86
+ )
87
+ # override the default output from pydantic by calling `to_dict()` of auth
88
+ if self.auth:
89
+ _dict["auth"] = self.auth.to_dict()
90
+ return _dict
91
+
92
+ @classmethod
93
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
94
+ """Create an instance of IntakeCatalogPatch from a dict"""
95
+ if obj is None:
96
+ return None
97
+
98
+ if not isinstance(obj, dict):
99
+ return cls.model_validate(obj)
100
+
101
+ _obj = cls.model_validate(
102
+ {
103
+ "auth": CatalogAuthPatch.from_dict(obj["auth"]) if obj.get("auth") is not None else None,
104
+ "namespace": obj.get("namespace") if obj.get("namespace") is not None else "intake",
105
+ "tableName": obj.get("tableName"),
106
+ "uri": obj.get("uri"),
107
+ "warehouse": obj.get("warehouse"),
108
+ }
109
+ )
110
+ return _obj
@@ -0,0 +1,158 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT Intake API
5
+
6
+ This API provides endpoints for managing Intakes.
7
+
8
+ The version of the OpenAPI document: 1beta.2.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 datetime import datetime
19
+ from typing import Any, ClassVar, Dict, List, Optional, Set
20
+
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator
22
+ from typing_extensions import Annotated, Self
23
+
24
+ from stackit.intake.models.intake_catalog import IntakeCatalog
25
+
26
+
27
+ class IntakeResponse(BaseModel):
28
+ """
29
+ IntakeResponse
30
+ """ # noqa: E501
31
+
32
+ catalog: IntakeCatalog
33
+ create_time: datetime = Field(description="The point in time the resource was created.")
34
+ dead_letter_topic: Annotated[str, Field(strict=True, max_length=1024)] = Field(
35
+ description="The topic where undelivered messages are published (Dead Letter Queue).", alias="deadLetterTopic"
36
+ )
37
+ description: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = Field(
38
+ default=None,
39
+ description="The description is a longer text chosen by the user to provide more context for the resource.",
40
+ )
41
+ display_name: Annotated[str, Field(min_length=1, strict=True, max_length=32)] = Field(
42
+ description="The display name is a short name chosen by the user to identify the resource.", alias="displayName"
43
+ )
44
+ failure_message: Optional[StrictStr] = Field(
45
+ default=None, description="A human-readable description of the error, if the state is 'failed'."
46
+ )
47
+ id: StrictStr = Field(description="A auto generated unique id which identifies the resource.")
48
+ intake_runner_id: StrictStr = Field(
49
+ description="The unique id of the intake runner this intake is running on.", alias="intakeRunnerId"
50
+ )
51
+ labels: Optional[Dict[str, StrictStr]] = Field(
52
+ default=None, description="Labels are a set of key-value pairs assigned to resources."
53
+ )
54
+ state: StrictStr = Field(description="The current state of the resource.")
55
+ topic: Annotated[str, Field(strict=True, max_length=1024)] = Field(description="The topic to publish data to.")
56
+ undelivered_message_count: Optional[StrictInt] = Field(
57
+ default=None,
58
+ description="Number of messages that failed delivery and were sent to the Dead Letter Queue.",
59
+ alias="undeliveredMessageCount",
60
+ )
61
+ uri: Annotated[str, Field(strict=True, max_length=1024)] = Field(description="The URI for reaching the resource.")
62
+ __properties: ClassVar[List[str]] = [
63
+ "catalog",
64
+ "create_time",
65
+ "deadLetterTopic",
66
+ "description",
67
+ "displayName",
68
+ "failure_message",
69
+ "id",
70
+ "intakeRunnerId",
71
+ "labels",
72
+ "state",
73
+ "topic",
74
+ "undeliveredMessageCount",
75
+ "uri",
76
+ ]
77
+
78
+ @field_validator("state")
79
+ def state_validate_enum(cls, value):
80
+ """Validates the enum"""
81
+ if value not in set(["reconciling", "active", "deleting", "failed"]):
82
+ raise ValueError("must be one of enum values ('reconciling', 'active', 'deleting', 'failed')")
83
+ return value
84
+
85
+ model_config = ConfigDict(
86
+ populate_by_name=True,
87
+ validate_assignment=True,
88
+ protected_namespaces=(),
89
+ )
90
+
91
+ def to_str(self) -> str:
92
+ """Returns the string representation of the model using alias"""
93
+ return pprint.pformat(self.model_dump(by_alias=True))
94
+
95
+ def to_json(self) -> str:
96
+ """Returns the JSON representation of the model using alias"""
97
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
98
+ return json.dumps(self.to_dict())
99
+
100
+ @classmethod
101
+ def from_json(cls, json_str: str) -> Optional[Self]:
102
+ """Create an instance of IntakeResponse from a JSON string"""
103
+ return cls.from_dict(json.loads(json_str))
104
+
105
+ def to_dict(self) -> Dict[str, Any]:
106
+ """Return the dictionary representation of the model using alias.
107
+
108
+ This has the following differences from calling pydantic's
109
+ `self.model_dump(by_alias=True)`:
110
+
111
+ * `None` is only added to the output dict for nullable fields that
112
+ were set at model initialization. Other fields with value `None`
113
+ are ignored.
114
+ """
115
+ excluded_fields: Set[str] = set([])
116
+
117
+ _dict = self.model_dump(
118
+ by_alias=True,
119
+ exclude=excluded_fields,
120
+ exclude_none=True,
121
+ )
122
+ # override the default output from pydantic by calling `to_dict()` of catalog
123
+ if self.catalog:
124
+ _dict["catalog"] = self.catalog.to_dict()
125
+ # set to None if labels (nullable) is None
126
+ # and model_fields_set contains the field
127
+ if self.labels is None and "labels" in self.model_fields_set:
128
+ _dict["labels"] = None
129
+
130
+ return _dict
131
+
132
+ @classmethod
133
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
134
+ """Create an instance of IntakeResponse from a dict"""
135
+ if obj is None:
136
+ return None
137
+
138
+ if not isinstance(obj, dict):
139
+ return cls.model_validate(obj)
140
+
141
+ _obj = cls.model_validate(
142
+ {
143
+ "catalog": IntakeCatalog.from_dict(obj["catalog"]) if obj.get("catalog") is not None else None,
144
+ "create_time": obj.get("create_time"),
145
+ "deadLetterTopic": obj.get("deadLetterTopic"),
146
+ "description": obj.get("description"),
147
+ "displayName": obj.get("displayName"),
148
+ "failure_message": obj.get("failure_message"),
149
+ "id": obj.get("id"),
150
+ "intakeRunnerId": obj.get("intakeRunnerId"),
151
+ "labels": obj.get("labels"),
152
+ "state": obj.get("state"),
153
+ "topic": obj.get("topic"),
154
+ "undeliveredMessageCount": obj.get("undeliveredMessageCount"),
155
+ "uri": obj.get("uri"),
156
+ }
157
+ )
158
+ return _obj
@@ -0,0 +1,135 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT Intake API
5
+
6
+ This API provides endpoints for managing Intakes.
7
+
8
+ The version of the OpenAPI document: 1beta.2.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 datetime import datetime
19
+ from typing import Any, ClassVar, Dict, List, Optional, Set
20
+
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator
22
+ from typing_extensions import Annotated, Self
23
+
24
+
25
+ class IntakeRunnerResponse(BaseModel):
26
+ """
27
+ IntakeRunnerResponse
28
+ """ # noqa: E501
29
+
30
+ create_time: datetime = Field(description="The point in time the resource was created.")
31
+ description: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = Field(
32
+ default=None,
33
+ description="The description is a longer text chosen by the user to provide more context for the resource.",
34
+ )
35
+ display_name: Annotated[str, Field(min_length=1, strict=True, max_length=32)] = Field(
36
+ description="The display name is a short name chosen by the user to identify the resource.", alias="displayName"
37
+ )
38
+ id: StrictStr = Field(description="A auto generated unique id which identifies the resource.")
39
+ labels: Optional[Dict[str, StrictStr]] = Field(
40
+ default=None, description="Labels are a set of key-value pairs assigned to resources."
41
+ )
42
+ max_message_size_ki_b: StrictInt = Field(
43
+ description="The maximum size of a message in kibibytes (1 KiB = 1024 bytes).", alias="maxMessageSizeKiB"
44
+ )
45
+ max_messages_per_hour: StrictInt = Field(
46
+ description="The maximum number of messages per hour.", alias="maxMessagesPerHour"
47
+ )
48
+ state: StrictStr = Field(description="The current state of the resource.")
49
+ uri: Annotated[str, Field(strict=True, max_length=1024)] = Field(description="The URI for reaching the resource.")
50
+ __properties: ClassVar[List[str]] = [
51
+ "create_time",
52
+ "description",
53
+ "displayName",
54
+ "id",
55
+ "labels",
56
+ "maxMessageSizeKiB",
57
+ "maxMessagesPerHour",
58
+ "state",
59
+ "uri",
60
+ ]
61
+
62
+ @field_validator("state")
63
+ def state_validate_enum(cls, value):
64
+ """Validates the enum"""
65
+ if value not in set(["reconciling", "active", "deleting"]):
66
+ raise ValueError("must be one of enum values ('reconciling', 'active', 'deleting')")
67
+ return value
68
+
69
+ model_config = ConfigDict(
70
+ populate_by_name=True,
71
+ validate_assignment=True,
72
+ protected_namespaces=(),
73
+ )
74
+
75
+ def to_str(self) -> str:
76
+ """Returns the string representation of the model using alias"""
77
+ return pprint.pformat(self.model_dump(by_alias=True))
78
+
79
+ def to_json(self) -> str:
80
+ """Returns the JSON representation of the model using alias"""
81
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
82
+ return json.dumps(self.to_dict())
83
+
84
+ @classmethod
85
+ def from_json(cls, json_str: str) -> Optional[Self]:
86
+ """Create an instance of IntakeRunnerResponse from a JSON string"""
87
+ return cls.from_dict(json.loads(json_str))
88
+
89
+ def to_dict(self) -> Dict[str, Any]:
90
+ """Return the dictionary representation of the model using alias.
91
+
92
+ This has the following differences from calling pydantic's
93
+ `self.model_dump(by_alias=True)`:
94
+
95
+ * `None` is only added to the output dict for nullable fields that
96
+ were set at model initialization. Other fields with value `None`
97
+ are ignored.
98
+ """
99
+ excluded_fields: Set[str] = set([])
100
+
101
+ _dict = self.model_dump(
102
+ by_alias=True,
103
+ exclude=excluded_fields,
104
+ exclude_none=True,
105
+ )
106
+ # set to None if labels (nullable) is None
107
+ # and model_fields_set contains the field
108
+ if self.labels is None and "labels" in self.model_fields_set:
109
+ _dict["labels"] = None
110
+
111
+ return _dict
112
+
113
+ @classmethod
114
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
115
+ """Create an instance of IntakeRunnerResponse from a dict"""
116
+ if obj is None:
117
+ return None
118
+
119
+ if not isinstance(obj, dict):
120
+ return cls.model_validate(obj)
121
+
122
+ _obj = cls.model_validate(
123
+ {
124
+ "create_time": obj.get("create_time"),
125
+ "description": obj.get("description"),
126
+ "displayName": obj.get("displayName"),
127
+ "id": obj.get("id"),
128
+ "labels": obj.get("labels"),
129
+ "maxMessageSizeKiB": obj.get("maxMessageSizeKiB"),
130
+ "maxMessagesPerHour": obj.get("maxMessagesPerHour"),
131
+ "state": obj.get("state"),
132
+ "uri": obj.get("uri"),
133
+ }
134
+ )
135
+ return _obj
@@ -0,0 +1,139 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT Intake API
5
+
6
+ This API provides endpoints for managing Intakes.
7
+
8
+ The version of the OpenAPI document: 1beta.2.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 datetime import datetime
19
+ from typing import Any, ClassVar, Dict, List, Optional, Set
20
+
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
22
+ from typing_extensions import Annotated, Self
23
+
24
+ from stackit.intake.models.client_config import ClientConfig
25
+ from stackit.intake.models.user_type import UserType
26
+
27
+
28
+ class IntakeUserResponse(BaseModel):
29
+ """
30
+ IntakeUserResponse
31
+ """ # noqa: E501
32
+
33
+ client_config: Optional[ClientConfig] = Field(default=None, alias="clientConfig")
34
+ create_time: datetime = Field(description="The point in time the resource was created.")
35
+ description: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = Field(
36
+ default=None,
37
+ description="The description is a longer text chosen by the user to provide more context for the resource.",
38
+ )
39
+ display_name: Annotated[str, Field(min_length=1, strict=True, max_length=32)] = Field(
40
+ description="The display name is a short name chosen by the user to identify the resource.", alias="displayName"
41
+ )
42
+ id: StrictStr = Field(description="A auto generated unique id which identifies the resource.")
43
+ labels: Optional[Dict[str, StrictStr]] = Field(
44
+ default=None, description="Labels are a set of key-value pairs assigned to resources."
45
+ )
46
+ state: StrictStr = Field(description="The current state of the resource.")
47
+ type: UserType
48
+ user: Annotated[str, Field(strict=True, max_length=1024)] = Field(description="The user to connect to the intake.")
49
+ __properties: ClassVar[List[str]] = [
50
+ "clientConfig",
51
+ "create_time",
52
+ "description",
53
+ "displayName",
54
+ "id",
55
+ "labels",
56
+ "state",
57
+ "type",
58
+ "user",
59
+ ]
60
+
61
+ @field_validator("state")
62
+ def state_validate_enum(cls, value):
63
+ """Validates the enum"""
64
+ if value not in set(["reconciling", "active", "deleting"]):
65
+ raise ValueError("must be one of enum values ('reconciling', 'active', 'deleting')")
66
+ return value
67
+
68
+ model_config = ConfigDict(
69
+ populate_by_name=True,
70
+ validate_assignment=True,
71
+ protected_namespaces=(),
72
+ )
73
+
74
+ def to_str(self) -> str:
75
+ """Returns the string representation of the model using alias"""
76
+ return pprint.pformat(self.model_dump(by_alias=True))
77
+
78
+ def to_json(self) -> str:
79
+ """Returns the JSON representation of the model using alias"""
80
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
81
+ return json.dumps(self.to_dict())
82
+
83
+ @classmethod
84
+ def from_json(cls, json_str: str) -> Optional[Self]:
85
+ """Create an instance of IntakeUserResponse from a JSON string"""
86
+ return cls.from_dict(json.loads(json_str))
87
+
88
+ def to_dict(self) -> Dict[str, Any]:
89
+ """Return the dictionary representation of the model using alias.
90
+
91
+ This has the following differences from calling pydantic's
92
+ `self.model_dump(by_alias=True)`:
93
+
94
+ * `None` is only added to the output dict for nullable fields that
95
+ were set at model initialization. Other fields with value `None`
96
+ are ignored.
97
+ """
98
+ excluded_fields: Set[str] = set([])
99
+
100
+ _dict = self.model_dump(
101
+ by_alias=True,
102
+ exclude=excluded_fields,
103
+ exclude_none=True,
104
+ )
105
+ # override the default output from pydantic by calling `to_dict()` of client_config
106
+ if self.client_config:
107
+ _dict["clientConfig"] = self.client_config.to_dict()
108
+ # set to None if labels (nullable) is None
109
+ # and model_fields_set contains the field
110
+ if self.labels is None and "labels" in self.model_fields_set:
111
+ _dict["labels"] = None
112
+
113
+ return _dict
114
+
115
+ @classmethod
116
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
117
+ """Create an instance of IntakeUserResponse from a dict"""
118
+ if obj is None:
119
+ return None
120
+
121
+ if not isinstance(obj, dict):
122
+ return cls.model_validate(obj)
123
+
124
+ _obj = cls.model_validate(
125
+ {
126
+ "clientConfig": (
127
+ ClientConfig.from_dict(obj["clientConfig"]) if obj.get("clientConfig") is not None else None
128
+ ),
129
+ "create_time": obj.get("create_time"),
130
+ "description": obj.get("description"),
131
+ "displayName": obj.get("displayName"),
132
+ "id": obj.get("id"),
133
+ "labels": obj.get("labels"),
134
+ "state": obj.get("state"),
135
+ "type": obj.get("type") if obj.get("type") is not None else UserType.INTAKE,
136
+ "user": obj.get("user"),
137
+ }
138
+ )
139
+ return _obj