From c5e18d8851859dffd75639916f9146d3832f5458 Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Fri, 6 Nov 2026 15:16:50 +0000 Subject: [PATCH] Generate telemetryrouter --- services/telemetryrouter/oas_commit | 2 +- .../src/stackit/telemetryrouter/__init__.py | 12 + .../telemetryrouter/api/default_api.py | 921 ++++++++++++++++++ .../telemetryrouter/models/__init__.py | 9 + .../models/access_token_base_request.py | 4 +- .../models/access_token_base_response.py | 4 +- .../models/config_filter_attributes.py | 13 +- .../models/create_access_token_payload.py | 4 +- .../models/create_access_token_response.py | 4 +- .../models/create_destination_payload.py | 4 +- .../models/create_telemetry_router_payload.py | 10 +- .../destination_config_open_telemetry.py | 26 +- ...nation_config_open_telemetry_basic_auth.py | 23 +- .../models/destination_config_s3.py | 23 +- .../destination_config_s3_access_key.py | 23 +- .../models/destination_response.py | 4 +- .../models/get_access_token_response.py | 4 +- .../partial_update_access_token_payload.py | 122 +++ .../partial_update_destination_payload.py | 129 +++ ...partial_update_telemetry_router_payload.py | 131 +++ .../models/telemetry_router_response.py | 24 +- .../models/update_access_token_payload.py | 4 +- .../models/update_access_token_response.py | 4 +- .../models/update_destination_payload.py | 4 +- .../models/update_telemetry_router_payload.py | 10 +- 25 files changed, 1481 insertions(+), 37 deletions(-) create mode 100644 services/telemetryrouter/src/stackit/telemetryrouter/models/partial_update_access_token_payload.py create mode 100644 services/telemetryrouter/src/stackit/telemetryrouter/models/partial_update_destination_payload.py create mode 100644 services/telemetryrouter/src/stackit/telemetryrouter/models/partial_update_telemetry_router_payload.py diff --git a/services/telemetryrouter/oas_commit b/services/telemetryrouter/oas_commit index 18a3d91ae..5147c3029 100644 --- a/services/telemetryrouter/oas_commit +++ b/services/telemetryrouter/oas_commit @@ -1 +1 @@ -915f82be0b0f434901fcedc91fafe58b652035ef +716f4d2bf40383fc9a9c3ee0f67a0490d4a15d81 diff --git a/services/telemetryrouter/src/stackit/telemetryrouter/__init__.py b/services/telemetryrouter/src/stackit/telemetryrouter/__init__.py index f6b382809..5fa730f42 100644 --- a/services/telemetryrouter/src/stackit/telemetryrouter/__init__.py +++ b/services/telemetryrouter/src/stackit/telemetryrouter/__init__.py @@ -48,6 +48,9 @@ "ListAccessTokensResponse", "ListDestinationsResponse", "ListTelemetryRoutersResponse", + "PartialUpdateAccessTokenPayload", + "PartialUpdateDestinationPayload", + "PartialUpdateTelemetryRouterPayload", "Response4xx", "TelemetryRouterResponse", "UpdateAccessTokenPayload", @@ -132,6 +135,15 @@ from stackit.telemetryrouter.models.list_telemetry_routers_response import ( ListTelemetryRoutersResponse as ListTelemetryRoutersResponse, ) +from stackit.telemetryrouter.models.partial_update_access_token_payload import ( + PartialUpdateAccessTokenPayload as PartialUpdateAccessTokenPayload, +) +from stackit.telemetryrouter.models.partial_update_destination_payload import ( + PartialUpdateDestinationPayload as PartialUpdateDestinationPayload, +) +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, diff --git a/services/telemetryrouter/src/stackit/telemetryrouter/api/default_api.py b/services/telemetryrouter/src/stackit/telemetryrouter/api/default_api.py index b93daab26..9143d02a4 100644 --- a/services/telemetryrouter/src/stackit/telemetryrouter/api/default_api.py +++ b/services/telemetryrouter/src/stackit/telemetryrouter/api/default_api.py @@ -52,6 +52,15 @@ from stackit.telemetryrouter.models.list_telemetry_routers_response import ( ListTelemetryRoutersResponse, ) +from stackit.telemetryrouter.models.partial_update_access_token_payload import ( + PartialUpdateAccessTokenPayload, +) +from stackit.telemetryrouter.models.partial_update_destination_payload import ( + PartialUpdateDestinationPayload, +) +from stackit.telemetryrouter.models.partial_update_telemetry_router_payload import ( + PartialUpdateTelemetryRouterPayload, +) from stackit.telemetryrouter.models.telemetry_router_response import ( TelemetryRouterResponse, ) @@ -3598,6 +3607,918 @@ def _list_telemetry_routers_serialize( _request_auth=_request_auth, ) + @validate_call + def partial_update_access_token( + 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.")], + access_token_id: Annotated[UUID, Field(description="The Access Token UUID.")], + partial_update_access_token_payload: PartialUpdateAccessTokenPayload, + _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, + ) -> UpdateAccessTokenResponse: + """partial_update_access_token + + Patch an existing access token for the given Telemetry Router by its ID. + + :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 access_token_id: The Access Token UUID. (required) + :type access_token_id: UUID + :param partial_update_access_token_payload: (required) + :type partial_update_access_token_payload: PartialUpdateAccessTokenPayload + :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_access_token_serialize( + project_id=project_id, + region_id=region_id, + telemetry_router_id=telemetry_router_id, + access_token_id=access_token_id, + partial_update_access_token_payload=partial_update_access_token_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "UpdateAccessTokenResponse", + "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_access_token_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.")], + access_token_id: Annotated[UUID, Field(description="The Access Token UUID.")], + partial_update_access_token_payload: PartialUpdateAccessTokenPayload, + _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[UpdateAccessTokenResponse]: + """partial_update_access_token + + Patch an existing access token for the given Telemetry Router by its ID. + + :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 access_token_id: The Access Token UUID. (required) + :type access_token_id: UUID + :param partial_update_access_token_payload: (required) + :type partial_update_access_token_payload: PartialUpdateAccessTokenPayload + :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_access_token_serialize( + project_id=project_id, + region_id=region_id, + telemetry_router_id=telemetry_router_id, + access_token_id=access_token_id, + partial_update_access_token_payload=partial_update_access_token_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "UpdateAccessTokenResponse", + "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_access_token_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.")], + access_token_id: Annotated[UUID, Field(description="The Access Token UUID.")], + partial_update_access_token_payload: PartialUpdateAccessTokenPayload, + _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_access_token + + Patch an existing access token for the given Telemetry Router by its ID. + + :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 access_token_id: The Access Token UUID. (required) + :type access_token_id: UUID + :param partial_update_access_token_payload: (required) + :type partial_update_access_token_payload: PartialUpdateAccessTokenPayload + :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_access_token_serialize( + project_id=project_id, + region_id=region_id, + telemetry_router_id=telemetry_router_id, + access_token_id=access_token_id, + partial_update_access_token_payload=partial_update_access_token_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "UpdateAccessTokenResponse", + "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_access_token_serialize( + self, + project_id, + region_id, + telemetry_router_id, + access_token_id, + partial_update_access_token_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 + if access_token_id is not None: + _path_params["accessTokenId"] = access_token_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if partial_update_access_token_payload is not None: + _body_params = partial_update_access_token_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}/access-tokens/{accessTokenId}", + 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 partial_update_destination( + 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.")], + destination_id: Annotated[UUID, Field(description="The Destination UUID.")], + partial_update_destination_payload: PartialUpdateDestinationPayload, + _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, + ) -> DestinationResponse: + """partial_update_destination + + Patches the given destination. + + :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 destination_id: The Destination UUID. (required) + :type destination_id: UUID + :param partial_update_destination_payload: (required) + :type partial_update_destination_payload: PartialUpdateDestinationPayload + :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_destination_serialize( + project_id=project_id, + region_id=region_id, + telemetry_router_id=telemetry_router_id, + destination_id=destination_id, + partial_update_destination_payload=partial_update_destination_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "DestinationResponse", + "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_destination_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.")], + destination_id: Annotated[UUID, Field(description="The Destination UUID.")], + partial_update_destination_payload: PartialUpdateDestinationPayload, + _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[DestinationResponse]: + """partial_update_destination + + Patches the given destination. + + :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 destination_id: The Destination UUID. (required) + :type destination_id: UUID + :param partial_update_destination_payload: (required) + :type partial_update_destination_payload: PartialUpdateDestinationPayload + :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_destination_serialize( + project_id=project_id, + region_id=region_id, + telemetry_router_id=telemetry_router_id, + destination_id=destination_id, + partial_update_destination_payload=partial_update_destination_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "DestinationResponse", + "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_destination_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.")], + destination_id: Annotated[UUID, Field(description="The Destination UUID.")], + partial_update_destination_payload: PartialUpdateDestinationPayload, + _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_destination + + Patches the given destination. + + :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 destination_id: The Destination UUID. (required) + :type destination_id: UUID + :param partial_update_destination_payload: (required) + :type partial_update_destination_payload: PartialUpdateDestinationPayload + :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_destination_serialize( + project_id=project_id, + region_id=region_id, + telemetry_router_id=telemetry_router_id, + destination_id=destination_id, + partial_update_destination_payload=partial_update_destination_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "DestinationResponse", + "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_destination_serialize( + self, + project_id, + region_id, + telemetry_router_id, + destination_id, + partial_update_destination_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 + if destination_id is not None: + _path_params["destinationId"] = destination_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if partial_update_destination_payload is not None: + _body_params = partial_update_destination_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}/destinations/{destinationId}", + 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 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, diff --git a/services/telemetryrouter/src/stackit/telemetryrouter/models/__init__.py b/services/telemetryrouter/src/stackit/telemetryrouter/models/__init__.py index eab5e0324..be6ce396b 100644 --- a/services/telemetryrouter/src/stackit/telemetryrouter/models/__init__.py +++ b/services/telemetryrouter/src/stackit/telemetryrouter/models/__init__.py @@ -62,6 +62,15 @@ from stackit.telemetryrouter.models.list_telemetry_routers_response import ( ListTelemetryRoutersResponse, ) +from stackit.telemetryrouter.models.partial_update_access_token_payload import ( + PartialUpdateAccessTokenPayload, +) +from stackit.telemetryrouter.models.partial_update_destination_payload import ( + PartialUpdateDestinationPayload, +) +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, diff --git a/services/telemetryrouter/src/stackit/telemetryrouter/models/access_token_base_request.py b/services/telemetryrouter/src/stackit/telemetryrouter/models/access_token_base_request.py index 387cf27ea..19d9ee60f 100644 --- a/services/telemetryrouter/src/stackit/telemetryrouter/models/access_token_base_request.py +++ b/services/telemetryrouter/src/stackit/telemetryrouter/models/access_token_base_request.py @@ -49,8 +49,8 @@ def description_validate_regular_expression(cls, value): if not isinstance(value, str): value = str(value) - if not re.match(r"^([a-zA-Z0-9][a-zA-Z0-9 \-]*)?$", value): - raise ValueError(r"must validate the regular expression /^([a-zA-Z0-9][a-zA-Z0-9 \-]*)?$/") + if not re.match(r"^([a-zA-Z0-9][a-zA-Z0-9 \-.]*)?$", value): + raise ValueError(r"must validate the regular expression /^([a-zA-Z0-9][a-zA-Z0-9 \-.]*)?$/") return value @field_validator("display_name") diff --git a/services/telemetryrouter/src/stackit/telemetryrouter/models/access_token_base_response.py b/services/telemetryrouter/src/stackit/telemetryrouter/models/access_token_base_response.py index 5521a2c2b..ffa24f9b5 100644 --- a/services/telemetryrouter/src/stackit/telemetryrouter/models/access_token_base_response.py +++ b/services/telemetryrouter/src/stackit/telemetryrouter/models/access_token_base_response.py @@ -55,8 +55,8 @@ def description_validate_regular_expression(cls, value): if not isinstance(value, str): value = str(value) - if not re.match(r"^([a-zA-Z0-9][a-zA-Z0-9 \-]*)?$", value): - raise ValueError(r"must validate the regular expression /^([a-zA-Z0-9][a-zA-Z0-9 \-]*)?$/") + if not re.match(r"^([a-zA-Z0-9][a-zA-Z0-9 \-.]*)?$", value): + raise ValueError(r"must validate the regular expression /^([a-zA-Z0-9][a-zA-Z0-9 \-.]*)?$/") return value @field_validator("display_name") diff --git a/services/telemetryrouter/src/stackit/telemetryrouter/models/config_filter_attributes.py b/services/telemetryrouter/src/stackit/telemetryrouter/models/config_filter_attributes.py index daee44ff4..ce0022ab7 100644 --- a/services/telemetryrouter/src/stackit/telemetryrouter/models/config_filter_attributes.py +++ b/services/telemetryrouter/src/stackit/telemetryrouter/models/config_filter_attributes.py @@ -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 @@ -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, diff --git a/services/telemetryrouter/src/stackit/telemetryrouter/models/create_access_token_payload.py b/services/telemetryrouter/src/stackit/telemetryrouter/models/create_access_token_payload.py index 5aaed1d4c..fe133a343 100644 --- a/services/telemetryrouter/src/stackit/telemetryrouter/models/create_access_token_payload.py +++ b/services/telemetryrouter/src/stackit/telemetryrouter/models/create_access_token_payload.py @@ -49,8 +49,8 @@ def description_validate_regular_expression(cls, value): if not isinstance(value, str): value = str(value) - if not re.match(r"^([a-zA-Z0-9][a-zA-Z0-9 \-]*)?$", value): - raise ValueError(r"must validate the regular expression /^([a-zA-Z0-9][a-zA-Z0-9 \-]*)?$/") + if not re.match(r"^([a-zA-Z0-9][a-zA-Z0-9 \-.]*)?$", value): + raise ValueError(r"must validate the regular expression /^([a-zA-Z0-9][a-zA-Z0-9 \-.]*)?$/") return value @field_validator("display_name") diff --git a/services/telemetryrouter/src/stackit/telemetryrouter/models/create_access_token_response.py b/services/telemetryrouter/src/stackit/telemetryrouter/models/create_access_token_response.py index 67df071f4..32cba9725 100644 --- a/services/telemetryrouter/src/stackit/telemetryrouter/models/create_access_token_response.py +++ b/services/telemetryrouter/src/stackit/telemetryrouter/models/create_access_token_response.py @@ -64,8 +64,8 @@ def description_validate_regular_expression(cls, value): if not isinstance(value, str): value = str(value) - if not re.match(r"^([a-zA-Z0-9][a-zA-Z0-9 \-]*)?$", value): - raise ValueError(r"must validate the regular expression /^([a-zA-Z0-9][a-zA-Z0-9 \-]*)?$/") + if not re.match(r"^([a-zA-Z0-9][a-zA-Z0-9 \-.]*)?$", value): + raise ValueError(r"must validate the regular expression /^([a-zA-Z0-9][a-zA-Z0-9 \-.]*)?$/") return value @field_validator("display_name") diff --git a/services/telemetryrouter/src/stackit/telemetryrouter/models/create_destination_payload.py b/services/telemetryrouter/src/stackit/telemetryrouter/models/create_destination_payload.py index 27813e46d..5cfc11f76 100644 --- a/services/telemetryrouter/src/stackit/telemetryrouter/models/create_destination_payload.py +++ b/services/telemetryrouter/src/stackit/telemetryrouter/models/create_destination_payload.py @@ -49,8 +49,8 @@ def description_validate_regular_expression(cls, value): if not isinstance(value, str): value = str(value) - if not re.match(r"^([a-zA-Z0-9][a-zA-Z0-9 \-]*)?$", value): - raise ValueError(r"must validate the regular expression /^([a-zA-Z0-9][a-zA-Z0-9 \-]*)?$/") + if not re.match(r"^([a-zA-Z0-9][a-zA-Z0-9 \-.]*)?$", value): + raise ValueError(r"must validate the regular expression /^([a-zA-Z0-9][a-zA-Z0-9 \-.]*)?$/") return value @field_validator("display_name") diff --git a/services/telemetryrouter/src/stackit/telemetryrouter/models/create_telemetry_router_payload.py b/services/telemetryrouter/src/stackit/telemetryrouter/models/create_telemetry_router_payload.py index 57ce1d671..7c8650bb4 100644 --- a/services/telemetryrouter/src/stackit/telemetryrouter/models/create_telemetry_router_payload.py +++ b/services/telemetryrouter/src/stackit/telemetryrouter/models/create_telemetry_router_payload.py @@ -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 @@ -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): @@ -49,8 +50,8 @@ def description_validate_regular_expression(cls, value): if not isinstance(value, str): value = str(value) - if not re.match(r"^([a-zA-Z0-9][a-zA-Z0-9 \-]*)?$", value): - raise ValueError(r"must validate the regular expression /^([a-zA-Z0-9][a-zA-Z0-9 \-]*)?$/") + if not re.match(r"^([a-zA-Z0-9][a-zA-Z0-9 \-.]*)?$", value): + raise ValueError(r"must validate the regular expression /^([a-zA-Z0-9][a-zA-Z0-9 \-.]*)?$/") return value @field_validator("display_name") @@ -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 diff --git a/services/telemetryrouter/src/stackit/telemetryrouter/models/destination_config_open_telemetry.py b/services/telemetryrouter/src/stackit/telemetryrouter/models/destination_config_open_telemetry.py index 3d1f83bd9..b425cd351 100644 --- a/services/telemetryrouter/src/stackit/telemetryrouter/models/destination_config_open_telemetry.py +++ b/services/telemetryrouter/src/stackit/telemetryrouter/models/destination_config_open_telemetry.py @@ -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 @@ -38,6 +39,29 @@ class DestinationConfigOpenTelemetry(BaseModel): uri: Annotated[str, Field(strict=True, max_length=1024)] = Field(description="The URI for reaching the resource.") __properties: ClassVar[List[str]] = ["basicAuth", "bearerToken", "uri"] + @field_validator("bearer_token") + def bearer_token_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + 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 + + @field_validator("uri") + def uri_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, diff --git a/services/telemetryrouter/src/stackit/telemetryrouter/models/destination_config_open_telemetry_basic_auth.py b/services/telemetryrouter/src/stackit/telemetryrouter/models/destination_config_open_telemetry_basic_auth.py index 6089c8299..02d0ec380 100644 --- a/services/telemetryrouter/src/stackit/telemetryrouter/models/destination_config_open_telemetry_basic_auth.py +++ b/services/telemetryrouter/src/stackit/telemetryrouter/models/destination_config_open_telemetry_basic_auth.py @@ -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 @@ -31,6 +32,26 @@ class DestinationConfigOpenTelemetryBasicAuth(BaseModel): username: Annotated[str, Field(min_length=1, strict=True, max_length=1024)] __properties: ClassVar[List[str]] = ["password", "username"] + @field_validator("password") + def password_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 + + @field_validator("username") + def username_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, diff --git a/services/telemetryrouter/src/stackit/telemetryrouter/models/destination_config_s3.py b/services/telemetryrouter/src/stackit/telemetryrouter/models/destination_config_s3.py index 2f20a9ffb..f0333e35f 100644 --- a/services/telemetryrouter/src/stackit/telemetryrouter/models/destination_config_s3.py +++ b/services/telemetryrouter/src/stackit/telemetryrouter/models/destination_config_s3.py @@ -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 @@ -38,6 +39,26 @@ class DestinationConfigS3(BaseModel): ) __properties: ClassVar[List[str]] = ["accessKey", "bucket", "endpoint"] + @field_validator("bucket") + def bucket_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not isinstance(value, str): + value = str(value) + + if not re.match(r"^[a-z0-9\-]+$", value): + raise ValueError(r"must validate the regular expression /^[a-z0-9\-]+$/") + return value + + @field_validator("endpoint") + def endpoint_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, diff --git a/services/telemetryrouter/src/stackit/telemetryrouter/models/destination_config_s3_access_key.py b/services/telemetryrouter/src/stackit/telemetryrouter/models/destination_config_s3_access_key.py index ecb82eef9..e44b5dd11 100644 --- a/services/telemetryrouter/src/stackit/telemetryrouter/models/destination_config_s3_access_key.py +++ b/services/telemetryrouter/src/stackit/telemetryrouter/models/destination_config_s3_access_key.py @@ -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 @@ -31,6 +32,26 @@ class DestinationConfigS3AccessKey(BaseModel): secret: Annotated[str, Field(min_length=1, strict=True, max_length=1024)] __properties: ClassVar[List[str]] = ["id", "secret"] + @field_validator("id") + def id_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 + + @field_validator("secret") + def secret_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, diff --git a/services/telemetryrouter/src/stackit/telemetryrouter/models/destination_response.py b/services/telemetryrouter/src/stackit/telemetryrouter/models/destination_response.py index 09baf467c..faa7c24ff 100644 --- a/services/telemetryrouter/src/stackit/telemetryrouter/models/destination_response.py +++ b/services/telemetryrouter/src/stackit/telemetryrouter/models/destination_response.py @@ -83,8 +83,8 @@ def description_validate_regular_expression(cls, value): if not isinstance(value, str): value = str(value) - if not re.match(r"^([a-zA-Z0-9][a-zA-Z0-9 \-]*)?$", value): - raise ValueError(r"must validate the regular expression /^([a-zA-Z0-9][a-zA-Z0-9 \-]*)?$/") + if not re.match(r"^([a-zA-Z0-9][a-zA-Z0-9 \-.]*)?$", value): + raise ValueError(r"must validate the regular expression /^([a-zA-Z0-9][a-zA-Z0-9 \-.]*)?$/") return value @field_validator("display_name") diff --git a/services/telemetryrouter/src/stackit/telemetryrouter/models/get_access_token_response.py b/services/telemetryrouter/src/stackit/telemetryrouter/models/get_access_token_response.py index 8662da0be..13e794440 100644 --- a/services/telemetryrouter/src/stackit/telemetryrouter/models/get_access_token_response.py +++ b/services/telemetryrouter/src/stackit/telemetryrouter/models/get_access_token_response.py @@ -55,8 +55,8 @@ def description_validate_regular_expression(cls, value): if not isinstance(value, str): value = str(value) - if not re.match(r"^([a-zA-Z0-9][a-zA-Z0-9 \-]*)?$", value): - raise ValueError(r"must validate the regular expression /^([a-zA-Z0-9][a-zA-Z0-9 \-]*)?$/") + if not re.match(r"^([a-zA-Z0-9][a-zA-Z0-9 \-.]*)?$", value): + raise ValueError(r"must validate the regular expression /^([a-zA-Z0-9][a-zA-Z0-9 \-.]*)?$/") return value @field_validator("display_name") diff --git a/services/telemetryrouter/src/stackit/telemetryrouter/models/partial_update_access_token_payload.py b/services/telemetryrouter/src/stackit/telemetryrouter/models/partial_update_access_token_payload.py new file mode 100644 index 000000000..d34a68af6 --- /dev/null +++ b/services/telemetryrouter/src/stackit/telemetryrouter/models/partial_update_access_token_payload.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +""" +STACKIT Telemetry Router API + +This API provides endpoints for managing Telemetry Routers. + +The version of the OpenAPI document: 1.0 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, field_validator +from pydantic_core import to_jsonable_python +from typing_extensions import Annotated, Self + + +class PartialUpdateAccessTokenPayload(BaseModel): + """ + PartialUpdateAccessTokenPayload + """ # noqa: E501 + + description: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = None + display_name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=32)]] = Field( + default=None, alias="displayName" + ) + __properties: ClassVar[List[str]] = ["description", "displayName"] + + @field_validator("description") + def description_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not isinstance(value, str): + value = str(value) + + if not re.match(r"^([a-zA-Z0-9][a-zA-Z0-9 \-.]*)?$", value): + raise ValueError(r"must validate the regular expression /^([a-zA-Z0-9][a-zA-Z0-9 \-.]*)?$/") + return value + + @field_validator("display_name") + def display_name_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not isinstance(value, str): + value = str(value) + + if not re.match(r"^[a-zA-Z0-9][a-zA-Z0-9 \-]*$", value): + raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9][a-zA-Z0-9 \-]*$/") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PartialUpdateAccessTokenPayload from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if description (nullable) is None + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: + _dict["description"] = None + + # set to None if display_name (nullable) is None + # and model_fields_set contains the field + if self.display_name is None and "display_name" in self.model_fields_set: + _dict["displayName"] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PartialUpdateAccessTokenPayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"description": obj.get("description"), "displayName": obj.get("displayName")}) + return _obj diff --git a/services/telemetryrouter/src/stackit/telemetryrouter/models/partial_update_destination_payload.py b/services/telemetryrouter/src/stackit/telemetryrouter/models/partial_update_destination_payload.py new file mode 100644 index 000000000..e0c6646ca --- /dev/null +++ b/services/telemetryrouter/src/stackit/telemetryrouter/models/partial_update_destination_payload.py @@ -0,0 +1,129 @@ +# coding: utf-8 + +""" +STACKIT Telemetry Router API + +This API provides endpoints for managing Telemetry Routers. + +The version of the OpenAPI document: 1.0 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, field_validator +from pydantic_core import to_jsonable_python +from typing_extensions import Annotated, Self + +from stackit.telemetryrouter.models.destination_config import DestinationConfig + + +class PartialUpdateDestinationPayload(BaseModel): + """ + PartialUpdateDestinationPayload + """ # noqa: E501 + + config: Optional[DestinationConfig] = None + description: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = Field( + default=None, + description="The description is a longer text chosen by the user to provide more context for the resource.", + ) + display_name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=32)]] = Field( + default=None, + description="The display name is a short name chosen by the user to identify the resource.", + alias="displayName", + ) + __properties: ClassVar[List[str]] = ["config", "description", "displayName"] + + @field_validator("description") + def description_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not isinstance(value, str): + value = str(value) + + if not re.match(r"^([a-zA-Z0-9][a-zA-Z0-9 \-.]*)?$", value): + raise ValueError(r"must validate the regular expression /^([a-zA-Z0-9][a-zA-Z0-9 \-.]*)?$/") + return value + + @field_validator("display_name") + def display_name_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not isinstance(value, str): + value = str(value) + + if not re.match(r"^[a-zA-Z0-9][a-zA-Z0-9 \-]*$", value): + raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9][a-zA-Z0-9 \-]*$/") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PartialUpdateDestinationPayload from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of config + if self.config: + _dict["config"] = self.config.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PartialUpdateDestinationPayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "config": DestinationConfig.from_dict(obj["config"]) if obj.get("config") is not None else None, + "description": obj.get("description"), + "displayName": obj.get("displayName"), + } + ) + return _obj diff --git a/services/telemetryrouter/src/stackit/telemetryrouter/models/partial_update_telemetry_router_payload.py b/services/telemetryrouter/src/stackit/telemetryrouter/models/partial_update_telemetry_router_payload.py new file mode 100644 index 000000000..2009c64a2 --- /dev/null +++ b/services/telemetryrouter/src/stackit/telemetryrouter/models/partial_update_telemetry_router_payload.py @@ -0,0 +1,131 @@ +# coding: utf-8 + +""" +STACKIT Telemetry Router API + +This API provides endpoints for managing Telemetry Routers. + +The version of the OpenAPI document: 1.0 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from pydantic_core import to_jsonable_python +from typing_extensions import Annotated, Self + +from stackit.telemetryrouter.models.config_filter import ConfigFilter + + +class PartialUpdateTelemetryRouterPayload(BaseModel): + """ + PartialUpdateTelemetryRouterPayload + """ # noqa: E501 + + description: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = Field( + default=None, + description="The description is a longer text chosen by the user to provide more context for the resource.", + ) + display_name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=32)]] = Field( + default=None, + description="The display name is a short name chosen by the user to identify the resource.", + alias="displayName", + ) + filter: Optional[ConfigFilter] = None + 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): + """Validates the regular expression""" + if value is None: + return value + + if not isinstance(value, str): + value = str(value) + + if not re.match(r"^([a-zA-Z0-9][a-zA-Z0-9 \-.]*)?$", value): + raise ValueError(r"must validate the regular expression /^([a-zA-Z0-9][a-zA-Z0-9 \-.]*)?$/") + return value + + @field_validator("display_name") + def display_name_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not isinstance(value, str): + value = str(value) + + if not re.match(r"^[a-zA-Z0-9][a-zA-Z0-9 \-]*$", value): + raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9][a-zA-Z0-9 \-]*$/") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PartialUpdateTelemetryRouterPayload from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of filter + if self.filter: + _dict["filter"] = self.filter.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PartialUpdateTelemetryRouterPayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "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 diff --git a/services/telemetryrouter/src/stackit/telemetryrouter/models/telemetry_router_response.py b/services/telemetryrouter/src/stackit/telemetryrouter/models/telemetry_router_response.py index 7c4e59b1c..85fb4f7b7 100644 --- a/services/telemetryrouter/src/stackit/telemetryrouter/models/telemetry_router_response.py +++ b/services/telemetryrouter/src/stackit/telemetryrouter/models/telemetry_router_response.py @@ -37,14 +37,30 @@ class TelemetryRouterResponse(BaseModel): default=None, description="The description is a longer text chosen by the user to provide more context for the resource.", ) + destination_count: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field( + default=None, + description="The number of destinations configured for the telemetry router.", + alias="destinationCount", + ) display_name: Annotated[str, Field(min_length=1, strict=True, max_length=32)] = Field( description="The display name is a short name chosen by the user to identify the resource.", alias="displayName" ) filter: Optional[ConfigFilter] = None id: UUID = Field(description="A auto generated unique id which identifies the resource.") + resource_labels: Optional[Dict[str, StrictStr]] = Field(default=None, alias="resourceLabels") status: StrictStr = Field(description="The current status of the resource.") uri: Annotated[str, Field(strict=True, max_length=1024)] = Field(description="The URI for reaching the resource.") - __properties: ClassVar[List[str]] = ["creationTime", "description", "displayName", "filter", "id", "status", "uri"] + __properties: ClassVar[List[str]] = [ + "creationTime", + "description", + "destinationCount", + "displayName", + "filter", + "id", + "resourceLabels", + "status", + "uri", + ] @field_validator("creation_time", mode="before") def creation_time_change_year_zero_to_one(cls, value): @@ -68,8 +84,8 @@ def description_validate_regular_expression(cls, value): if not isinstance(value, str): value = str(value) - if not re.match(r"^([a-zA-Z0-9][a-zA-Z0-9 \-]*)?$", value): - raise ValueError(r"must validate the regular expression /^([a-zA-Z0-9][a-zA-Z0-9 \-]*)?$/") + if not re.match(r"^([a-zA-Z0-9][a-zA-Z0-9 \-.]*)?$", value): + raise ValueError(r"must validate the regular expression /^([a-zA-Z0-9][a-zA-Z0-9 \-.]*)?$/") return value @field_validator("display_name") @@ -144,9 +160,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: { "creationTime": obj.get("creationTime"), "description": obj.get("description"), + "destinationCount": obj.get("destinationCount"), "displayName": obj.get("displayName"), "filter": ConfigFilter.from_dict(obj["filter"]) if obj.get("filter") is not None else None, "id": obj.get("id"), + "resourceLabels": obj.get("resourceLabels"), "status": obj.get("status"), "uri": obj.get("uri"), } diff --git a/services/telemetryrouter/src/stackit/telemetryrouter/models/update_access_token_payload.py b/services/telemetryrouter/src/stackit/telemetryrouter/models/update_access_token_payload.py index 28ff31807..6dfab0a8d 100644 --- a/services/telemetryrouter/src/stackit/telemetryrouter/models/update_access_token_payload.py +++ b/services/telemetryrouter/src/stackit/telemetryrouter/models/update_access_token_payload.py @@ -43,8 +43,8 @@ def description_validate_regular_expression(cls, value): if not isinstance(value, str): value = str(value) - if not re.match(r"^([a-zA-Z0-9][a-zA-Z0-9 \-]*)?$", value): - raise ValueError(r"must validate the regular expression /^([a-zA-Z0-9][a-zA-Z0-9 \-]*)?$/") + if not re.match(r"^([a-zA-Z0-9][a-zA-Z0-9 \-.]*)?$", value): + raise ValueError(r"must validate the regular expression /^([a-zA-Z0-9][a-zA-Z0-9 \-.]*)?$/") return value @field_validator("display_name") diff --git a/services/telemetryrouter/src/stackit/telemetryrouter/models/update_access_token_response.py b/services/telemetryrouter/src/stackit/telemetryrouter/models/update_access_token_response.py index 3aa7ec4d7..e7b38c70d 100644 --- a/services/telemetryrouter/src/stackit/telemetryrouter/models/update_access_token_response.py +++ b/services/telemetryrouter/src/stackit/telemetryrouter/models/update_access_token_response.py @@ -55,8 +55,8 @@ def description_validate_regular_expression(cls, value): if not isinstance(value, str): value = str(value) - if not re.match(r"^([a-zA-Z0-9][a-zA-Z0-9 \-]*)?$", value): - raise ValueError(r"must validate the regular expression /^([a-zA-Z0-9][a-zA-Z0-9 \-]*)?$/") + if not re.match(r"^([a-zA-Z0-9][a-zA-Z0-9 \-.]*)?$", value): + raise ValueError(r"must validate the regular expression /^([a-zA-Z0-9][a-zA-Z0-9 \-.]*)?$/") return value @field_validator("display_name") diff --git a/services/telemetryrouter/src/stackit/telemetryrouter/models/update_destination_payload.py b/services/telemetryrouter/src/stackit/telemetryrouter/models/update_destination_payload.py index aa053928a..87c75a039 100644 --- a/services/telemetryrouter/src/stackit/telemetryrouter/models/update_destination_payload.py +++ b/services/telemetryrouter/src/stackit/telemetryrouter/models/update_destination_payload.py @@ -51,8 +51,8 @@ def description_validate_regular_expression(cls, value): if not isinstance(value, str): value = str(value) - if not re.match(r"^([a-zA-Z0-9][a-zA-Z0-9 \-]*)?$", value): - raise ValueError(r"must validate the regular expression /^([a-zA-Z0-9][a-zA-Z0-9 \-]*)?$/") + if not re.match(r"^([a-zA-Z0-9][a-zA-Z0-9 \-.]*)?$", value): + raise ValueError(r"must validate the regular expression /^([a-zA-Z0-9][a-zA-Z0-9 \-.]*)?$/") return value @field_validator("display_name") diff --git a/services/telemetryrouter/src/stackit/telemetryrouter/models/update_telemetry_router_payload.py b/services/telemetryrouter/src/stackit/telemetryrouter/models/update_telemetry_router_payload.py index 47fc47dcb..32e6c4890 100644 --- a/services/telemetryrouter/src/stackit/telemetryrouter/models/update_telemetry_router_payload.py +++ b/services/telemetryrouter/src/stackit/telemetryrouter/models/update_telemetry_router_payload.py @@ -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 @@ -40,7 +40,8 @@ class UpdateTelemetryRouterPayload(BaseModel): 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): @@ -51,8 +52,8 @@ def description_validate_regular_expression(cls, value): if not isinstance(value, str): value = str(value) - if not re.match(r"^([a-zA-Z0-9][a-zA-Z0-9 \-]*)?$", value): - raise ValueError(r"must validate the regular expression /^([a-zA-Z0-9][a-zA-Z0-9 \-]*)?$/") + if not re.match(r"^([a-zA-Z0-9][a-zA-Z0-9 \-.]*)?$", value): + raise ValueError(r"must validate the regular expression /^([a-zA-Z0-9][a-zA-Z0-9 \-.]*)?$/") return value @field_validator("display_name") @@ -124,6 +125,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