diff --git a/python/svix/api/endpoint.py b/python/svix/api/endpoint.py index 7f4a2d0e8..9f95bc0f7 100644 --- a/python/svix/api/endpoint.py +++ b/python/svix/api/endpoint.py @@ -102,6 +102,13 @@ async def update( json_body=endpoint_update, ) + async def delete(self, app_id: str, endpoint_id: str) -> None: + return await v1_endpoint_delete.request_asyncio( + client=self._client, + app_id=app_id, + endpoint_id=endpoint_id, + ) + async def patch( self, app_id: str, endpoint_id: str, endpoint_patch: EndpointPatch ) -> EndpointOut: @@ -112,33 +119,31 @@ async def patch( json_body=endpoint_patch, ) - async def delete(self, app_id: str, endpoint_id: str) -> None: - return await v1_endpoint_delete.request_asyncio( + async def get_headers(self, app_id: str, endpoint_id: str) -> EndpointHeadersOut: + return await v1_endpoint_get_headers.request_asyncio( client=self._client, app_id=app_id, endpoint_id=endpoint_id, ) - async def get_secret(self, app_id: str, endpoint_id: str) -> EndpointSecretOut: - return await v1_endpoint_get_secret.request_asyncio( + async def update_headers( + self, app_id: str, endpoint_id: str, endpoint_headers_in: EndpointHeadersIn + ) -> None: + return await v1_endpoint_update_headers.request_asyncio( client=self._client, app_id=app_id, endpoint_id=endpoint_id, + json_body=endpoint_headers_in, ) - async def rotate_secret( - self, - app_id: str, - endpoint_id: str, - endpoint_secret_rotate_in: EndpointSecretRotateIn, - options: PostOptions = PostOptions(), + async def patch_headers( + self, app_id: str, endpoint_id: str, endpoint_headers_in: EndpointHeadersPatchIn ) -> None: - return await v1_endpoint_rotate_secret.request_asyncio( + return await v1_endpoint_patch_headers.request_asyncio( client=self._client, app_id=app_id, endpoint_id=endpoint_id, - json_body=endpoint_secret_rotate_in, - **options.to_dict(), + json_body=endpoint_headers_in, ) async def recover( @@ -156,60 +161,70 @@ async def recover( **options.to_dict(), ) - async def get_headers(self, app_id: str, endpoint_id: str) -> EndpointHeadersOut: - return await v1_endpoint_get_headers.request_asyncio( + async def replay_missing( + self, + app_id: str, + endpoint_id: str, + replay_in: ReplayIn, + options: PostOptions = PostOptions(), + ) -> ReplayOut: + return await v1_endpoint_replay_missing.request_asyncio( client=self._client, app_id=app_id, endpoint_id=endpoint_id, + json_body=replay_in, + **options.to_dict(), ) - async def update_headers( - self, app_id: str, endpoint_id: str, endpoint_headers_in: EndpointHeadersIn - ) -> None: - return await v1_endpoint_update_headers.request_asyncio( + async def get_secret(self, app_id: str, endpoint_id: str) -> EndpointSecretOut: + return await v1_endpoint_get_secret.request_asyncio( client=self._client, app_id=app_id, endpoint_id=endpoint_id, - json_body=endpoint_headers_in, ) - async def patch_headers( - self, app_id: str, endpoint_id: str, endpoint_headers_in: EndpointHeadersPatchIn + async def rotate_secret( + self, + app_id: str, + endpoint_id: str, + endpoint_secret_rotate_in: EndpointSecretRotateIn, + options: PostOptions = PostOptions(), ) -> None: - return await v1_endpoint_patch_headers.request_asyncio( + return await v1_endpoint_rotate_secret.request_asyncio( client=self._client, app_id=app_id, endpoint_id=endpoint_id, - json_body=endpoint_headers_in, + json_body=endpoint_secret_rotate_in, + **options.to_dict(), ) - async def get_stats( + async def send_example( self, app_id: str, endpoint_id: str, - options: EndpointStatsOptions = EndpointStatsOptions(), - ) -> EndpointStats: - return await v1_endpoint_get_stats.request_asyncio( + event_example_in: EventExampleIn, + options: PostOptions = PostOptions(), + ) -> MessageOut: + return await v1_endpoint_send_example.request_asyncio( client=self._client, app_id=app_id, endpoint_id=endpoint_id, - since=ensure_tz(options.since), - until=ensure_tz(options.until), + json_body=event_example_in, + **options.to_dict(), ) - async def replay_missing( + async def get_stats( self, app_id: str, endpoint_id: str, - replay_in: ReplayIn, - options: PostOptions = PostOptions(), - ) -> ReplayOut: - return await v1_endpoint_replay_missing.request_asyncio( + options: EndpointStatsOptions = EndpointStatsOptions(), + ) -> EndpointStats: + return await v1_endpoint_get_stats.request_asyncio( client=self._client, app_id=app_id, endpoint_id=endpoint_id, - json_body=replay_in, - **options.to_dict(), + since=ensure_tz(options.since), + until=ensure_tz(options.until), ) async def transformations_get( @@ -232,21 +247,6 @@ async def transformation_partial_update( json_body=endpoint_transformation_in, ) - async def send_example( - self, - app_id: str, - endpoint_id: str, - event_example_in: EventExampleIn, - options: PostOptions = PostOptions(), - ) -> MessageOut: - return await v1_endpoint_send_example.request_asyncio( - client=self._client, - app_id=app_id, - endpoint_id=endpoint_id, - json_body=event_example_in, - **options.to_dict(), - ) - class Endpoint(ApiBase): def list( @@ -283,6 +283,13 @@ def update( json_body=endpoint_update, ) + def delete(self, app_id: str, endpoint_id: str) -> None: + return v1_endpoint_delete.request_sync( + client=self._client, + app_id=app_id, + endpoint_id=endpoint_id, + ) + def patch( self, app_id: str, endpoint_id: str, endpoint_patch: EndpointPatch ) -> EndpointOut: @@ -293,33 +300,31 @@ def patch( json_body=endpoint_patch, ) - def delete(self, app_id: str, endpoint_id: str) -> None: - return v1_endpoint_delete.request_sync( + def get_headers(self, app_id: str, endpoint_id: str) -> EndpointHeadersOut: + return v1_endpoint_get_headers.request_sync( client=self._client, app_id=app_id, endpoint_id=endpoint_id, ) - def get_secret(self, app_id: str, endpoint_id: str) -> EndpointSecretOut: - return v1_endpoint_get_secret.request_sync( + def update_headers( + self, app_id: str, endpoint_id: str, endpoint_headers_in: EndpointHeadersIn + ) -> None: + return v1_endpoint_update_headers.request_sync( client=self._client, app_id=app_id, endpoint_id=endpoint_id, + json_body=endpoint_headers_in, ) - def rotate_secret( - self, - app_id: str, - endpoint_id: str, - endpoint_secret_rotate_in: EndpointSecretRotateIn, - options: PostOptions = PostOptions(), + def patch_headers( + self, app_id: str, endpoint_id: str, endpoint_headers_in: EndpointHeadersPatchIn ) -> None: - return v1_endpoint_rotate_secret.request_sync( + return v1_endpoint_patch_headers.request_sync( client=self._client, app_id=app_id, endpoint_id=endpoint_id, - json_body=endpoint_secret_rotate_in, - **options.to_dict(), + json_body=endpoint_headers_in, ) def recover( @@ -337,60 +342,70 @@ def recover( **options.to_dict(), ) - def get_headers(self, app_id: str, endpoint_id: str) -> EndpointHeadersOut: - return v1_endpoint_get_headers.request_sync( + def replay_missing( + self, + app_id: str, + endpoint_id: str, + replay_in: ReplayIn, + options: PostOptions = PostOptions(), + ) -> ReplayOut: + return v1_endpoint_replay_missing.request_sync( client=self._client, app_id=app_id, endpoint_id=endpoint_id, + json_body=replay_in, + **options.to_dict(), ) - def update_headers( - self, app_id: str, endpoint_id: str, endpoint_headers_in: EndpointHeadersIn - ) -> None: - return v1_endpoint_update_headers.request_sync( + def get_secret(self, app_id: str, endpoint_id: str) -> EndpointSecretOut: + return v1_endpoint_get_secret.request_sync( client=self._client, app_id=app_id, endpoint_id=endpoint_id, - json_body=endpoint_headers_in, ) - def patch_headers( - self, app_id: str, endpoint_id: str, endpoint_headers_in: EndpointHeadersPatchIn + def rotate_secret( + self, + app_id: str, + endpoint_id: str, + endpoint_secret_rotate_in: EndpointSecretRotateIn, + options: PostOptions = PostOptions(), ) -> None: - return v1_endpoint_patch_headers.request_sync( + return v1_endpoint_rotate_secret.request_sync( client=self._client, app_id=app_id, endpoint_id=endpoint_id, - json_body=endpoint_headers_in, + json_body=endpoint_secret_rotate_in, + **options.to_dict(), ) - def get_stats( + def send_example( self, app_id: str, endpoint_id: str, - options: EndpointStatsOptions = EndpointStatsOptions(), - ) -> EndpointStats: - return v1_endpoint_get_stats.request_sync( + event_example_in: EventExampleIn, + options: PostOptions = PostOptions(), + ) -> MessageOut: + return v1_endpoint_send_example.request_sync( client=self._client, app_id=app_id, endpoint_id=endpoint_id, - since=ensure_tz(options.since), - until=ensure_tz(options.until), + json_body=event_example_in, + **options.to_dict(), ) - def replay_missing( + def get_stats( self, app_id: str, endpoint_id: str, - replay_in: ReplayIn, - options: PostOptions = PostOptions(), - ) -> ReplayOut: - return v1_endpoint_replay_missing.request_sync( + options: EndpointStatsOptions = EndpointStatsOptions(), + ) -> EndpointStats: + return v1_endpoint_get_stats.request_sync( client=self._client, app_id=app_id, endpoint_id=endpoint_id, - json_body=replay_in, - **options.to_dict(), + since=ensure_tz(options.since), + until=ensure_tz(options.until), ) def transformations_get( @@ -412,18 +427,3 @@ def transformation_partial_update( endpoint_id=endpoint_id, json_body=endpoint_transformation_in, ) - - def send_example( - self, - app_id: str, - endpoint_id: str, - event_example_in: EventExampleIn, - options: PostOptions = PostOptions(), - ) -> MessageOut: - return v1_endpoint_send_example.request_sync( - client=self._client, - app_id=app_id, - endpoint_id=endpoint_id, - json_body=event_example_in, - **options.to_dict(), - ) diff --git a/python/svix/api/event_type.py b/python/svix/api/event_type.py index f7ac75797..d89204b7e 100644 --- a/python/svix/api/event_type.py +++ b/python/svix/api/event_type.py @@ -51,6 +51,17 @@ async def create( **options.to_dict(), ) + async def import_openapi( + self, + event_type_import_openapi_in: EventTypeImportOpenApiIn, + options: PostOptions = PostOptions(), + ) -> EventTypeImportOpenApiOut: + return await v1_event_type_import_openapi.request_asyncio( + client=self._client, + json_body=event_type_import_openapi_in, + **options.to_dict(), + ) + async def get(self, event_type_name: str) -> EventTypeOut: return await v1_event_type_get.request_asyncio( client=self._client, @@ -66,30 +77,19 @@ async def update( json_body=event_type_update, ) - async def patch( - self, event_type_name: str, event_type_patch: EventTypePatch - ) -> EventTypeOut: - return await v1_event_type_patch.request_asyncio( - client=self._client, - event_type_name=event_type_name, - json_body=event_type_patch, - ) - async def delete(self, event_type_name: str) -> None: return await v1_event_type_delete.request_asyncio( client=self._client, event_type_name=event_type_name, ) - async def import_openapi( - self, - event_type_import_openapi_in: EventTypeImportOpenApiIn, - options: PostOptions = PostOptions(), - ) -> EventTypeImportOpenApiOut: - return await v1_event_type_import_openapi.request_asyncio( + async def patch( + self, event_type_name: str, event_type_patch: EventTypePatch + ) -> EventTypeOut: + return await v1_event_type_patch.request_asyncio( client=self._client, - json_body=event_type_import_openapi_in, - **options.to_dict(), + event_type_name=event_type_name, + json_body=event_type_patch, ) @@ -111,6 +111,17 @@ def create( **options.to_dict(), ) + def import_openapi( + self, + event_type_import_openapi_in: EventTypeImportOpenApiIn, + options: PostOptions = PostOptions(), + ) -> EventTypeImportOpenApiOut: + return v1_event_type_import_openapi.request_sync( + client=self._client, + json_body=event_type_import_openapi_in, + **options.to_dict(), + ) + def get(self, event_type_name: str) -> EventTypeOut: return v1_event_type_get.request_sync( client=self._client, @@ -126,28 +137,17 @@ def update( json_body=event_type_update, ) - def patch( - self, event_type_name: str, event_type_patch: EventTypePatch - ) -> EventTypeOut: - return v1_event_type_patch.request_sync( - client=self._client, - event_type_name=event_type_name, - json_body=event_type_patch, - ) - def delete(self, event_type_name: str) -> None: return v1_event_type_delete.request_sync( client=self._client, event_type_name=event_type_name, ) - def import_openapi( - self, - event_type_import_openapi_in: EventTypeImportOpenApiIn, - options: PostOptions = PostOptions(), - ) -> EventTypeImportOpenApiOut: - return v1_event_type_import_openapi.request_sync( + def patch( + self, event_type_name: str, event_type_patch: EventTypePatch + ) -> EventTypeOut: + return v1_event_type_patch.request_sync( client=self._client, - json_body=event_type_import_openapi_in, - **options.to_dict(), + event_type_name=event_type_name, + json_body=event_type_patch, ) diff --git a/python/svix/api/message_attempt.py b/python/svix/api/message_attempt.py index 7919b465e..81395dc82 100644 --- a/python/svix/api/message_attempt.py +++ b/python/svix/api/message_attempt.py @@ -53,6 +53,19 @@ def to_dict(self) -> t.Dict[str, t.Any]: class MessageAttemptAsync(ApiBase): + async def list_by_endpoint( + self, + app_id: str, + endpoint_id: str, + options: MessageAttemptListOptions = MessageAttemptListOptions(), + ) -> ListResponseMessageAttemptOut: + return await v1_message_attempt_list_by_endpoint.request_asyncio( + client=self._client, + app_id=app_id, + endpoint_id=endpoint_id, + **options.to_dict(), + ) + async def list_by_msg( self, app_id: str, @@ -63,13 +76,13 @@ async def list_by_msg( client=self._client, app_id=app_id, msg_id=msg_id, **options.to_dict() ) - async def list_by_endpoint( + async def list_attempted_messages( self, app_id: str, endpoint_id: str, options: MessageAttemptListOptions = MessageAttemptListOptions(), - ) -> ListResponseMessageAttemptOut: - return await v1_message_attempt_list_by_endpoint.request_asyncio( + ) -> ListResponseEndpointMessageOut: + return await v1_message_attempt_list_attempted_messages.request_asyncio( client=self._client, app_id=app_id, endpoint_id=endpoint_id, @@ -84,44 +97,44 @@ async def get(self, app_id: str, msg_id: str, attempt_id: str) -> MessageAttempt attempt_id=attempt_id, ) - async def resend( + async def expunge_content( self, app_id: str, msg_id: str, - endpoint_id: str, - options: PostOptions = PostOptions(), + attempt_id: str, ) -> None: - return await v1_message_attempt_resend.request_asyncio( + return await v1_message_attempt_expunge_content.request_asyncio( client=self._client, app_id=app_id, msg_id=msg_id, - endpoint_id=endpoint_id, - **options.to_dict(), + attempt_id=attempt_id, ) - async def list_attempted_messages( + async def list_attempted_destinations( self, app_id: str, - endpoint_id: str, + msg_id: str, options: MessageAttemptListOptions = MessageAttemptListOptions(), - ) -> ListResponseEndpointMessageOut: - return await v1_message_attempt_list_attempted_messages.request_asyncio( + ) -> ListResponseMessageEndpointOut: + return await v1_message_attempt_list_attempted_destinations.request_asyncio( client=self._client, app_id=app_id, - endpoint_id=endpoint_id, + msg_id=msg_id, **options.to_dict(), ) - async def list_attempted_destinations( + async def resend( self, app_id: str, msg_id: str, - options: MessageAttemptListOptions = MessageAttemptListOptions(), - ) -> ListResponseMessageEndpointOut: - return await v1_message_attempt_list_attempted_destinations.request_asyncio( + endpoint_id: str, + options: PostOptions = PostOptions(), + ) -> None: + return await v1_message_attempt_resend.request_asyncio( client=self._client, app_id=app_id, msg_id=msg_id, + endpoint_id=endpoint_id, **options.to_dict(), ) @@ -143,29 +156,20 @@ async def list_attempts_for_endpoint( **options.to_dict(), ) - async def expunge_content( - self, - app_id: str, - msg_id: str, - attempt_id: str, - ) -> None: - return await v1_message_attempt_expunge_content.request_asyncio( - client=self._client, - app_id=app_id, - msg_id=msg_id, - attempt_id=attempt_id, - ) - class MessageAttempt(ApiBase): - @deprecated(reason="use list_by_msg or list_by_endpoint instead") - def list( + def list_by_endpoint( self, app_id: str, - msg_id: str, + endpoint_id: str, options: MessageAttemptListOptions = MessageAttemptListOptions(), ) -> ListResponseMessageAttemptOut: - return self.list_by_msg(app_id=app_id, msg_id=msg_id, options=options) + return v1_message_attempt_list_by_endpoint.request_sync( + client=self._client, + app_id=app_id, + endpoint_id=endpoint_id, + **options.to_dict(), + ) def list_by_msg( self, @@ -177,13 +181,13 @@ def list_by_msg( client=self._client, app_id=app_id, msg_id=msg_id, **options.to_dict() ) - def list_by_endpoint( + def list_attempted_messages( self, app_id: str, endpoint_id: str, options: MessageAttemptListOptions = MessageAttemptListOptions(), - ) -> ListResponseMessageAttemptOut: - return v1_message_attempt_list_by_endpoint.request_sync( + ) -> ListResponseEndpointMessageOut: + return v1_message_attempt_list_attempted_messages.request_sync( client=self._client, app_id=app_id, endpoint_id=endpoint_id, @@ -198,47 +202,56 @@ def get(self, app_id: str, msg_id: str, attempt_id: str) -> MessageAttemptOut: attempt_id=attempt_id, ) - def resend( + def expunge_content( self, app_id: str, msg_id: str, - endpoint_id: str, - options: PostOptions = PostOptions(), + attempt_id: str, ) -> None: - return v1_message_attempt_resend.request_sync( + return v1_message_attempt_expunge_content.request_sync( client=self._client, app_id=app_id, msg_id=msg_id, - endpoint_id=endpoint_id, - **options.to_dict(), + attempt_id=attempt_id, ) - def list_attempted_messages( + def list_attempted_destinations( self, app_id: str, - endpoint_id: str, + msg_id: str, options: MessageAttemptListOptions = MessageAttemptListOptions(), - ) -> ListResponseEndpointMessageOut: - return v1_message_attempt_list_attempted_messages.request_sync( + ) -> ListResponseMessageEndpointOut: + return v1_message_attempt_list_attempted_destinations.request_sync( client=self._client, app_id=app_id, - endpoint_id=endpoint_id, + msg_id=msg_id, **options.to_dict(), ) - def list_attempted_destinations( + def resend( self, app_id: str, msg_id: str, - options: MessageAttemptListOptions = MessageAttemptListOptions(), - ) -> ListResponseMessageEndpointOut: - return v1_message_attempt_list_attempted_destinations.request_sync( + endpoint_id: str, + options: PostOptions = PostOptions(), + ) -> None: + return v1_message_attempt_resend.request_sync( client=self._client, app_id=app_id, msg_id=msg_id, + endpoint_id=endpoint_id, **options.to_dict(), ) + @deprecated(reason="use list_by_msg or list_by_endpoint instead") + def list( + self, + app_id: str, + msg_id: str, + options: MessageAttemptListOptions = MessageAttemptListOptions(), + ) -> ListResponseMessageAttemptOut: + return self.list_by_msg(app_id=app_id, msg_id=msg_id, options=options) + @deprecated( reason="use list_by_msg instead, passing the endpoint id through options" ) @@ -256,16 +269,3 @@ def list_attempts_for_endpoint( endpoint_id=endpoint_id, **options.to_dict(), ) - - def expunge_content( - self, - app_id: str, - msg_id: str, - attempt_id: str, - ) -> None: - return v1_message_attempt_expunge_content.request_sync( - client=self._client, - app_id=app_id, - msg_id=msg_id, - attempt_id=attempt_id, - )