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,102 @@
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, StrictStr
21
+ from typing_extensions import Self
22
+
23
+ from stackit.intake.models.intake_runner_response import IntakeRunnerResponse
24
+
25
+
26
+ class ListIntakeRunnersResponse(BaseModel):
27
+ """
28
+ ListIntakeRunnersResponse
29
+ """ # noqa: E501
30
+
31
+ intake_runners: List[IntakeRunnerResponse] = Field(alias="intakeRunners")
32
+ next_page_token: Optional[StrictStr] = Field(
33
+ default=None, description="A token to retrieve the next page of results.", alias="nextPageToken"
34
+ )
35
+ __properties: ClassVar[List[str]] = ["intakeRunners", "nextPageToken"]
36
+
37
+ model_config = ConfigDict(
38
+ populate_by_name=True,
39
+ validate_assignment=True,
40
+ protected_namespaces=(),
41
+ )
42
+
43
+ def to_str(self) -> str:
44
+ """Returns the string representation of the model using alias"""
45
+ return pprint.pformat(self.model_dump(by_alias=True))
46
+
47
+ def to_json(self) -> str:
48
+ """Returns the JSON representation of the model using alias"""
49
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
50
+ return json.dumps(self.to_dict())
51
+
52
+ @classmethod
53
+ def from_json(cls, json_str: str) -> Optional[Self]:
54
+ """Create an instance of ListIntakeRunnersResponse 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
+ # override the default output from pydantic by calling `to_dict()` of each item in intake_runners (list)
75
+ _items = []
76
+ if self.intake_runners:
77
+ for _item in self.intake_runners:
78
+ if _item:
79
+ _items.append(_item.to_dict())
80
+ _dict["intakeRunners"] = _items
81
+ return _dict
82
+
83
+ @classmethod
84
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
85
+ """Create an instance of ListIntakeRunnersResponse from a dict"""
86
+ if obj is None:
87
+ return None
88
+
89
+ if not isinstance(obj, dict):
90
+ return cls.model_validate(obj)
91
+
92
+ _obj = cls.model_validate(
93
+ {
94
+ "intakeRunners": (
95
+ [IntakeRunnerResponse.from_dict(_item) for _item in obj["intakeRunners"]]
96
+ if obj.get("intakeRunners") is not None
97
+ else None
98
+ ),
99
+ "nextPageToken": obj.get("nextPageToken"),
100
+ }
101
+ )
102
+ return _obj
@@ -0,0 +1,102 @@
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, StrictStr
21
+ from typing_extensions import Self
22
+
23
+ from stackit.intake.models.intake_user_response import IntakeUserResponse
24
+
25
+
26
+ class ListIntakeUsersResponse(BaseModel):
27
+ """
28
+ ListIntakeUsersResponse
29
+ """ # noqa: E501
30
+
31
+ intake_users: List[IntakeUserResponse] = Field(alias="intakeUsers")
32
+ next_page_token: Optional[StrictStr] = Field(
33
+ default=None, description="A token to retrieve the next page of results.", alias="nextPageToken"
34
+ )
35
+ __properties: ClassVar[List[str]] = ["intakeUsers", "nextPageToken"]
36
+
37
+ model_config = ConfigDict(
38
+ populate_by_name=True,
39
+ validate_assignment=True,
40
+ protected_namespaces=(),
41
+ )
42
+
43
+ def to_str(self) -> str:
44
+ """Returns the string representation of the model using alias"""
45
+ return pprint.pformat(self.model_dump(by_alias=True))
46
+
47
+ def to_json(self) -> str:
48
+ """Returns the JSON representation of the model using alias"""
49
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
50
+ return json.dumps(self.to_dict())
51
+
52
+ @classmethod
53
+ def from_json(cls, json_str: str) -> Optional[Self]:
54
+ """Create an instance of ListIntakeUsersResponse 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
+ # override the default output from pydantic by calling `to_dict()` of each item in intake_users (list)
75
+ _items = []
76
+ if self.intake_users:
77
+ for _item in self.intake_users:
78
+ if _item:
79
+ _items.append(_item.to_dict())
80
+ _dict["intakeUsers"] = _items
81
+ return _dict
82
+
83
+ @classmethod
84
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
85
+ """Create an instance of ListIntakeUsersResponse from a dict"""
86
+ if obj is None:
87
+ return None
88
+
89
+ if not isinstance(obj, dict):
90
+ return cls.model_validate(obj)
91
+
92
+ _obj = cls.model_validate(
93
+ {
94
+ "intakeUsers": (
95
+ [IntakeUserResponse.from_dict(_item) for _item in obj["intakeUsers"]]
96
+ if obj.get("intakeUsers") is not None
97
+ else None
98
+ ),
99
+ "nextPageToken": obj.get("nextPageToken"),
100
+ }
101
+ )
102
+ return _obj
@@ -0,0 +1,102 @@
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, StrictStr
21
+ from typing_extensions import Self
22
+
23
+ from stackit.intake.models.intake_response import IntakeResponse
24
+
25
+
26
+ class ListIntakesResponse(BaseModel):
27
+ """
28
+ ListIntakesResponse
29
+ """ # noqa: E501
30
+
31
+ intakes: List[IntakeResponse]
32
+ next_page_token: Optional[StrictStr] = Field(
33
+ default=None, description="A token to retrieve the next page of results.", alias="nextPageToken"
34
+ )
35
+ __properties: ClassVar[List[str]] = ["intakes", "nextPageToken"]
36
+
37
+ model_config = ConfigDict(
38
+ populate_by_name=True,
39
+ validate_assignment=True,
40
+ protected_namespaces=(),
41
+ )
42
+
43
+ def to_str(self) -> str:
44
+ """Returns the string representation of the model using alias"""
45
+ return pprint.pformat(self.model_dump(by_alias=True))
46
+
47
+ def to_json(self) -> str:
48
+ """Returns the JSON representation of the model using alias"""
49
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
50
+ return json.dumps(self.to_dict())
51
+
52
+ @classmethod
53
+ def from_json(cls, json_str: str) -> Optional[Self]:
54
+ """Create an instance of ListIntakesResponse 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
+ # override the default output from pydantic by calling `to_dict()` of each item in intakes (list)
75
+ _items = []
76
+ if self.intakes:
77
+ for _item in self.intakes:
78
+ if _item:
79
+ _items.append(_item.to_dict())
80
+ _dict["intakes"] = _items
81
+ return _dict
82
+
83
+ @classmethod
84
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
85
+ """Create an instance of ListIntakesResponse from a dict"""
86
+ if obj is None:
87
+ return None
88
+
89
+ if not isinstance(obj, dict):
90
+ return cls.model_validate(obj)
91
+
92
+ _obj = cls.model_validate(
93
+ {
94
+ "intakes": (
95
+ [IntakeResponse.from_dict(_item) for _item in obj["intakes"]]
96
+ if obj.get("intakes") is not None
97
+ else None
98
+ ),
99
+ "nextPageToken": obj.get("nextPageToken"),
100
+ }
101
+ )
102
+ return _obj
@@ -0,0 +1,115 @@
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, StrictStr
21
+ from typing_extensions import Annotated, Self
22
+
23
+ from stackit.intake.models.intake_catalog_patch import IntakeCatalogPatch
24
+
25
+
26
+ class UpdateIntakePayload(BaseModel):
27
+ """
28
+ UpdateIntakePayload
29
+ """ # noqa: E501
30
+
31
+ catalog: Optional[IntakeCatalogPatch] = None
32
+ description: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = Field(
33
+ default=None,
34
+ description="The description is a longer text chosen by the user to provide more context for the resource.",
35
+ )
36
+ display_name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=32)]] = Field(
37
+ default=None,
38
+ description="The display name is a short name chosen by the user to identify the resource.",
39
+ alias="displayName",
40
+ )
41
+ intake_runner_id: StrictStr = Field(
42
+ description="The unique id of the intake runner this intake should run on.", alias="intakeRunnerId"
43
+ )
44
+ labels: Optional[Dict[str, StrictStr]] = Field(
45
+ default=None,
46
+ description="Labels are key-value pairs associated with the resource. To update labels: - Provide a new set of key-value pairs to replace the existing labels. - Send empty object `{}` to remove all labels. - Omit this field to leave the labels unchanged. ",
47
+ )
48
+ __properties: ClassVar[List[str]] = ["catalog", "description", "displayName", "intakeRunnerId", "labels"]
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 UpdateIntakePayload 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 catalog
88
+ if self.catalog:
89
+ _dict["catalog"] = self.catalog.to_dict()
90
+ # set to None if labels (nullable) is None
91
+ # and model_fields_set contains the field
92
+ if self.labels is None and "labels" in self.model_fields_set:
93
+ _dict["labels"] = None
94
+
95
+ return _dict
96
+
97
+ @classmethod
98
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
99
+ """Create an instance of UpdateIntakePayload from a dict"""
100
+ if obj is None:
101
+ return None
102
+
103
+ if not isinstance(obj, dict):
104
+ return cls.model_validate(obj)
105
+
106
+ _obj = cls.model_validate(
107
+ {
108
+ "catalog": IntakeCatalogPatch.from_dict(obj["catalog"]) if obj.get("catalog") is not None else None,
109
+ "description": obj.get("description"),
110
+ "displayName": obj.get("displayName"),
111
+ "intakeRunnerId": obj.get("intakeRunnerId"),
112
+ "labels": obj.get("labels"),
113
+ }
114
+ )
115
+ return _obj
@@ -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, StrictInt, StrictStr
21
+ from typing_extensions import Annotated, Self
22
+
23
+
24
+ class UpdateIntakeRunnerPayload(BaseModel):
25
+ """
26
+ UpdateIntakeRunnerPayload
27
+ """ # noqa: E501
28
+
29
+ description: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = Field(
30
+ default=None,
31
+ description="The description is a longer text chosen by the user to provide more context for the resource.",
32
+ )
33
+ display_name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=32)]] = Field(
34
+ default=None,
35
+ description="The display name is a short name chosen by the user to identify the resource.",
36
+ alias="displayName",
37
+ )
38
+ labels: Optional[Dict[str, StrictStr]] = Field(
39
+ default=None,
40
+ description="Labels are key-value pairs associated with the resource. To update labels: - Provide a new set of key-value pairs to replace the existing labels. - Send empty object `{}` to remove all labels. - Omit this field to leave the labels unchanged. ",
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
+ __properties: ClassVar[List[str]] = [
49
+ "description",
50
+ "displayName",
51
+ "labels",
52
+ "maxMessageSizeKiB",
53
+ "maxMessagesPerHour",
54
+ ]
55
+
56
+ model_config = ConfigDict(
57
+ populate_by_name=True,
58
+ validate_assignment=True,
59
+ protected_namespaces=(),
60
+ )
61
+
62
+ def to_str(self) -> str:
63
+ """Returns the string representation of the model using alias"""
64
+ return pprint.pformat(self.model_dump(by_alias=True))
65
+
66
+ def to_json(self) -> str:
67
+ """Returns the JSON representation of the model using alias"""
68
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
69
+ return json.dumps(self.to_dict())
70
+
71
+ @classmethod
72
+ def from_json(cls, json_str: str) -> Optional[Self]:
73
+ """Create an instance of UpdateIntakeRunnerPayload from a JSON string"""
74
+ return cls.from_dict(json.loads(json_str))
75
+
76
+ def to_dict(self) -> Dict[str, Any]:
77
+ """Return the dictionary representation of the model using alias.
78
+
79
+ This has the following differences from calling pydantic's
80
+ `self.model_dump(by_alias=True)`:
81
+
82
+ * `None` is only added to the output dict for nullable fields that
83
+ were set at model initialization. Other fields with value `None`
84
+ are ignored.
85
+ """
86
+ excluded_fields: Set[str] = set([])
87
+
88
+ _dict = self.model_dump(
89
+ by_alias=True,
90
+ exclude=excluded_fields,
91
+ exclude_none=True,
92
+ )
93
+ # set to None if labels (nullable) is None
94
+ # and model_fields_set contains the field
95
+ if self.labels is None and "labels" in self.model_fields_set:
96
+ _dict["labels"] = None
97
+
98
+ return _dict
99
+
100
+ @classmethod
101
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
102
+ """Create an instance of UpdateIntakeRunnerPayload from a dict"""
103
+ if obj is None:
104
+ return None
105
+
106
+ if not isinstance(obj, dict):
107
+ return cls.model_validate(obj)
108
+
109
+ _obj = cls.model_validate(
110
+ {
111
+ "description": obj.get("description"),
112
+ "displayName": obj.get("displayName"),
113
+ "labels": obj.get("labels"),
114
+ "maxMessageSizeKiB": obj.get("maxMessageSizeKiB"),
115
+ "maxMessagesPerHour": obj.get("maxMessagesPerHour"),
116
+ }
117
+ )
118
+ return _obj
@@ -0,0 +1,112 @@
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, StrictStr
21
+ from typing_extensions import Annotated, Self
22
+
23
+ from stackit.intake.models.user_type import UserType
24
+
25
+
26
+ class UpdateIntakeUserPayload(BaseModel):
27
+ """
28
+ UpdateIntakeUserPayload
29
+ """ # noqa: E501
30
+
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: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=32)]] = Field(
36
+ default=None,
37
+ description="The display name is a short name chosen by the user to identify the resource.",
38
+ alias="displayName",
39
+ )
40
+ labels: Optional[Dict[str, StrictStr]] = Field(
41
+ default=None,
42
+ description="Labels are key-value pairs associated with the resource. To update labels: - Provide a new set of key-value pairs to replace the existing labels. - Send empty object `{}` to remove all labels. - Omit this field to leave the labels unchanged. ",
43
+ )
44
+ password: Optional[Annotated[str, Field(strict=True, max_length=128)]] = Field(
45
+ default=None, description="A password chosen by the user."
46
+ )
47
+ type: Optional[UserType] = UserType.INTAKE
48
+ __properties: ClassVar[List[str]] = ["description", "displayName", "labels", "password", "type"]
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 UpdateIntakeUserPayload 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
+ # set to None if labels (nullable) is None
88
+ # and model_fields_set contains the field
89
+ if self.labels is None and "labels" in self.model_fields_set:
90
+ _dict["labels"] = None
91
+
92
+ return _dict
93
+
94
+ @classmethod
95
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
96
+ """Create an instance of UpdateIntakeUserPayload from a dict"""
97
+ if obj is None:
98
+ return None
99
+
100
+ if not isinstance(obj, dict):
101
+ return cls.model_validate(obj)
102
+
103
+ _obj = cls.model_validate(
104
+ {
105
+ "description": obj.get("description"),
106
+ "displayName": obj.get("displayName"),
107
+ "labels": obj.get("labels"),
108
+ "password": obj.get("password"),
109
+ "type": obj.get("type") if obj.get("type") is not None else UserType.INTAKE,
110
+ }
111
+ )
112
+ return _obj
@@ -0,0 +1,36 @@
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
+ from enum import Enum
18
+
19
+ from typing_extensions import Self
20
+
21
+
22
+ class UserType(str, Enum):
23
+ """
24
+ Type of user, 'intake' allows writing to the Intake, 'dead-letter' allows reading from the dead-letter queue
25
+ """
26
+
27
+ """
28
+ allowed enum values
29
+ """
30
+ INTAKE = "intake"
31
+ DEAD_MINUS_LETTER = "dead-letter"
32
+
33
+ @classmethod
34
+ def from_json(cls, json_str: str) -> Self:
35
+ """Create an instance of UserType from a JSON string"""
36
+ return cls(json.loads(json_str))
File without changes