stackit-telemetryrouter 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.
- src/stackit/telemetryrouter/__init__.py +151 -0
- src/stackit/telemetryrouter/api/__init__.py +4 -0
- src/stackit/telemetryrouter/api/default_api.py +4511 -0
- src/stackit/telemetryrouter/api_client.py +652 -0
- src/stackit/telemetryrouter/api_response.py +23 -0
- src/stackit/telemetryrouter/configuration.py +163 -0
- src/stackit/telemetryrouter/exceptions.py +217 -0
- src/stackit/telemetryrouter/models/__init__.py +80 -0
- src/stackit/telemetryrouter/models/access_token_base_request.py +105 -0
- src/stackit/telemetryrouter/models/access_token_base_response.py +138 -0
- src/stackit/telemetryrouter/models/config_filter.py +100 -0
- src/stackit/telemetryrouter/models/config_filter_attributes.py +96 -0
- src/stackit/telemetryrouter/models/config_filter_level.py +37 -0
- src/stackit/telemetryrouter/models/config_filter_matcher.py +36 -0
- src/stackit/telemetryrouter/models/create_access_token_payload.py +105 -0
- src/stackit/telemetryrouter/models/create_access_token_response.py +148 -0
- src/stackit/telemetryrouter/models/create_destination_payload.py +107 -0
- src/stackit/telemetryrouter/models/create_telemetry_router_payload.py +107 -0
- src/stackit/telemetryrouter/models/destination_config.py +111 -0
- src/stackit/telemetryrouter/models/destination_config_open_telemetry.py +102 -0
- src/stackit/telemetryrouter/models/destination_config_open_telemetry_basic_auth.py +82 -0
- src/stackit/telemetryrouter/models/destination_config_s3.py +102 -0
- src/stackit/telemetryrouter/models/destination_config_s3_access_key.py +82 -0
- src/stackit/telemetryrouter/models/destination_config_type.py +36 -0
- src/stackit/telemetryrouter/models/destination_response.py +152 -0
- src/stackit/telemetryrouter/models/get_access_token_response.py +138 -0
- src/stackit/telemetryrouter/models/list_access_tokens_response.py +104 -0
- src/stackit/telemetryrouter/models/list_destinations_response.py +102 -0
- src/stackit/telemetryrouter/models/list_telemetry_routers_response.py +104 -0
- src/stackit/telemetryrouter/models/response4xx.py +81 -0
- src/stackit/telemetryrouter/models/telemetry_router_response.py +137 -0
- src/stackit/telemetryrouter/models/update_access_token_payload.py +105 -0
- src/stackit/telemetryrouter/models/update_access_token_response.py +138 -0
- src/stackit/telemetryrouter/models/update_destination_payload.py +112 -0
- src/stackit/telemetryrouter/models/update_telemetry_router_payload.py +112 -0
- src/stackit/telemetryrouter/py.typed +0 -0
- src/stackit/telemetryrouter/rest.py +164 -0
- stackit_telemetryrouter-0.1.0.dist-info/METADATA +48 -0
- stackit_telemetryrouter-0.1.0.dist-info/RECORD +42 -0
- stackit_telemetryrouter-0.1.0.dist-info/WHEEL +4 -0
- stackit_telemetryrouter-0.1.0.dist-info/licenses/LICENSE.md +201 -0
- stackit_telemetryrouter-0.1.0.dist-info/licenses/NOTICE.txt +2 -0
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
STACKIT Telemetry Router API
|
|
5
|
+
|
|
6
|
+
This API provides endpoints for managing Telemetry Routers.
|
|
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 typing_extensions import Annotated, Self
|
|
23
|
+
|
|
24
|
+
from stackit.telemetryrouter.models.destination_config import DestinationConfig
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class CreateDestinationPayload(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
CreateDestinationPayload
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
|
|
32
|
+
config: DestinationConfig
|
|
33
|
+
description: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = Field(
|
|
34
|
+
default=None,
|
|
35
|
+
description="The description is a longer text chosen by the user to provide more context for the resource.",
|
|
36
|
+
)
|
|
37
|
+
display_name: Annotated[str, Field(min_length=1, strict=True, max_length=32)] = Field(
|
|
38
|
+
description="The display name is a short name chosen by the user to identify the resource.", alias="displayName"
|
|
39
|
+
)
|
|
40
|
+
__properties: ClassVar[List[str]] = ["config", "description", "displayName"]
|
|
41
|
+
|
|
42
|
+
@field_validator("display_name")
|
|
43
|
+
def display_name_validate_regular_expression(cls, value):
|
|
44
|
+
"""Validates the regular expression"""
|
|
45
|
+
if not re.match(r"^[a-zA-Z0-9][a-zA-Z0-9 \-]*$", value):
|
|
46
|
+
raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9][a-zA-Z0-9 \-]*$/")
|
|
47
|
+
return value
|
|
48
|
+
|
|
49
|
+
model_config = ConfigDict(
|
|
50
|
+
populate_by_name=True,
|
|
51
|
+
validate_assignment=True,
|
|
52
|
+
protected_namespaces=(),
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
def to_str(self) -> str:
|
|
56
|
+
"""Returns the string representation of the model using alias"""
|
|
57
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
58
|
+
|
|
59
|
+
def to_json(self) -> str:
|
|
60
|
+
"""Returns the JSON representation of the model using alias"""
|
|
61
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
62
|
+
return json.dumps(self.to_dict())
|
|
63
|
+
|
|
64
|
+
@classmethod
|
|
65
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
66
|
+
"""Create an instance of CreateDestinationPayload from a JSON string"""
|
|
67
|
+
return cls.from_dict(json.loads(json_str))
|
|
68
|
+
|
|
69
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
70
|
+
"""Return the dictionary representation of the model using alias.
|
|
71
|
+
|
|
72
|
+
This has the following differences from calling pydantic's
|
|
73
|
+
`self.model_dump(by_alias=True)`:
|
|
74
|
+
|
|
75
|
+
* `None` is only added to the output dict for nullable fields that
|
|
76
|
+
were set at model initialization. Other fields with value `None`
|
|
77
|
+
are ignored.
|
|
78
|
+
"""
|
|
79
|
+
excluded_fields: Set[str] = set([])
|
|
80
|
+
|
|
81
|
+
_dict = self.model_dump(
|
|
82
|
+
by_alias=True,
|
|
83
|
+
exclude=excluded_fields,
|
|
84
|
+
exclude_none=True,
|
|
85
|
+
)
|
|
86
|
+
# override the default output from pydantic by calling `to_dict()` of config
|
|
87
|
+
if self.config:
|
|
88
|
+
_dict["config"] = self.config.to_dict()
|
|
89
|
+
return _dict
|
|
90
|
+
|
|
91
|
+
@classmethod
|
|
92
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
93
|
+
"""Create an instance of CreateDestinationPayload from a dict"""
|
|
94
|
+
if obj is None:
|
|
95
|
+
return None
|
|
96
|
+
|
|
97
|
+
if not isinstance(obj, dict):
|
|
98
|
+
return cls.model_validate(obj)
|
|
99
|
+
|
|
100
|
+
_obj = cls.model_validate(
|
|
101
|
+
{
|
|
102
|
+
"config": DestinationConfig.from_dict(obj["config"]) if obj.get("config") is not None else None,
|
|
103
|
+
"description": obj.get("description"),
|
|
104
|
+
"displayName": obj.get("displayName"),
|
|
105
|
+
}
|
|
106
|
+
)
|
|
107
|
+
return _obj
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
STACKIT Telemetry Router API
|
|
5
|
+
|
|
6
|
+
This API provides endpoints for managing Telemetry Routers.
|
|
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 typing_extensions import Annotated, Self
|
|
23
|
+
|
|
24
|
+
from stackit.telemetryrouter.models.config_filter import ConfigFilter
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class CreateTelemetryRouterPayload(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
CreateTelemetryRouterPayload
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
|
|
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
|
+
filter: Optional[ConfigFilter] = None
|
|
40
|
+
__properties: ClassVar[List[str]] = ["description", "displayName", "filter"]
|
|
41
|
+
|
|
42
|
+
@field_validator("display_name")
|
|
43
|
+
def display_name_validate_regular_expression(cls, value):
|
|
44
|
+
"""Validates the regular expression"""
|
|
45
|
+
if not re.match(r"^[a-zA-Z0-9][a-zA-Z0-9 \-]*$", value):
|
|
46
|
+
raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9][a-zA-Z0-9 \-]*$/")
|
|
47
|
+
return value
|
|
48
|
+
|
|
49
|
+
model_config = ConfigDict(
|
|
50
|
+
populate_by_name=True,
|
|
51
|
+
validate_assignment=True,
|
|
52
|
+
protected_namespaces=(),
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
def to_str(self) -> str:
|
|
56
|
+
"""Returns the string representation of the model using alias"""
|
|
57
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
58
|
+
|
|
59
|
+
def to_json(self) -> str:
|
|
60
|
+
"""Returns the JSON representation of the model using alias"""
|
|
61
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
62
|
+
return json.dumps(self.to_dict())
|
|
63
|
+
|
|
64
|
+
@classmethod
|
|
65
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
66
|
+
"""Create an instance of CreateTelemetryRouterPayload from a JSON string"""
|
|
67
|
+
return cls.from_dict(json.loads(json_str))
|
|
68
|
+
|
|
69
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
70
|
+
"""Return the dictionary representation of the model using alias.
|
|
71
|
+
|
|
72
|
+
This has the following differences from calling pydantic's
|
|
73
|
+
`self.model_dump(by_alias=True)`:
|
|
74
|
+
|
|
75
|
+
* `None` is only added to the output dict for nullable fields that
|
|
76
|
+
were set at model initialization. Other fields with value `None`
|
|
77
|
+
are ignored.
|
|
78
|
+
"""
|
|
79
|
+
excluded_fields: Set[str] = set([])
|
|
80
|
+
|
|
81
|
+
_dict = self.model_dump(
|
|
82
|
+
by_alias=True,
|
|
83
|
+
exclude=excluded_fields,
|
|
84
|
+
exclude_none=True,
|
|
85
|
+
)
|
|
86
|
+
# override the default output from pydantic by calling `to_dict()` of filter
|
|
87
|
+
if self.filter:
|
|
88
|
+
_dict["filter"] = self.filter.to_dict()
|
|
89
|
+
return _dict
|
|
90
|
+
|
|
91
|
+
@classmethod
|
|
92
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
93
|
+
"""Create an instance of CreateTelemetryRouterPayload from a dict"""
|
|
94
|
+
if obj is None:
|
|
95
|
+
return None
|
|
96
|
+
|
|
97
|
+
if not isinstance(obj, dict):
|
|
98
|
+
return cls.model_validate(obj)
|
|
99
|
+
|
|
100
|
+
_obj = cls.model_validate(
|
|
101
|
+
{
|
|
102
|
+
"description": obj.get("description"),
|
|
103
|
+
"displayName": obj.get("displayName"),
|
|
104
|
+
"filter": ConfigFilter.from_dict(obj["filter"]) if obj.get("filter") is not None else None,
|
|
105
|
+
}
|
|
106
|
+
)
|
|
107
|
+
return _obj
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
STACKIT Telemetry Router API
|
|
5
|
+
|
|
6
|
+
This API provides endpoints for managing Telemetry Routers.
|
|
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 typing_extensions import Self
|
|
22
|
+
|
|
23
|
+
from stackit.telemetryrouter.models.config_filter import ConfigFilter
|
|
24
|
+
from stackit.telemetryrouter.models.destination_config_open_telemetry import (
|
|
25
|
+
DestinationConfigOpenTelemetry,
|
|
26
|
+
)
|
|
27
|
+
from stackit.telemetryrouter.models.destination_config_s3 import DestinationConfigS3
|
|
28
|
+
from stackit.telemetryrouter.models.destination_config_type import DestinationConfigType
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class DestinationConfig(BaseModel):
|
|
32
|
+
"""
|
|
33
|
+
DestinationConfig
|
|
34
|
+
""" # noqa: E501
|
|
35
|
+
|
|
36
|
+
config_type: DestinationConfigType = Field(alias="configType")
|
|
37
|
+
filter: Optional[ConfigFilter] = None
|
|
38
|
+
open_telemetry: Optional[DestinationConfigOpenTelemetry] = Field(default=None, alias="openTelemetry")
|
|
39
|
+
s3: Optional[DestinationConfigS3] = None
|
|
40
|
+
__properties: ClassVar[List[str]] = ["configType", "filter", "openTelemetry", "s3"]
|
|
41
|
+
|
|
42
|
+
model_config = ConfigDict(
|
|
43
|
+
populate_by_name=True,
|
|
44
|
+
validate_assignment=True,
|
|
45
|
+
protected_namespaces=(),
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
def to_str(self) -> str:
|
|
49
|
+
"""Returns the string representation of the model using alias"""
|
|
50
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
51
|
+
|
|
52
|
+
def to_json(self) -> str:
|
|
53
|
+
"""Returns the JSON representation of the model using alias"""
|
|
54
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
55
|
+
return json.dumps(self.to_dict())
|
|
56
|
+
|
|
57
|
+
@classmethod
|
|
58
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
59
|
+
"""Create an instance of DestinationConfig from a JSON string"""
|
|
60
|
+
return cls.from_dict(json.loads(json_str))
|
|
61
|
+
|
|
62
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
63
|
+
"""Return the dictionary representation of the model using alias.
|
|
64
|
+
|
|
65
|
+
This has the following differences from calling pydantic's
|
|
66
|
+
`self.model_dump(by_alias=True)`:
|
|
67
|
+
|
|
68
|
+
* `None` is only added to the output dict for nullable fields that
|
|
69
|
+
were set at model initialization. Other fields with value `None`
|
|
70
|
+
are ignored.
|
|
71
|
+
"""
|
|
72
|
+
excluded_fields: Set[str] = set([])
|
|
73
|
+
|
|
74
|
+
_dict = self.model_dump(
|
|
75
|
+
by_alias=True,
|
|
76
|
+
exclude=excluded_fields,
|
|
77
|
+
exclude_none=True,
|
|
78
|
+
)
|
|
79
|
+
# override the default output from pydantic by calling `to_dict()` of filter
|
|
80
|
+
if self.filter:
|
|
81
|
+
_dict["filter"] = self.filter.to_dict()
|
|
82
|
+
# override the default output from pydantic by calling `to_dict()` of open_telemetry
|
|
83
|
+
if self.open_telemetry:
|
|
84
|
+
_dict["openTelemetry"] = self.open_telemetry.to_dict()
|
|
85
|
+
# override the default output from pydantic by calling `to_dict()` of s3
|
|
86
|
+
if self.s3:
|
|
87
|
+
_dict["s3"] = self.s3.to_dict()
|
|
88
|
+
return _dict
|
|
89
|
+
|
|
90
|
+
@classmethod
|
|
91
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
92
|
+
"""Create an instance of DestinationConfig 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
|
+
"configType": obj.get("configType"),
|
|
102
|
+
"filter": ConfigFilter.from_dict(obj["filter"]) if obj.get("filter") is not None else None,
|
|
103
|
+
"openTelemetry": (
|
|
104
|
+
DestinationConfigOpenTelemetry.from_dict(obj["openTelemetry"])
|
|
105
|
+
if obj.get("openTelemetry") is not None
|
|
106
|
+
else None
|
|
107
|
+
),
|
|
108
|
+
"s3": DestinationConfigS3.from_dict(obj["s3"]) if obj.get("s3") is not None else None,
|
|
109
|
+
}
|
|
110
|
+
)
|
|
111
|
+
return _obj
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
STACKIT Telemetry Router API
|
|
5
|
+
|
|
6
|
+
This API provides endpoints for managing Telemetry Routers.
|
|
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 typing_extensions import Annotated, Self
|
|
22
|
+
|
|
23
|
+
from stackit.telemetryrouter.models.destination_config_open_telemetry_basic_auth import (
|
|
24
|
+
DestinationConfigOpenTelemetryBasicAuth,
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class DestinationConfigOpenTelemetry(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
DestinationConfigOpenTelemetry
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
|
|
33
|
+
basic_auth: Optional[DestinationConfigOpenTelemetryBasicAuth] = Field(default=None, alias="basicAuth")
|
|
34
|
+
bearer_token: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2048)]] = Field(
|
|
35
|
+
default=None, description="A bearer token to authenticate at the OpenTelemetry URI.", alias="bearerToken"
|
|
36
|
+
)
|
|
37
|
+
uri: Annotated[str, Field(strict=True, max_length=1024)] = Field(description="The URI for reaching the resource.")
|
|
38
|
+
__properties: ClassVar[List[str]] = ["basicAuth", "bearerToken", "uri"]
|
|
39
|
+
|
|
40
|
+
model_config = ConfigDict(
|
|
41
|
+
populate_by_name=True,
|
|
42
|
+
validate_assignment=True,
|
|
43
|
+
protected_namespaces=(),
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
def to_str(self) -> str:
|
|
47
|
+
"""Returns the string representation of the model using alias"""
|
|
48
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
49
|
+
|
|
50
|
+
def to_json(self) -> str:
|
|
51
|
+
"""Returns the JSON representation of the model using alias"""
|
|
52
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
53
|
+
return json.dumps(self.to_dict())
|
|
54
|
+
|
|
55
|
+
@classmethod
|
|
56
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
57
|
+
"""Create an instance of DestinationConfigOpenTelemetry from a JSON string"""
|
|
58
|
+
return cls.from_dict(json.loads(json_str))
|
|
59
|
+
|
|
60
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
61
|
+
"""Return the dictionary representation of the model using alias.
|
|
62
|
+
|
|
63
|
+
This has the following differences from calling pydantic's
|
|
64
|
+
`self.model_dump(by_alias=True)`:
|
|
65
|
+
|
|
66
|
+
* `None` is only added to the output dict for nullable fields that
|
|
67
|
+
were set at model initialization. Other fields with value `None`
|
|
68
|
+
are ignored.
|
|
69
|
+
"""
|
|
70
|
+
excluded_fields: Set[str] = set([])
|
|
71
|
+
|
|
72
|
+
_dict = self.model_dump(
|
|
73
|
+
by_alias=True,
|
|
74
|
+
exclude=excluded_fields,
|
|
75
|
+
exclude_none=True,
|
|
76
|
+
)
|
|
77
|
+
# override the default output from pydantic by calling `to_dict()` of basic_auth
|
|
78
|
+
if self.basic_auth:
|
|
79
|
+
_dict["basicAuth"] = self.basic_auth.to_dict()
|
|
80
|
+
return _dict
|
|
81
|
+
|
|
82
|
+
@classmethod
|
|
83
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
84
|
+
"""Create an instance of DestinationConfigOpenTelemetry from a dict"""
|
|
85
|
+
if obj is None:
|
|
86
|
+
return None
|
|
87
|
+
|
|
88
|
+
if not isinstance(obj, dict):
|
|
89
|
+
return cls.model_validate(obj)
|
|
90
|
+
|
|
91
|
+
_obj = cls.model_validate(
|
|
92
|
+
{
|
|
93
|
+
"basicAuth": (
|
|
94
|
+
DestinationConfigOpenTelemetryBasicAuth.from_dict(obj["basicAuth"])
|
|
95
|
+
if obj.get("basicAuth") is not None
|
|
96
|
+
else None
|
|
97
|
+
),
|
|
98
|
+
"bearerToken": obj.get("bearerToken"),
|
|
99
|
+
"uri": obj.get("uri"),
|
|
100
|
+
}
|
|
101
|
+
)
|
|
102
|
+
return _obj
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
STACKIT Telemetry Router API
|
|
5
|
+
|
|
6
|
+
This API provides endpoints for managing Telemetry Routers.
|
|
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 typing_extensions import Annotated, Self
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class DestinationConfigOpenTelemetryBasicAuth(BaseModel):
|
|
25
|
+
"""
|
|
26
|
+
Basic auth to authenticate at the OpenTelemetry URI
|
|
27
|
+
""" # noqa: E501
|
|
28
|
+
|
|
29
|
+
password: Annotated[str, Field(min_length=1, strict=True, max_length=1024)]
|
|
30
|
+
username: Annotated[str, Field(min_length=1, strict=True, max_length=1024)]
|
|
31
|
+
__properties: ClassVar[List[str]] = ["password", "username"]
|
|
32
|
+
|
|
33
|
+
model_config = ConfigDict(
|
|
34
|
+
populate_by_name=True,
|
|
35
|
+
validate_assignment=True,
|
|
36
|
+
protected_namespaces=(),
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
def to_str(self) -> str:
|
|
40
|
+
"""Returns the string representation of the model using alias"""
|
|
41
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
42
|
+
|
|
43
|
+
def to_json(self) -> str:
|
|
44
|
+
"""Returns the JSON representation of the model using alias"""
|
|
45
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
46
|
+
return json.dumps(self.to_dict())
|
|
47
|
+
|
|
48
|
+
@classmethod
|
|
49
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
50
|
+
"""Create an instance of DestinationConfigOpenTelemetryBasicAuth 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 DestinationConfigOpenTelemetryBasicAuth 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({"password": obj.get("password"), "username": obj.get("username")})
|
|
82
|
+
return _obj
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
STACKIT Telemetry Router API
|
|
5
|
+
|
|
6
|
+
This API provides endpoints for managing Telemetry Routers.
|
|
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 typing_extensions import Annotated, Self
|
|
22
|
+
|
|
23
|
+
from stackit.telemetryrouter.models.destination_config_s3_access_key import (
|
|
24
|
+
DestinationConfigS3AccessKey,
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class DestinationConfigS3(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
DestinationConfigS3
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
|
|
33
|
+
access_key: Optional[DestinationConfigS3AccessKey] = Field(default=None, alias="accessKey")
|
|
34
|
+
bucket: Annotated[str, Field(min_length=3, strict=True, max_length=63)]
|
|
35
|
+
endpoint: Annotated[str, Field(strict=True, max_length=1024)] = Field(
|
|
36
|
+
description="The URI for reaching the resource."
|
|
37
|
+
)
|
|
38
|
+
__properties: ClassVar[List[str]] = ["accessKey", "bucket", "endpoint"]
|
|
39
|
+
|
|
40
|
+
model_config = ConfigDict(
|
|
41
|
+
populate_by_name=True,
|
|
42
|
+
validate_assignment=True,
|
|
43
|
+
protected_namespaces=(),
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
def to_str(self) -> str:
|
|
47
|
+
"""Returns the string representation of the model using alias"""
|
|
48
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
49
|
+
|
|
50
|
+
def to_json(self) -> str:
|
|
51
|
+
"""Returns the JSON representation of the model using alias"""
|
|
52
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
53
|
+
return json.dumps(self.to_dict())
|
|
54
|
+
|
|
55
|
+
@classmethod
|
|
56
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
57
|
+
"""Create an instance of DestinationConfigS3 from a JSON string"""
|
|
58
|
+
return cls.from_dict(json.loads(json_str))
|
|
59
|
+
|
|
60
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
61
|
+
"""Return the dictionary representation of the model using alias.
|
|
62
|
+
|
|
63
|
+
This has the following differences from calling pydantic's
|
|
64
|
+
`self.model_dump(by_alias=True)`:
|
|
65
|
+
|
|
66
|
+
* `None` is only added to the output dict for nullable fields that
|
|
67
|
+
were set at model initialization. Other fields with value `None`
|
|
68
|
+
are ignored.
|
|
69
|
+
"""
|
|
70
|
+
excluded_fields: Set[str] = set([])
|
|
71
|
+
|
|
72
|
+
_dict = self.model_dump(
|
|
73
|
+
by_alias=True,
|
|
74
|
+
exclude=excluded_fields,
|
|
75
|
+
exclude_none=True,
|
|
76
|
+
)
|
|
77
|
+
# override the default output from pydantic by calling `to_dict()` of access_key
|
|
78
|
+
if self.access_key:
|
|
79
|
+
_dict["accessKey"] = self.access_key.to_dict()
|
|
80
|
+
return _dict
|
|
81
|
+
|
|
82
|
+
@classmethod
|
|
83
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
84
|
+
"""Create an instance of DestinationConfigS3 from a dict"""
|
|
85
|
+
if obj is None:
|
|
86
|
+
return None
|
|
87
|
+
|
|
88
|
+
if not isinstance(obj, dict):
|
|
89
|
+
return cls.model_validate(obj)
|
|
90
|
+
|
|
91
|
+
_obj = cls.model_validate(
|
|
92
|
+
{
|
|
93
|
+
"accessKey": (
|
|
94
|
+
DestinationConfigS3AccessKey.from_dict(obj["accessKey"])
|
|
95
|
+
if obj.get("accessKey") is not None
|
|
96
|
+
else None
|
|
97
|
+
),
|
|
98
|
+
"bucket": obj.get("bucket"),
|
|
99
|
+
"endpoint": obj.get("endpoint"),
|
|
100
|
+
}
|
|
101
|
+
)
|
|
102
|
+
return _obj
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
STACKIT Telemetry Router API
|
|
5
|
+
|
|
6
|
+
This API provides endpoints for managing Telemetry Routers.
|
|
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 typing_extensions import Annotated, Self
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class DestinationConfigS3AccessKey(BaseModel):
|
|
25
|
+
"""
|
|
26
|
+
The S3 access key
|
|
27
|
+
""" # noqa: E501
|
|
28
|
+
|
|
29
|
+
id: Annotated[str, Field(min_length=1, strict=True, max_length=1024)]
|
|
30
|
+
secret: Annotated[str, Field(min_length=1, strict=True, max_length=1024)]
|
|
31
|
+
__properties: ClassVar[List[str]] = ["id", "secret"]
|
|
32
|
+
|
|
33
|
+
model_config = ConfigDict(
|
|
34
|
+
populate_by_name=True,
|
|
35
|
+
validate_assignment=True,
|
|
36
|
+
protected_namespaces=(),
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
def to_str(self) -> str:
|
|
40
|
+
"""Returns the string representation of the model using alias"""
|
|
41
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
42
|
+
|
|
43
|
+
def to_json(self) -> str:
|
|
44
|
+
"""Returns the JSON representation of the model using alias"""
|
|
45
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
46
|
+
return json.dumps(self.to_dict())
|
|
47
|
+
|
|
48
|
+
@classmethod
|
|
49
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
50
|
+
"""Create an instance of DestinationConfigS3AccessKey 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 DestinationConfigS3AccessKey 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({"id": obj.get("id"), "secret": obj.get("secret")})
|
|
82
|
+
return _obj
|