stackit-telemetrylink 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 (24) hide show
  1. src/stackit/telemetrylink/__init__.py +81 -0
  2. src/stackit/telemetrylink/api/__init__.py +4 -0
  3. src/stackit/telemetrylink/api/default_api.py +3296 -0
  4. src/stackit/telemetrylink/api_client.py +650 -0
  5. src/stackit/telemetrylink/api_response.py +23 -0
  6. src/stackit/telemetrylink/configuration.py +163 -0
  7. src/stackit/telemetrylink/exceptions.py +217 -0
  8. src/stackit/telemetrylink/models/__init__.py +36 -0
  9. src/stackit/telemetrylink/models/create_or_update_folder_telemetry_link_payload.py +126 -0
  10. src/stackit/telemetrylink/models/create_or_update_organization_telemetry_link_payload.py +126 -0
  11. src/stackit/telemetrylink/models/create_or_update_project_telemetry_link_payload.py +126 -0
  12. src/stackit/telemetrylink/models/partial_update_folder_telemetry_link_payload.py +138 -0
  13. src/stackit/telemetrylink/models/partial_update_organization_telemetry_link_payload.py +138 -0
  14. src/stackit/telemetrylink/models/partial_update_project_telemetry_link_payload.py +138 -0
  15. src/stackit/telemetrylink/models/response4xx.py +82 -0
  16. src/stackit/telemetrylink/models/telemetry_link_request.py +138 -0
  17. src/stackit/telemetrylink/models/telemetry_link_response.py +158 -0
  18. src/stackit/telemetrylink/py.typed +0 -0
  19. src/stackit/telemetrylink/rest.py +164 -0
  20. stackit_telemetrylink-0.1.0.dist-info/METADATA +48 -0
  21. stackit_telemetrylink-0.1.0.dist-info/RECORD +24 -0
  22. stackit_telemetrylink-0.1.0.dist-info/WHEEL +4 -0
  23. stackit_telemetrylink-0.1.0.dist-info/licenses/LICENSE.md +201 -0
  24. stackit_telemetrylink-0.1.0.dist-info/licenses/NOTICE.txt +2 -0
