From e64189e6fe3e37cbc24c9e3c86f1a463f7a756dd Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Mon, 9 Nov 2026 13:05:41 +0000 Subject: [PATCH] Generate telemetryrouter --- services/telemetryrouter/oas_commit | 2 +- .../src/stackit/telemetryrouter/__init__.py | 36 + .../telemetryrouter/api/default_api.py | 921 ++++++++++++++++++ .../telemetryrouter/models/__init__.py | 25 + .../models/access_token_base_request.py | 4 +- .../models/access_token_base_response.py | 4 +- .../models/config_filter_attributes.py | 13 +- .../models/config_filter_patch.py | 103 ++ .../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_patch.py | 114 +++ ...destination_config_patch_open_telemetry.py | 132 +++ ..._config_patch_open_telemetry_basic_auth.py | 110 +++ .../models/destination_config_patch_s3.py | 130 +++ .../destination_config_patch_s3_access_key.py | 110 +++ .../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 | 131 +++ ...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 +- 31 files changed, 2222 insertions(+), 37 deletions(-) create mode 100644 services/telemetryrouter/src/stackit/telemetryrouter/models/config_filter_patch.py create mode 100644 services/telemetryrouter/src/stackit/telemetryrouter/models/destination_config_patch.py create mode 100644 services/telemetryrouter/src/stackit/telemetryrouter/models/destination_config_patch_open_telemetry.py create mode 100644 services/telemetryrouter/src/stackit/telemetryrouter/models/destination_config_patch_open_telemetry_basic_auth.py create mode 100644 services/telemetryrouter/src/stackit/telemetryrouter/models/destination_config_patch_s3.py create mode 100644 services/telemetryrouter/src/stackit/telemetryrouter/models/destination_config_patch_s3_access_key.py 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..bdcef991a 100644 --- a/services/telemetryrouter/oas_commit +++ b/services/telemetryrouter/oas_commit @@ -1 +1 @@ -915f82be0b0f434901fcedc91fafe58b652035ef +bead0331c9760ab4d2ff87614ae3ad156bc46758 diff --git a/services/telemetryrouter/src/stackit/telemetryrouter/__init__.py b/services/telemetryrouter/src/stackit/telemetryrouter/__init__.py index f6b382809..624c94def 100644 --- a/services/telemetryrouter/src/stackit/telemetryrouter/__init__.py +++ b/services/telemetryrouter/src/stackit/telemetryrouter/__init__.py @@ -33,6 +33,7 @@ "ConfigFilterAttributes", "ConfigFilterLevel", "ConfigFilterMatcher", + "ConfigFilterPatch", "CreateAccessTokenPayload", "CreateAccessTokenResponse", "CreateDestinationPayload", @@ -40,6 +41,11 @@ "DestinationConfig", "DestinationConfigOpenTelemetry", "DestinationConfigOpenTelemetryBasicAuth", + "DestinationConfigPatch", + "DestinationConfigPatchOpenTelemetry", + "DestinationConfigPatchOpenTelemetryBasicAuth", + "DestinationConfigPatchS3", + "DestinationConfigPatchS3AccessKey", "DestinationConfigS3", "DestinationConfigS3AccessKey", "DestinationConfigType", @@ -48,6 +54,9 @@ "ListAccessTokensResponse", "ListDestinationsResponse", "ListTelemetryRoutersResponse", + "PartialUpdateAccessTokenPayload", + "PartialUpdateDestinationPayload", + "PartialUpdateTelemetryRouterPayload", "Response4xx", "TelemetryRouterResponse", "UpdateAccessTokenPayload", @@ -87,6 +96,9 @@ from stackit.telemetryrouter.models.config_filter_matcher import ( ConfigFilterMatcher as ConfigFilterMatcher, ) +from stackit.telemetryrouter.models.config_filter_patch import ( + ConfigFilterPatch as ConfigFilterPatch, +) from stackit.telemetryrouter.models.create_access_token_payload import ( CreateAccessTokenPayload as CreateAccessTokenPayload, ) @@ -108,6 +120,21 @@ from stackit.telemetryrouter.models.destination_config_open_telemetry_basic_auth import ( DestinationConfigOpenTelemetryBasicAuth as DestinationConfigOpenTelemetryBasicAuth, ) +from stackit.telemetryrouter.models.destination_config_patch import ( + DestinationConfigPatch as DestinationConfigPatch, +) +from stackit.telemetryrouter.models.destination_config_patch_open_telemetry import ( + DestinationConfigPatchOpenTelemetry as DestinationConfigPatchOpenTelemetry, +) +from stackit.telemetryrouter.models.destination_config_patch_open_telemetry_basic_auth import ( + DestinationConfigPatchOpenTelemetryBasicAuth as DestinationConfigPatchOpenTelemetryBasicAuth, +) +from stackit.telemetryrouter.models.destination_config_patch_s3 import ( + DestinationConfigPatchS3 as DestinationConfigPatchS3, +) +from stackit.telemetryrouter.models.destination_config_patch_s3_access_key import ( + DestinationConfigPatchS3AccessKey as DestinationConfigPatchS3AccessKey, +) from stackit.telemetryrouter.models.destination_config_s3 import ( DestinationConfigS3 as DestinationConfigS3, ) @@ -132,6 +159,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..1b9a23e20 100644 --- a/services/telemetryrouter/src/stackit/telemetryrouter/models/__init__.py +++ b/services/telemetryrouter/src/stackit/telemetryrouter/models/__init__.py @@ -25,6 +25,7 @@ ) from stackit.telemetryrouter.models.config_filter_level import ConfigFilterLevel from stackit.telemetryrouter.models.config_filter_matcher import ConfigFilterMatcher +from stackit.telemetryrouter.models.config_filter_patch import ConfigFilterPatch from stackit.telemetryrouter.models.create_access_token_payload import ( CreateAccessTokenPayload, ) @@ -44,6 +45,21 @@ from stackit.telemetryrouter.models.destination_config_open_telemetry_basic_auth import ( DestinationConfigOpenTelemetryBasicAuth, ) +from stackit.telemetryrouter.models.destination_config_patch import ( + DestinationConfigPatch, +) +from stackit.telemetryrouter.models.destination_config_patch_open_telemetry import ( + DestinationConfigPatchOpenTelemetry, +) +from stackit.telemetryrouter.models.destination_config_patch_open_telemetry_basic_auth import ( + DestinationConfigPatchOpenTelemetryBasicAuth, +) +from stackit.telemetryrouter.models.destination_config_patch_s3 import ( + DestinationConfigPatchS3, +) +from stackit.telemetryrouter.models.destination_config_patch_s3_access_key import ( + DestinationConfigPatchS3AccessKey, +) from stackit.telemetryrouter.models.destination_config_s3 import DestinationConfigS3 from stackit.telemetryrouter.models.destination_config_s3_access_key import ( DestinationConfigS3AccessKey, @@ -62,6 +78,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..508f3c72a 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/config_filter_patch.py b/services/telemetryrouter/src/stackit/telemetryrouter/models/config_filter_patch.py new file mode 100644 index 000000000..e495cd5dc --- /dev/null +++ b/services/telemetryrouter/src/stackit/telemetryrouter/models/config_filter_patch.py @@ -0,0 +1,103 @@ +# 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 +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictBool +from pydantic_core import to_jsonable_python +from typing_extensions import Annotated, Self + +from stackit.telemetryrouter.models.config_filter_attributes import ( + ConfigFilterAttributes, +) + + +class ConfigFilterPatch(BaseModel): + """ + ConfigFilterPatch + """ # noqa: E501 + + attributes: Optional[Annotated[List[ConfigFilterAttributes], Field(min_length=1, max_length=100)]] = None + disabled: Optional[StrictBool] = None + __properties: ClassVar[List[str]] = ["attributes", "disabled"] + + 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 ConfigFilterPatch 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 each item in attributes (list) + _items = [] + if self.attributes: + for _item_attributes in self.attributes: + if _item_attributes: + _items.append(_item_attributes.to_dict()) + _dict["attributes"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ConfigFilterPatch from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "attributes": ( + [ConfigFilterAttributes.from_dict(_item) for _item in obj["attributes"]] + if obj.get("attributes") is not None + else None + ), + "disabled": obj.get("disabled"), + } + ) + return _obj 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..ecc386167 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..959f9f9c2 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_patch.py b/services/telemetryrouter/src/stackit/telemetryrouter/models/destination_config_patch.py new file mode 100644 index 000000000..2d3c9b825 --- /dev/null +++ b/services/telemetryrouter/src/stackit/telemetryrouter/models/destination_config_patch.py @@ -0,0 +1,114 @@ +# 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 +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field +from pydantic_core import to_jsonable_python +from typing_extensions import Self + +from stackit.telemetryrouter.models.config_filter_patch import ConfigFilterPatch +from stackit.telemetryrouter.models.destination_config_patch_open_telemetry import ( + DestinationConfigPatchOpenTelemetry, +) +from stackit.telemetryrouter.models.destination_config_patch_s3 import ( + DestinationConfigPatchS3, +) +from stackit.telemetryrouter.models.destination_config_type import DestinationConfigType + + +class DestinationConfigPatch(BaseModel): + """ + DestinationConfigPatch + """ # noqa: E501 + + config_type: Optional[DestinationConfigType] = Field(default=None, alias="configType") + filter: Optional[ConfigFilterPatch] = None + open_telemetry: Optional[DestinationConfigPatchOpenTelemetry] = Field(default=None, alias="openTelemetry") + s3: Optional[DestinationConfigPatchS3] = None + __properties: ClassVar[List[str]] = ["configType", "filter", "openTelemetry", "s3"] + + 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 DestinationConfigPatch 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() + # override the default output from pydantic by calling `to_dict()` of open_telemetry + if self.open_telemetry: + _dict["openTelemetry"] = self.open_telemetry.to_dict() + # override the default output from pydantic by calling `to_dict()` of s3 + if self.s3: + _dict["s3"] = self.s3.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DestinationConfigPatch from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "configType": obj.get("configType"), + "filter": ConfigFilterPatch.from_dict(obj["filter"]) if obj.get("filter") is not None else None, + "openTelemetry": ( + DestinationConfigPatchOpenTelemetry.from_dict(obj["openTelemetry"]) + if obj.get("openTelemetry") is not None + else None + ), + "s3": DestinationConfigPatchS3.from_dict(obj["s3"]) if obj.get("s3") is not None else None, + } + ) + return _obj diff --git a/services/telemetryrouter/src/stackit/telemetryrouter/models/destination_config_patch_open_telemetry.py b/services/telemetryrouter/src/stackit/telemetryrouter/models/destination_config_patch_open_telemetry.py new file mode 100644 index 000000000..2db96eea1 --- /dev/null +++ b/services/telemetryrouter/src/stackit/telemetryrouter/models/destination_config_patch_open_telemetry.py @@ -0,0 +1,132 @@ +# 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_patch_open_telemetry_basic_auth import ( + DestinationConfigPatchOpenTelemetryBasicAuth, +) + + +class DestinationConfigPatchOpenTelemetry(BaseModel): + """ + DestinationConfigPatchOpenTelemetry + """ # noqa: E501 + + basic_auth: Optional[DestinationConfigPatchOpenTelemetryBasicAuth] = Field(default=None, alias="basicAuth") + bearer_token: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2048)]] = Field( + default=None, description="A bearer token to authenticate at the OpenTelemetry URI.", alias="bearerToken" + ) + uri: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = Field( + default=None, 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 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 + + 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 DestinationConfigPatchOpenTelemetry 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 basic_auth + if self.basic_auth: + _dict["basicAuth"] = self.basic_auth.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DestinationConfigPatchOpenTelemetry from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "basicAuth": ( + DestinationConfigPatchOpenTelemetryBasicAuth.from_dict(obj["basicAuth"]) + if obj.get("basicAuth") is not None + else None + ), + "bearerToken": obj.get("bearerToken"), + "uri": obj.get("uri"), + } + ) + return _obj diff --git a/services/telemetryrouter/src/stackit/telemetryrouter/models/destination_config_patch_open_telemetry_basic_auth.py b/services/telemetryrouter/src/stackit/telemetryrouter/models/destination_config_patch_open_telemetry_basic_auth.py new file mode 100644 index 000000000..78874a4bb --- /dev/null +++ b/services/telemetryrouter/src/stackit/telemetryrouter/models/destination_config_patch_open_telemetry_basic_auth.py @@ -0,0 +1,110 @@ +# 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 DestinationConfigPatchOpenTelemetryBasicAuth(BaseModel): + """ + Basic auth to authenticate at the OpenTelemetry URI + """ # noqa: E501 + + password: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1024)]] = None + username: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1024)]] = None + __properties: ClassVar[List[str]] = ["password", "username"] + + @field_validator("password") + def password_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("username") + def username_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 + + 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 DestinationConfigPatchOpenTelemetryBasicAuth 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, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DestinationConfigPatchOpenTelemetryBasicAuth from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"password": obj.get("password"), "username": obj.get("username")}) + return _obj diff --git a/services/telemetryrouter/src/stackit/telemetryrouter/models/destination_config_patch_s3.py b/services/telemetryrouter/src/stackit/telemetryrouter/models/destination_config_patch_s3.py new file mode 100644 index 000000000..71516f1be --- /dev/null +++ b/services/telemetryrouter/src/stackit/telemetryrouter/models/destination_config_patch_s3.py @@ -0,0 +1,130 @@ +# 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_patch_s3_access_key import ( + DestinationConfigPatchS3AccessKey, +) + + +class DestinationConfigPatchS3(BaseModel): + """ + DestinationConfigPatchS3 + """ # noqa: E501 + + access_key: Optional[DestinationConfigPatchS3AccessKey] = Field(default=None, alias="accessKey") + bucket: Optional[Annotated[str, Field(min_length=3, strict=True, max_length=63)]] = None + endpoint: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = Field( + default=None, description="The URI for reaching the resource." + ) + __properties: ClassVar[List[str]] = ["accessKey", "bucket", "endpoint"] + + @field_validator("bucket") + def bucket_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-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 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 + + 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 DestinationConfigPatchS3 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 access_key + if self.access_key: + _dict["accessKey"] = self.access_key.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DestinationConfigPatchS3 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "accessKey": ( + DestinationConfigPatchS3AccessKey.from_dict(obj["accessKey"]) + if obj.get("accessKey") is not None + else None + ), + "bucket": obj.get("bucket"), + "endpoint": obj.get("endpoint"), + } + ) + return _obj diff --git a/services/telemetryrouter/src/stackit/telemetryrouter/models/destination_config_patch_s3_access_key.py b/services/telemetryrouter/src/stackit/telemetryrouter/models/destination_config_patch_s3_access_key.py new file mode 100644 index 000000000..92062f671 --- /dev/null +++ b/services/telemetryrouter/src/stackit/telemetryrouter/models/destination_config_patch_s3_access_key.py @@ -0,0 +1,110 @@ +# 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 DestinationConfigPatchS3AccessKey(BaseModel): + """ + The S3 access key + """ # noqa: E501 + + id: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1024)]] = None + secret: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1024)]] = None + __properties: ClassVar[List[str]] = ["id", "secret"] + + @field_validator("id") + def id_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("secret") + def secret_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 + + 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 DestinationConfigPatchS3AccessKey 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, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DestinationConfigPatchS3AccessKey from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"id": obj.get("id"), "secret": obj.get("secret")}) + return _obj 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..535ae0b2f 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..5399e3bdc 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..8f9b999d2 --- /dev/null +++ b/services/telemetryrouter/src/stackit/telemetryrouter/models/partial_update_destination_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, field_validator +from pydantic_core import to_jsonable_python +from typing_extensions import Annotated, Self + +from stackit.telemetryrouter.models.destination_config_patch import ( + DestinationConfigPatch, +) + + +class PartialUpdateDestinationPayload(BaseModel): + """ + PartialUpdateDestinationPayload + """ # noqa: E501 + + config: Optional[DestinationConfigPatch] = 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": DestinationConfigPatch.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..8ba4a4bbf --- /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_patch import ConfigFilterPatch + + +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[ConfigFilterPatch] = 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": ConfigFilterPatch.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