Skip to content

Commit 9298d6d

Browse files
Generate telemetryrouter
1 parent 2b94af1 commit 9298d6d

13 files changed

Lines changed: 566 additions & 11 deletions
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
915f82be0b0f434901fcedc91fafe58b652035ef
1+
2d2d7b46e39cd236134d3b1963a68de0fe3b24fc

‎services/telemetryrouter/src/stackit/telemetryrouter/__init__.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
"ListAccessTokensResponse",
4949
"ListDestinationsResponse",
5050
"ListTelemetryRoutersResponse",
51+
"PartialUpdateTelemetryRouterPayload",
5152
"Response4xx",
5253
"TelemetryRouterResponse",
5354
"UpdateAccessTokenPayload",
@@ -132,6 +133,9 @@
132133
from stackit.telemetryrouter.models.list_telemetry_routers_response import (
133134
ListTelemetryRoutersResponse as ListTelemetryRoutersResponse,
134135
)
136+
from stackit.telemetryrouter.models.partial_update_telemetry_router_payload import (
137+
PartialUpdateTelemetryRouterPayload as PartialUpdateTelemetryRouterPayload,
138+
)
135139
from stackit.telemetryrouter.models.response4xx import Response4xx as Response4xx
136140
from stackit.telemetryrouter.models.telemetry_router_response import (
137141
TelemetryRouterResponse as TelemetryRouterResponse,

‎services/telemetryrouter/src/stackit/telemetryrouter/api/default_api.py‎

Lines changed: 297 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@
5252
from stackit.telemetryrouter.models.list_telemetry_routers_response import (
5353
ListTelemetryRoutersResponse,
5454
)
55+
from stackit.telemetryrouter.models.partial_update_telemetry_router_payload import (
56+
PartialUpdateTelemetryRouterPayload,
57+
)
5558
from stackit.telemetryrouter.models.telemetry_router_response import (
5659
TelemetryRouterResponse,
5760
)
@@ -3598,6 +3601,300 @@ def _list_telemetry_routers_serialize(
35983601
_request_auth=_request_auth,
35993602
)
36003603

3604+
@validate_call
3605+
def partial_update_telemetry_router(
3606+
self,
3607+
project_id: Annotated[UUID, Field(description="The STACKIT portal project UUID the resource is located in.")],
3608+
region_id: Annotated[StrictStr, Field(description="The STACKIT region name the resource is located in.")],
3609+
telemetry_router_id: Annotated[UUID, Field(description="The Telemetry Router UUID.")],
3610+
partial_update_telemetry_router_payload: PartialUpdateTelemetryRouterPayload,
3611+
_request_timeout: Union[
3612+
None,
3613+
Annotated[StrictFloat, Field(gt=0)],
3614+
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
3615+
] = None,
3616+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
3617+
_content_type: Optional[StrictStr] = None,
3618+
_headers: Optional[Dict[StrictStr, Any]] = None,
3619+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3620+
) -> TelemetryRouterResponse:
3621+
"""partial_update_telemetry_router
3622+
3623+
Patches the given Telemetry Router.
3624+
3625+
:param project_id: The STACKIT portal project UUID the resource is located in. (required)
3626+
:type project_id: UUID
3627+
:param region_id: The STACKIT region name the resource is located in. (required)
3628+
:type region_id: str
3629+
:param telemetry_router_id: The Telemetry Router UUID. (required)
3630+
:type telemetry_router_id: UUID
3631+
:param partial_update_telemetry_router_payload: (required)
3632+
:type partial_update_telemetry_router_payload: PartialUpdateTelemetryRouterPayload
3633+
:param _request_timeout: timeout setting for this request. If one
3634+
number provided, it will be total request
3635+
timeout. It can also be a pair (tuple) of
3636+
(connection, read) timeouts.
3637+
:type _request_timeout: int, tuple(int, int), optional
3638+
:param _request_auth: set to override the auth_settings for an a single
3639+
request; this effectively ignores the
3640+
authentication in the spec for a single request.
3641+
:type _request_auth: dict, optional
3642+
:param _content_type: force content-type for the request.
3643+
:type _content_type: str, Optional
3644+
:param _headers: set to override the headers for a single
3645+
request; this effectively ignores the headers
3646+
in the spec for a single request.
3647+
:type _headers: dict, optional
3648+
:param _host_index: set to override the host_index for a single
3649+
request; this effectively ignores the host_index
3650+
in the spec for a single request.
3651+
:type _host_index: int, optional
3652+
:return: Returns the result object.
3653+
""" # noqa: E501
3654+
3655+
_param = self._partial_update_telemetry_router_serialize(
3656+
project_id=project_id,
3657+
region_id=region_id,
3658+
telemetry_router_id=telemetry_router_id,
3659+
partial_update_telemetry_router_payload=partial_update_telemetry_router_payload,
3660+
_request_auth=_request_auth,
3661+
_content_type=_content_type,
3662+
_headers=_headers,
3663+
_host_index=_host_index,
3664+
)
3665+
3666+
_response_types_map: Dict[str, Optional[str]] = {
3667+
"200": "TelemetryRouterResponse",
3668+
"400": "Response4xx",
3669+
"401": "Response4xx",
3670+
"404": None,
3671+
"409": "Response4xx",
3672+
"500": None,
3673+
}
3674+
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
3675+
response_data.read()
3676+
return self.api_client.response_deserialize(
3677+
response_data=response_data,
3678+
response_types_map=_response_types_map,
3679+
).data
3680+
3681+
@validate_call
3682+
def partial_update_telemetry_router_with_http_info(
3683+
self,
3684+
project_id: Annotated[UUID, Field(description="The STACKIT portal project UUID the resource is located in.")],
3685+
region_id: Annotated[StrictStr, Field(description="The STACKIT region name the resource is located in.")],
3686+
telemetry_router_id: Annotated[UUID, Field(description="The Telemetry Router UUID.")],
3687+
partial_update_telemetry_router_payload: PartialUpdateTelemetryRouterPayload,
3688+
_request_timeout: Union[
3689+
None,
3690+
Annotated[StrictFloat, Field(gt=0)],
3691+
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
3692+
] = None,
3693+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
3694+
_content_type: Optional[StrictStr] = None,
3695+
_headers: Optional[Dict[StrictStr, Any]] = None,
3696+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3697+
) -> ApiResponse[TelemetryRouterResponse]:
3698+
"""partial_update_telemetry_router
3699+
3700+
Patches the given Telemetry Router.
3701+
3702+
:param project_id: The STACKIT portal project UUID the resource is located in. (required)
3703+
:type project_id: UUID
3704+
:param region_id: The STACKIT region name the resource is located in. (required)
3705+
:type region_id: str
3706+
:param telemetry_router_id: The Telemetry Router UUID. (required)
3707+
:type telemetry_router_id: UUID
3708+
:param partial_update_telemetry_router_payload: (required)
3709+
:type partial_update_telemetry_router_payload: PartialUpdateTelemetryRouterPayload
3710+
:param _request_timeout: timeout setting for this request. If one
3711+
number provided, it will be total request
3712+
timeout. It can also be a pair (tuple) of
3713+
(connection, read) timeouts.
3714+
:type _request_timeout: int, tuple(int, int), optional
3715+
:param _request_auth: set to override the auth_settings for an a single
3716+
request; this effectively ignores the
3717+
authentication in the spec for a single request.
3718+
:type _request_auth: dict, optional
3719+
:param _content_type: force content-type for the request.
3720+
:type _content_type: str, Optional
3721+
:param _headers: set to override the headers for a single
3722+
request; this effectively ignores the headers
3723+
in the spec for a single request.
3724+
:type _headers: dict, optional
3725+
:param _host_index: set to override the host_index for a single
3726+
request; this effectively ignores the host_index
3727+
in the spec for a single request.
3728+
:type _host_index: int, optional
3729+
:return: Returns the result object.
3730+
""" # noqa: E501
3731+
3732+
_param = self._partial_update_telemetry_router_serialize(
3733+
project_id=project_id,
3734+
region_id=region_id,
3735+
telemetry_router_id=telemetry_router_id,
3736+
partial_update_telemetry_router_payload=partial_update_telemetry_router_payload,
3737+
_request_auth=_request_auth,
3738+
_content_type=_content_type,
3739+
_headers=_headers,
3740+
_host_index=_host_index,
3741+
)
3742+
3743+
_response_types_map: Dict[str, Optional[str]] = {
3744+
"200": "TelemetryRouterResponse",
3745+
"400": "Response4xx",
3746+
"401": "Response4xx",
3747+
"404": None,
3748+
"409": "Response4xx",
3749+
"500": None,
3750+
}
3751+
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
3752+
response_data.read()
3753+
return self.api_client.response_deserialize(
3754+
response_data=response_data,
3755+
response_types_map=_response_types_map,
3756+
)
3757+
3758+
@validate_call
3759+
def partial_update_telemetry_router_without_preload_content(
3760+
self,
3761+
project_id: Annotated[UUID, Field(description="The STACKIT portal project UUID the resource is located in.")],
3762+
region_id: Annotated[StrictStr, Field(description="The STACKIT region name the resource is located in.")],
3763+
telemetry_router_id: Annotated[UUID, Field(description="The Telemetry Router UUID.")],
3764+
partial_update_telemetry_router_payload: PartialUpdateTelemetryRouterPayload,
3765+
_request_timeout: Union[
3766+
None,
3767+
Annotated[StrictFloat, Field(gt=0)],
3768+
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
3769+
] = None,
3770+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
3771+
_content_type: Optional[StrictStr] = None,
3772+
_headers: Optional[Dict[StrictStr, Any]] = None,
3773+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3774+
) -> RESTResponseType:
3775+
"""partial_update_telemetry_router
3776+
3777+
Patches the given Telemetry Router.
3778+
3779+
:param project_id: The STACKIT portal project UUID the resource is located in. (required)
3780+
:type project_id: UUID
3781+
:param region_id: The STACKIT region name the resource is located in. (required)
3782+
:type region_id: str
3783+
:param telemetry_router_id: The Telemetry Router UUID. (required)
3784+
:type telemetry_router_id: UUID
3785+
:param partial_update_telemetry_router_payload: (required)
3786+
:type partial_update_telemetry_router_payload: PartialUpdateTelemetryRouterPayload
3787+
:param _request_timeout: timeout setting for this request. If one
3788+
number provided, it will be total request
3789+
timeout. It can also be a pair (tuple) of
3790+
(connection, read) timeouts.
3791+
:type _request_timeout: int, tuple(int, int), optional
3792+
:param _request_auth: set to override the auth_settings for an a single
3793+
request; this effectively ignores the
3794+
authentication in the spec for a single request.
3795+
:type _request_auth: dict, optional
3796+
:param _content_type: force content-type for the request.
3797+
:type _content_type: str, Optional
3798+
:param _headers: set to override the headers for a single
3799+
request; this effectively ignores the headers
3800+
in the spec for a single request.
3801+
:type _headers: dict, optional
3802+
:param _host_index: set to override the host_index for a single
3803+
request; this effectively ignores the host_index
3804+
in the spec for a single request.
3805+
:type _host_index: int, optional
3806+
:return: Returns the result object.
3807+
""" # noqa: E501
3808+
3809+
_param = self._partial_update_telemetry_router_serialize(
3810+
project_id=project_id,
3811+
region_id=region_id,
3812+
telemetry_router_id=telemetry_router_id,
3813+
partial_update_telemetry_router_payload=partial_update_telemetry_router_payload,
3814+
_request_auth=_request_auth,
3815+
_content_type=_content_type,
3816+
_headers=_headers,
3817+
_host_index=_host_index,
3818+
)
3819+
3820+
_response_types_map: Dict[str, Optional[str]] = {
3821+
"200": "TelemetryRouterResponse",
3822+
"400": "Response4xx",
3823+
"401": "Response4xx",
3824+
"404": None,
3825+
"409": "Response4xx",
3826+
"500": None,
3827+
}
3828+
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
3829+
return response_data.response
3830+
3831+
def _partial_update_telemetry_router_serialize(
3832+
self,
3833+
project_id,
3834+
region_id,
3835+
telemetry_router_id,
3836+
partial_update_telemetry_router_payload,
3837+
_request_auth,
3838+
_content_type,
3839+
_headers,
3840+
_host_index,
3841+
) -> RequestSerialized:
3842+
3843+
_host = None
3844+
3845+
_collection_formats: Dict[str, str] = {}
3846+
3847+
_path_params: Dict[str, str] = {}
3848+
_query_params: List[Tuple[str, str]] = []
3849+
_header_params: Dict[str, Optional[str]] = _headers or {}
3850+
_form_params: List[Tuple[str, str]] = []
3851+
_files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
3852+
_body_params: Optional[bytes] = None
3853+
3854+
# process the path parameters
3855+
if project_id is not None:
3856+
_path_params["projectId"] = project_id
3857+
if region_id is not None:
3858+
_path_params["regionId"] = region_id
3859+
if telemetry_router_id is not None:
3860+
_path_params["telemetryRouterId"] = telemetry_router_id
3861+
# process the query parameters
3862+
# process the header parameters
3863+
# process the form parameters
3864+
# process the body parameter
3865+
if partial_update_telemetry_router_payload is not None:
3866+
_body_params = partial_update_telemetry_router_payload
3867+
3868+
# set the HTTP header `Accept`
3869+
if "Accept" not in _header_params:
3870+
_header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
3871+
3872+
# set the HTTP header `Content-Type`
3873+
if _content_type:
3874+
_header_params["Content-Type"] = _content_type
3875+
else:
3876+
_default_content_type = self.api_client.select_header_content_type(["application/json"])
3877+
if _default_content_type is not None:
3878+
_header_params["Content-Type"] = _default_content_type
3879+
3880+
# authentication setting
3881+
_auth_settings: List[str] = []
3882+
3883+
return self.api_client.param_serialize(
3884+
method="PATCH",
3885+
resource_path="/v1/projects/{projectId}/regions/{regionId}/telemetry-routers/{telemetryRouterId}",
3886+
path_params=_path_params,
3887+
query_params=_query_params,
3888+
header_params=_header_params,
3889+
body=_body_params,
3890+
post_params=_form_params,
3891+
files=_files,
3892+
auth_settings=_auth_settings,
3893+
collection_formats=_collection_formats,
3894+
_host=_host,
3895+
_request_auth=_request_auth,
3896+
)
3897+
36013898
@validate_call
36023899
def update_access_token(
36033900
self,

‎services/telemetryrouter/src/stackit/telemetryrouter/models/__init__.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@
6262
from stackit.telemetryrouter.models.list_telemetry_routers_response import (
6363
ListTelemetryRoutersResponse,
6464
)
65+
from stackit.telemetryrouter.models.partial_update_telemetry_router_payload import (
66+
PartialUpdateTelemetryRouterPayload,
67+
)
6568
from stackit.telemetryrouter.models.response4xx import Response4xx
6669
from stackit.telemetryrouter.models.telemetry_router_response import (
6770
TelemetryRouterResponse,

‎services/telemetryrouter/src/stackit/telemetryrouter/models/config_filter_attributes.py‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@
1515

1616
import json
1717
import pprint
18+
import re # noqa: F401
1819
from typing import Any, ClassVar, Dict, List, Optional, Set
1920

20-
from pydantic import BaseModel, ConfigDict, Field
21+
from pydantic import BaseModel, ConfigDict, Field, field_validator
2122
from pydantic_core import to_jsonable_python
2223
from typing_extensions import Annotated, Self
2324

@@ -38,6 +39,16 @@ class ConfigFilterAttributes(BaseModel):
3839
]
3940
__properties: ClassVar[List[str]] = ["key", "level", "matcher", "values"]
4041

42+
@field_validator("key")
43+
def key_validate_regular_expression(cls, value):
44+
"""Validates the regular expression"""
45+
if not isinstance(value, str):
46+
value = str(value)
47+
48+
if not re.match(r"^[^\0-\x1F\x7F-\x9F]+$", value):
49+
raise ValueError(r"must validate the regular expression /^[^\0-\x1F\x7F-\x9F]+$/")
50+
return value
51+
4152
model_config = ConfigDict(
4253
validate_by_name=True,
4354
validate_by_alias=True,

‎services/telemetryrouter/src/stackit/telemetryrouter/models/create_telemetry_router_payload.py‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import re # noqa: F401
1919
from typing import Any, ClassVar, Dict, List, Optional, Set
2020

21-
from pydantic import BaseModel, ConfigDict, Field, field_validator
21+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
2222
from pydantic_core import to_jsonable_python
2323
from typing_extensions import Annotated, Self
2424

@@ -38,7 +38,8 @@ class CreateTelemetryRouterPayload(BaseModel):
3838
description="The display name is a short name chosen by the user to identify the resource.", alias="displayName"
3939
)
4040
filter: Optional[ConfigFilter] = None
41-
__properties: ClassVar[List[str]] = ["description", "displayName", "filter"]
41+
resource_labels: Optional[Dict[str, StrictStr]] = Field(default=None, alias="resourceLabels")
42+
__properties: ClassVar[List[str]] = ["description", "displayName", "filter", "resourceLabels"]
4243

4344
@field_validator("description")
4445
def description_validate_regular_expression(cls, value):
@@ -119,6 +120,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
119120
"description": obj.get("description"),
120121
"displayName": obj.get("displayName"),
121122
"filter": ConfigFilter.from_dict(obj["filter"]) if obj.get("filter") is not None else None,
123+
"resourceLabels": obj.get("resourceLabels"),
122124
}
123125
)
124126
return _obj

0 commit comments

Comments
 (0)