@@ -0,0 +1,126 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT Telemetry Link API
5
+
6
+ This API provides endpoints for managing Telemetry Links. The Telemetry Link enables Log Routing towards a defined Telemetry Router.
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, StrictBool, field_validator
22
+ from pydantic_core import to_jsonable_python
23
+ from typing_extensions import Annotated, Self
24
+
25
+
26
+ class CreateOrUpdateProjectTelemetryLinkPayload(BaseModel):
27
+ """
28
+ CreateOrUpdateProjectTelemetryLinkPayload
29
+ """ # noqa: E501
30
+
31
+ access_token: Annotated[str, Field(strict=True)] = Field(description="The access token.", alias="accessToken")
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: Annotated[str, Field(min_length=1, strict=True, max_length=32)] = Field(
37
+ description="The display name is a short name chosen by the user to identify the resource.", alias="displayName"
38
+ )
39
+ enabled: StrictBool = Field(
40
+ description="Indicates whether routing through the link to a telemetry-router is active."
41
+ )
42
+ telemetry_router_id: Annotated[str, Field(strict=True, max_length=1024)] = Field(
43
+ description="The ID of the telemetry-router to route the telemetry data.", alias="telemetryRouterId"
44
+ )
45
+ __properties: ClassVar[List[str]] = ["accessToken", "description", "displayName", "enabled", "telemetryRouterId"]
46
+
47
+ @field_validator("access_token")
48
+ def access_token_validate_regular_expression(cls, value):
49
+ """Validates the regular expression"""
50
+ if not isinstance(value, str):
51
+ value = str(value)
52
+
53
+ if not re.match(r"^[A-Za-z0-9-_=]+\.[A-Za-z0-9-_=]+\.?[A-Za-z0-9-_.+\/=]*$", value):
54
+ raise ValueError(
55
+ r"must validate the regular expression /^[A-Za-z0-9-_=]+\.[A-Za-z0-9-_=]+\.?[A-Za-z0-9-_.+\/=]*$/"
56
+ )
57
+ return value
58
+
59
+ @field_validator("display_name")
60
+ def display_name_validate_regular_expression(cls, value):
61
+ """Validates the regular expression"""
62
+ if not isinstance(value, str):
63
+ value = str(value)
64
+
65
+ if not re.match(r"^[a-zA-Z0-9][a-zA-Z0-9 \-]*$", value):
66
+ raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9][a-zA-Z0-9 \-]*$/")
67
+ return value
68
+
69
+ model_config = ConfigDict(
70
+ validate_by_name=True,
71
+ validate_by_alias=True,
72
+ validate_assignment=True,
73
+ protected_namespaces=(),
74
+ )
75
+
76
+ def to_str(self) -> str:
77
+ """Returns the string representation of the model using alias"""
78
+ return pprint.pformat(self.model_dump(by_alias=True))
79
+
80
+ def to_json(self) -> str:
81
+ """Returns the JSON representation of the model using alias"""
82
+ return json.dumps(to_jsonable_python(self.to_dict()))
83
+
84
+ @classmethod
85
+ def from_json(cls, json_str: str) -> Optional[Self]:
86
+ """Create an instance of CreateOrUpdateProjectTelemetryLinkPayload 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
+ return _dict
107
+
108
+ @classmethod
109
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
110
+ """Create an instance of CreateOrUpdateProjectTelemetryLinkPayload from a dict"""
111
+ if obj is None:
112
+ return None
113
+
114
+ if not isinstance(obj, dict):
115
+ return cls.model_validate(obj)
116
+
117
+ _obj = cls.model_validate(
118
+ {
119
+ "accessToken": obj.get("accessToken"),
120
+ "description": obj.get("description"),
121
+ "displayName": obj.get("displayName"),
122
+ "enabled": obj.get("enabled") if obj.get("enabled") is not None else True,
123
+ "telemetryRouterId": obj.get("telemetryRouterId"),
124
+ }
125
+ )
126
+ return _obj
@@ -0,0 +1,138 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT Telemetry Link API
5
+
6
+ This API provides endpoints for managing Telemetry Links. The Telemetry Link enables Log Routing towards a defined Telemetry Router.
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, StrictBool, field_validator
22
+ from pydantic_core import to_jsonable_python
23
+ from typing_extensions import Annotated, Self
24
+
25
+
26
+ class PartialUpdateFolderTelemetryLinkPayload(BaseModel):
27
+ """
28
+ PartialUpdateFolderTelemetryLinkPayload
29
+ """ # noqa: E501
30
+
31
+ access_token: Optional[Annotated[str, Field(strict=True)]] = Field(
32
+ default=None, description="The access token.", alias="accessToken"
33
+ )
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: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=32)]] = Field(
39
+ default=None,
40
+ description="The display name is a short name chosen by the user to identify the resource.",
41
+ alias="displayName",
42
+ )
43
+ enabled: Optional[StrictBool] = Field(
44
+ default=True, description="Indicates whether routing through the link to a telemetry-router is active."
45
+ )
46
+ telemetry_router_id: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = Field(
47
+ default=None,
48
+ description="The ID of the telemetry-router to route the telemetry data.",
49
+ alias="telemetryRouterId",
50
+ )
51
+ __properties: ClassVar[List[str]] = ["accessToken", "description", "displayName", "enabled", "telemetryRouterId"]
52
+
53
+ @field_validator("access_token")
54
+ def access_token_validate_regular_expression(cls, value):
55
+ """Validates the regular expression"""
56
+ if value is None:
57
+ return value
58
+
59
+ if not isinstance(value, str):
60
+ value = str(value)
61
+
62
+ if not re.match(r"^[A-Za-z0-9-_=]+\.[A-Za-z0-9-_=]+\.?[A-Za-z0-9-_.+\/=]*$", value):
63
+ raise ValueError(
64
+ r"must validate the regular expression /^[A-Za-z0-9-_=]+\.[A-Za-z0-9-_=]+\.?[A-Za-z0-9-_.+\/=]*$/"
65
+ )
66
+ return value
67
+
68
+ @field_validator("display_name")
69
+ def display_name_validate_regular_expression(cls, value):
70
+ """Validates the regular expression"""
71
+ if value is None:
72
+ return value
73
+
74
+ if not isinstance(value, str):
75
+ value = str(value)
76
+
77
+ if not re.match(r"^[a-zA-Z0-9][a-zA-Z0-9 \-]*$", value):
78
+ raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9][a-zA-Z0-9 \-]*$/")
79
+ return value
80
+
81
+ model_config = ConfigDict(
82
+ validate_by_name=True,
83
+ validate_by_alias=True,
84
+ validate_assignment=True,
85
+ protected_namespaces=(),
86
+ )
87
+
88
+ def to_str(self) -> str:
89
+ """Returns the string representation of the model using alias"""
90
+ return pprint.pformat(self.model_dump(by_alias=True))
91
+
92
+ def to_json(self) -> str:
93
+ """Returns the JSON representation of the model using alias"""
94
+ return json.dumps(to_jsonable_python(self.to_dict()))
95
+
96
+ @classmethod
97
+ def from_json(cls, json_str: str) -> Optional[Self]:
98
+ """Create an instance of PartialUpdateFolderTelemetryLinkPayload from a JSON string"""
99
+ return cls.from_dict(json.loads(json_str))
100
+
101
+ def to_dict(self) -> Dict[str, Any]:
102
+ """Return the dictionary representation of the model using alias.
103
+
104
+ This has the following differences from calling pydantic's
105
+ `self.model_dump(by_alias=True)`:
106
+
107
+ * `None` is only added to the output dict for nullable fields that
108
+ were set at model initialization. Other fields with value `None`
109
+ are ignored.
110
+ """
111
+ excluded_fields: Set[str] = set([])
112
+
113
+ _dict = self.model_dump(
114
+ by_alias=True,
115
+ exclude=excluded_fields,
116
+ exclude_none=True,
117
+ )
118
+ return _dict
119
+
120
+ @classmethod
121
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
122
+ """Create an instance of PartialUpdateFolderTelemetryLinkPayload from a dict"""
123
+ if obj is None:
124
+ return None
125
+
126
+ if not isinstance(obj, dict):
127
+ return cls.model_validate(obj)
128
+
129
+ _obj = cls.model_validate(
130
+ {
131
+ "accessToken": obj.get("accessToken"),
132
+ "description": obj.get("description"),
133
+ "displayName": obj.get("displayName"),
134
+ "enabled": obj.get("enabled") if obj.get("enabled") is not None else True,
135
+ "telemetryRouterId": obj.get("telemetryRouterId"),
136
+ }
137
+ )
138
+ return _obj
@@ -0,0 +1,138 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT Telemetry Link API
5
+
6
+ This API provides endpoints for managing Telemetry Links. The Telemetry Link enables Log Routing towards a defined Telemetry Router.
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, StrictBool, field_validator
22
+ from pydantic_core import to_jsonable_python
23
+ from typing_extensions import Annotated, Self
24
+
25
+
26
+ class PartialUpdateOrganizationTelemetryLinkPayload(BaseModel):
27
+ """
28
+ PartialUpdateOrganizationTelemetryLinkPayload
29
+ """ # noqa: E501
30
+
31
+ access_token: Optional[Annotated[str, Field(strict=True)]] = Field(
32
+ default=None, description="The access token.", alias="accessToken"
33
+ )
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: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=32)]] = Field(
39
+ default=None,
40
+ description="The display name is a short name chosen by the user to identify the resource.",
41
+ alias="displayName",
42
+ )
43
+ enabled: Optional[StrictBool] = Field(
44
+ default=True, description="Indicates whether routing through the link to a telemetry-router is active."
45
+ )
46
+ telemetry_router_id: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = Field(
47
+ default=None,
48
+ description="The ID of the telemetry-router to route the telemetry data.",
49
+ alias="telemetryRouterId",
50
+ )
51
+ __properties: ClassVar[List[str]] = ["accessToken", "description", "displayName", "enabled", "telemetryRouterId"]
52
+
53
+ @field_validator("access_token")
54
+ def access_token_validate_regular_expression(cls, value):
55
+ """Validates the regular expression"""
56
+ if value is None:
57
+ return value
58
+
59
+ if not isinstance(value, str):
60
+ value = str(value)
61
+
62
+ if not re.match(r"^[A-Za-z0-9-_=]+\.[A-Za-z0-9-_=]+\.?[A-Za-z0-9-_.+\/=]*$", value):
63
+ raise ValueError(
64
+ r"must validate the regular expression /^[A-Za-z0-9-_=]+\.[A-Za-z0-9-_=]+\.?[A-Za-z0-9-_.+\/=]*$/"
65
+ )
66
+ return value
67
+
68
+ @field_validator("display_name")
69
+ def display_name_validate_regular_expression(cls, value):
70
+ """Validates the regular expression"""
71
+ if value is None:
72
+ return value
73
+
74
+ if not isinstance(value, str):
75
+ value = str(value)
76
+
77
+ if not re.match(r"^[a-zA-Z0-9][a-zA-Z0-9 \-]*$", value):
78
+ raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9][a-zA-Z0-9 \-]*$/")
79
+ return value
80
+
81
+ model_config = ConfigDict(
82
+ validate_by_name=True,
83
+ validate_by_alias=True,
84
+ validate_assignment=True,
85
+ protected_namespaces=(),
86
+ )
87
+
88
+ def to_str(self) -> str:
89
+ """Returns the string representation of the model using alias"""
90
+ return pprint.pformat(self.model_dump(by_alias=True))
91
+
92
+ def to_json(self) -> str:
93
+ """Returns the JSON representation of the model using alias"""
94
+ return json.dumps(to_jsonable_python(self.to_dict()))
95
+
96
+ @classmethod
97
+ def from_json(cls, json_str: str) -> Optional[Self]:
98
+ """Create an instance of PartialUpdateOrganizationTelemetryLinkPayload from a JSON string"""
99
+ return cls.from_dict(json.loads(json_str))
100
+
101
+ def to_dict(self) -> Dict[str, Any]:
102
+ """Return the dictionary representation of the model using alias.
103
+
104
+ This has the following differences from calling pydantic's
105
+ `self.model_dump(by_alias=True)`:
106
+
107
+ * `None` is only added to the output dict for nullable fields that
108
+ were set at model initialization. Other fields with value `None`
109
+ are ignored.
110
+ """
111
+ excluded_fields: Set[str] = set([])
112
+
113
+ _dict = self.model_dump(
114
+ by_alias=True,
115
+ exclude=excluded_fields,
116
+ exclude_none=True,
117
+ )
118
+ return _dict
119
+
120
+ @classmethod
121
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
122
+ """Create an instance of PartialUpdateOrganizationTelemetryLinkPayload from a dict"""
123
+ if obj is None:
124
+ return None
125
+
126
+ if not isinstance(obj, dict):
127
+ return cls.model_validate(obj)
128
+
129
+ _obj = cls.model_validate(
130
+ {
131
+ "accessToken": obj.get("accessToken"),
132
+ "description": obj.get("description"),
133
+ "displayName": obj.get("displayName"),
134
+ "enabled": obj.get("enabled") if obj.get("enabled") is not None else True,
135
+ "telemetryRouterId": obj.get("telemetryRouterId"),
136
+ }
137
+ )
138
+ return _obj
@@ -0,0 +1,138 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT Telemetry Link API
5
+
6
+ This API provides endpoints for managing Telemetry Links. The Telemetry Link enables Log Routing towards a defined Telemetry Router.
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, StrictBool, field_validator
22
+ from pydantic_core import to_jsonable_python
23
+ from typing_extensions import Annotated, Self
24
+
25
+
26
+ class PartialUpdateProjectTelemetryLinkPayload(BaseModel):
27
+ """
28
+ PartialUpdateProjectTelemetryLinkPayload
29
+ """ # noqa: E501
30
+
31
+ access_token: Optional[Annotated[str, Field(strict=True)]] = Field(
32
+ default=None, description="The access token.", alias="accessToken"
33
+ )
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: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=32)]] = Field(
39
+ default=None,
40
+ description="The display name is a short name chosen by the user to identify the resource.",
41
+ alias="displayName",
42
+ )
43
+ enabled: Optional[StrictBool] = Field(
44
+ default=True, description="Indicates whether routing through the link to a telemetry-router is active."
45
+ )
46
+ telemetry_router_id: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = Field(
47
+ default=None,
48
+ description="The ID of the telemetry-router to route the telemetry data.",
49
+ alias="telemetryRouterId",
50
+ )
51
+ __properties: ClassVar[List[str]] = ["accessToken", "description", "displayName", "enabled", "telemetryRouterId"]
52
+
53
+ @field_validator("access_token")
54
+ def access_token_validate_regular_expression(cls, value):
55
+ """Validates the regular expression"""
56
+ if value is None:
57
+ return value
58
+
59
+ if not isinstance(value, str):
60
+ value = str(value)
61
+
62
+ if not re.match(r"^[A-Za-z0-9-_=]+\.[A-Za-z0-9-_=]+\.?[A-Za-z0-9-_.+\/=]*$", value):
63
+ raise ValueError(
64
+ r"must validate the regular expression /^[A-Za-z0-9-_=]+\.[A-Za-z0-9-_=]+\.?[A-Za-z0-9-_.+\/=]*$/"
65
+ )
66
+ return value
67
+
68
+ @field_validator("display_name")
69
+ def display_name_validate_regular_expression(cls, value):
70
+ """Validates the regular expression"""
71
+ if value is None:
72
+ return value
73
+
74
+ if not isinstance(value, str):
75
+ value = str(value)
76
+
77
+ if not re.match(r"^[a-zA-Z0-9][a-zA-Z0-9 \-]*$", value):
78
+ raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9][a-zA-Z0-9 \-]*$/")
79
+ return value
80
+
81
+ model_config = ConfigDict(
82
+ validate_by_name=True,
83
+ validate_by_alias=True,
84
+ validate_assignment=True,
85
+ protected_namespaces=(),
86
+ )
87
+
88
+ def to_str(self) -> str:
89
+ """Returns the string representation of the model using alias"""
90
+ return pprint.pformat(self.model_dump(by_alias=True))
91
+
92
+ def to_json(self) -> str:
93
+ """Returns the JSON representation of the model using alias"""
94
+ return json.dumps(to_jsonable_python(self.to_dict()))
95
+
96
+ @classmethod
97
+ def from_json(cls, json_str: str) -> Optional[Self]:
98
+ """Create an instance of PartialUpdateProjectTelemetryLinkPayload from a JSON string"""
99
+ return cls.from_dict(json.loads(json_str))
100
+
101
+ def to_dict(self) -> Dict[str, Any]:
102
+ """Return the dictionary representation of the model using alias.
103
+
104
+ This has the following differences from calling pydantic's
105
+ `self.model_dump(by_alias=True)`:
106
+
107
+ * `None` is only added to the output dict for nullable fields that
108
+ were set at model initialization. Other fields with value `None`
109
+ are ignored.
110
+ """
111
+ excluded_fields: Set[str] = set([])
112
+
113
+ _dict = self.model_dump(
114
+ by_alias=True,
115
+ exclude=excluded_fields,
116
+ exclude_none=True,
117
+ )
118
+ return _dict
119
+
120
+ @classmethod
121
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
122
+ """Create an instance of PartialUpdateProjectTelemetryLinkPayload from a dict"""
123
+ if obj is None:
124
+ return None
125
+
126
+ if not isinstance(obj, dict):
127
+ return cls.model_validate(obj)
128
+
129
+ _obj = cls.model_validate(
130
+ {
131
+ "accessToken": obj.get("accessToken"),
132
+ "description": obj.get("description"),
133
+ "displayName": obj.get("displayName"),
134
+ "enabled": obj.get("enabled") if obj.get("enabled") is not None else True,
135
+ "telemetryRouterId": obj.get("telemetryRouterId"),
136
+ }
137
+ )
138
+ return _obj
@@ -0,0 +1,82 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT Telemetry Link API
5
+
6
+ This API provides endpoints for managing Telemetry Links. The Telemetry Link enables Log Routing towards a defined Telemetry Router.
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 Response4xx(BaseModel):
26
+ """
27
+ Response4xx
28
+ """ # noqa: E501
29
+
30
+ message: StrictStr = Field(description="A message containing the reason for failure")
31
+ __properties: ClassVar[List[str]] = ["message"]
32
+
33
+ model_config = ConfigDict(
34
+ validate_by_name=True,
35
+ validate_by_alias=True,
36
+ validate_assignment=True,
37
+ protected_namespaces=(),
38
+ )
39
+
40
+ def to_str(self) -> str:
41
+ """Returns the string representation of the model using alias"""
42
+ return pprint.pformat(self.model_dump(by_alias=True))
43
+
44
+ def to_json(self) -> str:
45
+ """Returns the JSON representation of the model using alias"""
46
+ return json.dumps(to_jsonable_python(self.to_dict()))
47
+
48
+ @classmethod
49
+ def from_json(cls, json_str: str) -> Optional[Self]:
50
+ """Create an instance of Response4xx 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
+ _dict = self.model_dump(
66
+ by_alias=True,
67
+ exclude=excluded_fields,
68
+ exclude_none=True,
69
+ )
70
+ return _dict
71
+
72
+ @classmethod
73
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
74
+ """Create an instance of Response4xx from a dict"""
75
+ if obj is None:
76
+ return None
77
+
78
+ if not isinstance(obj, dict):
79
+ return cls.model_validate(obj)
80
+
81
+ _obj = cls.model_validate({"message": obj.get("message")})
82
+ return _obj