Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion services/telemetryrouter/oas_commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
915f82be0b0f434901fcedc91fafe58b652035ef
ce85c358fa92fa2943b3914b05bf1d2059d1d9b6
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"ListAccessTokensResponse",
"ListDestinationsResponse",
"ListTelemetryRoutersResponse",
"PartialUpdateTelemetryRouterPayload",
"Response4xx",
"TelemetryRouterResponse",
"UpdateAccessTokenPayload",
Expand Down Expand Up @@ -132,6 +133,9 @@
from stackit.telemetryrouter.models.list_telemetry_routers_response import (
ListTelemetryRoutersResponse as ListTelemetryRoutersResponse,
)
from stackit.telemetryrouter.models.partial_update_telemetry_router_payload import (
PartialUpdateTelemetryRouterPayload as PartialUpdateTelemetryRouterPayload,
)
from stackit.telemetryrouter.models.response4xx import Response4xx as Response4xx
from stackit.telemetryrouter.models.telemetry_router_response import (
TelemetryRouterResponse as TelemetryRouterResponse,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@
from stackit.telemetryrouter.models.list_telemetry_routers_response import (
ListTelemetryRoutersResponse,
)
from stackit.telemetryrouter.models.partial_update_telemetry_router_payload import (
PartialUpdateTelemetryRouterPayload,
)
from stackit.telemetryrouter.models.telemetry_router_response import (
TelemetryRouterResponse,
)
Expand Down Expand Up @@ -3598,6 +3601,300 @@ def _list_telemetry_routers_serialize(
_request_auth=_request_auth,
)

@validate_call
def partial_update_telemetry_router(
self,
project_id: Annotated[UUID, Field(description="The STACKIT portal project UUID the resource is located in.")],
region_id: Annotated[StrictStr, Field(description="The STACKIT region name the resource is located in.")],
telemetry_router_id: Annotated[UUID, Field(description="The Telemetry Router UUID.")],
partial_update_telemetry_router_payload: PartialUpdateTelemetryRouterPayload,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> TelemetryRouterResponse:
"""partial_update_telemetry_router

Patches the given Telemetry Router.

:param project_id: The STACKIT portal project UUID the resource is located in. (required)
:type project_id: UUID
:param region_id: The STACKIT region name the resource is located in. (required)
:type region_id: str
:param telemetry_router_id: The Telemetry Router UUID. (required)
:type telemetry_router_id: UUID
:param partial_update_telemetry_router_payload: (required)
:type partial_update_telemetry_router_payload: PartialUpdateTelemetryRouterPayload
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501

_param = self._partial_update_telemetry_router_serialize(
project_id=project_id,
region_id=region_id,
telemetry_router_id=telemetry_router_id,
partial_update_telemetry_router_payload=partial_update_telemetry_router_payload,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index,
)

_response_types_map: Dict[str, Optional[str]] = {
"200": "TelemetryRouterResponse",
"400": "Response4xx",
"401": "Response4xx",
"404": None,
"409": "Response4xx",
"500": None,
}
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
response_data.read()
return self.api_client.response_deserialize(
response_data=response_data,
response_types_map=_response_types_map,
).data

@validate_call
def partial_update_telemetry_router_with_http_info(
self,
project_id: Annotated[UUID, Field(description="The STACKIT portal project UUID the resource is located in.")],
region_id: Annotated[StrictStr, Field(description="The STACKIT region name the resource is located in.")],
telemetry_router_id: Annotated[UUID, Field(description="The Telemetry Router UUID.")],
partial_update_telemetry_router_payload: PartialUpdateTelemetryRouterPayload,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> ApiResponse[TelemetryRouterResponse]:
"""partial_update_telemetry_router

Patches the given Telemetry Router.

:param project_id: The STACKIT portal project UUID the resource is located in. (required)
:type project_id: UUID
:param region_id: The STACKIT region name the resource is located in. (required)
:type region_id: str
:param telemetry_router_id: The Telemetry Router UUID. (required)
:type telemetry_router_id: UUID
:param partial_update_telemetry_router_payload: (required)
:type partial_update_telemetry_router_payload: PartialUpdateTelemetryRouterPayload
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501

_param = self._partial_update_telemetry_router_serialize(
project_id=project_id,
region_id=region_id,
telemetry_router_id=telemetry_router_id,
partial_update_telemetry_router_payload=partial_update_telemetry_router_payload,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index,
)

_response_types_map: Dict[str, Optional[str]] = {
"200": "TelemetryRouterResponse",
"400": "Response4xx",
"401": "Response4xx",
"404": None,
"409": "Response4xx",
"500": None,
}
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
response_data.read()
return self.api_client.response_deserialize(
response_data=response_data,
response_types_map=_response_types_map,
)

@validate_call
def partial_update_telemetry_router_without_preload_content(
self,
project_id: Annotated[UUID, Field(description="The STACKIT portal project UUID the resource is located in.")],
region_id: Annotated[StrictStr, Field(description="The STACKIT region name the resource is located in.")],
telemetry_router_id: Annotated[UUID, Field(description="The Telemetry Router UUID.")],
partial_update_telemetry_router_payload: PartialUpdateTelemetryRouterPayload,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> RESTResponseType:
"""partial_update_telemetry_router

Patches the given Telemetry Router.

:param project_id: The STACKIT portal project UUID the resource is located in. (required)
:type project_id: UUID
:param region_id: The STACKIT region name the resource is located in. (required)
:type region_id: str
:param telemetry_router_id: The Telemetry Router UUID. (required)
:type telemetry_router_id: UUID
:param partial_update_telemetry_router_payload: (required)
:type partial_update_telemetry_router_payload: PartialUpdateTelemetryRouterPayload
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501

_param = self._partial_update_telemetry_router_serialize(
project_id=project_id,
region_id=region_id,
telemetry_router_id=telemetry_router_id,
partial_update_telemetry_router_payload=partial_update_telemetry_router_payload,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index,
)

_response_types_map: Dict[str, Optional[str]] = {
"200": "TelemetryRouterResponse",
"400": "Response4xx",
"401": "Response4xx",
"404": None,
"409": "Response4xx",
"500": None,
}
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
return response_data.response

def _partial_update_telemetry_router_serialize(
self,
project_id,
region_id,
telemetry_router_id,
partial_update_telemetry_router_payload,
_request_auth,
_content_type,
_headers,
_host_index,
) -> RequestSerialized:

_host = None

_collection_formats: Dict[str, str] = {}

_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
_header_params: Dict[str, Optional[str]] = _headers or {}
_form_params: List[Tuple[str, str]] = []
_files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
_body_params: Optional[bytes] = None

# process the path parameters
if project_id is not None:
_path_params["projectId"] = project_id
if region_id is not None:
_path_params["regionId"] = region_id
if telemetry_router_id is not None:
_path_params["telemetryRouterId"] = telemetry_router_id
# process the query parameters
# process the header parameters
# process the form parameters
# process the body parameter
if partial_update_telemetry_router_payload is not None:
_body_params = partial_update_telemetry_router_payload

# set the HTTP header `Accept`
if "Accept" not in _header_params:
_header_params["Accept"] = self.api_client.select_header_accept(["application/json"])

# set the HTTP header `Content-Type`
if _content_type:
_header_params["Content-Type"] = _content_type
else:
_default_content_type = self.api_client.select_header_content_type(["application/json"])
if _default_content_type is not None:
_header_params["Content-Type"] = _default_content_type

# authentication setting
_auth_settings: List[str] = []

return self.api_client.param_serialize(
method="PATCH",
resource_path="/v1/projects/{projectId}/regions/{regionId}/telemetry-routers/{telemetryRouterId}",
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
body=_body_params,
post_params=_form_params,
files=_files,
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
_request_auth=_request_auth,
)

@validate_call
def update_access_token(
self,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@
from stackit.telemetryrouter.models.list_telemetry_routers_response import (
ListTelemetryRoutersResponse,
)
from stackit.telemetryrouter.models.partial_update_telemetry_router_payload import (
PartialUpdateTelemetryRouterPayload,
)
from stackit.telemetryrouter.models.response4xx import Response4xx
from stackit.telemetryrouter.models.telemetry_router_response import (
TelemetryRouterResponse,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@

import json
import pprint
import re # noqa: F401
from typing import Any, ClassVar, Dict, List, Optional, Set

from pydantic import BaseModel, ConfigDict, Field
from pydantic import BaseModel, ConfigDict, Field, field_validator
from pydantic_core import to_jsonable_python
from typing_extensions import Annotated, Self

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

@field_validator("key")
def key_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if not isinstance(value, str):
value = str(value)

if not re.match(r"^[^\0-\x1F\x7F-\x9F]+$", value):
raise ValueError(r"must validate the regular expression /^[^\0-\x1F\x7F-\x9F]+$/")
return value

model_config = ConfigDict(
validate_by_name=True,
validate_by_alias=True,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import re # noqa: F401
from typing import Any, ClassVar, Dict, List, Optional, Set

from pydantic import BaseModel, ConfigDict, Field, field_validator
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
from pydantic_core import to_jsonable_python
from typing_extensions import Annotated, Self

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

@field_validator("description")
def description_validate_regular_expression(cls, value):
Expand Down Expand Up @@ -119,6 +120,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"description": obj.get("description"),
"displayName": obj.get("displayName"),
"filter": ConfigFilter.from_dict(obj["filter"]) if obj.get("filter") is not None else None,
"resourceLabels": obj.get("resourceLabels"),
}
)
return _obj
Loading
Loading